Modifying the Registry improves the slow network speed caused by Tcp latency in Windows

Source: Internet
Author: User

Modifying the Registry improves the slow network speed caused by Tcp latency in Windows. TCP is a link-oriented communication protocol. Each sending and receiving action of both parties must be based on the normal communication link. Therefore, TCP provides the default ACK authentication mechanism. The ACK authentication method is related to the operating system. In TCP, data validation is often delayed. When the delay timer does not overflow, generally, the two TCP data correspond to one confirmation. If the delay timer overflows, a confirmation message is sent. Www.2cto.com, but in some systems, TCP data must be sent every time the ACK packet is replied. The following problems may occur: assume that a tcp connection is established between Server A and Client B. At A certain time point, A sends data to B for the first time, and waits for B to reply to the ACK packet after sending the data, B considers that the ACK mark is returned only when the second TCP packet is received. After about ms, the latency timer in B overflows, and B then returns an ACK validation packet with A length of 1 to, therefore, when B receives the data for the second time, it will inexplicably produce a latency of about MS-This latency is not anything else, it is the default sending latency of the ACK Validation Package. When we test our self-developed server-side communication framework, once it is broadcast, at this time, the client in the receiver is likely to cause the above phenomenon due to uneven sending and receiving of both parties-this is not because your server communication framework performance is not up to standard, it is caused by the internal mechanism of TCP. Www.2cto.com, how should we avoid this situation? Here we will introduce the simplest and easiest way to achieve this: Modify the Registry to increase the default sending frequency of the ACK package on the client, that is, to shorten the sending latency of the ACK package: first, click the "Start" menu in the lower-left corner of your computer's screen, open "run", type "regedit" to open your registry, and select the HKEY_LOCAL_MACHINE project to start from the next level, until HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/Tcpip/Parameters/Interfaces, there are many items about your Nic, and they all have names similar to {Parameters, however, the correct one will display network settings in the right window, including your IP address and your server IP address ). If you find the IP address that matches your local IP address, it is the setting of the network card that you connect to the network, the goal of our task is to modify it to increase the sending frequency of the client ACK package. Next, right-click the blank area on the right of the window, choose "New"> "DWORD Value", change it to "TcpAckFrequency", right-click it, and choose "modify ", then fill in "1" in the blank space of "value data" (do not care whether it is hexadecimal or 10hexadecimal). Finally, close the registry, restart the computer, and complete the modification. Supplementary description about TcpAckFrequency: the value of TcpAckFrequency determines the frequency of responding messages sent by TCP/IP in windows, that is, it determines that several packets will be waiting before sending "correct command response; the default value is 2. At this time, the TCP/IP sends a response after receiving two segments, or, if a response is sent when one segment is received, but no other segment is received within 200 milliseconds, if the value is 3, the TCP/IP sends a response after receiving three segments, or send a response when one or two segments are received but no other segments are received within 200 milliseconds, and so on. If you want to shorten the response time by eliminating TCP/IP response latency, set this value to 1. In this case, Windows returns a "correct command response" every time a TCP packet is received ". The valid range of this value is 0 to 255. 0 indicates that the default value is used (2 ). After the Delayed ACK mechanism is adopted, the server usually sends two data packets and the client confirms them again. This will greatly reduce unnecessary ACK data packets and increase the access speed, reduce bandwidth waste. Modification Method: Add a key value to the Registry for modification; HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersInterfacesAdapter GUID Value Name: TcpDelAckTicks (different operating systems have different names) Data Type: REG_DWORD value data: set this value to a value between 0 and 6. By default, the latency ACK timer value is 200 milliseconds. If the TcpDelAckTicks value is set to 0, the delay confirmation is disabled.

Related Article

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: info-contact@alibabacloud.com 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.