Source: Network Technology Alliance
VXLAN (Virtual Extensible LAN) is a network virtualization technology designed to address scalability and isolation issues in traditional data center networks. It allows for the creation of a scalable virtual network on existing network infrastructure, enabling virtual machines (VMs) to move freely within a logical network, regardless of the underlying physical network topology.
Specifically, VXLAN establishes logical tunnels over existing networks, encapsulating VM data packets within UDP packets for transmission over IP networks. This encapsulation method allows VM data packets to communicate across different subnets and data centers while maintaining network isolation and security.

The main components of VXLAN include:
- VXLAN Identifier (VNI): Used to distinguish different virtual networks, similar to VLAN identifiers.
- VTEP (VXLAN Tunnel Endpoint): The network device responsible for encapsulating and decapsulating VXLAN packets, typically a switch or router.
- Control Plane and Data Plane: The control plane is responsible for establishing and maintaining VXLAN tunnels, while the data plane handles actual data transmission.
Why is VXLAN Needed?
The emergence of VXLAN (Virtual Extensible LAN) is to address the challenges faced by modern data center networks, including:
-
Dynamic Migration of Virtual Machines: In virtualized environments, the dynamic migration of VMs has become commonplace. This migration can bring benefits such as load balancing, resource optimization, and fault tolerance. However, traditional network architectures often cannot meet the dynamic migration needs of VMs across subnets or data centers, as these architectures are based on the physical network’s Layer 2 and Layer 3 structures, lacking sufficient flexibility and scalability.
-
Tenant Isolation Requirements: In cloud computing environments, data centers often need to serve multiple tenants. To ensure security and isolation, network traffic between different tenants must be isolated from each other. Traditional VLAN technology has limitations in scale and isolation, failing to meet the demands for large-scale, highly isolated tenants.
Thus, VXLAN was born.

Benefits of VXLAN
1. Support for Dynamic Migration of Virtual Machines
VXLAN enables the encapsulation of VM data packets within UDP packets for transmission over existing networks. This encapsulation allows VM data packets to communicate across different subnets and data centers while maintaining network isolation and security. Thus, VMs can move freely across different Layer 2 network domains, regardless of the underlying physical network topology.
2. Implementation of Large-Scale Tenant Isolation
VXLAN introduces the VXLAN Network Identifier (VNI) to identify different virtual networks. The VNI consists of 24 bits, theoretically supporting up to 16 million VXLAN segments, greatly enhancing network scalability and flexibility to meet the isolation needs of large-scale tenants.
3. Flexibility and Scalability
VXLAN is based on existing IP network infrastructure and does not rely on specific hardware devices or vendors. This allows for more flexible deployment and expansion, adapting to changing network demands and scales.
4. Cost Reduction
By implementing virtualization on existing network infrastructure, VXLAN can reduce the costs of network deployment and management while improving network utilization and performance.
What Are the Differences Between VXLAN and VLAN?
VXLAN (Virtual Extensible LAN) and VLAN (Virtual Local Area Network) are two different network isolation technologies that differ significantly in implementation, functionality, and applicable scenarios.
1. Implementation:
-
VLAN: VLAN is a Layer 2 (data link layer) network isolation technology that divides networks into different virtual networks by configuring VLAN identifiers (VLAN IDs) on switches. VLAN uses VLAN tags within a single physical network to identify and isolate different virtual networks, achieving isolation between different users or devices.
-
VXLAN: VXLAN is a Layer 3 (network layer) network virtualization technology that extends Layer 2 networks by establishing virtual tunnels over the underlying IP network. VXLAN uses VXLAN Network Identifiers (VNIs) to identify different virtual networks, encapsulating original Ethernet frames within UDP packets to facilitate communication between VMs, thus overcoming the limitations of physical networks.
2. Functionality:
-
VLAN: VLAN is primarily used for isolation and division of Layer 2 networks, allowing a single physical network to be divided into multiple virtual networks, enhancing network security and manageability between different VLANs.
-
VXLAN: VXLAN can achieve not only Layer 2 network isolation but also establish virtual networks over the underlying IP network, enabling large-scale dynamic migration of VMs and inter-data center communication. VXLAN provides greater network scalability and flexibility, suitable for large-scale cloud computing environments and virtualized data centers.
3. Applicable Scenarios:
-
VLAN: VLAN is suitable for small to medium-sized network environments, commonly found in internal enterprise LANs. It is mainly used for user organization, security isolation, and traffic management.
-
VXLAN: VXLAN is suitable for large data center networks, widely used in cloud computing environments and virtualized data centers. It meets the needs for large-scale VM dynamic migration, multi-tenant isolation, and network expansion, providing a more flexible and scalable network architecture.
💡 Memory Tip: Both VLAN and VXLAN are technologies used for network isolation and virtualization, but they differ in implementation, functionality, and applicable scenarios. VLAN is primarily used for isolation and division of Layer 2 networks, suitable for small to medium-sized network environments; while VXLAN is a Layer 3-based virtualization technology, suitable for large data center networks, enabling large-scale dynamic migration of VMs and inter-data center communication.

How VXLAN Works
The working principle of VXLAN is to establish virtual tunnels over the underlying IP network, encapsulating Layer 2 data packets within VXLAN messages for transmission, thus enabling communication between VMs while overcoming the limitations of traditional VLANs, expanding the scale and flexibility of the network.
-
VTEP (VXLAN Tunnel Endpoints): The devices at both ends of VXLAN are called VTEPs. They are located on physical or virtual switches in the virtualization environment and are responsible for encapsulating and decapsulating VXLAN packets.
-
VNI (VXLAN Network Identifier): The VNI is the identifier for virtual networks in the VXLAN network, equivalent to the VLAN ID in VLAN. VMs with different VNIs are logically isolated from each other.
-
VXLAN Encapsulation: When a VM sends a data packet, the packet is captured by the VTEP and encapsulated into a VXLAN packet. The VXLAN header contains the VNI and some control flags. The encapsulated packet is referred to as a VXLAN message.
-
UDP Encapsulation: VXLAN packets are encapsulated within UDP messages for transmission. This approach allows for the full utilization of existing network infrastructure without requiring special configurations on network devices.
-
Transmission over Underlying IP Network: VXLAN packets are transmitted over the underlying IP network, which can be a public internet or a private network.
-
Destination VTEP Decapsulation: Once the VXLAN packet reaches its destination, the destination VTEP decapsulates the packet, extracts the original packet, and forwards it to the target VM.
Previous Recommendations
Network Technology Alliance Knowledge Circle, open discount during Labor Day, friends in need hurry in!
Network Technology Alliance Knowledge Circle Directory: 2020.4-2024.5
The most comprehensive article summarizing Docker commands, save it in seconds!
Comprehensive summary of Linux network commands!
Four Wi-Fi security protocols: WEP, WPA, WPA2, WPA3, understand them at a glance!

