Virtualization
VERIFIED FIXES

Docker overlay network MTU mismatch drops large UDP frames after cluster MTU reduced — intermittent packet loss between services

Environment

Environment

Docker Swarm overlay network spanning three Linux hosts (Ubuntu 22.04) connected over WAN with MTU 1400 after an ISP change; overlay network default_vxlan mtu remained at 1500; containers communicate using high-throughput UDP-based protocol (MPEG-TS).

Symptoms

Symptoms

Large UDP packets (~1400–1450 bytes) sent between containers intermittently drop, causing stream corruption and retransmits at application layer. TCP traffic unaffected. Host-level ping of jumbo payloads shows fragmentation or loss when size > 1360. Drops appear correlated to large packet sizes and only when sent between containers on different hosts (overlay VXLAN path).

Observations

Observations

ip link show shows physical NIC MTU set to 1400. Docker overlay network vxlan0 created with default mtu 65536 but Docker's internal encapsulation adds 50 bytes overhead. iptables offload and GRO/TSO enabled. tcpdump on physical interface shows fragmented outer UDP packets and occasional host kernel dropping fragments with 'ICMP frag needed' absent because ICMP filtered by firewall. Disabling GRO/TSO reduced but did not eliminate loss.

Already attempted

Already attempted

Set docker daemon 'mtu': 1400 and restarted Docker daemon on all hosts; issue reduced but intermittent drops remained. Lowering application UDP payload to 1200 solved problem. Disabled offloads (ethtool -K) temporarily on NICs with partial improvement. Tried setting sysctl net.ipv4.ip_no_pmtu_disc=1 (not recommended) — no stable fix.

Question

Question

What's the correct overlay/Docker and host configuration to prevent VXLAN-encapsulated packets from being fragmented or dropped when the physical MTU is lower, while preserving performance?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
viktorbyte Answer
user
Posted 4w ago • 0 confirmations

This is classic VXLAN/PMTU mismatch. Set Docker's overlay MTU on all nodes so inner packets plus VXLAN overhead fit the physical MTU (e.g., physical 1400 minus ~60 => docker mtu ~1340). Restart Docker on each host so overlay networks agree. Also allow ICMP 'fragmentation needed' through any firewalls so PMTU can adjust. Verify by sending large UDP test packets and checking tcpdump on the physical NIC to ensure packets are not fragmented. Roll back if other overlay networks need different sizing and test gradually.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

Overlay/VXLAN MTU larger than physical MTU minus encapsulation, leading to invisible fragmentation and drops. 95%
Intermediate firewall or router filtering ICMP 'frag needed', preventing PMTU discovery and causing blackhole for large packets. 75%
Network offload (GRO/TSO) interacting with VXLAN causing improper segmentation on transmit or receive. 50%

Summary

Root cause is MTU mismatch: overlay/VXLAN adds encapsulation overhead causing inner packets to exceed physical MTU leading to fragmentation. Fragmentation is fragile across intermediate network elements, and when ICMP 'fragmentation needed' messages are filtered, PMTU discovery fails, causing persistent drops. Disabling offloads only hides symptoms. Correct approach is to consistently set overlay MTU smaller than physical MTU minus encapsulation overhead and ensure ICMPv4/6 'frag needed' is permitted for PMTU.

Suggested Fixes

Diagnostic step 1
Calculate encapsulation overhead (VXLAN 50–60 bytes typical). Set Docker daemon mtu on all cluster nodes to physical_mtu - vxlan_overhead - 20 (safety margin). For MTU 1400 and 50B overhead, set docker mtu to 1330.
Diagnostic step 2
Restart docker on all hosts to apply same overlay MTU across cluster.
Diagnostic step 3
Ensure intermediate network allows ICMP 'fragmentation needed' (type 3/code 4 for IPv4, type 2 for IPv6) so PMTU can work; temporarily allow these ICMP messages in firewall to test.

Continue troubleshooting

Matched from the title, description and tags