Find max MTU size

in Debian, Windows 7

Maximum Transmission unit is how big of a fragment can be sent. TCP/IP fragments data that doesn’t fit into one window (just about everything), then reassembles it at the far end. If the MTU is wrong, networking will fail.

I was wondering what the max MTU size was from my PC to our gateway … here is how I found the max mtu size

Y:\>for /L %i in (11825,1,12000) do @ping -l %i -n 1 | find "Reply" && ping -n 1 -w 1000>NUL

Reply from bytes=11825 time=6ms TTL=255
Reply from bytes=11826 time=6ms TTL=255
(...omitted for brevity...)
Reply from bytes=11833 time=6ms TTL=255
Reply from bytes=11834 time=6ms TTL=255


This batch file to find the max MTU size died at 11834~ in the 3 tests I ran, so 11834~ is the highest MTU this hop allows.

The loop starts at 11825, increments by 1, until it hits 12000 and does the “do” part of above, replacing %i with the current variable. The @ping doesn’t echo back the ping command, and the find command strips out only what we want to see.

The red part is optional, and is how to pause a windows batch loop on each iteration for 1 second. If you omit it, the loop works like a cisco ping and goes very fast.

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: