IEEE 802.1Q, often referred to asDot1q, is thenetworking standard that supportsvirtual local area networking (VLANs) on anIEEE 802.3Ethernet network. The standard defines a system ofVLAN tagging forEthernet frames and the accompanying procedures to be used bybridges andswitches in handling such frames. The standard also contains provisions for aquality-of-service prioritization scheme commonly known asIEEE 802.1p and defines theGeneric Attribute Registration Protocol.
Portions of the network which are VLAN-aware (i.e., IEEE 802.1Q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of the network, a tag is added to represent the VLAN membership.[a] 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 thenative VLAN.
The standard was developed byIEEE 802.1, aworking group of theIEEE 802 standards committee, and continues to be actively revised with notable amendments includingIEEE 802.1ad,IEEE 802.1ak andIEEE 802.1s. The 802.1Q-2014 revision incorporated theIEEE 802.1D-2004 standard.[1]
802.1Q adds a 32-bit field between the sourceMAC address and theEtherType fields of the original frame. Under 802.1Q, the maximum frame size is extended from 1,518 bytes to 1,522 bytes. 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 a tag to be popped without needing additional padding.[2][3] Two bytes are used for the tag protocol identifier (TPID), the other two bytes for tag control information (TCI). The TCI field is further divided into PCP, DEI, and VID.[4]
16 bits | 3 bits | 1 bit | 12 bits |
---|---|---|---|
TPID | TCI | ||
PCP | DEI | VID |
For frames (other than 802.3 frames) usingSubnetwork Access Protocol (SNAP) encapsulation with anorganizationally unique identifier (OUI) field of 00-00-00 (so that the protocol ID field in the SNAP header is an EtherType as specified inRFC 1042), the EtherType value in the SNAP header is set to 0x8100 and the aforementioned extra 4 bytes are appended after the SNAP header.[9] 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 placedbefore the LLC-SNAP header.
Because inserting the VLAN tag changes the frame, 802.1Q encapsulation forces a recalculation of the originalframe 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 asbaby giant anomalies.[10]
IEEE 802.1ad introduced the concept of double tagging. Double tagging can be useful forInternet service providers (ISPs), allowing them to use their VLANs internally while carrying traffic from clients that is already VLAN tagged. The outer (next to source MAC and representing ISP VLAN) S-TAG (service tag) comes first, followed by the inner C-TAG (customer tag). In such cases, 802.1ad specifies a TPID of 0x88a8 for service-provider outer S-TAG.
IEEE 802.1Q defines theMultiple VLAN Registration Protocol (MVRP), an application of theMultiple Registration Protocol, allowing bridges to negotiate the set of VLANs to be used over a specific link. MVRP replaced the slowerGARP VLAN Registration Protocol (GVRP) in 2007 with the IEEE 802.1ak-2007 amendment.
The 2003 revision of the standard was the first to include theMultiple Spanning Tree Protocol (MSTP) which was originally defined inIEEE 802.1s.