WireGuard, IPsec & VXLAN Tunnel MTU & TCP MSS Clamping Calculator
Interactive VPN Tunnel MTU & TCP MSS Clamping Calculator
?
MTU of the underlying WAN interface in bytes, as configured on the router port. Range: 1280 to 9216 bytes, step 2 (9216 covers the jumbo underlays common in EVPN-VXLAN fabrics).?
Tunnel protocol. WireGuard over IPv4 is 60 bytes of overhead, over IPv6 80 bytes, and VXLAN 50 bytes. The IPsec ESP (68 bytes) and GRE over IPsec (92 bytes) values are model assumptions: verify them on your device.?
Set to 1 when the WAN is a PPPoE connection, which adds an 8-byte header. Use 0 for plain Ethernet.?
Extra bytes taken by 802.1Q tags when the port limits the frame to 1,518 bytes: 0 if the port passes 1,522-byte tagged frames or the link is untagged, 4 for one tag, 8 for Q-in-Q. Read the maximum frame size in the switch or router port settings.Use the VPN Tunnel MTU & TCP MSS Clamping Calculator to evaluate MTU_inner = MTU_WAN − H_tunnel − H_PPPoE | MSS_v4 = MTU_inner − 40 for site-to-site WireGuard and IPsec VPN routers, EVPN-VXLAN data center fabrics. With the defaults (Underlying WAN Interface MTU = 1500 Bytes, Encapsulation Tunnel Protocol = WireGuard IPv4 · 60 B, PPPoE WAN Encapsulation = Plain Ethernet) it returns Total encapsulation overhead: 60 Bytes header deduction. Change any input and the results update from the same equation.
Governing equationMTU_inner = MTU_WAN − H_tunnel − H_PPPoE | MSS_v4 = MTU_inner − 40 (IETF RFC 1191 (PMTUD), RFC 7348 (VXLAN) & WireGuard protocol spec)
Model assumptions
An 802.1Q tag raises the maximum Ethernet frame size from 1,518 to 1,522 bytes and does not reduce the 1,500-byte payload. The tag overhead control subtracts 4 bytes per tag (8 for Q-in-Q) only for a port that caps the frame at 1,518 bytes; leave it at 0 if the port passes 1,522-byte frames.
Why HTTPS Hangs Over a VPN While Ping Works: The PMTUD Black Hole
A tunnel adds headers in front of each packet. If the inner packet is larger than the tunnel's inner MTU, the router must fragment it or refuse it. A packet with the Don't Fragment (DF) bit set is refused, and the router returns an ICMP Destination Unreachable message with code 4, fragmentation needed and DF set, which carries the next-hop MTU (IETF RFC 1191). If those ICMP messages are blocked, the sender never learns the smaller size. Large TLS and HTTP segments then stall, while small pings still pass.
The overhead is the sum of the headers the tunnel adds. For WireGuard over IPv4, the transport message has a 4-byte message-type field (1 byte of type and 3 reserved zero bytes), a 4-byte receiver index and an 8-byte counter, plus a 16-byte AEAD tag (WireGuard protocol specification): 4 + 4 + 8 + 16 = 32 bytes. Add the 8-byte UDP header and the 20-byte IPv4 header and the total is 60 bytes. VXLAN adds an 8-byte VXLAN header, 8 bytes of UDP, 20 bytes of outer IPv4 and 14 bytes of inner Ethernet, for 50 bytes (IETF RFC 7348). PPPoE adds 8 bytes. An 802.1Q tag raises the maximum Ethernet frame size by 4 bytes (1,518 to 1,522) and leaves the 1,500-byte payload unchanged, so the calculator subtracts 4 bytes per tag (8 for Q-in-Q) only for a port that caps the frame at 1,518 bytes.
| Tunnel Protocol | Header Overhead | 1500 WAN Inner MTU | 1500 WAN IPv4 MSS | PPPoE Inner MTU | PPPoE IPv4 MSS |
|---|---|---|---|---|---|
| VXLAN Overlay | 50 B | 1450 B | 1410 B | 1442 B | 1402 B |
| WireGuard (IPv4) | 60 B | 1440 B | 1400 B | 1432 B | 1392 B |
| IPsec ESP NAT-T | 68 B | 1432 B | 1392 B | 1424 B | 1384 B |
| WireGuard (IPv6) | 80 B | 1420 B | 1380 B | 1412 B | 1372 B |
| GRE over IPsec | 92 B | 1408 B | 1368 B | 1400 B | 1360 B |
How to Evaluate Inner MTU and TCP MSS for Each Tunnel?
Inner MTU = WAN MTU − total overhead. The IPv4 TCP MSS is the inner MTU minus 40 (20 bytes of IPv4 header and 20 bytes of TCP header), and the IPv6 TCP MSS is the inner MTU minus 60. The WAN MTU field accepts 1,280 to 9,216 bytes; 9,216 is the jumbo setting on data-centre fabric ports (Nexus 9000v lab configuration, lostintransit.se). Set the tunnel interface MTU to the inner MTU, or clamp the TCP MSS on the tunnel router so both ends size segments to fit. The overhead values for IPsec ESP (68 bytes) and GRE over IPsec (92 bytes) are model assumptions that the cited sources do not give. They depend on cipher, NAT traversal and options, so check them on your device. The payload share on the card is the IPv4 TCP MSS divided by the WAN IP MTU; it excludes the Ethernet header, preamble and gap, so it is not a wire efficiency.
Default case: WireGuard over IPv4 on a 1500-byte WAN gives 60 bytes of overhead, an inner MTU of 1440 and an IPv4 MSS of 1400. Preset 2, VXLAN over PPPoE with one VLAN tag on a port capped at 1,518 B frames and a 1500-byte WAN, gives 62 bytes of overhead (50 + 8 + 4), an inner MTU of 1438 and an IPv4 MSS of 1398. On a port that passes 1,522-byte frames the tag costs nothing: the overhead is 58 bytes and the inner MTU is 1442. WireGuard over IPv6 gives 80 bytes of overhead and an inner MTU of 1420, which fits both an IPv4 and an IPv6 underlay on a 1500-byte WAN.
| Underlay MTU | Protocol | Safe Inner MTU | IPv4 TCP MSS | IPv6 TCP MSS | TCP Payload / WAN MTU |
|---|---|---|---|---|---|
| 1420 B | WireGuard (IPv4) | 1360 B | 1320 B | 1300 B | 93.0% |
| 1492 B | WireGuard (IPv4) | 1432 B | 1392 B | 1372 B | 93.3% |
| 1500 B | WireGuard (IPv4) | 1440 B | 1400 B | 1380 B | 93.3% |
| 1550 B | VXLAN | 1500 B | 1460 B | 1440 B | 94.2% |
| 9000 B | VXLAN | 8950 B | 8910 B | 8890 B | 99.0% |
| 9000 B | WireGuard (IPv6) | 8920 B | 8880 B | 8860 B | 98.7% |
Worked Examples: Two Presets Calculated with MTU_inner = MTU_WAN − H_tunnel − H_PPPoE | MSS_v4 = MTU_inner − 40
Worked Example 1 (VXLAN over PPPoE, one VLAN tag on a port capped at 1,518 B frames): This preset sets Underlying WAN Interface MTU = 1500 Bytes, Encapsulation Tunnel Protocol = VXLAN · 50 B, PPPoE WAN Encapsulation = PPPoE, 802.1Q tags on a port capped at 1,518 B frames = One tag, 1,518 B frame cap. Evaluating MTU_inner = MTU_WAN − H_tunnel − H_PPPoE | MSS_v4 = MTU_inner − 40 gives: total overhead = 62 B, inner tunnel MTU = 1438 B, IPv4 TCP MSS = 1398 B, IPv6 TCP MSS = 1378 B, payload efficiency = 93.2 %. Related in the Network, Fiber, PoE & Rack Hub: WAN Bandwidth-Delay Product (BDP) & TCP Window Calculator and VoIP SIP Trunk Bandwidth & Erlang B Lines Calculator.
Worked Example 2 (IPsec ESP tunnel over a PPPoE fiber WAN): This preset sets Underlying WAN Interface MTU = 1500 Bytes, Encapsulation Tunnel Protocol = IPsec ESP NAT-T, PPPoE WAN Encapsulation = PPPoE, 802.1Q tags on a port capped at 1,518 B frames = None, or the port passes 1,522 B frames. The calculator returns: total overhead = 76 B, inner tunnel MTU = 1424 B, IPv4 TCP MSS = 1384 B, IPv6 TCP MSS = 1364 B, payload efficiency = 92.3 %. You can compare these limits with other calculators in the Engineering Studio.
How to Evaluate Testing the Path MTU With Unfragmented Pings?
From a Linux host, test the usable path with the DF bit set: ping -M do -s <payload> <peer>. ICMP adds 28 bytes (20-byte IPv4 header plus 8-byte ICMP header) to the payload. For a 1420-byte path, a payload of 1392 passes (1392 + 28 = 1420), and a payload of 1393 returns Frag needed and DF set with the MTU.
Sources
- WireGuard · Protocol and cryptographyTransport data message has a 4-byte message-type field (1 byte type and 3 reserved zero bytes), 4-byte receiver index and 8-byte counter (16 bytes) plus a 16-byte AEAD tag: the 32-byte WireGuard payload overhead used in the 60-byte IPv4 total with 8-byte UDP and 20-byte IPv4 headers.
- IETF RFC 7348 · VXLANVXLAN header is 8 octets; VTEPs must not fragment, so the physical MTU must accommodate the encapsulation. Basis of the 50-byte VXLAN overhead (8 VXLAN + 8 UDP + 20 IPv4 + 14 inner Ethernet).
- IETF RFC 1191 · Path MTU DiscoveryA router that cannot forward a DF-marked datagram returns ICMP Destination Unreachable code 4 (fragmentation needed and DF set) with the next-hop MTU, the mechanism behind PMTUD black holes.
- IETF RFC 4303 · IP Encapsulating Security PayloadESP header fields: 4-byte SPI and 4-byte sequence number, followed by the trailer with a 1-byte pad length and a 1-byte next header; used for the field count behind the 68-byte IPsec ESP model assumption.
- IETF RFC 4106 · AES-GCM in IPsec ESPThe AES-GCM ESP IV field is 8 octets and the full-length ICV is 16 octets; padding is minimal, fewer than 4 octets, when plaintext length is not hidden.
- Wikipedia · Ethernet frame General definitionAn 802.1Q tag increases the maximum Ethernet frame size by 4 octets (frame size 64-1522 octets with a tag); the 1,500-octet payload is unchanged, so the tag costs payload only on a port that caps the frame at 1,518 octets.
Method and test suite: Calculation Methodology.
Frequently Asked Questions: VPN Tunnel MTU & TCP MSS Clamping Calculator
Does TCP MSS clamping fix UDP traffic such as QUIC or VoIP?
No. MSS is a TCP option carried in the SYN handshake, so it does not apply to UDP. For UDP, set the interface MTU correctly, and rely on the application's path MTU probing where it exists.
Why does VXLAN need a larger underlay MTU?
VXLAN adds 50 bytes around the inner frame, and RFC 7348 says VTEPs must not fragment VXLAN packets. A 1500-byte inner MTU therefore needs an underlay of 1550 bytes or more. A 9000-byte underlay gives 8950 bytes of inner MTU.
Why is 1420 bytes the WireGuard figure, not 1440?
The 1440-byte figure is for an IPv4 underlay only. An IPv6 underlay adds 20 bytes of outer header, so the overhead is 80 bytes and the inner MTU is 1420 on a 1500-byte WAN. 1420 bytes fits both underlays.
Where do the 68-byte and 92-byte overhead values come from?
They are model assumptions for IPsec ESP and GRE over IPsec, and the encapsulation menu labels them that way. A count of the ESP fields (IETF RFC 4303 and RFC 4106) for AES-GCM in tunnel mode with UDP encapsulation for NAT traversal gives 62 bytes plus 0 to 3 bytes of padding: outer IPv4 20, UDP 8, SPI 4, sequence number 4, IV 8, pad length 1, next header 1 and ICV 16. The model's 68 bytes is above that count, and the 92 bytes for GRE over IPsec is not derived from a source. Use the MTU your tunnel measures in practice when you configure the interface.