PacketLab
VXLAN · Overlay foundations

Introduction to VXLAN

Follow one known unicast frame from its local attachment into a VXLAN packet and back.

Why carry Ethernet over IP?

Traditional constraintWhat changes with VXLAN
A VLAN tag has 12 identifier bits; 4094 ordinary VLAN IDsA 24-bit VNI identifies an overlay segment; device capacity is much smaller than the numeric space.
Spanning tree can block redundant bridged linksA routed underlay can use equal-cost paths without extending a single spanning-tree domain across the fabric.
Transit switches may learn many tenant MAC addressesIP transit devices forward outer packets; VTEPs retain tenant forwarding state.

VXLAN moves responsibilities rather than removing limits. VTEP MAC tables, neighbor tables, replication and control-plane scale still need capacity planning. Local access networks still need loop prevention. An overlay is also not encryption or authentication.

One application segment spans two edges in the example. A plain router will not bridge its ARP broadcasts. VXLAN adds a wrapper between VTEPs so the tenant can retain Layer 2 connectivity while transit uses IP routing.

Identify the two endpoint instances

One Ethernet segment across an IP fabricIllustrative topology
H1 connects to VTEP1, two routed underlay paths connect VTEP1 to VTEP2, and VTEP2 connects to H2. A dashed arc denotes the logical VNI 5012 overlay.
Solid lines: physical links. Dashed blue arc: logical VXLAN overlay, not another cable. H1 and H2 share the example tenant subnet; transit devices forward outer IP packets.

The example uses VTEP1 at 10.255.0.1 and VTEP2 at 10.255.0.2. Each endpoint can terminate many VNIs using the same transport address. A software virtual switch can act as a VTEP, as can a supported hardware switch. A transit router that merely forwards outer IP is not a VTEP for this segment.

Keep VLAN, VNI and destination separate

ItemExamplePurpose
Local VLAN10 at VTEP1; 20 at VTEP2Classifies the local Ethernet attachment.
VNI5012 at both edgesIdentifies this overlay segment within the fabric.
Remote VTEP IP10.255.0.2Addresses the receiving tunnel endpoint.
Remote tenant MAC02:00:00:00:00:22Identifies H2 inside this segment.

The VNI field is 24 bits, giving a roughly 16-million identifier space, not a guarantee of that many supported segments. Reserved values and usable ranges depend on platform. These examples use VNI 5012. An access VLAN tag is not automatically copied as a VNI, and the remote edge may reconstruct a different local tag.

Inspect the wrapper

Constructed IPv4 VXLAN packet decode · illustrative, selected fields
Outer Ethernet: next-hop MAC addresses on the current link
Outer IPv4:     10.255.0.1 -> 10.255.0.2
Outer UDP:      source 55001 -> destination 4789
VXLAN:          I flag = 1, VNI = 5012
Inner Ethernet: 02:00:00:00:00:11 -> 02:00:00:00:00:22
Inner IPv4:     10.10.10.11 -> 10.10.10.22

This is an illustrative decode, not a recorded capture. UDP destination 4789 is the standard VXLAN port. The source port shown is an example: an implementation can derive it from inner-flow fields to provide entropy for underlay ECMP. It is not H1’s TCP or UDP application port. VXLAN uses an eight-byte header containing flags and the VNI; the I flag indicates that the VNI is valid.

One frame, four decisions

StageDecision
H1 → VTEP1Classify the access frame into VNI 5012.
Ingress lookupResolve H2’s MAC in VNI 5012 to remote VTEP 10.255.0.2.
Routed transportChoose an underlay next hop for outer destination 10.255.0.2.
VTEP2 → H2Validate the encapsulation and local VNI, decapsulate and forward using tenant state.

The outer Ethernet addresses change at routed hops and the outer IP TTL is decremented. In this bridged example the inner IP TTL is not decremented merely by crossing the VXLAN tunnel. A later overlay routing operation would be different. The transport does not hash directly on the VNI as a universal rule; actual hashing fields are platform dependent.

Budget the real packet size

For an untagged inner Ethernet frame carrying a 1500-byte IP packet, inner Ethernet is 1514 bytes excluding FCS. Adding VXLAN 8 + UDP 8 + outer IPv4 20 gives an outer IP packet of 1550 bytes. Adding untagged outer Ethernet 14 gives 1564 bytes excluding FCS: 50 bytes more than the original Ethernet frame. Outer IPv6 adds another 20 bytes; tags and other encapsulations change the budget.

Check the platform’s definition of interface MTU rather than blindly adding 50 to every display value. A successful small ping cannot establish full-size VXLAN forwarding. Do not rely on fragmentation to compensate for an undersized underlay.

How does the edge learn the destination?

The data plane needs a destination-MAC-to-remote-VTEP mapping. Static provisioning, flood-and-learn mechanisms and an EVPN control plane are different ways of supplying forwarding information. They are not interchangeable commands, and EVPN is not required merely to use VXLAN encapsulation. Broadcast, unknown-unicast and multicast traffic also need an explicit replication design.

Constructed forwarding state at VTEP1 · illustrative, selected fields
Segment   Destination MAC     Location
VNI 5012  02:00:00:00:00:11    local access attachment
VNI 5012  02:00:00:00:00:22    remote VTEP 10.255.0.2

This is a teaching table, not a vendor show command. The remote entry selects the outer destination, while the VNI preserves segment context. A matching MAC address in another VNI is a separate forwarding entry.

Further reading

Key Takeaways

  • A VTEP maps an attachment and destination MAC to a segment and remote endpoint.
  • VLAN IDs and VNIs are separate fields with different scopes.
  • The outer IP destination is the remote VTEP; the inner destination remains the tenant host.
  • VXLAN normally uses UDP destination 4789 and source-port entropy for load sharing.
  • Encapsulation consumes MTU; count all headers using the platform’s MTU convention.

Introduction to VXLAN Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. Which address is the outer IP destination in the example?
2. What is the standard VXLAN UDP destination port?
3. What does VNI 5012 identify here?
4. Why can the outer UDP source port vary?
5. Which TTL changes in the routed underlay for this bridged example?
6. What is the outer IPv4 packet size for a 1500-byte inner IP packet and untagged inner Ethernet?