Schematic diagram of layer-3 switches

Source: Internet
Author: User

Compared with the traditional L2 Switch, the L3 switch provides the routing function, which can be understood as a vswitch with the routing function. Layer-3 switches can be divided into pure hardware and pure software based on their data processing. (1) Hardware-only layer-3 technology is relatively complex, costly, but fast, with good performance and strong load capabilities. The principle is to use an ASIC chip and hardware to search and refresh route tables. When the data is received by the port interface chip, first find the target MAC address in the layer-2 switching chip. If yes, perform layer-2 forwarding; otherwise, send the data to the layer-3 engine. In the layer-3 engine, the ASIC chip searches for the corresponding route table information, compares to the destination IP address of the data, and then sends the ARP packet to the destination host to obtain the MAC address of the host, send the MAC address to a layer-2 chip and the layer-2 Chip forwards the packet. (2) The software-based layer-3 switch technology is relatively simple, but slow, not suitable for cooperation. The principle is to use the CPU software to find the route table. When the data is received by the port interface chip, first find the target MAC address in the layer-2 switching chip. If the data is found, perform layer-2 forwarding. Otherwise, the data is sent to the CPU. The CPU looks for the corresponding route table information, which is opposite to the destination IP address of the Data. Then, it sends the ARP packet to the destination host to obtain the MAC address of the host and sends the MAC address to the L2 chip, the second-Layer Chip forwards the packet. Because low-cost CPU processing is slow, the processing speed of such a layer-3 switch is slow. L2 switches generally use the Mac table in the hardware chip of ASIC (dedicated ic) to implement L2 data exchange. Because it is a hardware forwarding, the forwarding performance is very high. However, in addition to the Mac table used for layer-2 switching, a layer-3 hardware Forwarding Table dedicated for layer-3 Forwarding is also saved. Shows the basic workflow of a layer-3 switch. The main steps are as follows: (1) Compare the source host's IP address with the target host's IP address before initiating communication, if the source host determines that the target host is located in a different network segment, it must submit packets through the gateway, therefore, it first needs to obtain the MAC address of the gateway through an ARP request packet (when the source host does not know the MAC address of the gateway ), that is, the source host sends an ARP request frame to obtain the MAC address corresponding to the gateway IP address. (2) After receiving the ARP request from the source host, the gateway responds with an ARP response packet. The "source MAC address" in the response packet contains the MAC address of the gateway. (3) After receiving the ARP response from the gateway, the source host uses the MAC address of the gateway as the "Destination MAC address" of the packet and uses the IP address of the source host as the "source IP address" of the packet ", use the IP address of the target host as the "Destination IP address". First, send the data sent to the destination host to the gateway. Diagram of the layer-3 switching process (4) After the gateway receives the data sent from the source host to the target host, because the IP addresses of the source host and the target host are not in the same network segment, upload the datagram to the layer-3 switching engine (ASIC chip) to check whether there is a layer-3 forwarding table for the target host. (5) If no table item for the target host is found in the three-tier hardware forwarding table, view the software route table from the CPU request. If there is a route table item for the network segment of the target host, you also need to obtain the MAC address of the target host, because the packets are encapsulated by frames at the link layer. The CPU of the layer-3 Switch sends an ARP broadcast request packet to the CIDR Block of the target host to obtain the MAC address of the target host. (6) After obtaining the MAC address of the target host, the switch adds corresponding table items to the ARP table and forwards packets from the source host to the target host. The layer-3 Switch layer-3 engine generates a layer-3 hardware forwarding table for the target host based on the route table. Data packets that arrive at the target host can be directly exchanged using the forwarding table items in the three-tier hardware forwarding table, no longer need to view the route table in the CPU. This is the principle of "one route, multiple switches.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.