Skip to content

2.2 IEEE 802.1Q Tagging

The previous section explained what VLANs do: VLANs create logical segments on a physical switch. This section explains how VLANs work at the wire level. The 802.1Q tag is the 4-byte field inserted into every Ethernet frame. The tag carries the VLAN ID and priority. Without understanding the tag, configuring QoS for PROFINET RT or diagnosing incorrect VLAN assignments is impractical.

Before 802.1Q, VLANs were vendor-proprietary. Cisco switches used ISL tagging. 3Com switches used a different scheme. Switches from different vendors had no way to exchange VLAN information.

IEEE 802.1Q, published in 1998, standardized VLAN tagging. The standard defines a 4-byte tag inserted into the Ethernet frame. The tag carries the VLAN ID and priority information. Any switch implementing 802.1Q exchanges VLAN-tagged frames with any other 802.1Q switch, regardless of vendor. The tag has a precise structure encoding 3 pieces of information.

802.1Q inserts a 4-byte tag between the Source MAC address and the EtherType field:

FieldSizeValue / Notes
Destination MAC6 bytesTarget device
Source MAC6 bytesSender
TPID2 bytes0x8100 — marks the frame as tagged
TCI2 bytesPCP + DEI + VID (see below)
EtherType2 bytesInner payload protocol
Payload46 to 1500 bytesData

The TCI (Tag Control Information) field is 16 bits with 3 sub-fields:

BitsFieldSizeValues
15 to 13PCP3 bitsPriority 0 (lowest) to 7 (highest)
12DEI1 bit0 = not drop-eligible, 1 = drop-eligible
11 to 0VID12 bitsVLAN ID 1 to 4094

Key terms:

  • TPID (Tag Protocol Identifier) — value 0x8100. Identifies the frame as 802.1Q tagged.
  • PCP (Priority Code Point) — 3-bit IEEE 802.1p QoS priority, values 0 to 7
  • DEI (Drop Eligible Indicator) — marks the frame as eligible for dropping under congestion
  • VID (VLAN Identifier) — 12-bit VLAN ID, range 1 to 4094

The 4-byte tag increases the maximum frame size from 1518 to 1522 bytes. Configure trunk ports to accept frames up to 1522 bytes. Otherwise, the switch discards tagged frames as giants. The PCP field controls which frames the switch processes first during congestion.

The 3-bit PCP field prioritizes frames at Layer 2. Switches process higher-priority frames first when queues are congested.

PCPPriorityIndustrial Use
7HighestNetwork control: STP BPDUs, MRP frames
6HighPROFINET RT frames
2DefaultBest effort
0LowestBackground

Mark PROFINET RT frames with PCP 6 and MRP control frames with PCP 7. A switch with a congested output queue processes PCP 6 frames first. This behavior helps maintain PROFINET RT cycle times. After configuring priority marking, verify the marking on live traffic.

After configuring QoS on a switch, verify that frames carry the correct priority. The following script captures frames on a ring port and reports PROFINET RT frames missing PCP 6:

from scapy.all import sniff, Ether, Dot1Q
issues = []
def check_priority(pkt):
if not pkt.haslayer(Ether):
return
eth = pkt[Ether]
if eth.type == 0x8892: # PROFINET RT
if pkt.haslayer(Dot1Q):
pcp = pkt[Dot1Q].prio
if pcp != 6:
issues.append(f"PROFINET RT from {eth.src}: PCP={pcp} (expected 6)")
else:
issues.append(f"PROFINET RT from {eth.src}: no 802.1Q tag")
elif eth.type == 0x88E3: # MRP
if pkt.haslayer(Dot1Q) and pkt[Dot1Q].prio != 7:
issues.append(f"MRP from {eth.src}: PCP={pkt[Dot1Q].prio} (expected 7)")
sniff(iface="eth0", prn=check_priority, timeout=30, store=False)
if issues:
print(f"Priority marking issues ({len(issues)} found):")
for issue in issues:
print(f" {issue}")
else:
print("All PROFINET RT and MRP frames have correct priority marking.")

PROFINET RT frames without PCP 6 compete equally with best-effort traffic. During congestion, the switch delays or drops these frames, causing cycle time violations. If PROFINET RT frames show PCP 0, fix the QoS configuration on the switch.

EtherTypeProtocol
0x0800IPv4
0x0806ARP
0x8100802.1Q VLAN tag
0x8892PROFINET RT
0x88CCLLDP
0x88E3MRP

VID is 12 bits, values 1 to 4094

The VLAN ID occupies bits 11 to 0 of the TCI field. VLAN 0 and 4095 are reserved. VLAN 1 is the default — assign production traffic to a dedicated VLAN.

PCP 6 for PROFINET RT, PCP 7 for MRP

Mark PROFINET RT frames with PCP 6 and MRP control frames with PCP 7. Verify the marking with Scapy after configuring QoS on the switch.

The 802.1Q tag carries the VLAN ID. The next section covers trunk and access ports — how switches apply and strip these tags at each port type, and the most common misconfiguration mistakes.

  • IEEE 802.1Q-2022 — Bridges and Bridged Networks
  • PROFIBUS and PROFINET International. (2022). PROFINET System Description.