What the Four Bytes After a MAC Address Mean in an 802.1Q Capture
Capture traffic on a switch uplink and Wireshark suddenly adds a line called 802.1Q Virtual LAN. The obvious question is whether the sending computer put that VLAN on the packet. Often it did not. A VLAN tag says which VLAN a frame belongs to on this particular Layer 2 link. An endpoint can send one, but switches also commonly add tags before forwarding frames over a trunk and remove them again before an access port.
It makes more sense when placed back in the Ethernet frame. An ordinary frame has a destination MAC, a source MAC, then an EtherType such as 0x0800 for IPv4 or 0x0806 for ARP. An 802.1Q frame inserts four bytes between the source MAC and the original EtherType:
Destination MAC | Source MAC | 0x8100 | TCI | original EtherType | payload
└──── VLAN tag ────┘
Cisco's overview of the 802.1Q frame format describes the same placement: the tag sits between the source address and the Type/Length field, which means the original EtherType moves back. Wireshark can therefore decode the VLAN header first and still treat the following 0x0800 as IPv4 or 0x0806 as ARP. It is not another IP layer wrapped around the packet.
What is in those four bytes
The first two bytes are normally 0x8100, the TPID (Tag Protocol Identifier). They tell the receiver that an 802.1Q tag begins here. The final two bytes are the TCI. In practice, these are the parts worth noticing:
| Field | Bits | What it means in a capture |
|---|---|---|
| PCP | 3 | Layer 2 priority, from 0 to 7; a value alone does not prove the network honours it |
| DEI | 1 | Drop Eligible Indicator; older material may call this bit CFI |
| VLAN ID | 12 | The VLAN to which this frame belongs |
For example, 802.1Q VLAN, PRI: 0, DEI: 0, ID: 20 normally makes ID: 20 the important part: at this capture point, the frame is travelling as VLAN 20. PCP 0 only says that this tag has no higher priority marking. Queuing and remarking might still happen elsewhere in the path.
One small trap: a VLAN ID of 0 does not mean the frame belongs to “VLAN 0”. It can be a priority-tagged frame, carrying PCP and DEI without an ordinary VLAN membership. The receiving port's configuration and policy determine the actual VLAN in that case; the zero in the capture is not enough.
Why the same traffic is tagged in one capture and untagged in another
Usually the traffic did not change. The capture point did.
Access ports and endpoint adapters. On an access port, a switch normally handles untagged frames as members of that port's VLAN. Endpoints generally receive untagged frames too, so it is perfectly normal not to see 802.1Q when capturing on a laptop. Servers, hypervisors and some access points can deliberately use VLAN subinterfaces, and their own adapters may then see tags.
Trunks between switches or to an AP. A link carrying multiple VLANs needs a way to distinguish them at the far end, so this is where tags are most often visible. Many platforms send the native VLAN untagged by default. An untagged frame on a trunk does not, by itself, prove that it is not VLAN traffic; check the native VLAN and port mode at both ends.
SPAN and capture appliances. Whether a mirror session preserves the original tag depends on the switch and on how the session is configured. Some mirroring takes a copy after switching, by which point the tag may have been changed or removed; some platforms require an explicit encapsulation-replicate setting. If the capture disagrees with what the network should be doing, verify the mirror source, destination and platform behaviour before blaming Wireshark.
Three questions before drawing conclusions from a VLAN ID
A VLAN ID in a trace is useful, but it is not a topology diagram. I usually line up three facts before using it as evidence:
- Where and in which direction was the packet captured: endpoint port, trunk, or mirror port?
- Which VLANs does that interface allow, and how does it handle the native VLAN?
- At the next hop, does the tag remain, disappear, or change value?
Consider a common example: a DHCP request from a phone is tagged VLAN 30 on an AP uplink, but the DHCP server sees it as VLAN 10. Do not begin at the DHCP service. Follow the AP uplink, aggregation trunk, gateway or tunnel egress one hop at a time. The fault may be an AP service-VLAN mapping, a trunk's allowed-VLAN list, or a rewrite further down the path.
The MAC address itself does not change when a VLAN tag is added. Switches learn the MAC table with the VLAN as part of the context, so the same MAC in two VLANs is not automatically a duplicate. Include the VLAN when querying a table; otherwise, it is easy to mistake a record from another Layer 2 domain for the incident in front of you. For the basics of learning and aging, see how a switch MAC address table works.
Do not assume two tags mean a bad VLAN configuration
Two consecutive VLAN headers in Wireshark usually indicate QinQ or another double-tagging arrangement. A provider can add an outer S-Tag around a customer's C-Tag, allowing different customers to use the same VLAN ID while remaining separate in transit. It can certainly be a configuration mistake, but two tags alone do not establish that. First check whether the link crosses a carrier, a campus aggregation network, or a private Layer 2 service.
The value of a VLAN tag is not merely reading a number. Its value is knowing where that number was observed. With that context, you can tell whether 20 is the endpoint's actual access VLAN, a mark on a trunk, or a remnant of the mirror path.
References
- Cisco, “Inter-Switch Link and IEEE 802.1Q Frame Format” — tag position, TPID, priority and VLAN ID: https://www.cisco.com/c/en/us/support/docs/lan-switching/8021q/17056-741-4.html
- Wireshark Display Filter Reference —
vlanprotocol fields and filters: https://www.wireshark.org/docs/dfref/v/vlan.html