No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


IEEE 802.1Q Frame Format

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
IEEE 802.1Q Frame Format

IEEE 802.1Q Frame Format


This document describes VLAN frame format and QinQ packet encapsulation format.

VLAN Frame Format

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 to identify the VLAN to which the frame belongs. Figure 1-1 shows the position of a VLAN tag in a VLAN data frame.

Figure 1-1 IEEE 802.1Q frame format

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

There are two main types of Ethernet links: access links (transmit untagged frames) and trunk links (transmit tagged frames). The two link types differ in the number of VLANs they can carry traffic for: an access link can carry traffic for only one VLAN, and therefore usually connects a switch to a user terminal, such as a host, a server, or an unmanaged switch; a trunk link can carry traffic for multiple VLANs, and as such usually connects a switch to another switch or a router. The frames transmitted on an access link are untagged frames, and the frames transmitted on a trunk link are tagged frames.

All frames processed on a switch carry VLAN tags. After receiving an untagged frame from a user terminal, the switch adds a VLAN tag to the frame, recalculates the frame check sequence (FCS), and then transmits the frame through a trunk link. Before sending the frame to a user terminal, the switch removes the VLAN tag, and sends the untagged frame to the terminal through an access link.

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

Table 1-1 Fields in a VLAN tag






2 bytes

Tag Protocol Identifier (TPID), indicating the frame type.

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

Device vendors can define their own TPID values, and users can then change the value to realize interconnection of devices from different vendors.


3 bits

Priority (PRI), indicating the 802.1p priority of a frame.

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 the highest priority first.


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.


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.

QinQ Packet Encapsulation Format

However, because the 12-bit VLAN tag field defined in IEEE 802.1Q identifies a maximum of 4096 VLANs, the number of users that 802.1Q VLANs can identify and isolate on metro Ethernet networks (MANs) is insufficient. To address this issue, QinQ is developed to expand VLAN space beyond 4096 VLANs so that a larger number of users can be identified on MANs. QinQ is developed to expand VLAN space by adding an additional 802.1Q tag to an 802.1Q packet. This increases the number of VLANs to 4094 x 4094.

The switch forwards packets over a public network according to the outer VLAN tag carried in the packets, and learns MAC addresses from the outer VLAN tag. The inner VLAN tag in the packets is forwarded as payload of the packets. QinQ is applied in scenarios other than simply to expand VLAN space. For example, because the inner and outer VLAN tags can be used to differentiate packets based on users and services, the inner tag can represent a user and the outer tag can represent a service.

Figure 1-2 802.1Q encapsulation and QinQ encapsulation

Frame Size

The maximum frame length allowed by each interface on a carrier network should be at least 1504 bytes to accommodate the additional length of QinQ packets compared with 802.1Q packets. By default, the maximum frame length allowed on a switch is larger than 1504 bytes and so does not require modification.


Different carriers may use different TPID values in outer VLAN tags of QinQ frames. To ensure that QinQ frames sent from a Huawei device can be transmitted across a carrier network, set the TPID value to that used by the carrier. Table 1-2 provides some of the common protocol types and their TPID values, which should not be used in such cases.

Table 1-2 Protocol types and values


Protocol Type























Updated: 2019-07-23

Document ID: EDOC1100088104

Views: 1464

Downloads: 23

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Previous Next