Problems with data data in a TCP packet

Source: Internet
Author: User

The largest data in a TCP packet 2008-03-10 18:54

In Ethernet, the maximum Transmission Unit MTU is 1500 bytes, in one IP packet, the 20 bytes of the IP header are stripped, the maximum data length that can be transmitted is 1480 bytes. In TCP packets, 20 TCP headers are removed, and the maximum data segment that can be transmitted is 1460 bytes. Therefore, when the data exceeds the maximum data length, the data will be fragmented, and in the IP header you will see multiple slices in transit, but the identification numbers are the same, indicating that the same packet.

In the IP layer, there would have been a field to identify the total length of IP packets, which is 16bit, or 65536 bytes. But in fact, in different network protocols, it is not necessarily possible to achieve.

Enter the name "MTU" 2010-03-18 21:58 | (Category: Default category)

Intranet needs to look at the gateway, the specific way is as follows:
Modify MTU
1, under what circumstances need to change the MTU?
If your dynamic domain site cannot be visited normally, it is difficult to connect, and the connection is very slow, please try to set Directsend to "always off". If you have a normal visit after closing, you will need to change the MTU. If your site is working properly, just download slowly, you don't have to change the MTU. Please skip this section.
2, what is the MTU?
The MTU is an abbreviation for the maximum transmission unit. It means the largest packet transmitted over the network. The unit of the MTU is bytes. The MTU of most network equipment is 1500. If the MTU of the native is larger than the MTU of the gateway, the large packets are removed and sent, which can cause a lot of packet fragmentation, increased packet loss rate, and decreased network speed. If you set the MTU of this machine to be smaller or identical than the MTU of the gateway, you can reduce the packet loss.
3, how to detect the MTU of the gateway?
In this machine open DOS window, execute: ping-f-l 1472 where is the gateway IP address, 1472 is the length of the packet, note that the above parameter is "-l" (lowercase L) instead of "-1". If can ping pass, performance packet does not need unpacking, can send out through net Guan Fa. If rendered: Packet needs to is fragmented but DF set. The performance packet needs to be detached and sent. At this point, reduce the packet length, and then execute the ping command above. Try a few more times from 1400 to 1472 to find the right packet length. The value of the MTU is obtained by adding the packet length to the packet header by 28 bytes. If the MTU value of the gateway is detected to be 1500, no changes are required. If the gateway has a firewall ping, you can try to set the MTU to 1400 directly.
4. How to modify the MTU of this machine?
The amendments are as follows:
(1), run regedit
(2), read to: hkey_local_machine/system/currentcontrolset/services/tcpip/parameters/inte***ces
(3), inte***ces have more than one subkey, each subkey corresponds to a network card. Please select the network card as follows:
(a) Affirm the IP of the network card or dial-up connection used to connect to the Internet, such as;
(b) Click on the subkey on Inte***ces to view the IPAddress item in the list of key values;
(c) If the key value of the IPAddress is the same as the IP in (a), that is, the subkey is the NIC to be found.
(4), enter the subkey, right-click in the right window, select "New", "Double-byte value", enter the name "MTU", press ENTER. Then double-click "MTU" with the mouse and pop up the Modify window:
Fill in the value of the MTU. Please set the base to decimal before filling. After Setup, the ability to restart the machine will take effect.

Q: The LAN server obtains the IP address provided by the local ISP at, take the Windows 98 operating system. How can I change the MTU value of the network to optimize the setup consequences?

Answer: You can refer to the following ways

First, after dialing the internet, open the MS-DOS window and type "ping-f-l 1464" command line. Among them, express query, 1464 is to try to enter the MTU value, may have to start testing from 1500 and try multiple times. If the results of the run show "Request Timed Out" or "Packet needs to is fragmented but DF set." Information, then you need to drop the MTU value again, and try again until the information is no longer present. Note The MTU value at this point and then add 28 to get the best MTU for the right use. The maximum value obtained here is 1464, plus 28 is 1492.

The second step is to open the Registry Editor and find the [Hkey_local_ machine//system//current controlset//services//class//nettrans//0000] branch.

The third step is to create a new sub-key of the string type named "Maxmtu" and set its value to the best MTU value as measured.

Fourth step, open the [hkey_local_machine//system//currentcontrolset//services//class//net//000x//ndi//params//ip MTU//enum] branch. There are 4 options available.

Fifth, right-click in the right-hand side of the registry, select "New" → "string value" and set its value to the best MTU of the test, then rename the item to "active", then delete the original items here.

Sixth step, open the [hkey_local_machine//system//currentcontrolset//services//class//net//0000] branch.

Seventh, right-click Ipmtu and select the Fix shortcut menu item to change its value to the best MTU value.

Eighth step, open the [hkey_local_machine//system//currentcontrolset//services//class//net//0000//ndi//params//IPMTU] branch, Corrects its value to the optimal MTU value.
Nineth Step, exit the registry and restart the system for the correction to take effect.

Tip: What is an MTU?

From the beginning of the Windows 95 system, the MTU in TCP/IP configuration options (that is, maximum transmission unit, or "Maximum Transmission unit") is configured for the LAN, but is not optimized for broadband access. Cable Modem Convergence MTU Scale setting is 1500, but there are differences between the various DSLs, such as ADSL pppoe=1492 mtu,adsl STATIC ip=1500 mtu,cable=1500.

The default MTU size for negotiated PCs is 1500 bytes

Problems with data data in a TCP packet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.