The difference between a switch and a 4g router
Traditional switches evolved from bridges and belonged to the second layer of OSI, the data link layer equipment. It addresses according to the MAC address, selects the route through the station table, and the establishment and maintenance of the station table are automatically carried out by the switch. The 4g router with ethernet belongs to the third layer of OSI, that is, the network layer device. It addresses according to the IP address and is generated through the routing table routing protocol. The biggest advantage of the switch is that it is fast. Because the switch only needs to identify the MAC address in the frame, it is simple to generate and select the forwarding port algorithm directly based on the MAC address, which is convenient for ASIC implementation, so the forwarding speed is extremely high. But the working mechanism of the switch also brings some problems.
1. Loop: According to the switch address learning and station table establishment algorithm, loops are not allowed between switches. Once there is a loop, the spanning tree algorithm must be started to block the port that generates the loop. The router's routing protocol does not have this problem. There can be multiple paths between routers to balance the load and improve reliability.
2. Load concentration: There can only be one path between switches, so that information is concentrated on one communication link, and dynamic distribution is not possible to balance the load. The router's routing protocol algorithm can avoid this. The OSPF routing protocol algorithm can not only generate multiple routes, but also select different optimal routes for different network applications.
3. Broadcast control: The switch can only reduce the collision domain, but not the broadcast domain. The entire switched network is a large broadcast domain, and broadcast messages are scattered throughout the switched network. The router can isolate the broadcast domain, and broadcast packets cannot continue to be broadcast through the router.
4. Subnetting: The switch can only recognize the MAC address. The MAC address is a physical address and uses a flat address structure, so the subnet cannot be divided according to the MAC address. The router recognizes the IP address. The IP address is assigned by the network administrator. It is a logical address and the IP address has a hierarchical structure. It is divided into a network number and a host number. It can be easily used to divide subnets. The main function of the router is to Connect to different networks.
5. Confidentiality issue: Although the switch can also filter the frame according to the source MAC address, destination MAC address and other contents of the frame, the router implements the message according to the source IP address, destination IP address, TCP port address and other contents of the message. Filtering is more intuitive and convenient.