December 4, 2026

MTU, MSS and the Ping Test: Finding the Largest Packet a Path Will Carry

A truck stopped in front of a low underpass with a height-limit bar

Some network faults look like magic. Small web pages load and big ones hang. SSH connects, then freezes the moment a long directory listing scrolls. A VPN passes pings and stalls on file copies. Very often the cause is a packet-size limit somewhere along the path, and the tool that finds it is ordinary ping with two extra flags. The machine used for the tests below happens to sit behind a link with an unusual 1,400-byte limit, which makes the arithmetic easy to watch.

Video: Chris Greer on YouTube

MTU: the size limit of one link

Bytes per packet

Every network link has a maximum transmission unit, the largest IP packet it carries in one piece. Ethernet’s is 1,500 bytes, a figure RFC 2516 states directly when it explains PPPoE: Ethernet has a maximum payload size of 1500 octets.

A path across the internet crosses many links, and the one that matters is the smallest. RFC 1191, which defined Path MTU Discovery in November 1990, puts it in one line: the path MTU is equal to the minimum of the MTUs of each hop in the path.

Reading the local value

ip link prints the MTU of each interface. On the test machine:

$ ip link show eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UP ...

1,400, not the usual 1,500. Cloud networks, tunnels and VPNs commonly run below 1,500, because they wrap each packet in their own headers and need the room.

Large pile of brown cardboard boxes with blue tape

The ping test

Turn fragmentation off, then vary the size

The test has two parts. -M do tells Linux ping to set the Don’t Fragment bit, so an oversized packet fails instead of being split. -s sets the size of the ping’s data. The total packet is that data plus 28 bytes of headers: 20 for IP and 8 for ICMP.

So on a 1,400-byte link the largest data size that fits is 1,400 minus 28, which is 1,372:

$ ping -c 1 -M do -s 1372 192.0.2.1
1380 bytes from 192.0.2.1: icmp_seq=1 ttl=64 time=0.084 ms
1 packets transmitted, 1 received, 0% packet loss

$ ping -c 1 -M do -s 1373 192.0.2.1
ping: local error: message too long, mtu=1400
1 packets transmitted, 0 received, +1 errors, 100% packet loss

One byte more and the packet was refused before it left the machine. The error even names the limit.

The standard Ethernet number

On an ordinary 1,500-byte Ethernet path the same test uses 1,472:

Link MTU Largest ping -s with -M do
1,500 (Ethernet) 1,472
1,492 (PPPoE) 1,464
1,400 (this test machine) 1,372
9,000 (jumbo frames) 8,972

On the test machine, -s 1472 failed with the same local error as 1,373, because the very first link was already smaller.

When the limit is further away

The local error only appears when the machine’s own interface is the bottleneck. When a router farther along the path has the smaller MTU, the packet leaves normally and is dropped at that router. RFC 1191 describes what is supposed to happen then: the router discards the packet and sends back an ICMP Destination Unreachable message with the code fragmentation needed and DF set. ping reports that as a “Frag needed” message naming the router. Starting at 1,472 and lowering the size until replies come back finds the path’s limit.

With fragmentation allowed

Dropping the Don’t Fragment bit changes the outcome without fixing it. ping -M dont -s 2000 sent a 2,028-byte packet that the machine split to fit its 1,400-byte link, and tcpdump on the interface caught it leaving as two pieces:

IP 192.0.2.2 > 192.0.2.1: ICMP echo request, id 677, seq 1, length 1376
IP 192.0.2.2 > 192.0.2.1: ip-proto-1

The first fragment carried the ICMP header, which is why tcpdump could name it. The second was raw data, which tcpdump could only label with the protocol number. No reply came back. The gateway on this network either never reassembled the pieces or chose not to answer a fragmented ping, and the sender had no way to tell which. That silence is the practical case against relying on fragmentation, and part of why the rest of this post is about avoiding it.

Why big transfers hang: the black hole

When the ICMP message never arrives

Path MTU Discovery depends on that ICMP message. A sender starts with full-size packets marked Don’t Fragment, a router along the way rejects them, and the ICMP reply tells the sender to shrink. RFC 1191 calls it a “Datagram Too Big” message.

