Comparison of Two-layer and three-layer Ethernet switches and their basic types

Source: Internet
Author: User

What are the differences between layer-2 and layer-3 Ethernet switches and their basic types? The following are some comparisons: after reading this article, we will be able to fully understand the layer-3 Ethernet switch.

Next we will talk about the three-layer Ethernet switch process. VLAN segmentation is used to isolate inter-VLAN communication, and layer-3 Ethernet switch devices of routers supporting VLANs can be used to establish inter-VLAN communication. However, the use of routers to connect different VLANs in the enterprise campus network is obviously not the trend of the times. Because we can use a layer-3 Ethernet switch.

◆ Differential 1 Performance): Traditional routers distribute packets based on the microprocessor, which is processed by software. layer-3 Ethernet switches use ASIC hardware to forward packets, which has a great performance difference;

◆ Difference 2 interface type): the interfaces of layer-3 Ethernet switches are basically Ethernet interfaces, and there are no rich types of router interfaces;

◆ Difference 3: A layer-3 Ethernet switch can also work in the layer-2 mode and directly exchange packets that do not require routing, whereas a router does not have a layer-2 function.

First, let's take a look at the process of device intercommunication: The switch is divided into two VLANs, and the routing interface is configured on vlan1 and vlan 2 to implement intercommunication between vlan1 and vlan 2. For example, A initiates A ping request to B ):
◆ A checks the destination IP address of the packet and finds that it is in the same network segment as itself;
◆ A ----> B ARP request message, which is broadcast in VLAN1;
◆ B ----> A ARP response packet;
◆ A ----> B icmp request;
◆ B ----> A icmp reply;

The interconnection between A and C takes ping requests from A to C as an example ):
◆ A checks the destination IP address of the packet and finds that it is not in the same network segment as itself;
◆ A ----> switchint vlan 1) ARP request packet, which is broadcast in VLAN1;
◆ Gateway ----> a arp response packet;
◆ A ----> switchicmp request the destination MAC is the MAC of int vlan 1, the source MAC is the MAC of A, the destination IP is C, and the source IP is );
◆ After receiving the packet, the switch determines that the packet is a three-layer Ethernet switch. Check the destination IP address of the packet and find that the packet is in its direct connection network segment;
◆ Switchint vlan 2) ----> c arp request message, which is broadcast in VLAN2;
◆ C ---> switchint vlan 2) ARP response packet;
◆ Switchint vlan 2) ----> compared with the MAC header of the packet, the C icmp request is re-encapsulated, while the fields above the IP layer are basically unchanged;
◆ C ----> A icmp reply. The subsequent processing process is basically the same as that of the previous icmp request.

In the above steps, if the ARP table already has corresponding table items, no arp request packets will be sent to the other party. How can we differentiate the data streams of two or three-layer Ethernet switches? The 3526 product is a layer-3 Ethernet switch, which includes both layer-2 Processing and layer-3 Ethernet switch processing.

Differences between the basic Forwarding Model of Layer 2 and Layer 3 Ethernet switches:

A layer-3 Ethernet switch is divided into two VLANs. Communication between A and B is completed in one vlan. For A vswitch, It is A layer-2 data stream. Communication between A and C must span VLANs, is the data flow of a layer-3 Ethernet switch. The above mentioned is a macro method. From a micro perspective, after a packet enters from the port, how does the Swtich device distinguish between two-layer packets or three-layer Ethernet switch packets?

Because the packets from A to B are in the same VLAN, the destination MAC address of the packet will be the MAC address of host B, and the packets from A to C must span the VLAN, the destination MAC address of the packet is the MAC address on vlan1. Therefore, the switch's standard for distinguishing two-layer Ethernet switch packets is to check whether the destination MAC address of the packet is equal to the MAC address on the vswitch Virtual Interface.

Taking the Huawei 3ComS3526 vswitch as an example, the entire process of a layer-3 Ethernet switch is divided into three major parts: the platform software protocol stack part. The key features include running the routing protocol and maintaining the routing information table; the IP protocol stack function plays an important role in the process of the entire system. When the hardware cannot complete packet forwarding, this part can replace the hardware to complete the layer-3 Ethernet switch forwarding of packets. In addition, the data streams for telnet, ping, ftp, and snmp on the vswitch are all processed in this section.

Example of a layer-3 Ethernet switch:
Display ip routing-table:
Routing Tables:
Destination/Mask Proto Pre Metric Nexthop Interface
0.0.0.0/0 Static 60 0 10.110.20.9vlan-Interface2
10.110.48.0/21 Direct 0 0 10.110.48.1 VLAN-Interface1
10.110.48.1/32 Direct 0 0 127.0.0.1 InLoopBack0
10.110.20.8/30 Direct 0 0 10.110.20.10 VLAN-Interface2
10.110.20.10/32 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoopBack0

Layer-3 Ethernet switch maintenance ARP table
Display arp:
IpAddress Mac_Address vlan id Port Name Type
10.110.20.9 00e0. fc00.55182 GigabitEthernet2/1 Dynamic
10.110.51.75 0010. b555.f0391 Ethernet0/9 Dynamic
10.110.54.30 0800.20aa.f41d1 Ethernet0/10 Dynamic
10.110.51.1370010.a4aa.fce61 Ethernet0/12 Dynamic
10.110.50.90 0010. b555.e04f1 Ethernet0/8 Dynamic

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.