Multi-layer switching (also known as layer 3 switching technology, or IP switching technology) is proposed relative to the traditional switching concept. As we all know, traditional switching technology operates at the second layer of the OSI network standard model - the data link layer, while multi-layer switching technology implements high-speed forwarding of data packets in the third layer of the network model. Simply put, multi-layer switching technology is: second layer switching technology + third layer forwarding technology.
The emergence of multi-layer switching technology has solved the situation where subnets in network segments must rely on routers for management after the division of network segments in LANs, and solved the network bottleneck problem caused by the low speed and complexity of traditional routers. Of course, multi-layer switching technology is not a simple stacking of network switches and routers, but an organic combination of the two to form an integrated and complete solution.
Start with exchange and routing
1. How does exchange technology forward data?
LAN switching technology emerged as a solution to provide effective network segmentation for shared LANs, which can enable each user to share the maximum bandwidth as much as possible. As mentioned above, switching technology operates in the second layer of the OSI layer seven network model, namely the data link layer. Therefore, the forwarding of data packets by the switch is based on the MAC (Media Access Control) address - physical address. For IP network protocols, it is transparent, that is, when the switch forwards data packets, it does not need to know or know the IP addresses of the source and sink machines. It only requires its physical address, namely the MAC address. During the operation process, the switch will constantly collect information to establish its own address table. This table is quite simple. It shows which port a certain MAC address was found on. Therefore, when the switch receives a TCP/IP packet, it will look at the destination MAC address of the tag part of the data packet and check its own address table to confirm which port to send the packet out. Since this process is relatively simple, and today this function is carried out by a brand new hardware - ASIC (Application Specific Interated Circuit), the speed is quite high. Generally, it only takes a few dozen microseconds, and the switch can decide where an IP packet should be sent.
It is worth mentioning that if the switch receives an unrecognized packet, that is, if the destination MAC address cannot be found in the address table, the switch "diffuses" the IP packet, that is, sends it out from each port, just like the switch handles it when receiving a broadcast packet. The weakness of the second-layer switch is that its method of handling broadcast packets is too ineffective. For example, when a switch receives a broadcast packet sent from a TCP/IP workstation, it will transmit the packet to all other ports, even if some ports are connected to IPX or DECnet workstations! In this way, the bandwidth of non-TCP/IP contacts will be negatively affected. Even if the same TCP/IP contacts are the same as the subnet of the workstation sending the broadcast packet, they will receive some network broadcasts that have nothing to do with them, and the efficiency of the entire network will be greatly reduced.
2. What is the difference between forwarding data by a router and a switch?
In contrast, the router operates at the third layer of the OSI layer seven network model - the network layer. Whenever it receives any data packet (including broadcast packets), it must remove the information of the second layer (data link layer) of the data packet (called "unpacking") and view the third layer information (IP address). Then, the routing of the packet is determined based on the routing table, and then the secure access table is checked; if it is passed, the second layer of information is encapsulated (called "packaging"), and the packet is finally forwarded. If the network address corresponding to the MAC address cannot be found in the routing table, the router will return a message to the site of the source address and throw the packet away.
Compared with switches, routers can obviously provide a series of access control mechanisms that constitute enterprise network security control policies. Since the router must have a "disassembly" process for any packet, the same process must be repeated even if all packets sent from the same source address to the same destination address. This makes it impossible for routers to have high throughput, and is one of the reasons why routers become network bottlenecks.
3. Improve hardware performance and do not solve the router bottleneck problem
Improving the router's hardware performance (with higher speed, larger memory) is not enough to improve its performance. Because in addition to hardware support, the router's "complex processing and powerful functions" are mainly implemented through software, which inevitably makes it a network bottleneck. In addition, when the traffic flowing through the router exceeds its throughput capability, it will cause congestion inside the router. Continuous congestion will not only delay forwarded packets, but more seriously will cause the packets flowing through the router to be lost. All of these bring great trouble to network applications. The complexity of the router also puts a heavy burden on the maintenance of the network. For example, when adding, moving, or changing users on the network, configuring a router will be complicated.
4. There are also shortcomings in switches and routers.
Combining switches and routers (which are also the networking solution adopted by most businesses today) is functionally feasible. However, there are obvious shortcomings, and the shortcomings are:
Switches and routers are different devices in the network and must be purchased, set up and managed separately, and the cost must be more than the cost of a single complete solution based on integration.
What problems did multi-layer exchange solve?
The limitations caused by traditional network structures on user applications are the key issues that multi-layer switching technology needs to solve. Currently, the maximum processing capacity of the highest-end routers on the market is 250,000 packets per second, while the maximum processing capacity of the highest-end switch is more than 10 million packets per second, which is 40 times different. In switched networks, especially large-scale switched networks, it is unimaginable without routing functions. However, the processing power of the router limits the speed of the switching network, which is the problem that multi-layer clearinghouses need to solve.
To understand that layer 3 switching is not difficult, please first look at the picture below right: Assuming that A and B have communicated through switches before, if the intermediate switch supports layer 3 switching, it will record the IP addresses of A and B and their MAC addresses. When other hosts such as C want to communicate with A or B, for the addressed packet sent by C, the layer 3 switching will send C a reply packet to tell him the MAC address of A or B. In the future, C will of course "directly" communicate with him using the MAC address of A or B.
Because both parties to the communication do not pass through third parties such as routers, even if A, B and C belong to different subnets, they can directly know the other party's MAC address to communicate. More importantly, the third-layer switch does not spread broadcast packets like other switches. The reason why the third-layer switch is called a third-layer switch is because they can understand the third-layer information, such as IP addresses, ARPs, etc. Therefore, the three-layer exchange can understand the purpose of a certain broadcast packet, and without spreading it out, it meets the needs of the person sending the broadcast packet (regardless of whether they are in any subnet). If the third layer switch is considered a router, it should also be called a super-high speed anti-traditional router, because the third layer switch does not do any "disassembly" data packets, and all packets passing by will not be modified and transmitted to the destination at the exchange speed.