Introduction to VXLAN
Follow one known unicast frame from its local attachment into a VXLAN packet and back.
Why carry Ethernet over IP?
| Traditional constraint | What changes with VXLAN |
|---|---|
| A VLAN tag has 12 identifier bits; 4094 ordinary VLAN IDs | A 24-bit VNI identifies an overlay segment; device capacity is much smaller than the numeric space. |
| Spanning tree can block redundant bridged links | A routed underlay can use equal-cost paths without extending a single spanning-tree domain across the fabric. |
| Transit switches may learn many tenant MAC addresses | IP 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
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
| Item | Example | Purpose |
|---|---|---|
| Local VLAN | 10 at VTEP1; 20 at VTEP2 | Classifies the local Ethernet attachment. |
| VNI | 5012 at both edges | Identifies this overlay segment within the fabric. |
| Remote VTEP IP | 10.255.0.2 | Addresses the receiving tunnel endpoint. |
| Remote tenant MAC | 02:00:00:00:00:22 | Identifies 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
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.22This 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
| Stage | Decision |
|---|---|
| H1 → VTEP1 | Classify the access frame into VNI 5012. |
| Ingress lookup | Resolve H2’s MAC in VNI 5012 to remote VTEP 10.255.0.2. |
| Routed transport | Choose an underlay next hop for outer destination 10.255.0.2. |
| VTEP2 → H2 | Validate 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.
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.2This 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.