Which mtu size in bytes is better? How to determine the optimal MTU size

If you specify the MTU size incorrectly for PPPoE connections from Rostelecom, problems may arise when opening some resources. Before you determine the required setup configuration for your connection, it's worth learning more about what this option is.

TCP MTU option for Rostelecom and other providers

As a protocol network layer in the TCP/IP set, the latter is intended to be implemented potentially large systems local networks. From our time with IP, we have become accustomed to the concept of hosts that can send information back and forth, even though they are located quite far apart and the data may have to travel across multiple devices. Even though we typically think of the Internet's TCP/IP protocol suite as an abstract "virtual network," we must always remember that at the network layer, data flows over one or more physical lines.

How is data sent?

In order to transmit information over the IP protocol, data is encapsulated (packed) into datagrams ( information blocks). They, in turn, must be sent by physical channel directly to the destination or indirectly to the next intermediate stage of the journey to the recipient. The size of such data packets is called MTU (Maximum Transmission Unit), used in PPPoE connections x Rostelecom and other providers.

The link layer implementation places the transported message and headers in single package data - IP datagram. This immediately raises a potential question about whether the datagram fits within the supported packet size of the underlying data link.

Matching IP datagrams to block size in the core network

The underlying network that is used to connect to other devices can be:

  • local (Ethernet);
  • wireless (Wi-Fi 11);
  • switched;
  • telephone (DSL);
  • fiber optic (FDDI).

Each physical network usually uses own format transmission, which has restrictions on the amount of data in one block. If an IP datagram is too large for the link layer section of a particular network format, we have a problem.

For example, consider FDDI. The maximum data field size in FDDI is approximately 4470 bytes, depending on the use of SNAP (SubNetwork Access Protocol). This means that FDDI can handle IP datagrams up to 4470 bytes. In contrast, Ethernet uses a format that is limited to a packet size of 1500 bytes and will not be able to interoperate with a larger IP datagram.

So, remember that the transmission of a datagram in an internetwork can be carried out through more than one physical line. In order to access a resource on the Internet, we typically send a request through our local router, which then connects to other devices that forward it to the Internet site. Each section in this chain can use its own primary packet size.

The idea of ​​a network layer protocol to implement the concept of " virtual network"is to transfer data between devices, even if they are far from each other. This means that higher levels don't have to worry about details like size limits basic technologies channel. However, someone has to take care of this, which is what IP (Internet Protocol) does.

IP limit: MTU settings for Rostelecom

All IP devices on the Internet must receive information about the quality of the technology used to implement the current level of communication channel. This criterion is Network MTU Rostelecom, which is configured on network equipment user. This term is also sometimes seen as maximum size block for transmission.

Interesting: There are two ways to change the MTU: in the operating system itself or in the router settings. The second one will be optimal, since with its help all devices on your network will be able to obtain information about the required value.

When a device receives a message sent over Internet networks, it looks at its size and then calculates how large the datagram will be after adding the 20 or more bytes required for the IP header. If the total length exceeds Rostelecom MTU for PPPoE connection in specific network, Internet Protocol will split the message into several fragments. So when the host connects TCP level via Ethernet LAN to your local network, he will be able to use the MTU option specified by Rostelecom equipment.

You can find out what MTU Rostelecom has for your type of connection and equipment directly from the provider by calling. The value of this option for most networks in Russia does not exceed 1492 bytes. To figure out best option for your own Internet you can personally, based on the specified value.

To accurately determine the MTU, you need to specify the default value - 1500.

Exists great amount utilities that allow you to do this and not only that. The most common - Internet Tweak 2001 http://www.magellass.com/, NetBoost 99 http://www.download.ru/, iSpeed http://www.hms.com/, MTUSpeed http://www.mjs.u-net.com/, BlazeNET http://www.indeavour.com/html_about_blazenet.htm. If you don't have. opportunity to run one of the above programs, do it manually - using the Windows registry.

In chapter

HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Services\Class \NetTrans\OOOx.

If there is a MaxMTU parameter there, delete it. Next, in the Control Panel, run the utility Net, on the tab Configuration select list item Remote Access Controller and press the button Properties. A dialog box will open Properties: Remote access controller. On the tab Additionally in the parameter group Property select list item IP packet size, and in the parameter group Value - big(Fig. 8.1).

Rice. 8.1. Dialog window Properties: Remote Access Controller

Thus, the MTU becomes equal to 1500. For the changes to take effect, restart the computer.

To check whether packets will be fragmented, you need to establish a connection to the Internet. To do this, you can use the Ping program, which is included in any operating system Windows family.

In it. you need to set the following parameters:

ping -f -1 1500 xxx.xxx.xxx.xxx

where is xxx. xxx. xxx. xxx - IP address of the server being tested.

