{
  "id": "vxlan",
  "title": "VXLAN",
  "lang": "en",
  "source_lang": "en",
  "summary": "VXLAN is a network encapsulation technology that carries Ethernet frames over IP networks, enabling large-scale logical Layer 2 networks independent of physical topology.",
  "category": "computer-science",
  "subcategory": "networks-security",
  "type": "concept",
  "aliases": [
    "Virtual Extensible LAN",
    "Virtual Extensible Local Area Network"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/vxlan/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/vxlan/",
      "json": "https://aiwiki.page/zh/vxlan.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "VXLAN is a network encapsulation technology that transports Ethernet frames across an Internet Protocol (IP) network. It creates logical Layer 2 networks over a routed Layer 3 infrastructure, allowing devices attached to different physical locations to communicate as members of the same Ethernet segment. Widely used in data centers and cloud computing, VXLAN separates logical network organization from the physical network topology and provides a 24-bit identifier for distinguishing network segments."
    },
    {
      "heading": "Background and development",
      "text": "Traditional Ethernet networks commonly use virtual LANs (VLANs) to divide a shared switching infrastructure into separate broadcast domains. The VLAN identifier is 12 bits long, with 4,094 values available for ordinary VLAN use. This is sufficient for many networks but can constrain large multitenant environments.\n\nServer virtualization increased the number of independently managed workloads and logical networks within data centers. Operators also needed to move virtual machines between hosts without necessarily changing their network addresses. Extending conventional Layer 2 networks across large infrastructures introduced challenges involving broadcast traffic, forwarding-table size, and loop prevention.\n\nVXLAN addresses these problems by carrying Ethernet traffic inside IP packets. Its design was developed through a multivendor effort and documented in RFC 7348, published in August 2014 as an Informational RFC through the Internet Engineering Task Force. RFC 7348 defines the basic encapsulation and a multicast-based approach to endpoint discovery and traffic distribution; it does not define the later EVPN control plane.\n\nVXLAN does not eliminate all Ethernet scaling problems. Rather, it changes where Ethernet state is maintained and allows the transport infrastructure to use routed-network mechanisms."
    },
    {
      "heading": "Overlay and underlay",
      "text": "A VXLAN deployment has two distinct network layers:\n\n- Underlay: the physical or otherwise pre-existing IP network that provides connectivity between tunnel endpoints.\n- Overlay: the logical Ethernet networks transported across that underlay.\n\nThis is an example of an overlay network. Underlay devices forward packets toward destination IP addresses without needing to learn the Ethernet addresses of every workload carried inside those packets.\n\nThe underlay commonly consists of switches and routers arranged in a leaf–spine topology. Routing protocols such as Open Shortest Path First or Border Gateway Protocol (BGP) establish reachability between tunnel endpoints. Equal-cost multipath routing can distribute traffic across multiple available paths, supporting load balancing without requiring the overlay topology to match the physical topology.\n\nThe overlay and underlay nevertheless remain operationally dependent: a logical segment cannot carry traffic between endpoints if the underlay lacks the necessary reachability, packet-size support, or forwarding capacity."
    },
    {
      "heading": "VXLAN network identifiers",
      "text": "Each VXLAN segment is identified by a VXLAN Network Identifier (VNI). The VNI is a 24-bit field, giving an identifier space of:\n\n\\[2^{24} = 16{,}777{,}216.\\]\n\nThis is commonly described as support for approximately 16 million logical segments. It is an identifier-space limit, not a guarantee that an individual switch or deployment can support that many active segments.\n\nA VNI identifies the logical context in which a frame is forwarded. Consequently, different segments can contain overlapping Ethernet addresses without those addresses necessarily conflicting.\n\nIn basic Layer 2 operation, a VNI identifies a bridged Ethernet segment. In EVPN-based routed designs, deployments may also use Layer 3 VNIs associated with routing instances. These roles depend on the surrounding forwarding architecture rather than on a different base VXLAN packet format.\n\nVNIs are often mapped to local VLANs at an attachment point. Such mappings allow an ordinary Ethernet-connected server to participate in a VXLAN segment without implementing VXLAN itself."
    },
    {
      "heading": "Tunnel endpoints and encapsulation",
      "text": "A VXLAN Tunnel Endpoint (VTEP) performs encapsulation and decapsulation. It may run in a virtual switch on a server, in a physical data-center switch, or in another networking device.\n\nWhen traffic must cross the underlay, the ingress VTEP:\n\n- Receives an Ethernet frame from a local attachment.\n- Determines its VXLAN segment and destination forwarding information.\n- Adds a VXLAN header containing the VNI.\n- Encapsulates the result in UDP and IP.\n- Sends the packet toward a remote VTEP.\n\nThe receiving VTEP removes the outer headers and forwards the inner Ethernet frame within the appropriate logical network.\n\nThe packet structure, from outermost to innermost, is:\n\nComponent | Purpose\nOuter Ethernet header | Delivers the packet across the current underlay link\nOuter IP header | Identifies the source and destination VTEPs\nUDP header | Carries the VXLAN payload and supplies fields usable for multipath hashing\nVXLAN header | Identifies the logical segment\nInner Ethernet frame | Carries the original endpoint traffic\n\nThe original Ethernet frame’s frame check sequence is not carried as part of the encapsulated inner frame.\n\nThe base VXLAN header is 8 bytes long. It includes flags, the 24-bit VNI, and reserved fields. The I flag indicates that the VNI field is valid; the base specification requires the other flag bits and reserved fields to be transmitted as zero.\n\nThe assigned UDP destination port is 4789, although some older implementations used other ports. The UDP source port is commonly derived from a hash of fields in the inner packet. This gives underlay forwarding devices additional variation for multipath selection, helping prevent many unrelated inner flows from appearing as one identical outer flow.\n\nVXLAN uses UDP as an encapsulation transport; it does not add retransmission or reliable delivery."
    },
    {
      "heading": "Address learning and traffic distribution",
      "text": "A VTEP needs to know which remote VTEP can reach a particular destination Ethernet address. VXLAN deployments obtain this information through data-plane learning, control-plane signaling, static configuration, or combinations of these mechanisms.\n\nFlood-and-learn operation\n\nIn the multicast-based model described by RFC 7348, a VNI is associated with an IP multicast group. Broadcast, unknown-unicast, and multicast traffic—collectively called BUM traffic—can be distributed to participating VTEPs through that group.\n\nA receiving VTEP can learn an association between an inner source Ethernet address and the outer source IP address of the sending VTEP. Later traffic to the learned destination can then be sent directly by unicast.\n\nThis model resembles conventional Ethernet learning, but the learned information includes the remote tunnel endpoint. Its operation depends on multicast support in the underlay.\n\nAnother distribution method is ingress replication, also called head-end replication. The originating VTEP sends a separate unicast copy to each relevant remote VTEP. This avoids requiring underlay multicast but increases replication work and bandwidth consumption at the sender.\n\nEVPN control plane\n\nMany deployments combine VXLAN with Ethernet VPN (EVPN). In this arrangement, BGP distributes endpoint reachability information and other forwarding information between participating devices.\n\nEVPN can advertise Ethernet addresses and associated IP addresses, signal membership for BUM distribution, support endpoint mobility, and provide mechanisms for multihoming. It reduces reliance on learning remote endpoints solely from flooded traffic.\n\nEVPN and VXLAN have different roles:\n\n- VXLAN is a data-plane encapsulation: it specifies how traffic is carried.\n- EVPN is a control-plane technology: it distributes information used to make forwarding decisions.\n\nEVPN is not mandatory for VXLAN, and EVPN can be used with data-plane technologies other than VXLAN.\n\nFeatures such as proxy responses and suppression of Address Resolution Protocol (ARP) traffic can reduce flooding when sufficient endpoint information is available. They do not mean that every form of broadcast or multicast traffic disappears."
    },
    {
      "heading": "Bridging and routing",
      "text": "VXLAN encapsulation preserves an inner Ethernet frame, making it suitable for extending a Layer 2 segment across a routed network. Communication between different IP subnets still requires routing.\n\nIn integrated routing and bridging deployments, a device can both bridge traffic within a subnet and route traffic between subnets. EVPN-VXLAN architectures commonly distinguish:\n\n- Layer 2 VNIs, associated with bridge domains.\n- Layer 3 VNIs, associated with tenant routing instances.\n\nA distributed anycast gateway allows multiple switches to present the same gateway IP and Ethernet address to attached workloads. This enables traffic to enter the routing function near its source rather than necessarily passing through a single centralized gateway.\n\nVXLAN alone does not define the complete inter-subnet routing design. Gateway placement, route distribution, routing-instance separation, and the choice of symmetric or asymmetric forwarding are additional architectural decisions."
    },
    {
      "heading": "Packet size and performance",
      "text": "Encapsulation increases packet size. With an outer IPv4 header and no optional headers or VLAN tags, VXLAN adds:\n\n- 14 bytes of outer Ethernet header;\n- 20 bytes of outer IPv4 header;\n- 8 bytes of UDP header;\n- 8 bytes of VXLAN header.\n\nThis is 50 bytes of additional headers, excluding Ethernet frame check sequences and physical-link overhead. Using an outer IPv6 header instead raises that figure to 70 bytes.\n\nThese figures must be interpreted carefully when calculating the maximum transmission unit (MTU). A 1,500-byte inner IP packet, carried inside a 14-byte inner Ethernet header, produces a 1,550-byte outer IP packet with ordinary IPv4-based VXLAN encapsulation. Thus, an underlay IP MTU of 1,500 bytes cannot carry that packet intact.\n\nDeployments generally accommodate encapsulation by increasing the underlay MTU or reducing the effective workload MTU. Fragmentation is not a dependable substitute: the base VXLAN specification prohibits VTEPs from fragmenting VXLAN packets, and receiving VTEPs may silently discard fragments created along the path.\n\nPerformance also depends on encapsulation capacity, forwarding-table limits, packet rate, and replication load. Hardware offload can reduce host processing overhead, while implementation-specific limits may constrain active VNIs, learned addresses, routes, or replication peers."
    },
    {
      "heading": "Applications and limitations",
      "text": "VXLAN is used for:\n\n- Multitenant networks: separating logical networks over shared infrastructure.\n- Virtualized data centers: connecting workloads independently of their physical placement.\n- Cloud networking: providing tenant segments across pools of compute hosts.\n- Data-center interconnection: extending selected logical networks between sites.\n- Network migration: linking conventional VLAN-based access networks to an overlay fabric.\n\nLayer 2 extension remains an architectural trade-off. It can preserve addressing and simplify some workload moves, but it can also enlarge the scope of broadcast traffic, failures, and troubleshooting. VXLAN does not by itself make applications mobile, preserve application sessions, or synchronize storage.\n\nOperational diagnosis requires examining both the inner network and the outer transport. A failure can originate in local VLAN mapping, endpoint learning, EVPN advertisements, VNI configuration, underlay routing, packet-size handling, or tunnel filtering."
    },
    {
      "heading": "Security properties",
      "text": "VXLAN provides logical separation but does not inherently provide encryption, endpoint authentication, or cryptographic integrity protection. A VNI is an identifier, not a secret or an authorization credential.\n\nAn attacker able to inject accepted VXLAN packets into a trusted tunnel domain may attempt traffic spoofing or unauthorized segment access. Deployments therefore depend on correctly bounded tunnel membership, packet filtering, and access control, with separate cryptographic protection where required.\n\nOverlay encapsulation can also affect security monitoring: devices that inspect only outer headers may not see the original endpoint addresses or application traffic. Enforcement and visibility consequently depend on whether inspection occurs before encapsulation, after decapsulation, or in equipment capable of interpreting the tunnel."
    }
  ],
  "links": [
    "data-center",
    "cloud-computing",
    "virtualization",
    "virtual-machine",
    "internet-engineering-task-force",
    "router",
    "ospf",
    "load-balancing",
    "encryption",
    "authentication",
    "access-control"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}