Firewalls that block all ICMP break the loop. RFC 4821, published in March 2007, describes the result: classic Path MTU Discovery is subject to protocol failures (connection hangs) if those messages are not delivered or processed. The sender never learns the packets are too big, keeps sending them, and they keep disappearing. The RFC’s name for a router that drops oversized packets silently is an ICMP black hole.

The symptom pattern

That explains the opening list of faults. Small exchanges, a ping, a TCP handshake, a short HTTP response, fit under any MTU and work. The first full-size packet, the bulk of a web page or a file, is the one that vanishes. The connection opens and then stalls, which is exactly what makes these faults look random.

The ping test exposes it in seconds: a path where -s 1472 with -M do gets no reply at all, while smaller sizes do, has a smaller MTU somewhere and is not reporting it.

Water faucet

MSS: the TCP side of the same limit

Maximum segment size

TCP sidesteps much of this by agreeing on a size up front. Each side announces a maximum segment size during the handshake, the largest block of data it will accept in one segment. It is the MTU minus the IP and TCP headers, 20 bytes each without options. On standard Ethernet that gives the familiar 1,460.

What the kernel actually used

ss -ti shows the values Linux settled on for each open connection. For a live HTTPS connection out of the test machine’s 1,400-byte interface:

mss:1348 pmtu:1400 rcvmss:1348 advmss:1348

The path MTU is 1,400. Subtracting 40 bytes of headers gives 1,360. The extra 12 bytes come off for the TCP timestamp option, which this connection used, leaving 1,348 bytes of data per packet. The same tool on a loopback connection on the same machine reported pmtu:65535, because loopback has no Ethernet limit at all.

MSS clamping

Routers on links with a reduced MTU, PPPoE connections and VPN gateways especially, often rewrite the MSS value in passing TCP handshakes down to what the link can carry. That is called MSS clamping. It keeps TCP connections working even when ICMP is blocked, because the two ends never try to send oversized segments in the first place. It does nothing for traffic that is not TCP.

PPPoE and 1,492

Where eight bytes go

Many DSL and some fiber connections use PPPoE, which carries PPP inside Ethernet frames. RFC 2516 does the subtraction: Ethernet carries 1,500 bytes, the PPPoE header takes 6 and the PPP protocol ID takes 2, so the PPP MTU MUST NOT be greater than 1492. The same section says the receive unit must not be negotiated larger than 1,492.

Every device behind such a connection still thinks in 1,500-byte Ethernet terms. The router in between is the one that has to bridge the difference, by clamping MSS, by sending the ICMP messages correctly, or both. When it does neither, the symptoms above appear for every user on the line.

Network cables

Fixing it

Lower the MTU where the problem is

When the test finds a smaller path MTU and the network in between will not report it, the practical fix is to stop sending packets that large in the first place:

  • Set the MTU on the affected interface or VPN tunnel to the value the ping test found plus 28. ip link set dev wg0 mtu 1380 is the Linux form.
  • Turn on MSS clamping on the router, if it offers it, for the WAN or tunnel interface.
  • Allow ICMP “fragmentation needed” messages through firewalls. Blocking all ICMP is the root cause of most black holes.

Raising it is rarely worth it

Jumbo frames of 9,000 bytes can help on a dedicated storage network where every device, switch and cable supports them. Mixed into an ordinary home or office network, a single device left at 1,500 turns into the same black-hole problem in reverse. The test for that is the same command with -s 8972.

Other limits on the old numbers

RFC 1191 also records two figures that still turn up in documentation. Hosts not on the same network historically assumed a path MTU of 576 bytes, which the RFC describes as the current practice of its time. And a host must never reduce its estimate below 68 bytes, the official minimum for IPv4. Neither is a sensible setting today, but both explain odd values in old configuration files.

Sources

  • RFC 1191, “Path MTU Discovery,” November 1990: https://www.rfc-editor.org/rfc/rfc1191.html
  • RFC 4821, “Packetization Layer Path MTU Discovery,” March 2007: https://www.rfc-editor.org/rfc/rfc4821.html
  • RFC 2516, “A Method for Transmitting PPP Over Ethernet (PPPoE),” February 1999: https://www.rfc-editor.org/rfc/rfc2516.html

655 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *