< Home

VLAN Tags

Definition and Function

A switch identifies packets from different VLANs according to the information contained in its VLAN tags. IEEE 802.1Q adds a 4-byte VLAN tag between the Source/Destination MAC address and Length/Type fields of an Ethernet frame, as shown in Figure 1.

Figure 1 IEEE 802.1Q-tagged frame format

A VLAN tag contains four fields. Table 1 describes the fields.

Table 1 Fields in a VLAN tag
Field Length Description Value
TPID 2 bytes Tag Protocol Identifier (TPID), indicating the frame type.

The value 0x8100 indicates an 802.1Q-tagged frame. An 802.1Q-incapable device discards the 802.1Q frames.

IEEE 802.1Q defines the value of the field as 0x8100. However, vendors can define their own TPID values and users can then modify the value to realize interconnection of devices from different vendors.

PRI 3 bits Priority (PRI), indicating the frame 802.1p priority.

The value is in the range from 0 to 7. A larger value indicates a higher priority. If congestion occurs, the switch sends packets with higher priorities first.

CFI 1 bit Canonical Format Indicator (CFI), indicating whether a MAC address is encapsulated in canonical format over different transmission media. CFI is used to ensure compatibility between Ethernet and token ring networks.

The value 0 indicates that the MAC address is encapsulated in canonical format, and the value 1 indicates that the MAC address is encapsulated in non-canonical format. The CFI field has a fixed value of 0 on Ethernet networks.

VID 12 bits VLAN ID (VID), indicating the VLAN to which a frame belongs. The VLAN ID is in the range from 0 to 4095. The values 0 and 4095 are reserved, and therefore available VLAN IDs are in the range from 1 to 4094.

VLAN Tags in Received and Sent Frames

The following are the two types of Ethernet frames in a VLAN:
  • Tagged frame: frame with a 4-byte VLAN tag
  • Untagged frame: frame without a 4-byte VLAN tag
Common devices process tagged and untagged frames as follows:
  • User hosts, servers, hubs, and unmanaged switches can only receive and send untagged frames.
  • Switches, routers, and ACs can receive and send both tagged and untagged frames.
  • Voice terminals and APs can receive and send either tagged or untagged frames of only one VLAN.

All frames processed on a switch carry VLAN tags to improve frame processing efficiency.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >