【Network】 The difference between router and switch

 

https://blog.csdn.net/haiqiang1995/article/details/79375444

https://blog.csdn.net/qq_41901122/article/details/99691552

 

a. The switch works at the second layer, the data link layer; the router works at the third layer, the network layer.

b. Only the physical address can be identified at the data link layer, so when a port of the switch receives a data frame, the switch will read the MAC address of the corresponding target address in the data frame, and then in its own MAC address table Find out if there is port information of the target MAC address, if there is, then forward the data frame to the corresponding port; if not, forward it to all ports except the source port.

c. When a certain interface of the router receives a packet, the router will read the network part of the logical address of the corresponding target in the packet and then look it up in the routing table. If a routing entry for the destination address is found in the routing table, the packet is forwarded to the corresponding interface of the router; if no routing entry for the destination address is found in the routing table, then if the router is configured with a default route, the Configure the corresponding interface forwarded to the router; if no default route is configured in the router, the packet is discarded and unreachable information is returned.

d. Traditional switches can only divide conflict domains, not broadcast domains; routers can divide broadcast domains;

e. The router provides the firewall service: the router only forwards the data packets of a specific address, and does not transmit the data packet transmission that does not support the routing protocol and the data packet transmission of the unknown target network, thereby preventing the broadcast storm.

Published 61 original articles · won praise 2 · Views 7302

Guess you like

Origin blog.csdn.net/hebaojing/article/details/103456974