Date:2022-07-13 10:54:40

A Guide to the Difference Between Routers and Switches

Routers and switches are not unfamiliar to many people, but if you want to talk about the difference between routers and switches, many people do not know very well. The following will explain the difference between routers and switches.
 
router and a switch
 
1. The difference between a router and a switch
 
The traditional switch is developed from the bridge and belongs to the second layer of OSI, that is, the data link layer device. It addresses according to the MAC address, selects the route through the station table, the establishment and maintenance of the station table are carried out automatically by the switch. The router belongs to the third layer of OSI, that is, the network layer device. It is addressed according to the IP address and generated through the routing table routing protocol. The biggest advantage of a switch is that it is fast. Because the switch only needs to identify the MAC address in the frame, and the forwarding port selection algorithm is simple 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.1 Loop: According to the switch address learning and station table establishment algorithm, no loop is allowed between switches. Once a loop exists, the spanning tree algorithm must be activated to block the ports that generate the loop. The routing protocol of routers does not have this problem, and there can be multiple paths between routers to balance the load and improve reliability.
 
1.2 Load concentration: There can only be one path between switches, so that information is concentrated on one communication link and cannot be dynamically allocated 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.
 
1.3 Broadcast control: The switch can only narrow the collision domain, but not the broadcast domain. The entire switched network is a large broadcast domain, and broadcast packets are distributed to the entire switched network. The router can isolate the broadcast domain, and broadcast packets cannot continue to be broadcast through the router.
 
1.4 Subnet division: The switch can only identify the MAC address. MAC addresses are physical addresses and have a flat address structure, so subnetting cannot be based on MAC addresses. The router identifies the IP address, which is assigned by the network administrator. It is a logical address and the IP address has a hierarchical structure. It is divided into network numbers and host numbers, which can be easily used to divide subnets. The main function of the router is to use Connect to different networks.
 
1.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 filters the packet according to the source IP address, destination IP address, TCP port address and other contents of the packet. Implement filtering, which is more intuitive and convenient.
 
1.6 Media related: The switch can also complete the conversion between different link layers and physical layers as a bridging device, but this conversion process is complicated and is not suitable for ASIC implementation, which will inevitably reduce the forwarding speed of the switch. Therefore, at present, the switch mainly completes the network interconnection of the same or similar physical medium and link protocol, and will not be used for interconnection between the networks whose physical medium and link layer protocol are far different. The router is different. It is mainly used for interconnection between different networks, so it can connect networks with different physical media, link layer protocols and network layer protocols. Although the router has an advantage in function, it is expensive and has low packet forwarding speed.
 
2. The difference between a wireless router and a wireless AP
 
2.1 Distinguish wireless AP and wireless router by function
 
Wireless router: A wireless router is a combination of a simple AP and a broadband router; with the help of the router function, it can realize the sharing of Internet connections in the home wireless network, and realize the wireless shared access of ADSL and residential broadband. In addition, the wireless router Terminals connected wirelessly and wiredly through it can be assigned to a subnet, so that it is very convenient for various devices in the subnet to exchange data.
 
It can be said that a wireless router is a collection of APs, routing functions and switches. It supports wired and wireless to form the same subnet and is directly connected to the MODEM. The wireless AP is equivalent to a wireless switch, which is connected to a wired switch or router, and obtains an IP from the router for the wireless network card connected to it.
 
2.2 Differentiate between wireless AP and wireless router by application
 
Standalone APs are used more in companies that require a large number of APs for large area coverage, all connected via Ethernet and to a separate WLAN firewall.
 
Wireless routers are used more in SOHO environments, and in this environment, one AP is enough. In this way, a wireless router that integrates a broadband access router and an AP provides a single-machine solution that is easier to manage and less expensive than two separate machines.
 
Wireless routers generally include a Network Address Translation (NAT) protocol to support network connection sharing for wireless LAN users -- a feature that is useful in SOHO environments. They may also have basic firewalls or packet filters to prevent port scanning software and other attacks on broadband connections. Finally, most wireless routers include a four-port Ethernet converter that can connect several wired PCs. This is very convenient for managing routers or connecting a printer to a local area network.
 
2.3 Analyze the wireless AP and wireless routing with the network topology diagram
 
The AP cannot be directly connected to the ADSL MODEM, so another switch or hub must be added when using it;
 
When using the above topology, the usage of AP and wireless router is the same. However, most wireless routers can directly connect with ADSL MODEM for broadband sharing due to their broadband dial-up capability.
 
2.4 Analysis of wireless AP and wireless routing by cost
 
The price of 802.11B wireless APs and wireless routers is similar. Generally, wireless routers are about 100 yuan more expensive; 802.11G depends on the specific situation. The gap, but the price difference of cheap products is also more than 100 yuan.
 
2.5 Standards for Wireless Routers
 
The Institute of Electrical and Electronics Engineers (IEEE) officially approved the latest Wi-Fi wireless standard 802.11n on September 14, 2009.
 
In theory, 802.11n can achieve a transmission rate of 300Mbps, which is 6 times that of the 802.11g standard and 30 times that of the 802.11b standard.
 
2.6 Key points of construction and installation
 
For specific construction methods, please refer to the national architectural standard design atlas "Smart Home Control System Construction Atlas 03X602" and the international standard specification "EIA/TIA569 Commercial Building Communication Channel and Space Standard".
 

TAGS: router and a switch [Previous Page]

Previous Page:What is the Difference Between Low-end and High-end Routers? Factors Affecting Router Performance

next page:Testing Challenges and Solutions for IoT-enabled Devices