COMPUTER SCIENCE / NETWORKING

MTU, TCP MSS, Tunnel Overhead and IP Fragmentation Calculator

Stack common encapsulation layers, find the safe inner MTU and transport payload, and test whether an IPv4 or IPv6 packet fits across the path.

Build the packet path

Examples
Encapsulation layers

How MTU, MSS and tunnel overhead fit together

The path MTU is the largest IP packet the path can carry without IP fragmentation. A tunnel adds outer headers, so the inner packet must be smaller: effective inner MTU = path MTU − encapsulation overhead. TCP MSS describes only TCP application data, so it also subtracts the inner IP and TCP headers.

For ordinary headers, IPv4 TCP MSS is inner MTU minus 40 bytes, while IPv6 TCP MSS is inner MTU minus 60 bytes. TCP options, IPv4 options and extension headers require more room.

Worked examples

WireGuard over PPPoE

A home router on PPPoE starts with 1,500 − 8 = 1,492 bytes. WireGuard over IPv4 adds 60 bytes: a 20-byte outer IPv4 header, an 8-byte UDP header, a 16-byte WireGuard data header and a 16-byte Poly1305 authentication tag. That leaves 1,492 − 60 = 1,432 bytes for the tunnel interface, so the TCP MSS is 1,432 − 40 = 1,392. If the peer might be reached over IPv6, plan for 80 bytes instead and use 1,412.

IPsec site-to-site behind NAT

When either gateway sits behind NAT, IPsec wraps ESP in UDP port 4500, which adds 8 bytes. With the 56-byte ESP allowance this gives 1,500 − 64 = 1,436 bytes inside the tunnel and an MSS of 1,396. Cipher, padding and integrity tag all change the real figure, which is why many engineers simply use an interface MTU of 1,400 and an MSS of 1,360 for IPsec. AWS Site-to-Site VPN, for example, supports an MTU of 1,446 and an MSS of 1,406.

VXLAN on a jumbo-frame underlay

VXLAN carries the whole inner Ethernet frame, so it costs 50 bytes over IPv4: 14 for the inner Ethernet header, 8 for VXLAN, 8 for UDP and 20 for the outer IP header. On a 9,000-byte underlay the virtual machines can use 8,950 bytes. To give them a normal 1,500-byte MTU, the underlay needs at least 1,550 bytes, which is why many fabrics are built with 1,600 or more.

Fragmenting a 4,000-byte IPv4 packet

On a 1,500-byte link with DF clear, the 4,000-byte packet carries 3,980 bytes of data after its 20-byte header. Each fragment can carry at most 1,480 bytes, a multiple of 8. The result is three fragments with 1,480, 1,480 and 1,020 data bytes, at offsets 0, 185 and 370 in 8-byte units. Their total sizes are 1,500, 1,500 and 1,040 bytes, and only the last has the More Fragments flag cleared.

Common tunnel MTU and MSS values

All rows assume a 1,500-byte path, an IPv4 outer header and IPv4 inside the tunnel. For IPv6 inside the tunnel, subtract another 20 bytes from the MSS.

Link or tunnelOverheadInner MTUTCP MSS
Plain Ethernet0 B1,5001,460
PPPoE8 B1,4921,452
IP-in-IP20 B1,4801,440
GRE24 B1,4761,436
VXLAN or GENEVE without options50 B1,4501,410
IPsec ESP tunnel mode (estimate)56 B1,4441,404
WireGuard over IPv460 B1,4401,400
IPsec with NAT traversal (estimate)64 B1,4361,396
WireGuard over PPPoE68 B1,4321,392
WireGuard over IPv6 (default 1,420)80 B1,4201,380
GRE over IPsec (estimate)80 B1,4201,380

What MSS clamping does

When a TCP connection opens, each side announces the largest segment it wants to receive in the MSS option of its SYN. A router with MSS clamping rewrites that option in SYN packets passing through it, lowering it to a value that fits the tunnel. Both ends then send smaller segments, and full-sized packets never reach the tunnel.

Clamping is the usual fix when Path MTU Discovery breaks, because it doesn’t depend on ICMP messages getting back to the sender. Set the clamp to the inner MTU minus 40 bytes for IPv4 or minus 60 bytes for IPv6. Linux can also clamp to the route MTU automatically with --clamp-mss-to-pmtu or maxseg size set rt mtu. Clamping only helps TCP. UDP traffic, such as QUIC, DNS and VPNs that run over UDP, still needs a correct interface MTU or its own size discovery.

The calculator’s Configuration targets menu gives the matching commands for Cisco IOS, Linux iptables and nftables, WireGuard, MikroTik RouterOS and Windows.

