How to set the right MTU
On June 15,2023 by Tom RoutleyIn Digital Networks, MTU(Maximum Transfer Unit) is the parameter that decides the largest datagram transferred without being fragmented through the network. Below is an introduction to MTU as well as an explanation on how to calculate it. Also, find out its value in Windows and Linux and how to change them.
What is MTU?
The Maximum Transmission Unit (MTU) (maximum size of transfer unit) is a parameter that determines the longest datagram can be transmitted by an IP interface without needing to be fragmented into smaller units. The MTU should be larger than the largest datagram you want to convey without being fragmented. More simply, the MTU defines the maximum size (in bytes) of the packet that can be transmitted at once.
Values for different Internet protocols:
For Ethernet, this value should be 1500 bytes.
For PPPoE, 1492 bytes.
For PPP (low speed), 576 bytes.
For ATM, 9180 bytes.
For FDDI, 4470 bytes.
Calculate the MTU
Each transmission frame is defined by the body (= MMS = maximum segment size), which defines the largest segment of TCP information that can be transmitted, and the header:
MTU = MSS + TCP / IP headers
Consider that:
MSS = MTU-40
Packets are not fragmented
No lost packets
Packet size / speed
Either a transfer of information of 1500000 bytes using different size of packets through a T1 line (CTS) (T1 = 1544000 bits / sec) as follows:
(MSS + header) * 8 bits / byte
---------------------------------- = Latency
1,544,000 bits / sec.
By using different values of MTU, one can calculate the latency of transmission:
If MTU = 1500, then: (1460 +40) * 8 / 1544000 = 7772 ms
If MTU = 576, then: (536 +40) * 8 / 1544000 = 2924 ms
At 10 loops, we get 77.72 ms for the MTU to 1500, and 29.24 ms for the 576.
Summarizing, the more packets there are, the longer the transfer.
Using the same formula for the transfer of 1mb.:
1MByte = 1024 KB = 1,048,576 bytes.
If MTU = 1500, then: (1460 +40) * 8 / 1544000 = 7772 ms
1 MByte / MSS = 1048576 bytes / 1460 = 718.2, so 719 packages to transfer 1 MByte.
To transfer 1Mbyte: 719 ms 7772 * packets (always loop) = 5588.068 ms, or 5588 seconds.
If we transfer our 1 MByte in 10 loops (defined by the header), we will ideally:
(1 packet loops * 10 * 7.772ms delay) + 718 * 7772 = 5658 seconds.
If MTU = 576, then: (536 +40) * 8 / 1544000 = 2924 ms
1 MByte / MSS = 1048576 bytes / 536 = 1956.3, therefore 1957 packets to transfer 1 MByte.
To transfer 1 MByte: 1957 packets * 2924 ms (always loop) = 5722.268 ms, or 5722 seconds per loop.
If we transferred the 1 MByte in 10 loops:
(1 packet loops * 10 * 2.924ms) * 2924 + 1956 = 5748 sec.
To transfer 1Mbyte, if one uses an MTU to 1500 then there is 719 * 40 = 28,760 bytes for the header, while the MTU to 576, we get 1957 * 40 = 78,280, more than 49,520 bytes of 'header sent Mbyte each. For our example of 10 loops, it is not considerable, but on the daily transfers ...
Most modems use a larger header, and we do not take into account such other latencies that may be associated.
Find the value of the MTU on Windows
To find the maximum MTU, it should be in the command prompt (Start> Run> "cmd")/bold>. Once in the command prompt (black page), it is necessary to test ping indicating the size of packages to test:
ping-f-l (size of the package -28) (IP of your server)
The
The-l option sends the packet size.
Removing 28 to the packet size to be tested corresponds to the header of this package.
We must take the test to an IP. For the sake of an Internet browser, it is better to take a Web address/
This gives:
- If the answer to the query is:
Reply from 192.168.0.1: bytes = 1372 ....
Reply from 192.168.0.1: bytes = 1372 ....
Reply from 192.168.0.1: bytes = 1372 ....
Reply from 192.168.0.1: bytes = 1372 ....
Here the packet size allows transporting without fragmentation. One can test a higher value. When you get the message: "The package must be fragmented but DF set", the packet size is too large.
Changing the MTU on Windows
Once you have determined the optimal MTU, there are two ways of changing the value of MTU. I mention here the easiest to implement via a software calledDrTCP:
Once installed, you have a "MTU" box
Find the value of the MTU on Linux
Just run this command as root with
interface_name ifconfig | grep-Eo "MTU: [0-9] +"
Changing the MTU on Linux
In root with the ifconfig command that changes the MTU on Linux with the following syntax:
interface_name ifconfig mtu value_mtu
Example: set the MUT of the interface to 1500:
ifconfig eth0 mtu 1500
Photo: © Everypixel
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply