Workflow Tools Control Yard

Home / Network

MTU and MSS calculator

Start from the MTU of the link, add the tunnels and encapsulations on the path, and get the largest packet that fits inside, the TCP MSS to clamp to, and ping commands for Windows, Linux and macOS that test it.

Test it with ping

Each command sends the largest packet that should fit, with fragmenting turned off. If replies come back, the path carries it; if not, make the size smaller until they do.

Overheads

What each layer adds to a packet, in bytes. IPsec ESP also pads the packet so that its end falls on a 4-byte boundary, or a 16-byte one with AES-CBC, so its overhead changes with the size of the packet.

LayerBytesWhat they areSource
PPPoE8PPPoE header 6, PPP protocol ID 2RFC 2516
GRE over IPv424Outer IPv4 header 20, GRE header 4RFC 2784
GRE with a key, over IPv428Outer IPv4 header 20, GRE header 4, key 4RFC 2784, RFC 2890
VXLAN over IPv450Outer IPv4 header 20, UDP 8, VXLAN header 8, inner Ethernet header 14RFC 7348
VXLAN over IPv670Outer IPv6 header 40, UDP 8, VXLAN header 8, inner Ethernet header 14RFC 7348
WireGuard over IPv460Outer IPv4 header 20, UDP 8, WireGuard header 16, authentication tag 16Linux WireGuard
WireGuard over IPv680Outer IPv6 header 40, UDP 8, WireGuard header 16, authentication tag 16Linux WireGuard
IPsec ESP tunnel, AES-GCM, over IPv454 + paddingOuter IPv4 header 20, ESP header 8, IV 8, padding to 4 bytes, pad length and next header 2, ICV 16RFC 4303, RFC 4106
IPsec ESP tunnel, AES-GCM, over IPv4 with NAT traversal62 + paddingAs above, and UDP 8RFC 4303, RFC 4106, RFC 3948
IPsec ESP tunnel, AES-CBC and SHA-256, over IPv462 + paddingOuter IPv4 header 20, ESP header 8, IV 16, padding to 16 bytes, pad length and next header 2, ICV 16RFC 4303, RFC 3602, RFC 4868
IPsec ESP tunnel, AES-CBC and SHA-256, over IPv4 with NAT traversal70 + paddingAs above, and UDP 8RFC 4303, RFC 3602, RFC 4868, RFC 3948
IPsec ESP tunnel, AES-CBC and SHA-1, over IPv458 + paddingOuter IPv4 header 20, ESP header 8, IV 16, padding to 16 bytes, pad length and next header 2, ICV 12RFC 4303, RFC 3602, RFC 2404
IPsec ESP tunnel, AES-GCM, over IPv674 + paddingOuter IPv6 header 40, ESP header 8, IV 8, padding to 4 bytes, pad length and next header 2, ICV 16RFC 4303, RFC 4106

MSS and clamping

The TCP MSS is the most data one TCP segment carries: the MTU less 40 bytes for IPv4 (a 20-byte IPv4 header and a 20-byte TCP header) and less 60 for IPv6, whose header is 20 bytes longer (RFC 8200 section 8.3, RFC 9293 section 3.7.1).

When a tunnel makes the path smaller than the hosts know, the routers or firewalls at its ends can lower the MSS in the TCP handshakes that pass through, so that TCP sends smaller segments. RFC 4459 calls this MSS clamping. It works for TCP only, not for UDP, and it is most used with PPPoE.

Limits and defaults

Sources

More Network tools