Routers and switches packets received treatment

1. Layer 2 packets received by the router, how to deal with? Layer 2 packet is received by unicast, multicast, and broadcast to analyze
(1) If you receive a two-story unicast frame, for a router is concerned, is a three-tier device, of course, a function of both the second floor, so when a unicast frame is received, to determine whether the destination mac address of the frame is not a mac address of the interface, if it is, go to three decapsulation ip address, object look three ip ip address is not the interface address, and if so, to deal with the interface, if not, to find the routing table, to re-do a two-story frame package, continue to look down. If the purpose of mac mac address of the interface is not directly lose.
(2) If the received broadcast a two-story frame, it is arp broadcast, it will de-encapsulation, see who arp ip address information in the request that, if the request is in the IP address of the router where the interface, will go response; If the IP address of the IP address is not the router interface request, while the router is not turned ARP proxy, will be discarded if the ARP request is not a router interface is behind the segment and opened to the ARP proxy, router to judge there is no route to the target segment, if there is, just do proxy.
(3) If you receive a Layer 2 multicast frame, depending on the router's interface has not joined the group, by default, the router interface is added to the 224.0.0.1,224.0.0.2 (enabled multicast joined ), if the router interface is not added to the multicast group, then discarded.
2. Layer 2 packets received three switches, how to deal with? Layer 2 packet is received by unicast, multicast, and broadcast to analyze
(1) If you receive a unicast frame two-story, three switches need to configure a vlan interface interface, with finished there will be an IP address, while a mac address corresponding to the IP address, if the object received is the mac address mac address of the switch, it first floor frame decapsulation and send it to a three-layer process, to the routing table, if not switch mac address, mac address forwarding table to see if there is a direct Layer 2 forwarding does not require on to three, and if not, unknown unicast flooding.
(2) If the received broadcast frame a floor, such as ARP broadcast, then in this case, all interfaces will go towards the flooding, in addition, because it is three switches, ARP floor will decapsulating view the contents inside look at the ARP request is the IP address of the ip address vlan interface is not three switches, if it is to return, if not discarded.
(3) If the received frame is a Layer 2 multicast, flooded towards all the ports, and the decapsulated multicast frames, vlan interface to the interface, the interface in a look added to the group, if added in response to the go or the process, if not joined, does not respond will not be processed.

Guess you like

Origin blog.51cto.com/13963342/2482751