MTU and MSS calculator
Do some pages fail to load, or large transfers stall, after a VPN or tunnel? Enter the physical MTU and the encapsulation layers to see the inner MTU, the TCP MSS, ping test commands and MSS clamping examples.
Checking your session…
01
How to use
A
Enter the MTU of the physical interface and choose the IP version of the traffic inside the tunnel.
B
Add the encapsulation layers from the physical link inwards; edit the typical header sizes to match your configuration, and enter the value yourself for IPsec/OpenVPN/L2TP.
C
Get the inner MTU and MSS; test the path with the ping commands and adapt the MSS clamping example to your environment if needed.
02
MTU, MSS and tunnel headers
MTU is the largest IP packet an interface can carry in one frame (typically 1500 bytes on Ethernet). A tunnel or VPN wraps every packet in new headers; these take space from the same frame, so the MTU left for packets going through the tunnel is smaller. MSS is the largest amount of data TCP carries in one segment and is found by subtracting the IP and TCP headers from the MTU.
Layers can be stacked (e.g. WireGuard over PPPoE); each lowers the MTU by its own header. The tool adds the encapsulations in order from the physical link inwards and shows the MTU left at every step.
03
Why header sizes are "typical values"
PPPoE (8 bytes), GRE (24 for an IPv4 outer header), WireGuard (60 for IPv4 outer, 80 for IPv6 outer) and VXLAN (50 for IPv4 outer) have a fixed structure and are common values. Even so, the outer IP version, options and extra tags on the surrounding network (e.g. VLAN) can change them; that is why every value stays editable.
For IPsec ESP, OpenVPN and L2TP the header varies over a wide range with the cipher suite, integrity algorithm, padding and options such as NAT traversal (NAT-T). This tool offers no preset for them: enter it from your own configuration or the product documentation.
04
When MSS clamping is needed
A TCP connection fixes its MSS when the ends handshake (SYN) and does not know the MTU of a tunnel in the middle. If path MTU discovery fails (ICMP blocked), the ends send packets that do not fit the tunnel and the connection stalls. Lowering the MSS of SYN packets at the tunnel exit pulls the ends to a suitable size from the start.
Clamping only fixes TCP; for UDP-based protocols the tunnel interface's MTU must be set to a suitable value. The example lines are for common platforms; verify interface names, chains and direction rules for your own environment.
FAQ
- Is my input sent anywhere?
- No. The calculation runs in code in your browser; values are not sent to any server and are not stored.
- What is the difference between MTU and MSS?
- MTU is the largest IP packet an interface can carry; MSS is the amount of data TCP carries in one segment. In IPv4 MSS = MTU − 40, in IPv6 MTU − 60 (TCP options excluded).
- Which MTU should I use for WireGuard?
- With a 1500-byte outer link you get 1440 over IPv4 and 1420 over IPv6 (60 and 80 bytes of headers). In practice 1420 is widely considered safe; still, verify your own path with ping. A narrower link (PPPoE, mobile) may call for a lower value.
- Why is there no preset header value for IPsec?
- The ESP header and trailer vary with the cipher suite, padding, whether NAT-T is used and tunnel/transport mode. A wrong preset would mislead; enter it from your own configuration or find it by testing with ping.
- Why is the -l / -s value in the ping command MTU − 28?
- Ping takes the size of the ICMP payload; 20 bytes of IPv4 header and 8 bytes of ICMP header are added. In IPv6 the IP header is 40 bytes, i.e. MTU − 48.
- Is MSS clamping enough on its own?
- For TCP usually yes, for UDP/ICMP no. Also set the tunnel interface's MTU correctly and do not block ICMP "Fragmentation Needed" / "Packet Too Big" messages needlessly.
Seeing stalls on a VPN or tunnel?
Let us do the design, MTU plan and testing together for site-to-site links, remote access and cloud networks. In a free discovery call we discuss your current state and goals.