What is VXLAN?
Hello guys!
Today, I would like to present an introduction to VXLAN.
Objetive
The purpose of this post is to present an introduction to the VXLAN.
What is VXLAN?
Virtual eXtensible Local Area Network (VXLAN) is one of the layer 3 network virtualization technologies defined by the Internet Engineering Task Force (IETF) and is an extension of the virtual local area network (VLAN). VXLAN encapsulates a Layer 2 Ethernet frame in a UDP packet and transmits the packet over a Layer 3 network.
VXLAN is a tunneling protocol that provides data center connectivity using tunneling to extend Layer 2 connections into an underlying Layer 3 network.
VXLAN is essentially a tunneling technology. It establishes a logical tunnel in the IP network between the source and destination network devices to encapsulate user-side packets and route them through the tunnel. Servers are connected to different network device ports in the data center's VXLAN network, which can be thought of as a Layer 2 virtual switch.

Figure 1- VXLAN tunneling technology
VXLAN has become the leading technology for building data center networks because it can meet the requirements of dynamic virtual machine (VM) migration and multi-tenancy in data center networks.
How does VXLAN work?
The VXLAN tunneling protocol, which encapsulates Layer 2 Ethernet frames in Layer 3 UDP packets, allows you to create virtualized Layer 2 subnets or segments that span Layer 3 physical networks. Each Layer 2 subnet is identified by an identifier VXLAN network (VNI) that segments traffic.
The entity that performs encapsulation and de-encapsulation of packets is called a VXLAN tunnel endpoint (VTEP). To support devices that cannot function as a VTEP on their own, such as bare-metal server. This type of VTEP is known as a hardware VTEP. VTEPs can also reside on hypervisor hosts, such as kernel-based virtual machine (KVM) hosts, to directly support virtualized workloads. This type of VTEP is known as a software VTEP.
What are the differences between VXLAN and VLAN?
VLAN is a traditional network isolation technology. As per the standards, a maximum of about 4k VLANs are available, which cannot meet the tenant isolation requirements of large data centers. In addition, each VLAN is a small, fixed Layer 2 virtual network, which does not support large-scale dynamic VM migration.
VXLAN overcomes the previous disadvantages of VLAN. The VXLAN uses the 24-bit VNI field (as shown in Figure 2) to identify up to 16M tenants, compared to a maximum of 4K tenants in the VLAN. VXLAN establishes a virtual tunnel between two switches in the data center's core IP network and virtualizes the data center network into a large Layer 2 virtual switch to meet large-scale dynamic VM migration requirements.
Although VXLAN is an extension of VLAN, VXLAN is quite different from VLAN in terms of virtual tunneling.
Now, let's take a look at what VXLAN packages actually look like.

Figure 2 - VXLAN Packet Format (Using External IPv4 Header as an Example)
A VXLAN tunnel endpoint (VTEP) encapsulates the following headers in the original Ethernet frame (original L2 frame):
VXLAN header
A VXLAN header is eight bytes long. Includes a 24-bit VNI field to define different tenants in the VXLAN network. In addition, it also contains the VXLAN Flags field (8 bits, set to 00001000) and two reserved fields (24 bits and 8 bits, respectively).
UDP Header
The VXLAN header and the original Ethernet frame are used as UDP data. In the UDP header, the destination port number (VXLAN Port) is fixed at 4789, and the source port number (UDP Src. Port) is suitable using the hashing algorithm based on the original Ethernet frame.
External IP header
It is the encapsulated external IP header. No external IP header, source IP address (Outer Src. IP) is the IP address of the VTEP connected to the source VM, and the destination IP address (Outer Dst. IP) is the IP address of the VTEP connected to the VM destiny .
External MAC header
It is the encapsulated outer Ethernet header. No external Ethernet header, source MAC address (Source MAC address) Is the MAC address of the VTEP connected to the source VM, and destination MAC address (Dst. MAC address) Is the MAC address of the next hop along the path to the destination VTEP.
-END-




