<-- home

Why VXLAN (rfc7348)?

From the rfc7348

VXLAN is a Layer 2 overlay scheme on a Layer 3 network.

To understand VXLAN better, let’s first understand what’s subnetting and VLAN.

Let’s say we have a physical LAN where there are multiple hosts with IPs in network. Each host can talk to the other host using a switch alone. Now, we want to group set of hosts and separate them from each other. What are our options?

IP Subnetting

The first thought that comes to my mind is IP subnetting. It can prevent two hosts in different subnets from talking to each other unless we explicitly allow it using a router.

Say now we have two subnets, where the two ranges are - and - The broadcast address for first subnet is and for second subnet it’s

However, they still have the same layer 2 broadcast domain.

Consider the following example (in gif below) where even though the host ( can’t ping the other hosts ( and but it can broadcast in the other subnet since the broadcast domain at layer 2 is same and switch will broadcast all the frames with destination FFFF.FFFF.FFFF to all the ports irrespective of layer 3 source/destination IPs.

bradcast switch

The behavior is same in presence of router that allows the two subnets to talk to each other. Since switch operates at Layer 2.

icmp own subnet broadcast


So how can we split the broadcast domains for the subnets? This is where VLAN comes in. VLAN can be used to separate the broadcast domains as well.

VLAN frames are tagged by switch based on what port they arrive at. VLAN header is 4 bytes long and is placed before the type field in ethernet frame. It contains a 12 bit VLAN Identifier (VID) that identifies the frame it belongs to.

In the example below, hosts (, and are in the same vlan (vlan1) and the remaining hosts belong to a different vlan. As in the previous experiments, let’s ping the broadcast address ( from the host Note that in this case, the packet is only broadcasted to the hosts that belong to the same vlan irrespective of the subnet. Note that the host ( will drop the packet since the destination belongs to a different subnet and we don’t have a default gateway set. However, hosts in the other vlan don’t even receive the icmp request.

vlan broadcast

Note that 12 bit identifier limits the maximum number of vlans you can have to 4096. However with recent influx of virtualized environments, this is not enough and VLAN is not friendly enough for large number of multi tenant topologies. Hence the proposal for VXLAN.


VXLAN stands for Virtual eXtensible Local Area Network, it’s a layer 2 in layer 3 overlay tunnel. More specifically an Ethernet in UDP tunnel. The idea of VXLAN is similar to VLAN, as in it provides logical separation of private networks.

Consider the network topology in the diagram below network A and B are part of the same private network separated by external network. A-P, B-Q use same subnet in the same physical network.

The requirement from underlay network (UDP) is that it should have ip connectivity between two networks, UDP port 4789 is reserved for VXLAN.

The endpoint of the tunnel, VTEP (Virtual Tunnel End Point) forms the control plane of VXLAN (overlay network). It maintains a mapping of internal MAC address to the outer IP address i.e., while sending a packet from A: to B: VTEP can learn

VMs in subnets (A and B in the above picture) are unaware of the VXLAN themselves, and they route the traffic as they normally would. Say, a VM (A, wants to route traffic to another VM in same network (B, located at a different physical server and network. It would send the MAC frame as it would if both were on the same physical network. VTEP on that host checks the MAC address of

Following packet trace shows the VXLAN packet wrapper in UDP outer packet. UDP forms the overlay network and inner nodes (with IP don’t need to know about overlay network.


VXLAN is an important piece of puzzle when it comes to scaling ipv4 and providing network abstractions. I hope you have a slightly better understanding of where VXLAN belongs in plethora of networking technologies.


[1] Packet trace for VXLAN - cloudshark
[2] RFC-7348: Virtual eXtensible Local Area Network (VXLAN)