Troubleshooting an MTU problem

MTU problems have a recognisable pattern. Ping and small requests work, but larger transfers hang. SSH logs in but stalls on a big command output, file copies freeze at the start, some websites load only partly, and TLS handshakes time out because certificates fill full-sized packets.

  1. Ping the far side with fragmentation disabled, starting at the payload size the calculator gives. Increase it until it fails. For IPv4, the largest working payload plus 28 is the path MTU; for IPv6, add 48.
  2. On Linux, tracepath reports the path MTU hop by hop without special options.
  3. Check that firewalls allow ICMP “fragmentation needed” (IPv4 type 3, code 4) and ICMPv6 “Packet Too Big” (type 2). Blocking them causes PMTUD black holes.
  4. Lower the tunnel interface MTU, clamp TCP MSS, or both. If you control the hosts, Linux can probe for a working size itself with net.ipv4.tcp_mtu_probing.

Where this calculator is useful

VPN traffic stalls on large transfers

Small pings may work while HTTPS or file transfers stall because a VPN adds headers and ICMP Packet Too Big messages are blocked. Model the VPN overhead, set the tunnel interface MTU, and clamp TCP MSS where PMTUD cannot operate reliably.

Overlay networks inside cloud or data centres

VXLAN and GENEVE wrap an inner Ethernet frame in UDP and IP. Either the underlay needs a larger MTU or virtual machines need a smaller inner MTU. Stacking IPsec with an overlay consumes still more headroom.

PPPoE broadband and nested tunnels

PPPoE commonly reduces a 1500-byte link to 1492 bytes before any VPN overhead. Selecting both layers shows why a default 1500-byte inner packet no longer fits.

Fragmentation behavior

IPv4 routers may fragment a packet when DF is clear. Every fragment gets its own IPv4 header, and all non-final payloads must be a multiple of eight bytes because the fragment offset uses eight-byte units. With DF set, an oversized packet is dropped and the router should return an ICMP fragmentation-needed message.

IPv6 routers never fragment forwarded packets. They return ICMPv6 Packet Too Big; the source reduces its packet size or creates fragments itself. Blocking these messages can produce a PMTUD black hole.

Overhead values are planning estimates

Actual IPsec, GENEVE and other tunnel overhead depends on address family, encryption mode, authentication tag, padding, options and implementation. The calculator reports VLAN tags separately as Layer-2 frame overhead; it does not incorrectly subtract them from the IP MTU. Use the custom field and verify the final design with vendor documentation and packet captures.

Frequently asked questions

What TCP MSS should I use for a 1500-byte IPv4 path?

Without a tunnel or TCP options, 1460 bytes. Subtract tunnel overhead from 1460 when the inner traffic is IPv4.

Why does ping work when websites fail?

A default ping payload is often small. Larger TCP packets may exceed the effective MTU, and the connection can stall if required ICMP messages are blocked.

Is MTU measured in bits or bytes?

MTU is measured in bytes and normally refers to the maximum Layer 3 packet carried by an interface or path.

Does MSS clamping fix UDP?

No. MSS is a TCP option. UDP applications must size datagrams appropriately or rely on application-level discovery and segmentation.

Should I always disable fragmentation?

No single rule fits every network, but avoiding fragmentation and preserving working PMTUD is generally more reliable than depending on routers to fragment traffic.

What MTU should I use for WireGuard?

On a 1,500-byte connection, the default of 1,420 is safe whether the tunnel runs over IPv4 or IPv6. If the peers only ever use IPv4, 1,440 works. Over PPPoE, take 8 bytes more off, giving 1,412.

What is the difference between MTU and MSS?

MTU is the largest IP packet a link can carry, headers included. MSS is the largest block of TCP data in one segment, so it leaves out the IP and TCP headers. With IPv4 and no options, MSS is MTU minus 40.

What MSS should I set for an IPsec VPN?

Subtract the ESP overhead for your cipher, plus 8 bytes for NAT traversal, from the path MTU, then take off 40. A common safe choice is an MTU of 1,400 and an MSS of 1,360. Some providers publish their own limits, such as AWS Site-to-Site VPN’s 1,446 MTU and 1,406 MSS.

What MTU does the VXLAN underlay need?

At least 50 bytes more than the inner MTU over IPv4, or 70 over IPv6. To carry 1,500-byte inner packets, that means 1,550 bytes, and many networks use 1,600 or jumbo frames for headroom.

How do I find the path MTU with ping?

Ping with fragmentation disabled and raise the payload until it fails, for example ping -f -l 1472 on Windows or ping -M do -s 1472 on Linux. Add 28 bytes to the largest working IPv4 payload to get the path MTU.

← All networking calculators