July 15, 2023 · macos networking

MTU Size Test on macOS

The Maximum Transmission Unit (MTU) of a network path is the maximum size of data you can send in a packet from one place to another. Every hop in a network has its own MTU, while the path MTU represents the lowest compatible value in a network. In well behaving networks, IPv4 packets work reliably since they can be fragmented. Some routers also modify packets on the fly to adapt to differing sizes of MTU. But in situations where only a few certain websites are loading, an incompatible MTU can sometimes be the problem. Any size below 1280 is non-standard, while 1500 is the most compatible.

The MTU can be checked using the ping command on macOS. First, run ping example.com -D -s 1472. Then try changing the last number to find the largest successful ping. Lastly add 28 to the result for the MTU. Here is an example of MTU size 1500:

Successful ping:

yoonsik@macbook-air-d5 ~ % ping example.com -D -s 1472
PING example.com ( 1472 data bytes
1480 bytes from icmp_seq=0 ttl=57 time=22.916 ms
--- example.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss

Unsuccessful ping:

yoonsik@macbook-air-d5 ~ % ping example.com -D -s 1473
PING example.com ( 1473 data bytes
ping: sendto: Message too long
--- example.com ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss

ping manual