For MTU testing it is much more convenient to use modern programs With graphical interface. There are a huge number of such programs. For example, IP Tools. First, you need to determine the IP address of the server you are testing to avoid wasting time allotted to the DNS query.

To do this, use the Traceroute command. Click the button Start in the lower left corner of the screen, select the command Execute and in the window that appears, type and website URL. The MS DOS application window will appear. For example, by entering any address, after a while its IP will appear in square brackets. Now use the Ping program. Run it with these parameters

ping -f -I 1500 xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the IP address of the server being tested. The best time to check the MTU for a dial-up connection is at night. Then the load on the communication line is minimal.

If no response is received, the packet is lost. Moreover, because we forbade it to fragment, and the size is too large for the provider’s equipment. Start gradually reducing the package size. For example, instead of an MTU value of 1500, set it to 1480, etc., until a response is received.

Your ISP may use a lower value. For example, 1524, 1152, 1024, 1006, 576, 568, 560, 552, 548, 536, 528, 520, 512.

This experiment confirmed our guess - the Internet provider can use any packet size, up to 1500. If you are not tired of experimenting yet, try downloading a 500 KB file from the same server at different MTU values.

You will likely find that the speed is greater when using larger

packages. Again, this is only if your provider can accept them without fragmenting them. Also, if you ping many of your favorite sites with a non-fragmentable packet, you will see that almost all accept packets of size 1500 just fine.

And what? You may ask: "Where is that recommended MTU of 576?" But, as it turns out, he is almost nowhere to be found. That's why best advice may become - do not follow other people's recommendations, conduct your own research that can give real results.

Indeed, the quality and speed of the Internet is greatly influenced by packet fragmentation, which occurs if a large packet passes through a network that has an MTU less than the length of your packet.

You can, of course, play it safe and choose the most minimum size MTU at which packets will most likely not be fragmented, but this may have an even more detrimental effect on the performance of your system than using large packets. In fact, the main thing is that your MTU does not exceed the MTU of the provider, even if the function is enabled

The PMTU system itself will find a path for your packets on the Network in which they will not be fragmented.

By the way, if you find that your provider has an MTU of 512 or less, then it makes sense to think about changing it - too much slag will be transferred along with your data.

The MTU number represents the maximum transferable data packet that is sent from the server to the equipment. It is used in the Internet connection and directly affects its speed. How does MTU work? To ensure connection transfer is fast and efficient, data is transferred not one byte at a time, but in whole packets. The computer unpacks the package and downloads information, for example, a web page, a game, etc.

Few of them ordinary users wondered what MTU is and why it is indicated in the settings

Why is it worth checking and changing such a parameter? It often happens that a user connects to the Internet, and although the stated connection speed should be high, the browser loads the site or game slowly, or does not want to access some pages at all. At the same time, the Internet does not disappear entirely, but poor loading affects individual sites or applications.

To deal with the problem, it is recommended to change DNS settings. This can be done through the Control Panel. Open the Internet connections section, select your network and view its properties. In them you will find components, among which you should select the TCP/IP Internet protocol and manually enter DNS addresses- 8.8.8.8 and in the second line 8.8.4.4.

If you tried changing the DNS value, but it did not help, you should refer to the data packet size settings. When the provider has one number for this parameter, and your router has another number, then the speed drops and connection is not working well. There is no need to change it on your computer, since latest versions Windows system itself determines the optimal value for network operation.

How do you know what MTU to set on your router?

There are standard values ​​for this parameter for routers. In most cases, the number 1500 is used - it is the base default, used for dynamic and static IP addresses.

For an L2TP connection, the number 1460 is selected, and for PPPoE - 1420. It is worth trying the combination 1476 - it is set by default for 3G networks.

Another option you can use to find out the correct size combination packet transmission for router, call to service center your provider. They will provide you with accurate data, but may not be able to answer your request, so it is worth learning how to determine this number yourself.

This can be done by checking set value MTU on computer and router. If they don't match, that's the reason bad speed connections. To find out the combination on your computer, do the following:

  • Enter in Total Commander PING string-f -l 1472 xxx.xxx.xxx.xxx, where instead of crosses, enter your IP address.
  • If the result is the text “Reply from...”, then the correct MTU number is 1500, as it should be by default. Why 1472? The remaining kilobytes are system ones and are automatically added to this number for a total of 1500.
  • If the text “Packet needs to be fragmented but DF set” appears in response to the command, you need to manually search for the correct value by decreasing the number 1472 by tens until you have the line “Reply from...”. Then to final value you need to add 28 system kilobytes to get the correct number.

Setting up MTU in the router

After figuring out the required combination for maximum transmitted packet data, enter it into the router parameters.

