What is 802.1Q?
IEEE 802.1Q VLAN tagging
802.1Q (IEEE 802.1Q VLAN tagging) is the standard that adds a small tag to Ethernet frames so that one link can carry traffic for many separate VLANs.
The tag is four bytes, inserted between the source MAC address and the EtherType of the original frame. The first two bytes are the Tag Protocol Identifier, 0x8100, which tells the receiver "this frame is tagged". The other two hold a 3-bit priority field (PCP, used for class of service), a 1-bit drop-eligible flag, and the 12-bit VLAN ID. Twelve bits give 4096 values, but 0 and 4095 are reserved, so usable VLANs run from 1 to 4094. Because the tag makes the frame four bytes longer, the maximum standard Ethernet frame grows from 1518 to 1522 bytes, while the IP MTU stays at 1500.
You meet 802.1Q on trunk ports: links between switches, or between a switch and a router or hypervisor. A switch adds the tag when it sends a frame onto a trunk and strips it when it delivers the frame to an access port, so ordinary hosts never see tags. One VLAN on a trunk can be sent untagged, called the native VLAN (or the PVID on Linux bridges); a native VLAN that differs at the two ends quietly joins two VLANs together, which is a classic mistake. Another is forgetting to allow a VLAN on a trunk, so one VLAN works and the next doesn't. Stacking two tags (QinQ, standardised as 802.1ad) lets a provider carry a customer's VLANs inside its own. See VLAN for the concept the tag implements. The Switching basics lesson builds access ports and a tagged trunk to a router, including the missing-VLAN mistake.
Lessons that use 802.1Q
- Switching basics: layer 2, VLANs and IP addressingTeaches this term · Beginner · 40 min
How a switch learns MAC addresses and floods broadcasts, how IP subnets and default gateways decide where packets go, how VLANs split a switch into separate networks, and how trunks and a router connect them. Built on a real switch, three PCs and a VyOS router.
- Building a network lab on an Apple Silicon MacBeginner · 45 min
Run real network labs on an M-series Mac: native FRR and Linux containers, x86-only images through Rosetta, and full x86 VyOS VMs under QEMU in Docker, with the pitfalls that stop most people and a starter lab that mixes all three.