IEEE 802.1Q


IEEE 802.1Q, often referred to as Dot1q, is the networking standard that supports virtual LANs on an IEEE 802.3 Ethernet network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and defines the Generic Attribute Registration Protocol.
Portions of the network which are VLAN-aware can include VLAN tags. When a frame enters the VLAN-aware portion of the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN.
The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised. One of the notable revisions is 802.1Q-2014 which incorporated IEEE 802.1aq and much of the IEEE 802.1D standard.

Frame format

802.1Q adds a 32-bit field between the source MAC address and the EtherType fields of the original frame. Under 802.1Q, the minimum frame size remains 64 bytes but a bridge may extend the minimum size frame from 64 to 68 bytes on transmission. This allows to easily pop a tag without additional padding. and the maximum frame size is extended from 1,518 bytes to 1,522 bytes. Two bytes are used for the tag protocol identifier, the other two bytes for tag control information. The TCI field is further divided into PCP, DEI, and VID.
;Tag protocol identifier
;Tag control information
For frames using Subnetwork Access Protocol encapsulation with an organizationally unique identifier field of 00-00-00, the EtherType value in the SNAP header is set to 0x8100 and the aforementioned extra 4 bytes are appended after the SNAP header. In other words the VLAN tag follows the SNAP header. For 802.3 frames in LLC-SNAP format, the order is opposite; the VLAN tag is placed before the LLC-SNAP header.
Because inserting the VLAN tag changes the frame, 802.1Q encapsulation forces a recalculation of the original frame check sequence field in the Ethernet trailer.
The IEEE 802.3ac standard increased the maximum Ethernet frame size from 1518 bytes to 1522 bytes to accommodate the four-byte VLAN tag. Some network devices that do not support the larger frame size will process these frames successfully, but may report them as "baby giant" anomalies.

Double tagging

introduced the concept of double tagging. Double tagging can be useful for internet service providers, allowing them to use VLANs internally while mixing traffic from clients that are already VLAN tagged. The outer S-TAG comes first, followed by the inner C-TAG. In such cases, 802.1ad specifies a TPID of 0x88a8 for service-provider outer S-TAG.

Other protocols

IEEE 802.1Q defines the Multiple VLAN Registration Protocol, an application of the Multiple Registration Protocol, allowing bridges to negotiate the set of VLANs to be used over a specific link. MVRP replaced the slower GARP VLAN Registration Protocol in 2007 with the IEEE 802.1ak-2007 amendment.
The 2003 revision of the standard included the Multiple Spanning Tree Protocol which was originally defined in IEEE 802.1s.