Why split one switch into several networks
An earlier topic (Collision Domain vs Broadcast Domain) covered why keeping broadcast domains small matters. The obvious way to get multiple broadcast domains is multiple physical switches, one per department. That's expensive and inflexible: move someone to a new team and you're re-cabling a desk.
A VLAN (Virtual LAN) gets the same isolation in software. It's like one office building where every floor has its own badge-access elevator bank: everyone shares the same building and wiring, but Finance's badge doesn't open Engineering's floor, and an announcement made on one floor doesn't play on another. A switch can have VLAN 10 on some ports and VLAN 20 on others, and traffic between them stays fully separated unless something at Layer 3 deliberately connects them.
Access ports vs. trunk ports
- Access port: belongs to exactly one VLAN. This is what an end device (a laptop, a printer, a phone) plugs into. The device has no idea VLANs even exist, it just sends normal untagged frames.
- Trunk port: carries traffic for multiple VLANs over a single physical link, typically between two switches or a switch and a router. To keep the VLANs distinguishable in transit, each frame gets tagged with which VLAN it belongs to.
The 802.1Q tag
802.1Q defines a 4-byte tag inserted into the Ethernet frame right after the source MAC (Media Access Control) address. It carries a 12-bit VLAN ID, giving room for VLANs 1 through 4094.
| Access Port | Trunk Port | |
|---|---|---|
| VLANs carried | Exactly one | Multiple, distinguished by 802.1Q tag |
| Typical use | End device (PC, phone, printer) | Switch-to-switch or switch-to-router link |
| Frames sent | Untagged | Tagged (except the native VLAN) |
Every switch ships with all ports in VLAN 1 by default. Leaving management and user traffic sitting on VLAN 1 unmodified is a common early misconfiguration. Most real deployments move active traffic onto explicitly created VLANs and treat VLAN 1 as unused. The next topic, native VLANs, explains one specific reason why.