VLAN Access,trunk,hybrid three modes of difference

Source: Internet
Author: User
Tags switches

    1. Tag message structure is after the source MAC address and destination MAC address, plus 4bytes VLAN information, the normal PC network card is not recognized.

    2. The access port belongs to only 1 VLANs and is typically used to connect to a computer port.

    3. The port of the trunk type can be used for multi-VLAN communication.

    4. The hybrid type of port allows multiple VLANs through, can receive send multi-VLAN messages, can be used for switch-to-switch connections, and can also be used for switch and computer connections.

    5. The hybrid type of port and trunk port are the same method when processing packets. The only difference is that when sending a packet, the hybrid port can allow packets of multiple VLANs to be sent without tagging, while the truck port only allows packets of the default VLAN (native VLAN or default VLAN) to be sent without tagging.

    6. The access port belongs to only one VLAN, so its default VLAN is the VLAN in which it resides, without setting it. The hybrid port and trunk ports belong to multiple VLANs, so you need to set the default VLAN, by default, their default VLAN is VLAN 1.

    7. If the default VLAN ID of the port is set, when the port receives a packet without VLAN tag, the packet is forwarded to the switch port where the default VLAN resides, and when the port sends a packet with VLAN tag, if the VLAN ID of the packet is the same as the port default VLAN, The switch removes the VLAN tag carried by the packet and forwards it to that port.

    8. The default VLAN for Huawei switches is called Pvid, and Cisco switches are called native VLANs.

    9. The switch port processes the incoming and outgoing packets as follows:


  • The Access port receives the packet:

    A packet is received to determine if there is VLAN information, and if not, the native VLAN ID of the upper port is called and the interchange is forwarded.

    Someone asked: What if there is VLAN information? In general, you should not connect an access port to another port with a VLAN, because access is originally designed to connect to a normal computer, and a normal computer's network card sends packets without VLANs. If it is connected to the trunk port on the end due to a configuration error, or now some computers have a NIC that can send and receive VLAN tag packets, in both cases, I understand that if the trunk port sends the VLAN ID of the data to the native of the access port VLAN is the same, the switch forwards the packet. If the VLAN ID of the packet sent by the trunk port is different from the native VLAN of the access port, the switch discards the packet.

  • The Access port sends the packet:

    The VLAN information of the packet is stripped and sent out directly.

  • Trunk Ports Receive packets:

    A packet is received to determine if there is VLAN information, and if not, the native VLAN ID of the upper port is called and the interchange is forwarded.

    If there is VLAN information, determine whether the trunk port allows packets of that VLAN to enter, and if so, to forward, otherwise discard.

  • Trunk Ports Send packets:

    Compares the port's native VLAN with the VLAN information that sends the packet, and if the two are equal, the VLAN information is stripped and then sent. If they are not equal, they are sent directly.

  • The hybrid port receives the packet:

    A packet is received to determine if there is VLAN information, and if not, the native VLAN ID of the upper port is called and the interchange is forwarded.

    If there is VLAN information, determine whether the hybrid port allows packets of that VLAN to enter, and if so, to forward, otherwise discard.

  • The hybrid port sends the packet:

    Determine the properties of the VLAN configuration on this port, and if the attribute is UNTAG, peel the VLAN tag and forward again. If the property is tag, it is sent directly.


It must be clear that the internal switch in the processing of packets, all packets must be on the VLAN tag, knowing this, the switch processing VLAN specific process is easy to understand.


Example 1:

Two switches, one console port configuration trunk, native VLAN 100, another console port configured access, native VLAN is the default 1.

Q: Can I connect to a PC connected to two switches? For Mao?


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/C3/wKiom1WnZWGCfEphAAC6j4a1oEw300.jpg "title=" VLAN. PNG "alt=" Wkiom1wnzwgcfephaac6j4a1oew300.jpg "/>


Answer: Tong. Because the trunk port sends out the VLAN tag in the native VLAN packet will be stripped, then the other switch's access port receives the packet is UNTAG, it can of course handle, it receives only internally using native VLAN 1, etc one out switch, Because it is an access port, the VLAN tag is stripped off and sent to the trunk port, and the trunk port re-hits its own native VLAN 100 for forwarding.

This example shows that the trunk port when sending native VLAN packets is stripped tag, even if the two links are configured with different native VLANs, can also be interoperable.  However, the console port of the switch will normally error: "Mismatched Native VLAN". Oh, isn't it magical?


VLAN Access,trunk,hybrid three modes of difference

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.