HSR Sector 6 · Bangalore +91 96110 27980 Mon–Sat · 09:30–20:30
Chapter 3 of 20 — Data Center Networking
advanced Chapter 3 of 20

VxLAN — Data Center Overlay Networks & Layer 2 Extension

By Vikas Swami, CCIE #22239 | Updated Mar 2026 | Free Course

What is VxLAN — Virtual Extensible LAN for Data Centers

Virtual Extensible LAN (VxLAN) has emerged as a pivotal technology in modern data center networking, enabling scalable and flexible Layer 2 overlay networks over Layer 3 IP networks. Unlike traditional VLANs, which are limited to 4094 IDs, VxLAN offers a significantly larger address space, accommodating up to 16 million segments. This capability is essential for large-scale data centers that require multi-tenancy, segmentation, and mobility without the constraints of VLAN limitations.

VxLAN functions as a VxLAN data center overlay network, encapsulating Layer 2 Ethernet frames within UDP packets. This encapsulation allows data centers to extend Layer 2 segments across geographically dispersed locations, facilitating workload mobility and simplifying network architecture. The core concept revolves around creating logical networks on top of existing IP networks, effectively decoupling the network topology from physical infrastructure.

In practice, VxLAN enables data center architects to design scalable, multi-tenant environments where isolated networks coexist seamlessly. It also simplifies network provisioning, allowing for rapid deployment of new tenants or services without extensive reconfiguration of underlying physical switches. As a data center overlay technology, VxLAN integrates with existing IP routing infrastructure, making it compatible with standard network equipment and protocols. This compatibility fosters interoperability and reduces overall deployment costs, positioning VxLAN as a critical component in contemporary data center architectures.

VxLAN vs VLAN — Why 4096 VLANs Are Not Enough

Traditional VLANs have served as the foundation of network segmentation, but their inherent limitations become apparent as data centers scale. VLANs operate within a 12-bit VLAN ID field, restricting the maximum number of unique VLANs to 4094 (VLAN ID 1-4094, with VLAN IDs 0 and 4095 reserved). This constraint becomes a bottleneck in large multi-tenant environments, high-density data centers, and cloud deployments where thousands of isolated networks are necessary.

Enter VxLAN, which addresses these limitations by encapsulating Layer 2 frames within UDP packets, using a 24-bit VNI (VxLAN Network Identifier). This expansion from 12 bits to 24 bits allows for approximately 16 million unique segments, vastly exceeding VLAN capacity. The comparison table below illustrates the key differences:

Feature VLAN VxLAN
Maximum Number of Segments 4094 16 million+
Encapsulation Method IEEE 802.1Q Tag UDP-based encapsulation
Layer Layer 2 Overlay Layer 2 over Layer 3
Scalability Limited, suitable for small to medium environments Highly scalable, ideal for large data centers
Network Segmentation Based on VLAN IDs Based on VNI, supporting multi-tenancy

In essence, VxLAN's expanded ID space and overlay architecture make it suitable for cloud-scale data centers, where multi-tenancy, VM mobility, and network segmentation are critical. It enables dynamic provisioning and simplifies network management, reducing operational complexity and increasing agility. As data centers evolve, VxLAN becomes indispensable for overcoming the limitations of VLANs, supporting the growth of digital enterprises.

VxLAN Packet Format — UDP Encapsulation & VNI Headers

The VxLAN packet format is designed for efficient encapsulation of Ethernet frames within UDP packets, facilitating seamless transport across IP networks. This encapsulation involves several header layers, primarily the outer UDP/IP header and the VxLAN-specific headers, which include the VNI.

In detail, a typical VxLAN packet comprises:

  • Outer Ethernet Header: Carries the IP packet over the physical network.
  • Outer IP Header: Uses either IPv4 or IPv6, depending on network configuration.
  • Outer UDP Header: Usually with destination port 4789, designated for VxLAN traffic.
  • VxLAN Header: Contains the VNI (VxLAN Network Identifier) and flags. The header is 8 bytes long, with the VNI occupying 3 bytes.
  • Original Ethernet Frame: The inner Ethernet frame that is being transported over the overlay network.

Here's an example of a simplified VxLAN UDP encapsulation:

+--------------------------------------------------------------+
| Outer Ethernet Header | Outer IP Header | UDP Header | VxLAN Header | Inner Ethernet Frame |
+--------------------------------------------------------------+

For example, a VxLAN header might look like this in hex:

0x08 00 00 00 01 23 45 67

Where the 3-byte VNI (e.g., 0x12345) uniquely identifies the overlay segment. The UDP destination port 4789 is standard for VxLAN traffic, ensuring that network devices recognize and process the encapsulated packets correctly.

This encapsulation allows physical IP networks to carry multiple isolated Layer 2 segments, enabling data center overlays to scale efficiently without subnet conflicts or VLAN ID exhaustion. The use of UDP also provides compatibility with existing IP routing infrastructure, simplifying integration and deployment.

VxLAN VTEPs — Tunnel Endpoints and Encapsulation/Decapsulation

