Skip to content

Overlay networks: VXLAN between two hosts

Select an icon to see what it is.

Step 6 of 6

The cost: 50 bytes per packet

The outer headers use part of each packet's size budget. With a 1500 byte MTU on the physical network, docker sets the overlay interface MTU to 1450. Packets from the containers must fit inside that, or they get fragmented.

PrevNext

MTU budget

physical MTU 1500 covers the whole outer IPv4 packet
outer IPv4 20 B + UDP 8 B + VXLAN 8 B + inner Ethernet 14 B = 50 B
1500 - 50 = 1450 overlay MTU for the inner IP packet

Try it yourself

This needs two Docker hosts that can reach each other. Run the first block on host A, the join command it prints on host B, then the rest on host A.

$ docker swarm init --advertise-addr 10.0.0.20
$ docker network create -d overlay --attachable --subnet 10.10.0.0/24 shop-overlay
$ docker run -d --name web --network shop-overlay nginx
$ # on host A, in a second terminal: sudo tcpdump -ni any udp port 4789
$ # on host B: docker run --rm --network shop-overlay alpine wget -qO- web
$ docker rm -f web

Quiz

1. What does VXLAN put around the original frame?
2. How much overhead does VXLAN add?
3. What does the VNI do?