Modern data centers host thousands of virtual machines distributed across many physical servers.
This creates a significant networking challenge for engineers.The VLAN Scalability Problem
These virtual machines require Layer 2 connectivity.
They must behave as if they are on the same switch, even across different racks or buildings.Traditional VLANs cannot meet this demand.
The 802.1Q standard uses a 12-bit VLAN ID field, which limits you to 4094 VLANs across your entire infrastructure.
Figure 1 – VLAN scalability limitation in a multi-tenant data center
In a multi-tenant data center where each customer requires isolated network segments, that ceiling is reached quickly.
There is a second problem.
Modern data centers use a routed spine-leaf architecture where every link is a Layer 3 link.
VLANs are a Layer 2 construct and cannot cross Layer 3 boundaries without complex workarounds.VXLAN as the Solution
VXLAN (Virtual eXtensible LAN), defined in RFC 7348, solves both problems.
It encapsulates Layer 2 Ethernet frames inside UDP packets, creating a virtual Layer 2 network that travels freely across any Layer 3 infrastructure.

Figure 2 – The VXLAN
Instead of a 12-bit VLAN ID, VXLAN uses a 24-bit VNI (VXLAN Network Identifier).
That is over 16 million unique segments, enough for any multi-tenant environment at any scale.Answer the question below
What is the maximum number of VLANs supported by 802.1Q?
VXLAN is built on a two-layer model: a physical IP network below, and a virtual Layer 2 network above.
Understanding this separation is the foundation of everything that follows.The Underlay Network
The underlay is your physical IP network.
In a data center, this is typically a routed spine-leaf fabric where every switch runs a routing protocol such as OSPF or BGP.
Figure 3 – The underlay IP fabric: a routed spine-leaf network carrying VXLAN traffic
The underlay has one job: forward IP packets between devices.
It carries VXLAN-encapsulated traffic without knowing anything about the virtual networks inside.Answer the question below
What type of network forwards VXLAN-encapsulated packets?
The Overlay Network
The overlay is the virtual Layer 2 network built on top of the underlay.
Each VNI defines one isolated segment.
VMs inside the same VNI communicate as if they share the same switch, regardless of where they physically sit in the fabric.

Figure 4 – The VXLAN overlay: a logical Layer 2 tunnel built on top of the IP fabric
The following diagram shows a VXLAN tunnel connecting two segments across the underlay.
The overlay is completely invisible to the physical network: the underlay only sees IP packets.Answer the question below
What identifier defines an isolated VXLAN segment?
The VTEP
The device that sits at the boundary between overlay and underlay is called a VTEP (VXLAN Tunnel Endpoint).

Figure 5 – Two VTEPs at the edges of the VXLAN tunnel
The VTEP handles two operations:
Encapsulation — when a frame leaves the local segment, the VTEP wraps it in VXLAN headers and sends it into the underlay as a UDP packet
Decapsulation — when a VXLAN packet arrives from the underlay, the VTEP strips all outer headers and delivers the original frame to the destination VM
Every VTEP has an IP address on the underlay, typically a loopback, which serves as the tunnel source and destination.
A VTEP can be a physical Cisco Nexus switch or a software VTEP embedded in a hypervisor.
In both cases the behavior is identical: encapsulate outbound, decapsulate inbound.Answer the question below
What does VTEP stand for?
Now let's trace what happens to a frame when a VM sends it across the fabric.

Figure 6 – VM traffic inside a VXLAN Fabric
Encapsulation Overview
When VM A sends a frame to VM B on a remote VTEP,
the source VTEP wraps the original Ethernet frame in several layers of headers before forwarding it into the underlay.
Figure 7 – VXLAN packet encapsulation: outer headers wrap the original Ethernet frame
Several headers are added around the original frame.
From outside to inside, the packet structure becomes:
Outer Ethernet header — used for forwarding on the physical link
Outer IP header — source IP is the local VTEP loopback, destination IP is the remote VTEP loopback
UDP header — carries the VXLAN packet across the IP network
VXLAN header — contains the VNI identifying the overlay segment
Original Ethernet frame — the VM’s original Layer 2 traffic
Original IP header and payload — the VM’s actual data
This encapsulation adds 50 bytes of overhead:
Outer Ethernet: 14 bytes
Outer IP: 20 bytes
UDP: 8 bytes
VXLAN: 8 bytes
Because of this additional overhead, underlay networks typically use jumbo frames with MTU 9000.
Answer the question below
Which protocol transports the encapsulated packet across the underlay?
UDP Transport
VXLAN uses UDP as its transport protocol.
The UDP destination port is 4789, assigned by IANA.
The UDP source port is derived from a hash of the inner packet headers.
This allows the underlay network to distribute flows across multiple equal-cost paths using ECMP.The VXLAN Header and VNI
The VXLAN header is 8 bytes long.
Its most important field is the 24-bit VNI (VXLAN Network Identifier), which identifies the overlay segment the frame belongs to.

Figure 8 – The VXLAN header: 8 bytes containing the 24-bit VNI field
When the remote VTEP receives the packet, it reads the VNI, identifies the correct overlay segment, removes the outer headers, and delivers the original Ethernet frame to the destination VM.
Answer the question below
What UDP destination port does VXLAN use?
Answer the question below
What smallest underlay IP MTU carries a 1514-byte untagged frame (no FCS) through VXLAN?