2.Switch, meaning "switch", is a kind of network equipment used for electric (optical) signal forwarding, which can provide a dedicated electrical signal path for any two network nodes. Include network, voice, optical fiber switch, etc. , the most common is the Ethernet switch. Switches work at the second layer of the OSI reference model, namely the data link layer. The switch will correspond the MAC address with the port to form a MAC address table, and the packets sent to this MAC address will only be sent to its corresponding port, not all ports. Therefore, the switch can be used to divide the data link layer broadcast, that is, the collision domain; But you can't divide the network layer broadcast, that is, the broadcast domain.
Third, the router is the hub of the Internet, and it is a "traffic policeman" in both LAN and WAN. It will send signals in the best path in sequence.
Fourth, the main differences between hubs, switches and routers.
Different levels of work.
HUB works in the first layer of OSI reference model, namely "physical layer".
The switch works at the data link layer of the OSI reference model, that is, the second layer.
Routers work in the third layer (network layer) of OSI, so they can get more protocol information and make more intelligent forwarding decisions.
(2) Data forwarding is based on different objects.
Switches use physical addresses or MAC addresses to determine the destination address for forwarding data.
Routers use IP addresses to determine the address for data forwarding.
(3) Different functions.
Switches can only split collision domains, not broadcast domains; The network segments connected by the switch still belong to the same broadcast domain, and broadcast packets will spread on all network segments connected by the switch, which will lead to communication congestion and security loopholes in some cases.
Routers can divide broadcast domains, although switches working at more than three layers can also divide broadcast domains, but there is no communication between sub-broadcast domains, and the communication between them still needs routers.
Routers can provide firewall services. Routers only forward packets with specific addresses, and do not forward packets that do not support routing protocols and packets of unknown target networks, thus preventing broadcast storms.