After learning about several methods and configurations of VLAN division, I am very curious about how VLAN works. How does it achieve the isolation function? With these questions, let's take a look today. Basic VLAN Communication Principles In order to improve processing efficiency, all data frames inside the switch are VLAN tagged and processed in a unified manner. When a data enters the switch interface, if it does not have a VLAN Tag and the interface is configured with a PVID, then the data frame will be tagged with the PVID of the interface. If the data frame already has a VLAN Tag, then even if the interface has been configured with a PVID, the switch will not tag the data frame with a VLAN Tag. Due to different interface types, switches process data frames differently. The following two cases illustrate the working principle of VLAN: Different VLANs on the same switch In the figure above, the switch is configured with VLAN 10 and 20 respectively, and the corresponding PCs are added to different VLANs. By capturing packets on GE0/01 and GE0/0/3 on the switch, it is found that GE0/0/1 can capture data packets, but no data packets pass through GE0/0/3. This also confirms a feature of VLAN, isolating broadcast storms. Normally, when PC1 communicates with PC2 for the first time, it broadcasts an ARP request, which can be received normally by all ports of the switch except the port that sends data. However, since the above topology is divided into VLANs, the ARP broadcast is discarded by the GE0/0/3 port. As a result, PC1 cannot obtain the MAC address of PC2, resulting in communication failure. When you see this, you may ask, can we tell PC1 the MAC address of PC2 in advance, so that PC1 does not need to send ARP broadcast packets to request the MAC address. Add the MAC addresses of each other on PC1 and PC2 and execute the following command:
After adding, capture packets on the switch GE0/0/1 and GE0/0/3 ports again. As shown in the following figure, no data is captured on GE0/0/3. This time, the request from GE0/0/1 port to the ICMP packet times out. By binding the MAC address information in advance, however, PC1 and PC2 still cannot access each other. So how does the VLAN data packet work? First, let's look at what the Access port does when receiving and sending data packets.
Note: If the port is of access type and a VLAN is added, the PVID attribute value of this port becomes the same as the VID value; the default VLAN ID is the currently added VLAN ID From the above access port receiving and sending data packets, we can roughly infer that the communication process between PC1 and PC2 is as follows:
Same VLAN on the same switch In the figure above, two switches are interconnected through GE0/0/24 port, and GE0/0/24 is configured as a trunk port to allow VLAN 10 and 20 to pass. So what is the process of VLAN across switches? First, capture packets on the GE0/0/24 ports of SW1 and SW2 respectively to see what kind of data packets pass through GE0/0/24. From the above figure, we can see that the data packets passing through the G0/0/24 ports of SW1 and SW2 are the same and carry tags. Let's take a look at the process of sending and receiving data packets on the trunk. Trunk port processing of untagged packets:
Trunk port processing of tagged packets:
Send frame processing:
From the above Trunk port data packet sending and receiving process, we can roughly infer the process of PC1 and PC3 as follows:
|
<<: Understand in one article: website, URL, domain name, IP address, DNS, domain name resolution
>>: Popular science article: What exactly is 5G technology?
[[433809]] This article is reprinted from the WeC...
According to people familiar with the matter, a c...
Huaruiyun is affiliated to Shenzhen Huaruiyun Net...
Yecao Cloud is a Chinese hosting company founded ...
RepriseHosting is a foreign hosting company found...
In today's interconnected world, achieving su...
Friendhosting has launched a 30% discounts for Va...
Wireless AP is an access point for users who use ...
The 5G era has arrived, and all walks of life are...
Introduction Beijing Borui Hongyuan Data Technolo...
Open source has become a trend, and almost all te...
At the press conference of the National Developme...
Every upgrade of communication technology brings ...
RAKsmart's discounts continue this month. In ...
5G opens a new era of the Internet of Everything....