This is done as follows:

  • Go to your router settings. In the browser line, enter the IP address of the equipment, in the window that appears, enter the login and password (if you have not changed them, use the word Admin in both lines).
  • Select the Network section, open the WAN menu.
  • Enter the required number in the MTU Size line, save the changes and reboot the equipment.

IN computer networks the term maximum transmission unit (MTU) means the maximum size of a useful data block of one packet (English payload), which can be transmitted by the protocol without fragmentation. Typically, protocol headers are not included in the MTU, but on some systems, some protocols may include headers. When people talk about MTU they usually mean the link layer protocol. network model OSI.

However, this term can also be applied to other levels:

L1 - media mtu (full L2 frame);

L2 - mtu, hw mtu, system mtu;

L3 - ip mtu (ip header is taken into account), mtu routing;

L4 - tcp mss Non-system: tunnel mtu, vlan mtu, mpls mtu.

The maximum frame size is limited for several reasons:

To reduce retransmission time in the event of packet loss or irreparable corruption. The probability of loss increases as the packet length increases.

So that during half-duplex operation the host does not occupy for a long time channel (interframe gap is also used for this purpose).

The larger the packet sent, the longer the wait for other packets to be sent, especially in serial interfaces. Therefore, a small MTU was relevant in times of slow dial-up connections.

Small size and speed of network buffers for incoming and outgoing packets. However, too large buffers also degrade performance.

The MTU value is determined by the standard of the corresponding protocol, but can be overridden automatically for a specific flow (by the PMTUD protocol) or manually for the desired interface. On some interfaces the default MTU may be set lower than the maximum possible. The MTU value is usually limited below by the minimum allowable frame length.

For a high-performance network, the reasons that caused the initial MTU limits are obsolete. In this regard, a standard for Jumbo frames with an increased MTU was developed for Ethernet.

The host knows MTU value for its own (possibly its neighbors) interface, but minimum value The MTU for all network nodes is usually unknown. Another potential problem is that the protocols are more high level can create packages bigger size, not supported by other network nodes.

Passage of large packets through a network with fragmentation. To overcome these problems, IP supports fragmentation, which allows a datagram to be broken into smaller pieces, each small enough to pass smoothly through the node causing the fragmentation. Packet fragments are marked so that the IP of the target host can reassemble the fragments into the original datagram. The disadvantages of packet fragmentation are speed.

Although fragmentation solves the problem of packet size and MTU mismatch, it significantly reduces performance network devices. In this regard, an alternative technology called Path MTU discovery (RFC 1191) was proposed in 1988. The essence of the technology is that when two hosts connect, the DF (don’t fragment) parameter is set, which prohibits packet fragmentation. This causes a host whose MTU value is less than the packet size to reject the packet and send an ICMP "fragmentation required but disable flag (DF)" message. The sending host reduces the packet size and resends it. This operation continues until the packet is small enough to reach the destination host without fragmentation.

However, this technology also has potential problems. Some routers are configured by administrators to completely block ICMP packets (this is not very smart, but may be the most simple solution several security issues). As a result, if the packet size does not match the MTU value on certain area, the packet is discarded and the sending host cannot obtain the MTU value information and does not resend the packet. Therefore, no connection is established between hosts. The problem was called MTU Discovery Black Hole (RFC 2923), and the protocol was modified to detect such routers.

Since Windows (XP,7,8) automatically selects best MTU(PMTU), in our case we just need to make sure that something other than optimal is not installed for this connection, fixed value. By the way, this is the most optimal value It is quite easy to find out by conducting a simple experiment. Open the cmd.exe console and enter the command in it:

PING -f -l 1472 xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the IP address of your provider’s gateway,

F disables packet fragmentation,

L sets the packet size.

If you receive in response something like “Reply from xxx.xxx.xxx.xxx: bytes=1472 time=144ms TTL=10”, then this will mean that MTU=1500 (28 bytes of the header are not taken into account). If the answer is “Packet needs to be fragmented but DF set”, then decrease the value of 1472 until you get the packet passed - this value plus 28 bytes of the header and will be equal to the required MTU.

The resulting value (+28 header bytes) must be compared with the MTU value used by the system, which can be determined using the command on the same command line:

netsh interface ipv4 show subinterfaces

(This will display the MTU value for ipv4 network interfaces.)

You can change the MTU value in Windows (XP, 7, 8) using the command

(It is advisable to perform the action of changing the settings only experienced user, because incorrect value will affect the operation of the network for the worse!!!):

netsh interface ipv4 set subinterface “ХХХХХХХХ” mtu=1500 store=persistent

Where ХХХХХХХХ is the name of the network interface (Default is “Local Area Connection”, for convenience you can rename it, for example to Lan1 in the folder " Network connections" in the "Control Panel").

Unlike Windows OS, most routers ( Wi-Fi Home routers) use static setting MTU specified in the router settings. The default MTU value is 1500.

