One route and multiple switches [Ethernet positive solution]

Source: Internet
Author: User

Layer-3 switch structure: ASIC chip and CPU
The ASIC chip is used for layer-2 and layer-3 forwarding. It contains a MAC address table for layer-2 forwarding and a layer-3 forwarding table for IP forwarding.
The CPU is used for forwarding control. It mainly maintains some software table items (including route tables and ARP tables) and configures the hardware layer-3 forwarding table of ASIC based on the forwarding information of Software Table items.
What determines high-speed forwarding is the two-tier hardware table item of ascic, while the hardware table of ASIC comes from the Software Table item maintained by the CPU.

Assume that vlan a and vlan B are in two different CIDR blocks.
Virtual Interface.

A Ping B data stream analysis is as follows:
Host a checks the IP address of target B, which is not in the same CIDR block as itself. Therefore, it needs to be forwarded through the gateway. First, the ARP cache is queried and the gateway Mac is not found, so broadcast ARP requests (the target Mac is all F, the source MAC is the MAC of A, the source IP is the IP of A, and the target IP is the gateway IP) and request the MAC address of the gateway, when a layer-3 Switch receives a broadcast frame, it unpacks it and finds that the target IP address is for itself. Therefore, it returns an ARP response and tells a about its MAC address. After receiving the ARP response,, update the ARP cache and re-encapsulate ICMP (the target Mac is the gateway, the source MAC is A, the target IP is B, and the source IP is a). After the switch receives the IP address, first, update the Mac table based on the source MAC + vid of the message, and query the Mac table based on the destination MAC + vid of the message to find the Mac table items matching the layer-3 interface (description: when a layer-3 Switch assigns a svi ip address, the Mac + vid of the layer-3 interface is added to the Mac table of the switch ), when the destination MAC in the packet matches the Mac table items of the layer-3 interface, layer-3 Forwarding is performed to find the layer-3 table items, because it is empty for the first time The query failed, so the packet was handed over to the CPU for software processing. The CPU looked up the route based on the target IP address and matched it to a direct connection CIDR block. Therefore, the query failed because the ARP table was empty for the first time, then, the target network segment broadcasts the MAC address of ARP request B. After receiving the ARP request, B returns the ARP response. The switch receives the response and updates the Mac table and ARP table, at the same time, re-encapsulate ICMP and send it to B (the target Mac is B, the source MAC is the MAC of the layer-3 switching interface, the target IP is B, and the source IP is ). At the same time, the layer-3 table items of the switch are added based on the obtained layer-3 forwarding information (including IP, Mac, VLAN, and outbound interface). If subsequent packets match the layer-3 table items, you can directly perform hardware forwarding, which is called "One route multiple exchanges ". B receives an ICMP response, which is the inverse process of the above process. Therefore, Ping is successful.

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.