Subnetcalculator

MTU / MSS Calculator

Stack real tunnel encapsulations — WireGuard inside PPPoE, VXLAN inside IPsec — and get the effective MTU, TCP MSS, and paste-ready clamp commands. Everything runs in your browser; nothing is sent anywhere.

MTU / MSS Calculator

IP version
Encapsulation stack outermost first

Add each layer the packet actually crosses on the wire, in order. Real deployments stack more than one — e.g. WireGuard inside PPPoE, or VXLAN inside IPsec.

Effective MTU
1500
bytes
TCP MSS to advertise
1448
bytes

Total overhead

0 bytes
Overhead Usable payload

MSS clamp commands

iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1448

iptables also supports --clamp-mss-to-pmtu, which is preferable when path MTU discovery is working end to end — it clamps to whatever the path actually supports instead of a fixed number.

Managing MTU across a fleet of tunnels?

💾 Join the SubnetVault waitlist

Overlapping CIDRs are the other common VPN failure mode — check with the subnet overlap checker. To measure the real path MTU instead of estimating it, see the ping test tool.

MTU and MSS, and why they're not the same number

MTU (Maximum Transmission Unit) is the largest IP packet a link can carry in one piece, including the IP header. MSS (Maximum Segment Size) is the largest chunk of TCP payload a single segment can carry — it's what's left over after subtracting the IP header (20 bytes for IPv4, 40 for IPv6) and the TCP header (20 bytes, plus 12 more if the connection negotiates TCP timestamps, which most modern stacks do by default). The two numbers get confused constantly because they're both "the packet size limit," but an MSS advertised without accounting for every layer between the two TCP endpoints is a very specific and very common bug: connections establish fine, small requests work, and then a large response or file upload stalls or hangs entirely.

The reason it's specifically the large transfers that break is Path MTU Discovery. TCP starts by assuming the interface MTU is usable end to end and relies on ICMP "fragmentation needed" (IPv4) or "packet too big" (IPv6) messages to discover a smaller MTU somewhere on the path. Firewalls and security groups block ICMP by default astonishingly often, which silently disables PMTUD — the segment that's too large just vanishes with no signal back to either endpoint, and the connection hangs until it times out. TCP MSS clamping avoids the whole failure mode by never advertising an MSS large enough to need mid-path fragmentation, regardless of whether ICMP gets through.

Why stacking is the part every other calculator skips

A single-layer calculator answers "what's my MTU under WireGuard" or "what's my MTU under GRE," but production topologies rarely stop at one tunnel. A remote worker's laptop might run WireGuard over a PPPoE/DSL uplink that's already 8 bytes short of standard Ethernet. A cloud-to-cloud connection might carry VXLAN-encapsulated overlay traffic inside an IPsec tunnel between two VPC gateways, each layer eating into the same 1500-byte (or smaller) budget. Each encapsulation subtracts its own header from whatever MTU survived the layer above it — the math is cumulative, not a pick-one lookup — and the only way to get a correct effective MTU is to sum every layer the packet actually crosses on the wire, in the right order. That's the entire reason this tool lets you build an ordered stack instead of a single dropdown.

Measuring the real path MTU instead of estimating it

This calculator computes what your effective MTU should be given a base link MTU and a known encapsulation stack — but the only way to confirm what a path actually supports is to test it with a fragmentation-forbidding ping and binary-search the packet size:

  • Linux: ping -M do -s <size> <host>-M do forbids fragmentation, so a size that's too large fails outright instead of silently fragmenting.
  • Windows: ping -f -l <size> <host>-f sets the don't-fragment flag.
  • macOS: ping -D -s <size> <host>-D is the don't-fragment equivalent.

On every platform, the size you pass is the ICMP payload, not the full packet — you need to add 28 bytes back (8 bytes of ICMP header + 20 bytes of IPv4 header) to get the actual path MTU. So if ping -M do -s 1472 host succeeds but -s 1473 fails, the path MTU is 1472 + 28 = 1500. Compare that measured number against what this calculator predicts for your encapsulation stack — a mismatch usually means either an assumption about the stack is wrong, or there's a hop in the middle enforcing a smaller MTU than any endpoint is configured for.

MTU / MSS Calculator FAQ

Why does this tool let me stack multiple encapsulations instead of picking one tunnel type?

Most MTU calculators assume a single tunnel — just VXLAN, or just IPsec. Real deployments compose layers: a WireGuard tunnel running over a home PPPoE/DSL link, or VXLAN carried inside an IPsec tunnel between two clouds. Each layer subtracts its own header overhead from the same base link MTU, and the effective MTU is whatever survives after every layer is accounted for. Modeling only the innermost or outermost layer overstates the usable MTU and leads to silent fragmentation or black-holed packets under real traffic.

Why does the tool show a formula-based figure for IPsec and OpenVPN instead of one fixed number?

IPsec ESP overhead depends on the cipher (AES-GCM's IV and ICV are smaller than AES-CBC + SHA-256's), whether the encryption padding needs to reach a block boundary, and whether NAT-T UDP encapsulation is active. OpenVPN overhead depends on transport (UDP vs TCP) and cipher similarly. A single hardcoded number would be wrong for a meaningful fraction of real configurations, so the tool computes the total from the components you select and states the assumption inline instead of presenting false precision.

What's the actual difference between MTU and MSS?

MTU is the largest IP packet, in bytes, that a link can carry without fragmenting — it includes the IP header. MSS is the largest chunk of TCP payload a segment can carry — it excludes the IP header and the TCP header. MSS is derived from MTU: MSS = MTU − IP header (20 bytes for IPv4, 40 for IPv6) − TCP header (20 bytes, plus 12 more if the connection negotiates TCP timestamps). Advertising an MSS that doesn't account for every layer of encapsulation between the two TCP endpoints is the single most common cause of connections that work for small requests but hang on large transfers.

I raised the interface MTU but large transfers still stall — why?

Raising the local interface MTU only helps if every hop on the path, including the remote end's tunnel interface, agrees on the same effective MTU. If any single hop enforces a smaller MTU — a jumbo-frame VPC gateway dropping to 1500 at the internet edge is a common one — packets larger than that hop's limit get dropped or fragmented, and ICMP "fragmentation needed" messages that would normally trigger Path MTU Discovery are frequently blocked by firewalls. TCP MSS clamping sidesteps the problem for TCP by never letting a segment get large enough to need fragmentation in the first place.

Does TCP MSS clamping do anything for UDP-based tunnels?

No — MSS is a TCP-only concept negotiated in the SYN packet. UDP has no equivalent negotiation, so a UDP-encapsulated tunnel (WireGuard, VXLAN, most OpenVPN and IPsec NAT-T deployments) that black-holes at a given size needs the interface MTU itself lowered to the effective MTU this tool computes, not MSS clamping. Clamping still matters on the same link for any TCP traffic riding inside or alongside that tunnel.

How is this different from just checking the RFC 791 / RFC 8200 minimums?

RFC 791 sets the IPv4 minimum reassembly buffer at 576 bytes and RFC 8200 sets the IPv6 minimum link MTU at 1280 bytes — those are floors a path must never fall below, not targets to design around. This calculator flags both as hard errors when your stacked overhead pushes the effective MTU under them, but the useful number for day-to-day tuning is the effective MTU and MSS themselves, which are almost always well above those minimums and specific to your exact encapsulation stack.

More Network Tools

Free tools for network engineers — no signup, no rate-limit walls.