VxLAN Tunnel Endpoints (VTEPs) are fundamental to establishing overlay networks, serving as the ingress and egress points for encapsulated traffic. VTEPs perform the critical functions of encapsulating local Layer 2 frames into VxLAN packets and decapsulating received packets back into Ethernet frames for local delivery.

VTEPs can be implemented in either hardware (on switches or routers) or software (host-based). In a typical data center setup, each hypervisor host or switch acts as a VTEP, maintaining a mapping between VNI and the associated Layer 2 segments.

Encapsulation Process:

  1. The VTEP receives a local Ethernet frame destined for a remote tenant or segment.
  2. The VTEP encapsulates the Ethernet frame within a UDP packet, appending the VxLAN header with the appropriate VNI.
  3. The encapsulated packet is sent over the IP network to the remote VTEP.

Decapsulation Process:

  1. The remote VTEP receives the UDP packet.
  2. It strips the UDP, IP, and Ethernet headers, retrieving the original Ethernet frame.
  3. The Ethernet frame is forwarded to the local network or host, completing the Layer 2 extension.

Configuring VTEPs involves strategic placement on network devices and ensuring proper IP reachability and security policies. For example, Cisco Nexus switches can be configured as VTEPs using commands like:

vlan 10
   vn-segment 10010
interface nve1
   no shutdown
   source-interface loopback0
   member vni 10010

Consistency in VNI assignment and proper IP routing are essential for seamless overlay operation. VTEPs are also responsible for maintaining MAC-to-VNI mappings, which are dynamically learned via VxLAN Flood and Learn or through static configurations.

VxLAN Flood and Learn — Multicast-Based BUM Traffic Handling

In a VxLAN overlay network, handling broadcast, unknown unicast, and multicast (BUM) traffic is a significant challenge. Traditional Layer 2 networks rely on MAC flooding or spanning tree protocols, but in large overlays, this approach becomes inefficient and unscalable. Instead, VxLAN employs multicast-based Flood and Learn mechanisms to optimize BUM traffic handling.

Under the Flood and Learn method, VTEPs join specific multicast groups associated with each VNI. When a new MAC address is learned, the VTEP registers it in its MAC table, and subsequent traffic for that MAC is sent directly via unicast. For unknown MAC addresses, traffic is flooded to the multicast group, ensuring delivery to all relevant VTEPs.

This multicast approach reduces unnecessary flooding across the entire network, improves scalability, and minimizes bandwidth consumption. However, deploying multicast at scale requires supporting multicast routing protocols like PIM (Protocol Independent Multicast) and IGMP snooping on switches.

For example, configuring multicast groups in Cisco Nexus switches involves:

vlan 100
   vn-segment 100100
   flood vni 100100
interface nve1
   member vni 100100
   multicast-group 239.1.1.1

Alternatively, the Flood and Learn method can be replaced with ingress replication for environments where multicast support is limited or unavailable. This leads us to the next section, where unicast-based overlay methods are discussed.

VxLAN with Ingress Replication — Unicast-Based Overlay

While multicast-based Flood and Learn is effective, some data center environments prefer unicast-based VxLAN overlay for simplicity and control. Ingress Replication is a common method where the ingress VTEP replicates packets directly to each egress VTEP, eliminating the need for multicast support in the network.

In ingress replication, the ingress VTEP maintains a list of remote VTEPs for each VNI. When a packet arrives, it is unicast to each remote VTEP, which then decapsulates and forwards it to the local network segment. This method offers deterministic delivery, easier troubleshooting, and simplifies network design, especially in multi-tenant or cloud environments.

Implementing ingress replication involves configuring vPC or multi-hop VTEP architectures. For example, on Cisco Nexus switches, commands include:

interface nve1
   member vni 10010
      ingress-replication protocol bgp

This configuration enables BGP to distribute VTEP reachability information, allowing ingress replication to function smoothly. Compared to multicast, ingress replication consumes more bandwidth due to packet duplication, but it provides better control and security, especially when multicast routing is complex or unsupported.

Choosing between multicast Flood and Learn versus ingress replication depends on network topology, scalability requirements, and existing infrastructure capabilities. Both methods are vital tools in the VxLAN toolkit, ensuring efficient handling of Layer 2 extension traffic across data centers.

VxLAN Gateway Types — Layer 2 and Layer 3 Gateway Functions

VxLAN gateways serve as crucial points for bridging overlay networks with traditional Layer 2 or Layer 3 networks. They facilitate inter-VNI communication, connect overlay segments to physical networks, and enable seamless data flow across different network domains.

There are primarily two types of VxLAN gateways:

Layer 2 Gateways

Layer 2 gateways connect VxLAN overlay segments to physical or virtual LANs. They act as bridging devices that translate VxLAN-encapsulated traffic into native Ethernet frames for access switches or servers. This is useful for integrating overlay networks with existing LAN infrastructure, allowing tenants or workloads to access physical resources transparently.

Layer 3 Gateways

