09: VLANs and Data-Center Networks
Course: Networking - Security Advanced · Updated: October 2026 Literature: K&R chapter 6: VLANs, link virtualisation (MPLS), data-center networking Prerequisite: Article 08: The link layer
Learning objectives
After studying this article you can:
- explain the problems of large, flat LANs and how VLANs solve them
- explain port-based VLANs, trunk ports and the 802.1Q tag
- explain how traffic gets between VLANs (inter-VLAN routing)
- explain the basic idea of MPLS (label switching)
- describe the architecture of modern data-center networks: hierarchical vs spine-leaf (Clos), load balancing, ECMP
- explain overlay networks such as VXLAN/EVPN
1. Why VLANs?
Imagine a company network where all departments (Finance, HR, Engineering, guests) are attached to the same switches in one flat LAN:
- Broadcast traffic (ARP, DHCP, mDNS, ...) reaches every host. This wastes bandwidth and is a security problem.
- No isolation: an infected PC in the guest area can talk directly to the Finance servers.
- Inefficient: to separate departments physically, you'd need separate switches for each.
- Users move: if an HR employee moves to another floor, they should still be in the "HR network".
Solution: Virtual LANs (VLANs). One physical switch infrastructure is divided into several virtual LANs. Each VLAN is a separate broadcast domain.
2. Port-based VLANs
The administrator assigns each switch port to a VLAN:
1 2 3 4 5 6 7 | |
- Frames from a port in VLAN 10 go only to other ports in VLAN 10 (traffic isolation).
- Between VLANs you need a router (or a layer-3 switch), just as between separate LANs. This is called inter-VLAN routing. The router is also the natural place for access control (firewall rules between VLANs).
- Membership can be changed in software, with no rewiring.
2.1 Trunk ports and 802.1Q
When a VLAN spans several switches, you connect them with a trunk link that carries frames from all VLANs. To tell the VLANs apart, each frame gets a VLAN tag (IEEE 802.1Q):
1 2 3 4 5 6 | |
- TPID
0x8100: says "this is a tagged frame" - PCP (Priority Code Point, 3 bits): Quality of Service on layer 2 (802.1p)
- VLAN ID (12 bits): 4094 usable VLANs (IDs 1–4094)
- The tag is added at the sending end of the trunk and removed at the receiving end. Access ports send untagged frames to the hosts.
- Native VLAN: frames on a trunk without a tag belong to the native VLAN (by default VLAN 1). This is a security risk (see below).
- QinQ (802.1ad): two tags stacked, used by service providers.
3. MPLS: Multiprotocol Label Switching
MPLS sits "between" layer 2 and layer 3 (sometimes called layer 2.5):
- Each packet gets a short label (20 bits) at the edge of the provider's network.
- Routers in the core (label switching routers, LSR) forward based on the label, not the IP address. This is fast and allows traffic engineering: paths can be chosen that the normal IP routing would not use.
- It is used by ISPs for VPN services to businesses (MPLS L3VPN) and for fast reroute.
- Trend (2026): MPLS is being replaced or supplemented by Segment Routing (SR-MPLS, SRv6) inside providers, and by SD-WAN over the Internet at businesses (see article 05).
4. Data-center networks
Large data centres (Google, Microsoft, Amazon, Meta) contain hundreds of thousands of servers. They host cloud services, search, social media and AI training. The challenges:
- Many applications that each serve many clients at the same time
- Very high internal traffic ("east-west" traffic between servers is much larger than "north-south" traffic to the Internet)
- Reliability: equipment fails every day
- Power and cooling
4.1 The classic hierarchical design
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Load balancer: receives requests from outside and spreads them over servers. It often does NAT and TLS termination as well (a layer-4/7 load balancer).
Problem: bandwidth higher up in the tree is limited (oversubscription). Two servers in different branches compete for the same uplinks.
4.2 Modern design: spine-leaf (Clos)
1 2 3 4 5 | |
- Every leaf (TOR) switch connects to every spine switch.
- Any two servers are always at most 2 switch hops apart (leaf → spine → leaf).
- ECMP (Equal-Cost Multi-Path) spreads flows over all the spines, using a hash of the 5-tuple.
- It scales horizontally: add more spines for more bandwidth.
- Routing inside the data centre is often eBGP (RFC 7938) or IS-IS. There is no Spanning Tree and no large layer-2 domains.
4.3 Overlays: VXLAN and EVPN
Virtual machines and containers need to move around while keeping their IP address, and cloud customers each want their own isolated networks. 4094 VLANs aren't enough.
- VXLAN (RFC 7348) encapsulates Ethernet frames inside UDP packets (port 4789). It has a 24-bit VNI, which allows ~16 million virtual networks. Layer 2 is stretched over a routed layer-3 underlay.
- EVPN (RFC 7432, 8365) uses BGP as the control plane to distribute MAC and IP information. There is no flood-and-learn.
- In public clouds, these overlays are invisible to the customer and are managed by SDN (VPCs, see article 05).
4.4 Trends (2026)
- AI data centres: GPU clusters for AI training need extreme bandwidth with very low latency. They use 400G/800G Ethernet, RoCE (RDMA over Converged Ethernet), InfiniBand, and the Ultra Ethernet Consortium specifications (1.0 released in 2025).
- SmartNICs / DPUs: network cards with their own processors that take networking, storage and security work off the CPU.
- Optical circuit switches (Google Jupiter): reconfigurable optical connections between spines.
- Sustainability: energy use of data centres (and AI) is a growing political and technical topic. The Netherlands has had restrictions on hyperscale data centres since 2022.
5. Summary
- VLANs divide one physical network into isolated broadcast domains. 802.1Q tags carry the VLAN ID over trunks. A router is needed between VLANs.
- MPLS forwards based on labels for speed, traffic engineering and VPNs.
- Data centres moved from hierarchical trees to spine-leaf (Clos) fabrics with ECMP and routing.
- VXLAN/EVPN overlays provide millions of isolated virtual networks for clouds.
References
Videos
- Jim Kurose: VLANs, MPLS, data-center networking (chapter 6 video lectures): https://gaia.cs.umass.edu/kurose_ross/lectures.php
- Jeremy's IT Lab: VLANs part 1–3, trunking (free CCNA course): https://www.youtube.com/@JeremysITLab
- Practical Networking: VLANs explained: https://www.youtube.com/@PracticalNetworking
- Meta / Google engineering talks on data-center fabrics (e.g. "Introducing data center fabric, the next-generation Facebook data center network"): https://engineering.fb.com/
Articles
- Meta Engineering, Introducing data center fabric (2014) and Reinventing Facebook's data center network (F16, 2019): https://engineering.fb.com/
- Singh et al., Jupiter Rising: A Decade of Clos Topologies and Centralized Control in Google's Datacenter Network (SIGCOMM 2015)
- Ivan Pepelnjak, ipSpace.net, blog and webinars on data-center design: https://blog.ipspace.net/
- Ultra Ethernet Consortium: https://ultraethernet.org/
Standards
- IEEE 802.1Q: VLAN tagging · IEEE 802.1ad: QinQ
- RFC 3031: MPLS architecture
- RFC 7348: VXLAN · RFC 7432: BGP MPLS-based Ethernet VPN · RFC 8365: EVPN overlay
- RFC 7938: BGP in large-scale data centres
Tools
- Wireshark: filter
vlanorvxlanto see the tags and encapsulation - Containerlab with free network operating systems (Nokia SR Linux, Arista cEOS, FRR) to build a spine-leaf lab: https://containerlab.dev/
- GNS3 / EVE-NG: network emulation: https://www.gns3.com/
Cyber Security
Why it matters
Network segmentation is one of the most effective security measures there is. VLANs are its basic building block. Segmentation:
- limits lateral movement: an attacker who compromises one PC can't reach the rest of the network directly. Ransomware groups depend on lateral movement.
- reduces the impact of an attack: the blast radius
- separates risk levels: IoT devices, cameras, printers, guest Wi-Fi, OT/industrial control systems and servers each get their own segment
- is required by standards and regulations: PCI-DSS (payment card data), ISO 27001, IEC 62443 (OT) and the EU NIS2 Directive (transposed into Dutch law by the Cyberbeveiligingswet, Cbw)
But VLANs are not a security boundary by themselves. They separate broadcast domains, and only the firewall between the VLANs decides what traffic is allowed. Known attacks:
| Attack | Description |
|---|---|
| Switch spoofing | The attacker's device pretends to be a switch and negotiates a trunk using DTP (Cisco Dynamic Trunking Protocol). It then receives traffic from all VLANs. |
| Double tagging | The attacker sends a frame with two 802.1Q tags. The first tag (= the native VLAN) is removed by the first switch, and the second switch then forwards the frame into the target VLAN. This only works one way, and only if the attacker is in the native VLAN. |
| Flat networks | In many incidents, the root cause was that "everything could talk to everything" (e.g. Maersk / NotPetya, 2017). |
| Data-centre and cloud attacks | Misconfigured overlays, unencrypted VXLAN across untrusted networks, and cloud security groups that allow too much |
How to make it safe
- Design segments on purpose: group systems by function and risk (users, servers, management, IoT, OT, guests, DMZ). Document which flows are needed.
- Filter between VLANs with a firewall or ACLs: default deny, and allow only the flows you need.
- Disable DTP: configure ports explicitly as
accessortrunk(switchport mode access,switchport nonegotiate). - Native VLAN: change it to an unused VLAN ID that no host uses, and tag the native VLAN on trunks (
vlan dot1q tag native). Don't use VLAN 1 for users. - Prune VLANs on trunks: allow only the VLANs that are needed on each trunk.
- Disable unused ports and put them in an unused "black-hole" VLAN.
- Separate management: put switch and router management in a dedicated management VLAN/VRF that users can't reach.
- Use private VLANs / micro-segmentation: in data centres and clouds, isolate workloads from each other even within one segment (e.g. VMware NSX, Cilium network policies, AWS security groups). This is a core part of Zero Trust (see article 14).
- Encrypt overlays that cross untrusted networks (MACsec, IPsec, or WireGuard underlays).
- Test segmentation regularly: run scans from each segment (e.g.
nmap) to check that the firewall rules really block what they should.
Extra references
- NCSC-NL, Factsheet: Netwerksegmentatie (network segmentation): https://www.ncsc.nl/
- NSA, Network Infrastructure Security Guide (segmentation, VLAN hardening): https://media.defense.gov/2022/Jun/15/2003018261/-1/-1/0/CTR_NSA_NETWORK_INFRASTRUCTURE_SECURITY_GUIDE_20220615.PDF
- CISA, Layering Network Security Through Segmentation (infographic): https://www.cisa.gov/
- Andy Greenberg, The Untold Story of NotPetya, the Most Devastating Cyberattack in History (Wired, 2018): https://www.wired.com/story/notpetya-cyberattack-ukraine-russia-code-crashed-the-world/
- EU NIS2 Directive (2022/2555): https://eur-lex.europa.eu/eli/dir/2022/2555/oj