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.

By topologia.appUpdated: Nov 13, 2026⏱ 7 min❓ 4 questions📶 Level advanced

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
  1. The limits of VLANs in a data center
  2. How VXLAN works
  3. MTU: the detail that breaks everything
  4. VLAN-to-VNI mapping on NX-OS
  5. What you must remember
  6. Exam-style questions

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).

IP underlay (OSPF/BGP)UDP 4789 · VNI 10010 Leaf1 VTEP Leaf2 VTEP VM1 · VLAN 10 VM2 · VLAN 10
VM1 and VM2 are in VLAN 10 in different racks. The leafs map it to VNI 10010 and carry it over the IP network.
VLANVXLAN
IdentifierVLAN ID, 12 bitsVNI, 24 bits
Possible segments4094~16 million
TransportLayer 2 + STPLayer 3 (IP, ECMP)
Overhead4 bytes50 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.

Question 1 of 4 · One answerHow many bits does the VXLAN segment identifier (VNI) have?
Question 2 of 4 · One answerWhich UDP port does VXLAN use according to IANA?
Question 3 of 4 · One answerVMs in the same VLAN stretched with VXLAN can ping with small packets, but large transfers fail. Most likely cause?
Question 4 of 4 · Choose twoWhich two statements about VXLAN are correct? (Choose two.)