802.1Q trunks
Why a trunk exists
A trunk is a link configured to carry traffic for multiple VLANs. Rather than dedicate one cable per VLAN, the switches can identify the VLAN of a frame with an IEEE 802.1Q tag. For our diagram, the inter-switch link carries VLAN 10 and VLAN 20; host links remain ordinary access ports. Both ends must agree on how frames are classified and which VLANs may cross.
A -- p1 [S1] t1 ===== t1 [S2] p1 -- CB -- p2 [S1] [S2] p2 -- DA,C: VLAN 10 B,D: VLAN 20Read the tag
A conventional single C-tag adds four octets between the source MAC and the original EtherType/length field: a two-octet TPID (commonly 0x8100) and a two-octet TCI. TCI contains PCP (3 bits), DEI (1 bit) and VID (12 bits). PCP conveys priority information; DEI marks drop eligibility; VID identifies the VLAN. VID 0 is priority-tagged without a VLAN ID assignment in the tag; 4095 is reserved. Ordinary configurable IDs are 1–4094, subject to device limits and reservations. With PCP 5, DEI 0 and VID 20, TCI = (5 × 8192) + 20 = 40980 = 0xA014. A 1518-byte untagged frame with a 1500-byte payload becomes 1522 bytes with one tag, including FCS but excluding preamble and interframe gap; this is not a universal MTU setting.
Allowed VLANs, PVID and native VLAN
The allowed list limits which VLAN data traffic may use the trunk. If S1 allows 10 and 20 but S2 allows only 10, VLAN 20 cannot cross successfully in this model even if the physical link is up. VLANs also need to exist and be forwarding at each end. PVID is the port VLAN identifier used to classify untagged ingress (and priority-tagged ingress where applicable). On conventional Cisco 802.1Q trunks, the native VLAN normally travels untagged unless native tagging is configured; agree at both ends. On a VLAN-filtering Linux bridge, PVID and untagged egress are separately configurable. Do not assume all vendors use one identical native VLAN mechanism.
Compare two port representations
For a paper example based on Cisco IOS XE 17, assume VLANs 10, 20 and 99 already exist, and the isolated switch has a Layer 2 interface named GigabitEthernet1/0/24. The following is a configuration excerpt, not an instruction to apply it to a real switch. The native VLAN 99 is unused by endpoints in this lab. The listed VLANs replace the prior allowed list; use approved change control before any real change.
interface GigabitEthernet1/0/24 switchport mode trunk switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,99A Linux bridge can expose VLAN membership with bridge vlan show; a port entry marked PVID indicates ingress classification, while Egress Untagged describes output formatting. Actual Linux and Cisco configurations are not interchangeable.
Practice tag and membership
For a tag with PCP 0, DEI 1 and VID 30, TCI is 0x101E. Suppose S1 allows 10,20,30 and S2 allows 20,30,40; the shared permitted set is 20 and 30, assuming matching tag handling and active forwarding. Check both ends, not just the sender.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
802.1Q trunks — knowledge check
Reason about VLAN membership, forwarding and diagnostic evidence.
How many octets does a conventional single 802.1Q C-tag add?
S1 allows 10,20 and S2 allows 20,30. Which VLAN is shared under the stated assumptions?
What does PVID describe in the Linux bridge example?
What TCI is formed by PCP 0, DEI 1 and VID 30?
What does VID 4095 represent in the conventional tag?