Layer 3 gateways enable routing between different VxLAN segments, or between VxLAN overlays and external networks. They perform IP routing functions, often implemented on routers or multilayer switches, with support for VRFs, BGP EVPN, or other control plane protocols. Layer 3 gateways facilitate north-south traffic flow, data center interconnects, and multi-tenant isolation.

Modern data centers often deploy BGP EVPN as a control plane mechanism, providing dynamic MAC and IP learning, scalability, and redundancy. For example, Cisco Nexus switches can be configured to serve as both Layer 2 and Layer 3 VxLAN gateways using commands like:

interface nve1
   no shutdown
   source-interface loopback0
   member vni 10010
      exit
router bgp 65000
   address-family l2vpn evpn
      neighbor 192.168.1.1 activate

Choosing the appropriate gateway type depends on the specific network architecture, traffic patterns, and operational requirements. VxLAN gateways enable flexible, scalable connectivity, bridging overlay and underlay networks efficiently.

Configuring VxLAN — Step-by-Step on Cisco NX-OS

Implementing VxLAN on Cisco NX-OS devices involves several configuration steps, including enabling the overlay, configuring VTEPs, assigning VNIs, and establishing control plane mechanisms like BGP EVPN. Here is a detailed, step-by-step guide:

  1. Enable the NVE Interface:
  2. conf t
    interface nve1
     no shutdown
     source-interface loopback0
    
  3. Configure Loopback Interface: Used as the source for VxLAN traffic.
  4. interface loopback0
     ip address 192.168.1.1/32
    
  5. Create VNI and Map to VLANs:
  6. vlan 10
       vn-segment 10010
    interface vlan 10
     no shutdown
    
    interface nve1
     member vni 10010
      ingress-replication protocol bgp
    
  7. Configure BGP EVPN: For control plane learning and scalability.
  8. router bgp 65000
     address-family l2vpn evpn
      neighbor 192.168.1.2 activate
      advertise-all-vni
    
  9. Enable Multicast or Ingress Replication: Based on network design choices.
  10. interface nve1
      multicast-group 239.1.1.1
    
  11. Verify the Configuration:
  12. show nve peers
    show vni brief
    show evpn
    

This configuration establishes a VxLAN overlay with BGP EVPN as the control plane, supporting scalable and dynamic Layer 2 extension across multiple data center sites. Proper planning of IP addressing, VNI assignment, and control plane protocols is essential for a successful deployment.

Key Takeaways

  • VxLAN provides a scalable Layer 2 overlay solution, supporting up to 16 million segments, far exceeding VLAN limitations.
  • It encapsulates Ethernet frames within UDP packets, enabling overlay networks over existing Layer 3 infrastructure.
  • VTEPs are the core components, performing encapsulation and decapsulation functions essential for overlay operation.
  • Multicast Flood and Learn handles BUM traffic efficiently, but ingress replication offers a unicast alternative for simpler management.
  • VxLAN gateways enable seamless bridging between overlay segments and traditional networks, supporting both Layer 2 and Layer 3 functions.
  • Proper configuration on platforms like Cisco NX-OS involves setting up VTEPs, VNIs, and control plane protocols such as BGP EVPN.
  • Understanding VxLAN's technical details and deployment strategies is critical for network professionals aiming to design scalable, flexible data center architectures.

Frequently Asked Questions

What are the main advantages of using VxLAN in data centers?

VxLAN offers significant benefits including high scalability with up to 16 million segments, simplified multi-tenancy, and workload mobility across geographically dispersed data centers. It reduces VLAN ID limitations, supports flexible overlay architectures, and integrates seamlessly with existing IP networks. Additionally, VxLAN enhances network agility, simplifies provisioning, and improves resource utilization by enabling dynamic and scalable segmentation. Its compatibility with standard IP routing and multicast protocols also ensures ease of deployment in diverse network environments.

How does VxLAN differ from traditional VLANs in practical deployment?

Unlike VLANs, which are limited to 4094 IDs and operate within a single broadcast domain, VxLAN employs a 24-bit VNI, supporting millions of segments across Layer 3 networks. This allows data centers to implement large-scale multi-tenancy and workload mobility without VLAN ID exhaustion. VxLAN encapsulates Ethernet frames within UDP packets, enabling overlay networks over existing IP fabric, whereas VLANs are confined to physical or logical switches. Deployment-wise, VxLAN offers greater scalability, flexibility, and simplifies network segmentation in large, dynamic environments.

What are the common methods for handling BUM traffic in VxLAN networks?

VxLAN networks typically handle broadcast, unknown unicast, and multicast (BUM) traffic using multicast-based Flood and Learn, where VTEPs join specific multicast groups to manage traffic efficiently. Alternatively, ingress replication can be used, where the ingress VTEP unicasts BUM traffic directly to each remote VTEP, eliminating multicast dependency. The choice depends on network design, scalability, and multicast support. Flood and Learn scales well with multicast infrastructure, while ingress replication simplifies deployment in multicast-unfriendly environments, providing deterministic traffic delivery.

Ready to Master Data Center Networking?

Join 45,000+ students at Networkers Home. CCIE-certified trainers, 24x7 real lab access, and 100% placement support.

Explore Course