What is the difference between the Hybrid and Trunk ports of a VLAN?

Source: Internet
Author: User
Tags passthrough

There are three port modes: access, hybrid, and trunk. The accesskey can belong to multiple VLANs and receive and send packets from multiple VLANs. It is generally used for connection between switches. hybrid can also belong to multiple VLANs, it can receive and send packets from multiple VLANs. It can be used for connections between switches or between switches and user computers. The main difference between trunk and hybrid is that the hybrid port allows packets from multiple VLANs not to be tagged, while the trunk port only allows packets from the default vlan not to be tagged, hybrid and trunk cannot coexist on the same vswitch.
The following exam details three ports:
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.
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.
There are three types of Ethernet ports: 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.
Hybrid and Trunk have the same processing method when receiving data. The only difference is that when sending data, Hybrid allows packets of multiple VLANs to be sent without tags, however, the Trunk port only allows packets sent by default VLAN without tags.
First, we need to clarify the concept of port default VLAN.
The Access port only belongs to one VLAN. Therefore, its default VLAN is the VLAN where it is located. You do not need to set it;
The Hybrid and Trunk ports belong to multiple VLANs, so you need to set the default vlan id. By default, the default VLAN of the Hybrid and Trunk ports is VLAN 1.
When the port receives a packet without a VLAN Tag, the packet is forwarded to the port of the default VLAN (if the default vlan id of the port is set ). When a port sends a packet with a VLAN Tag, if the vlan id of the packet is the same as the default vlan id of the port, the system removes the VLAN Tag of the packet and then sends the packet.
Note: For H3C switches, the default VLAN is called "Pvid Vlan". For Cisco switches, the default VLAN is called "Native Vlan". The process of Data Processing for incoming and outgoing interfaces is as follows:
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)
Acess port sends messages:
Remove the VLAN information of the packets and send them directly.
(Therefore, the Access port can implement host communication under the same VLAN on the same vswitch; it can also implement default VLAN1 Packet Exchange during vswitch-level connection, but cannot implement VLAN passthrough .)
Trunk port receipt:
When a packet is received, determine whether there is VLAN information: If yes, determine whether the trunk port allows data from the VLAN to enter: If yes, the packet is forwarded; otherwise, the packet is discarded; if no VLAN information is available, the PVID of the port is configured and forwarded.
Trunk port sends messages:
Compare the VLAN information of the packet to be sent with the PVID of the port. If not, send the packet directly. If the two are equal, the VLAN information is stripped and then sent.
(So, after you set all the vswitch-level ports to Trunk and allow all VLANs to pass through, the VLAN2-VLAN4000 is directly passthrough, and VLAN1 is because it is the same as the Trunk default PVID, you need to remove VLAN information and add VLAN information to implement passthrough. If you change the default PVID of the Trunk, you can implement VLAN-X communication under a switch and the VLAN-Y under another switch .)
Hybrid port receipt:
When a packet is received, determine whether the VLAN information exists. If yes, determine whether the hybrid port allows data from the VLAN to enter. If yes, the packet is forwarded, otherwise, discard (in this case, the untag configuration on the port does not need to be considered. The untag configuration only takes effect when sending packets );
If no port exists, the PVID of the port is set and the port is forwarded.
Hybrid port sends messages:
1. Determine the attributes of the VLAN on the current port (The disp interface can see which VLANs are untags and which VLANs are tags)
2. If it is an untag, the VLAN information is stripped and then sent. If it is a tag, it is directly sent.
(Therefore, Hybrid enables communication between hosts under different VLANs .)
The following cases can help you understand the H3C switch's hybrid port mode.
[Switch-Ethernet0/1] int e0/1
[Switch-Ethernet0/1] port link-type hybrid
[Switch-Ethernet0/1] port hybrid pvid vlan 10
[Switch-Ethernet0/1] port hybrid vlan 10 20 untagged
[Switch-Ethernet0/1] int e0/2
[Switch-Ethernet0/2] port link-type hybrid
[Switch-Ethernet0/2] port hybrid pvid vlan 20
[Switch-Ethernet0/2] port hybrid vlan 10 20 untagged
In this case, the connected pcs under inter e0/1 and inter e0/2 can communicate with each other, but the round-trip VLANs used for data communication are different.
The following example describes the pc2 connected to inter e0/1 to access inter e0/2.
The data sent by pc1 is sent to the switch by marking vlan10 in the pvid vlan10 of inter0/1. The switch finds that inter e0/2 allows data from vlan 10 to pass through, therefore, the data is forwarded to inter e0/2. Because vlan 10 on inter e0/2 is untagged, the switch removes the vlan10 mark on the packet and sends it to pc2, in this case, pc1-> p2 follows vlan10.
Then, we analyze the process of pc2 returning packets to pc1. The data sent by pc2 is sent to the switch by the pvid vlan20 of inter0/2 encapsulation vlan20, the switch finds that inter e0/1 allows the data of vlan 20 to pass, so the data is forwarded to inter e0/1, because vlan 20 on inter e0/1 is untagged, the switch removes the vlan20 mark on the data packet and sends it to pc1 as a normal package. In this case, pc2-> pc1 follows vlan20.

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.