networking, updated

VLAN (802.1Q)

IEEE 802.1Q splits one physical switch network into separate layer-2 networks by adding a 4-byte tag to Ethernet frames on trunk links.

OSI layer
2 Data link
Carried in
Ethernet
Identified by
TPID 0x8100 (QinQ outer: 0x88A8)
Specs
IEEE 802.1Q, IEEE 802.1ad
Wireshark filter
vlan
Encrypted
no

Packet structure

802.1Q VLAN tag4 bytes

Select a field to see what it does.

4 bytes inserted between the source MAC and the EtherType of an Ethernet frame. QinQ (802.1ad) stacks a second tag with TPID 0x88a8 in front.

In the frame: Destination MAC | Source MAC | 802.1Q tag | EtherType | Payload | FCS. The tag makes the frame 4 bytes longer (maximum 1522).

How it works

Port typeFrames on the wireTypical use
Access portUntagged; the switch adds/removes the tag internallyEnd devices
Trunk portTagged with the VLAN ID, except the native VLAN, which is untaggedSwitch-to-switch, switch-to-router, hypervisors

Traffic between VLANs must be routed (router on a stick, layer-3 switch, firewall), which is where it can be filtered.

QinQ (802.1ad) puts a provider tag (TPID 0x88a8) in front of the customer tag, so a carrier can transport customer VLANs unchanged.

Capturing tags: many NICs and drivers strip VLAN tags before the capture sees them. To see tags, capture on a trunk with tag offloading disabled or on a mirror (SPAN) port configured to keep them.

In Wireshark

FilterShows
vlanTagged frames
vlan.id == 20One VLAN
vlan.priority >= 5Voice / high-priority traffic
vlan.etype == 0x8100A tag inside a tag (QinQ or double tagging attack)
eth.type == 0x88a8802.1ad outer tags

What normal looks like: tags only on trunk links, every frame with one tag (two on provider QinQ links). A frame with two 0x8100 tags arriving on an access port is an attack.

Security notes

References

§ home
~/knubertus/home/
1,1 Top