After the router is generated in the switch, it is also a certain connection between the router and the switch after the switch is generated in the hub, is not completely independent of the two devices. The router mainly overcomes the switch that the switch cannot be routed forward. Overall, the main difference between routers and switches is reflected in the following aspects: (1) The original switch in the working level is the data link layer working in the OSI / RM open architecture, which is the second layer, and The router is designed to work on the network layer of the OSI model. Since the switch operates in the second layer (data link layer) of the OSI, its working principle is relatively simple, and the router works in the third layer of OSI (network layer), you can get more protocol information, the router can make More intelligent forwarding decisions. (2) Data forwarding the object different switches are the use of physical addresses or MAC addresses to determine the destination address of forwarding data. The router uses the ID number (ie, IP address) of different networks to determine the address of the data forwarded. The IP address is implemented in software, which is described in the network, and sometimes the address of these third layers is also referred to as a protocol address or network address. The MAC address is usually the hardware, and is allocated by the NIC manufacturer, and has been solidified to the NIC. Generally, it is not changeable. The IP address is usually automatically assigned by a network administrator or system. (3) Traditional switches can only partition the conflict domain, and the broadcast domain cannot be split; and the router can split the broadcast domain. The network segment connected by the switch is still in the same broadcast domain, and the broadcast packet propagates on all segments of the switch connected to all network segments of the switch, which will cause communication congestion and security vulnerabilities in some cases. The network segment connected to the router is assigned to different broadcast domains, and broadcast data will not pass through the router. Although the third layer of the switch has a VLAN function, it is also possible to split the broadcast domain, but each sub-broadcast domain cannot communicate with communication, and the communication between them still needs a router. (4) The router provides a service of the firewall, which forwards only a specific address packet, which does not transmit packet transfer and unknown target network packets that do not support routing protocols, thereby preventing broadcast storms.