Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Detailed explanation of Vlan-read and understand tag and untagged

Shulou Source: shulou.com Published: 2022-06-01 08:29:18 10月03日 Update

The Vlan here is a Vlan that conforms to the IEEE 802.1Q standard.

The frame structure is as follows:

| | DA | SA | tag | Type | Date | CRC | |

Compared to a normal Ethernet frame, the Vlan frame adds a 4byte-long Tag field after the source Mac address. This field is divided into:

| | TPID | priority | CFI | Vlan ID | |

TPID: tag protocal ID is a fixed value: 0x8100

Priority: 3bits is long and has 8 priorities

CFI: 0 for specification and 1 for non-specification

Vlan ID: 12bits is long, with a value of 14094

This tag is very important, although there are many forms of Vlan, such as port-based Vlan, Mac-based Vlan, protocol-based Vlan, etc., but will eventually be converted to tag.

The most commonly used is port-based Vlan, which leads to several different port types: access/trunk/hybrid

The Access port can only belong to one Vlan. When the port receives an ordinary Ethernet frame, it hits Tag,Vlan ID, which is the ID; of the Vlan where the port is located. When the port is forwarded out, the Tag will be removed. It is commonly used to connect non-Vlan aware devices such as PC.

The Trunk port can belong to more than one Vlan. When forwarding frames, except for the Vlan frames consistent with its PVID without Tag, all the other ports need to be tag. PVID is the ID of the default Vlan for this port. It is generally used for direct interconnection of switches.

Hybrid ports can also belong to multiple Vlan, but unlike Trunk ports, it allows multiple Vlan frames to be forwarded with tag and multiple Vlan frames without tag. It is flexible to use, and protocol-based Vlan is an example.

Tags: Ports multiple different normal Ethernet fields that is Ethernet important consistent switch priority example address common form location standard thus type Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL Huawei Apple Linux