A VLAN splits one physical switch into several isolated networks: devices within the same VLAN exchange frames directly, while traffic between different VLANs travels only through a router. This way one office network hosts accounting, guests and servers without buying separate equipment.
How tagging works
The IEEE 802.1Q standard adds four bytes of tag to an Ethernet frame, raising the maximum frame size from 1,518 to 1,522 bytes. The tag begins with a TPID field holding the value 0x8100, by which a tagged frame is recognised; inside are the VLAN identifier (12 bits, values 1–4094, with 0 and 4095 reserved) and a priority field for QoS (3 bits, the frame’s class of service). On a trunk port, an untagged frame belongs to the native VLAN.
Ports: access and trunk
| Port type | How it works | Where it is used |
|---|---|---|
| Access port | accepts untagged frames and places them in a single VLAN | workstation, printer, access point |
| Trunk port | carries frames of several VLANs, each with its own 802.1Q tag | switch-to-switch links, connection to a hypervisor |
| Hybrid port | a list of VLANs carried both tagged and untagged | mixed device sets and uplinks |
Configuration example
interface GigabitEthernet0/1 switchport mode access switchport access vlan 10!interface GigabitEthernet0/2 switchport mode trunk switchport trunk allowed vlan 10,20What VLANs are for
- segmentation: traffic classes and user groups are split across separate networks without new cables or switches;
- security: traffic from one VLAN cannot be picked up in another, and a firewall or ACLs sit between VLANs;
- less broadcast traffic: a broadcast stays within its own VLAN;
- flexibility: moving an employee to another VLAN means changing a port number or a setting, not re-pulling a cable.
Sources
the term is written from these pagesVerified 9 Nov