Skip to main content

Інструкція користувача

How to determine the optimal MTU size?

Важливо

This instruction is relevant only if you encounter problems with data transmission over the network.

For example, certain web pages do not open for some unknown reason, or file transfer errors are present.

If the Internet access and data transfer work correctly, you should not experiment with the MTU parameter because you can worsen the performance of your home network by doing the wrong thing. Nowadays, various network devices (routers, adapters, modems, etc.) usually use the optimal MTU settings preset by default and often the auto-size packet function automatically determines the MTU value.

The MTU (Maximum Transmission Unit) refers to the maximum packet size transmitted over the network without fragmentation. If a packet is larger than the MTU setting, it will fragment (split) into smaller packets. With many such packets, this can significantly slow down data transmission over the network.

Using the wrong MTU size can cause problems with opening some browsers, malfunctions in VoIP telephony, issues with receiving or transmitting files over the network. To fix this, you need to check the current MTU value you have set and determine the optimal MTU size. Using the optimal MTU size can significantly improve network performance. Maximum speed is achieved when all packets in a stream have a length equal to the MTU value.

It is possible to manually set the MTU value for the desired interface in many network devices, but you need to determine its optimal size correctly.

Consider one of the simplest and most accurate ways to determine the optimal MTU size.

To do this, we will use the ping utility. We will use it to send requests to the network and gradually increase the size of the packet until we get a message about the need to fragment the packet.

We will perform the ping command in the command line of the Windows operating system. To connect to the Windows 10 command line, press Win + R (in earlier versions of Windows, press Start > Run), and in the window that appears, type cmd in the Open field. Next, press the OK button (or the 'Enter' key on your keyboard).

The syntax of the ping command to be used is:

ping [url] -f -l <packet_size>

Use some popular domain as the URL.

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
optimal-mtu-01-en.png

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 fragmented message.

optimal-mtu-02-en.png

So, in our example, we found the maximum size of the packet to be 1472 bytes (at this value, the packet does not need to be fragmented) because at 1473 bytes, the message saying that the packet needs to be fragmented appeared.

But this is not the MTU value yet. We have got 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).

To exit the command-line interface, run the exit command.

Важливо

For correct execution of this test, ICMP packets must pass through the network (some network devices, servers or firewalls may block ICMP requests).

You can then set the resulting MTU value in the router's settings on the WAN interface. Refer to the Adjusting MTU size manual for more information on setting the MTU parameter on Keenetic routers.

Примітка

Sometimes you need to know the MTU value of your computer when you connect directly to it with your ISP's Internet cable. To see the current MTU value, use a special command from the Windows command line:

  • netsh interface ipv4 show subinterfaces

optimal-mtu-03-en.png

You will see information on all interfaces on the computer. See the MTU value for the main connection (in our example, it is 1500 for the Ethernet interface).