The Triolan provider ensures the transmission of Ethernet packets of the maximum usable size, which corresponds to the MTU 1500 setting.

There are providers whose network settings limit the MTU size to values ​​less than 1500. This is often due to the use of additional encapsulation protocols (PPPoE, L2P, etc.). In this case, Windows OS configures the required MTU value using the PMTU protocol, but if problems arise, the settings described above may be required. More often, problems with MTU are associated specifically with routers in which the MTU value is incorrectly configured. For Triolan networks this value is 1500, for other networks it can be determined using command line, as described above.

At the moment when the host must transmit data through the interface, it refers to the maximum payload size for a single packet Maximum Transmission Unit, to determine how much data it can fit in each packet. For example, Ethernet interfaces have a default MTU of 1500 bytes, not including the Ethernet header or trailer. This means that a host that needs to send data over TCP will typically use the first 20 of these 1500 bytes for the IP header, the next 20 for the TCP header, and the remaining 1460 bytes for the payload. Encapsulating data into maximum-size packets like this allows for the most efficient use of bandwidth while minimizing the use of data protocol overhead. Optimal MTU size is the key to effective use network channels data transfer and reducing the load on network equipment.

Unfortunately, not all devices on the Internet have the same maximum MTU size. MTU may vary depending on type physical media or configured encapsulation (such as GRE tunneling or IPsec encryption). When a router decides to forward an IPv4 packet over an interface and determines that the packet size exceeds the interface MTU, the router must split the packet so that it is sent as two (or more) separate parts, each of which does not exceed the MTU size limit of the link between subscribers. Fragmentation is quite expensive, both in router resources and bandwidth usage. New headers must be created and attached to each fragment. In the IPv6 protocol specification, packet fragmentation is completely removed from the router, but this is a topic for another discussion.

Determining the optimal MTU size of a data packet

To use the channel in the most efficient manner, hosts must determine optimal size MTU is the minimum MTU among all nodes on the path between hosts. For example, for two hosts, the path between which consists of 3 routers with different maximum possible sizes packets: 1500, 800 and 1200 bytes, each of the end hosts must accept nai smaller size 800 byte packet to avoid fragmentation.

Do not Fragment and Destination Unreachable, Fragmentation Needed

Packets can travel across networks randomly and it is impossible to calculate in advance all the routes and the maximum packet size for each connection. RFC 1191 specifies the methodology for determining the MTU size. The process by which a host for a particular connection can detect a smaller MTU size than its own supports network interface. Two components are key: the Do not Fragment (DF) bit of the IP header and the subcode of the ICMP Destination Unreachable, Fragmentation Needed message.

Setting the DF bit in an IP packet prevents the router from performing fragmentation when it detects an MTU smaller than the packet size. Instead, the packet is discarded and a message is sent to the sender via ICMP indicating that the packets need to be fragmented. Essentially, the router is indicating that it needs to break the packet into pieces in order to forward it further, but the Don’t Fragment (DF) flag prevents this from happening. RFC 1191 extends the ICMP fragmentation request message to include the MTU size for the current connection.

Now that the maximum packet size for a connection has been detected, the host can cache this value and generate subsequent ones of the appropriate size. Note that discovering the maximum packet size for a particular connection is an ongoing process. In case of use dynamic routing and rebuilding the route between the sender and receiver, the host periodically continues to try to set the DF flag to detect further reduction in packet size. RFC 1191 also allows you to periodically test the ability to increase the maximum packet size for each route, sometimes attempting to transmit a larger packet than the cached one. If the packet is transmitted successfully, the packet size limit is increased.

Calculating the maximum MTU size of a packet using traceroute

You can calculate the maximum packet MTU size for each route through using a tool such as path trace. Is a part Linux package- IPutils. Or a utility written for Windows - mturoute:

I give an example of determining the MTU for a route between two hosts through an encrypted GRE tunnel. We see how the utility consistently selects the maximum packet size:

C:\bin>mturoute.exe 192.168.3.1 * ICMP Fragmentation is not permitted. * * Speed ​​optimization is enabled. * * Maximum payload is 10000 bytes. * - ICMP payload of 1472 bytes is too big. + ICMP payload of 92 bytes succeeded. + ICMP payload of 782 bytes succeeded. + ICMP payload of 1127 bytes succeeded. + ICMP payload of 1299 bytes succeeded. - ICMP payload of 1385 bytes is too big. + ICMP payload of 1342 bytes succeeded. + ICMP payload of 1363 bytes succeeded. + ICMP payload of 1374 bytes succeeded. - ICMP payload of 1379 bytes is too big. + ICMP payload of 1376 bytes succeeded. + ICMP payload of 1377 bytes succeeded. + ICMP payload of 1378 bytes succeeded. Path MTU: 1406 bytes.