ELEC3506

MAC and LANsLecture 413 min

VLANs and the 802.1Q Tag

How a VLAN separates broadcast domains without touching a single cable, and the 4-byte tag that lets one trunk link carry several of them at once.

By the end of this page you should be able to

  • Explain what makes a VLAN a logical LAN rather than a physical one
  • Distinguish an access link from a trunk link
  • List the ways stations can be grouped into a VLAN
  • Describe the four fields inside an 802.1Q tag and where it sits in the frame

The idea

A physical LAN is fixed by wiring — which stations share a broadcast domain is decided by which cables run where. A VLAN breaks that link. It is a LAN configured by software, not by wiring, so one physical switch can host several logically separate networks, and two ports on the same switch can belong to entirely different broadcast domains without a single cable changing.

How it works

How VLANs are built

Stations are grouped into a VLAN by VLAN number, IP address, MAC address, or some combination of these — the switch decides which broadcast domain a frame belongs to based on whichever rule it is configured with, not based on which physical cable the frame arrived on.

Two kinds of link matter once more than one switch is involved:

  • Access links connect to end devices — a PC, a printer — and carry traffic for exactly one VLAN. The device on the other end has no idea VLANs exist.
  • Trunk links connect switches to each other and carry traffic for multiple VLANs over a single physical link. This is called trunking.

Trunking needs a way to tell frames from different VLANs apart once they share one wire. That is what the tag does.

Aside

The lecture does not give the tag format

Lecture 4 covers VLANs conceptually — grouping, broadcast domains, trunk and access links — but its own diagram is an unexpanded placeholder with no field breakdown. What follows is the standard IEEE 802.1Q tag format, confirmed against the tag structure and frame-size figures.

Before — untagged Ethernet frame

An untagged Ethernet frame: 6-byte destination, 6-byte source, 2-byte type or length, data, and 4-byte CRC.BYTESDestination6 BSource6 BType/Length2 BData46–1500 BCRC4 B

After — 802.1Q tag inserted between source address and type/length

A tagged Ethernet frame: 6-byte destination, 6-byte source, a 4-byte 802.1Q tag inserted immediately after the source address, then the 2-byte type or length field, data, and 4-byte CRC.BYTESDestination6 BSource6 B802.1Q Tag4 B — inserted2Data46–1500 BCRC4 B

The 4-byte tag itself

The 802.1Q tag broken into its own fields: a 16-bit tag protocol identifier fixed at 0x8100, a 3-bit priority code point, a 1-bit drop eligible indicator, and a 12-bit VLAN ID.BITS — ONE 32-BIT WORDTPID16 b · 0x8100PCP3 b1VLAN ID12 b
Inserting 4 bytes after the source address — rather than appending it — is what makes the tag invisible to any device that does not know to look for it: an old NIC reads type/length exactly where it expects to find it, one byte over.

The tag is 4 bytes, inserted between the source address and the type/length field, not appended to the end. That placement matters: a device that does not understand VLANs still finds the type/length field exactly where it expects, one field earlier than it sits in a tagged frame, so an untagged-only device simply never looks in the right place to notice the tag exists.

Inside those 4 bytes:

  • TPID (16 bits) — fixed at 0x8100, the value that tells a VLAN-aware device “this is a tag, not the type field”.
  • PCP (3 bits) — priority code point, for traffic prioritisation.
  • DEI (1 bit) — drop eligible indicator.
  • VLAN ID (12 bits) — the actual VLAN number, giving up to 4096 possible values.

Because the tag adds 4 bytes to every frame that carries it, the maximum Ethernet frame size grows from the usual 1518 bytes to 1522 bytes on a tagged link.

Check yourself

An untagged frame is 64 bytes. The same frame goes out over a trunk link with an 802.1Q tag added. How big is it now?

68 bytes. The tag is a flat 4-byte insertion regardless of the frame’s original size, which is exactly why the maximum frame size grows from 1518 to 1522 bytes rather than to some other number.

Physical LANVLAN
Determined byWiringSwitch configuration (software)
Changing membershipRe-run cableReconfigure the switch
Broadcast domainOne per physical segmentOne per VLAN, independent of wiring
Access linkTrunk link
Connects toAn end deviceAnother switch
CarriesOne VLANMultiple VLANs, tagged
Does the end device see the tag?NoN/A — this link runs between switches

In the exam

  • A VLAN is software-defined, not wiring-defined. State this as the core distinction if asked what a VLAN is.
  • Access links carry one VLAN; trunk links carry many, tagged. Get the direction right — trunk links run switch to switch, not switch to device.
  • The 802.1Q tag is 4 bytes, inserted between the source address and type/length, not appended.
  • Maximum frame size: 1518 → 1522 bytes once a tag is present. This is the number most likely to appear as a one-mark question.
  • TPID is fixed at 0x8100. That is how a switch recognises a tag rather than an ordinary type field.
  • None of the tag format is in Lecture 4’s own slides. If a question tests it, it is testing whether you know the standard, not whether you remembered the lecture.

Check yourself

  1. What makes a VLAN different from a physical LAN segment?
  2. What does a trunk link carry that an access link does not?
  3. Where does the 802.1Q tag sit in the frame?
  4. A trunk link carries tagged frames. What is the new maximum Ethernet frame size?
  5. The lecture's own VLAN diagram is an unexpanded placeholder with no tag breakdown. Where does the 802.1Q field structure on this page come from?