1231123210201020102010201020802.1Q tag · 4 bytes · 32 bitsTPID0x810016 bitsPCP03 bitsDEI01 bitVID1012 bits
Blue = VLAN 10 (staff) · Pink = VLAN 20 (guests)Envelope: one frame; its seal shows whose VLAN it is inColoured block on an envelope: the 802.1Q tag and its VLAN IDTwo switches split into VLAN 10 (staff, blue) and VLAN 20 (guests, pink). Access ports belong to one VLAN and send frames untagged; the trunk between the switches carries both, each frame wearing a 4-byte IEEE 802.1Q tag with its 12-bit VLAN ID (1 to 4094 usable). The native VLAN (1 by default) crosses untagged. Broadcasts never leave their VLAN, and traffic between VLANs goes through a router. MAC addresses 00:00:5e:00:53:01-05 are RFC 7042 documentation values; ff:ff:ff:ff:ff:ff is the real broadcast address. The two office networks 192.168.10.0/24 and 192.168.20.0/24 are private ranges (RFC 1918). Frames cross a switch in microseconds; the figure slows everything down so you can watch.

Splitting a switch

  1. A VLAN (virtual LAN) splits one physical switch into separate networks. Here each port is set to VLAN 10 (blue, staff) or VLAN 20 (pink, guests). Each VLAN is its own broadcast domain: the devices one broadcast can reach.

Across a trunk

Broadcasts

Native VLAN

Between VLANs

Inside the frame

;; step 1/10 · two-vlans · idle
Switch 1  port 1 access VLAN 10 · port 2 access VLAN 20
          port 3 trunk to Switch 2 · port 4 trunk to the router
Switch 2  port 1 trunk to Switch 1
          port 2 access VLAN 10 · port 3 access VLAN 20
VLAN 10 Staff  192.168.10.0/24
VLAN 20 Guest  192.168.20.0/24

Switches keep a separate MAC table for each VLAN. Here both switches have already learned every address (see "How a switch learns"). "Native VLAN" is vendor wording. IEEE 802.1Q calls it the port VLAN ID (PVID), which is 1 by default, and lists per VLAN which ports send it untagged.