Vlan and switch port mode Access, Hybrid, Trunk

Source: Internet
Author: User
1 VLAN description the Chinese name of a VLAN (VirtualLocalAreaNetwork) is a virtual LAN. VLAN is a new data exchange technology that logically divides LAN devices into network segments to implement virtual working groups. This emerging technology is mainly used in vswitches and routers, but mainstream applications are still in vswitches. But not all vswitches

1. vlan Introduction The Chinese name of a VLAN (Virtual Local Area Network) is a Virtual LAN. VLAN is a new data exchange technology that logically divides LAN devices into network segments to implement virtual working groups. This emerging technology is mainly used in vswitches and routers, but mainstream applications are still in vswitches. But not all vswitches

1 vlan Overview
The Chinese name of a VLAN (Virtual Local Area Network) is "Virtual LAN ". VLAN is a new data exchange technology that logically divides LAN devices into network segments to implement virtual working groups. This emerging technology is mainly used in vswitches and routers, but mainstream applications are still in vswitches. However, not all vswitches have this function. Only vswitches above Layer 2 of the VLAN Protocol have this function. The emergence of 802.1Q standards breaks the deadlock that virtual networks depend on a single vendor, and promotes the rapid development of VLANs from one side.
2. vswitch port working mode
The switch port has three working modes: Access, Hybrid, and Trunk.
An Access port can only belong to one VLAN and is generally used to connect to a computer;
A Trunk port allows multiple VLANs to pass through. It can receive and send packets from multiple VLANs. It is generally used for ports connected between switches;
A Hybrid port allows multiple VLANs to pass through. It can receive and send packets from multiple VLANs. It can be used to connect switches or to users' computers.

3 basic concepts (tag, untag, 802.1Q)

Untag is a common ethernet packet. The NIC of a common PC can identify such packets for communication;
The structure of the tag packet is changed after the source mac address and the target mac address, with the 4-bytes vlan information added, that is, the vlan tag header. Generally, the NIC of a common PC cannot be identified.
Describe the frame structure of the tag packet encapsulated by 802.1Q


A frame with 802.1Q is a four-byte mark inserted on a standard Ethernet frame. Including:
Two-byte protocol identifier (TPID). When the prefix 0 x is fixed, it indicates that the frame carries the mark information of 802.1Q.
Two bytes of tag control information (TCI), including three fields.
Priority domain, which occupies 3 bits, indicates the Priority of the message. values 0 to 7 are the highest Priority, and 0 is the lowest Priority. This domain is used by 802.1p.
Standard Format Indicator (CFI) domain, 1bit, 0 indicates standard format, used in Ethernet; 1 indicates non-standard format, used in Token Ring.
The vlan id field, which occupies 12 bits and is used to indicate the VLAN's attribution.

4. Switch interface Data Processing Process

Processing When receiving packets through port 4.1:


Acess port receipt:
When a packet is received, determine whether there is VLAN information: If there is no VLAN information, add the PVID of the port and perform exchange and forwarding. If yes, discard the packet directly (default)
Trunk port receipt:
When a packet is received, determine whether there is VLAN information: If there is no VLAN information, add the PVID of the port and perform exchange and forwarding. If so, determine whether the trunk port allows the data of the VLAN to enter: if yes, the packet carries the original VLAN label for forwarding. Otherwise, the packet is discarded.
Hybrid port receipt:
When a packet is received, determine whether there is VLAN information: If there is no VLAN information, set the PVID of the port and perform exchange and forwarding. If yes, determine whether the hybrid port allows data of the VLAN to enter: if yes, it will be forwarded; otherwise, it will be discarded.

Handling of messages sent from Port 4.2


Acess port sends messages:
Remove the VLAN information of the packets and send them directly.
Trunk port sends messages:
Compare the PVID of the port with the VLAN information of the packet to be sent. If the two are the same, the VLAN information is removed and then sent. Otherwise, the packet will carry the original VLAN tag for forwarding.
Hybrid port sends messages:
1. Determine the attributes of the VLAN on the current port.
2. If it is an untag, the VLAN information is stripped and then sent. If it is a tag, the PVID of the port is compared with the VLAN information of the packet to be sent. If the two are equal, the VLAN information is stripped and then sent, otherwise, the packets will carry the original VLAN tags for forwarding.

**************************************** **************************************** ********
Http://blog.csdn.net/jesseyoung/article/details/40047749
Blog homepage: http://blog.csdn.net/jesseyoung

**************************************** **************************************** ********

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.