Bookmarks

VXLAN — VXLAN

Virtual eXtensible LAN

A tunnelling protocol that builds isolated layer 2 networks on top of an ordinary IP network and tells them apart by 24-bit VNI identifiers.

Also: virtual extensible LAN

checked 9 Nov

All terms

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:

ElementWhat it does
Outer Ethernet, IP, UDPdelivery between VTEPs over an ordinary IP network; the destination UDP port is 4789
VXLAN header8 bytes, including the 24-bit VNI, the number of the virtual network
Original framethe 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

bashA VXLAN interface with VNI 42 and a multicast group for unknown traffic
# ip link add vxlan0 type vxlan id 42 group 239.1.1.1 dev eth1 dstport 4789

The 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

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • VLANvirtual LAN

    A VLAN divides a physical switch into segments with a 12-bit tag (up to 4,094); VXLAN builds isolated L2 networks over IP and tells them apart by a 24-bit VNI.

In depth in the references

where the topic is covered in detail