VXLAN solves the limits of classic VLANs: a VLAN identifier has only 12 bits, so there can be no more than 4,094 networks, while large data centres and clouds need hundreds of thousands. The protocol wraps an Ethernet frame in a UDP packet and carries it across a routed IP network, so a “layer 2” segment can even stretch between data centres.
How the frame is built
The scheme is described in RFC 7348 (2014); the protocol was developed by engineers from Arista, Broadcom, Cisco, Cumulus Networks, Intel, Red Hat and VMware. The original frame is surrounded by new headers:
| Element | What it does |
|---|---|
| Outer Ethernet, IP, UDP | delivery between VTEPs over an ordinary IP network; the destination UDP port is 4789 |
| VXLAN header | 8 bytes, including the 24-bit VNI, the number of the virtual network |
| Original frame | the virtual machine’s Ethernet frame; per RFC 7348 an inner VLAN tag is not included by default |
The VNI is 24 bits wide, which gives 16.7 million segments against 4,094 for VLANs. A segment is an isolated domain: machines in different VNIs cannot see each other. Only VTEPs see the VNI; it is never shown to the virtual machine, and on the host the network looks like a normal L2 network. The VXLAN header and outer headers add about 50 bytes, so raise the MTU on the physical network to keep frames from being fragmented.
VTEPs and the forwarding table
The tunnel endpoints are VTEPs (VXLAN Tunnel End Points). Usually this is a hypervisor or a top-of-rack switch: it encapsulates a virtual machine’s frame in UDP and decapsulates the reply. A VTEP learns which MAC address sits behind which VTEP the way an ordinary switch does, from incoming frames, and floods unknown traffic (broadcast, unknown unicast, multicast) to the multicast group of its VNI. If you would rather not use multicast in the physical network, a control-plane protocol distributes the addresses: this is how EVPN works, with BGP carrying MAC and ARP tables between VTEPs and traffic flowing point to point through ingress replication.
A Linux example
# ip link add vxlan0 type vxlan id 42 group 239.1.1.1 dev eth1 dstport 4789The Linux kernel supports VXLAN natively: the interface behaves like a normal L2 device, learns MAC addresses on its own and keeps a forwarding table that you can inspect with bridge fdb. Kubernetes CNI plugins such as flannel build their overlay network on the same principle: each node has its own subnet, and traffic between nodes travels inside VXLAN.
Where it is used
- Data centres with leaf-spine fabrics: VXLAN over a routed fabric provides L2 between racks without stretched VLANs and STP.
- Cloud platforms: tenant isolation on shared physical hardware.
- Kubernetes networks: CNI plugins such as flannel build a VXLAN overlay between cluster nodes.
- SDN platforms: a controller (for example, NSX) manages VNIs and VTEPs itself.
Sources
the term is written from these pages- RFC 7348 — Virtual eXtensible Local Area Network (VXLAN)rfc-editor.org/rfc/rfc7348.html(opens in a new tab)
- RFC 8365 — A Network Virtualization Overlay Solution Using Ethernet VPN (EVPN)rfc-editor.org/rfc/rfc8365.html(opens in a new tab)
- Linux kernel — Virtual eXtensible Local Area Networking documentationkernel.org/doc/Documentation/networking/vxlan.txt(opens in a new tab)
Verified 9 Nov