Data center · Lesson 2 of 4
VXLAN: How to Get Past the 4094-VLAN Limit
A data center with hundreds of tenants runs out of 4094 VLANs. It also needs to carry the same VLAN from rack to rack without depending on Spanning Tree.
In a nutshell
VXLAN carries Layer 2 frames inside UDP packets over an IP network. It uses a 24-bit identifier (VNI): about 16 million segments instead of 4094 VLANs.
In this lesson
The limits of VLANs in a data center
- Scale: 12 bits = 4094 usable VLANs. A cloud provider with thousands of tenants runs out of VLANs.
- Spanning Tree: stretching a VLAN across many racks creates huge Layer 2 domains and blocked links.
- Mobility: a VM that moves to another rack must keep its IP, so its VLAN must exist on both sides.
How VXLAN works
VXLAN encapsulates the original Ethernet frame inside a UDP packet (port 4789) that travels over a routed IP network (the underlay). The switches that encapsulate and decapsulate are called VTEPs (VXLAN Tunnel Endpoints).
| VLAN | VXLAN | |
|---|---|---|
| Identifier | VLAN ID, 12 bits | VNI, 24 bits |
| Possible segments | 4094 | ~16 million |
| Transport | Layer 2 + STP | Layer 3 (IP, ECMP) |
| Overhead | 4 bytes | 50 bytes |
MTU: the detail that breaks everything
VXLAN adds 50 bytes (14 outer Ethernet + 20 IP + 8 UDP + 8 VXLAN). If the underlay MTU is 1500, large VM frames are lost. In practice jumbo frames (9216) are configured across the underlay.
VLAN-to-VNI mapping on NX-OS
LEAF1(config)# feature nv overlay
LEAF1(config)# feature vn-segment-vlan-based
LEAF1(config)# vlan 10
LEAF1(config-vlan)# vn-segment 10010 ← local VLAN 10 = VNI 10010
LEAF1(config)# interface nve1
LEAF1(config-if-nve)# no shutdown
LEAF1(config-if-nve)# source-interface loopback1 ← VTEP IP
LEAF1(config-if-nve)# host-reachability protocol bgp ← EVPN control plane
LEAF1(config-if-nve)# member vni 10010
LEAF1(config-if-nve-vni)# ingress-replication protocol bgp
Today the norm is to use BGP EVPN as the control plane (VTEPs advertise MACs and IPs through BGP) instead of multicast-based flood and learn.
Key idea
The VLAN still exists, but it is only local to each leaf. What identifies the segment across the fabric is the VNI.
What you must remember
- VXLAN uses a 24-bit VNI: ~16 million segments.
- It encapsulates in UDP 4789 over an IP network; the endpoints are VTEPs.
- It adds 50 bytes: use jumbo frames in the underlay.
- On NX-OS: vlan X → vn-segment, and interface nve1.
Check what you learned
4 exam-style questions. Some have one answer and others ask you to choose several. Answer them all to complete the lesson.