Description

Calculate MTU of a circuit

Symptoms

Checking MTU for the Internet circuit

Solution

Pre-requisite

  • Need to have ping allowed to a specific server or to the internet

 

1. Windows

ping [url] -f -l <packet_size>

The -f flag prohibits packet fragmentation.
The -l <packet_size> flag sets the size of the packet when it is sent to the network. Note that the -l flag uses the lowercase letter L.

  • Here is an example. Let's ping www.google.com with a packet size of 1450 bytes:
ping www.google.com -f -l 1450

  • After pinging, you will immediately see the result. In our example, we got a response, and no packet fragmentation request message was received. So we will now proceed with our test. First, start testing the packet size at 1450 bytes, and gradually increase this value until you see the Packet needs to be a fragmented message.
  • We got frag needed response at a packet size of 1473

2. Linux

ping -M do -s 1490 google.com

-M do - implies do not fragment the packet
-s - size of packet

Calculate MTU

  • We have the MSS (Maximum Segment Size) value, which defines the maximum size of the data block in bytes. This parameter does not take into account the length of the ICMP and IP headers. In our case MTU value = MSS + IP header + ICMP header.

  • Now let's add 28 bytes reserved for the data header (20 bytes for the IP header and 8 bytes for the ICMP request header) to the number obtained during the test. Thus, for our example, MTU=1472+28=1500 bytes (this is the optimal value for the MTU parameter).

Modification History

2024-03-31 : Article Created

2025-02-04 : Minor changes