none
windows 7 TCP ack frequency.

    Question

  • Hi,
    i observed windows 7 TCP stack (in my PC) always sends TCP ACK message to server(sender) after receiving two segments(1460 byte X 2) even though receiver window size 17520 byte. i feel if we can wait more segments to receive and send ACK can improve data speed. can anyone help me to understand how windows 7 TCP stack behaves.
    regards
    DT

    DT

    Wednesday, July 18, 2012 9:02 AM

All replies

  • Hi,


    Based on my knowledge, this may be related to the flow control. Window size is sliding, therefore, please check the current window size both of the sender and the receiver.


    More information, please refer to Transmission Control Protocol.


    Hope this helps.


    Jeremy Wu

    TechNet Community Support

    Thursday, July 19, 2012 9:09 AM
  • hi,

    This issue happens only with certain brands of  PCs. If all PCs use windows 7 operating system , Can TCP implementation differ from PC vendor to vendor. 

    regards,

    DT


    DT

    Thursday, July 19, 2012 12:09 PM
  • Hi,

    When troubleshooting, i observed this issue happens only with specific brand of computers. if all PCs use windows 7 operating system,can TCP implementation defer from PC vendor to Vendor.

    regards,

    DT


    DT

    Thursday, July 19, 2012 12:12 PM
  • Hi,

    Based on my knowledge, the Windows 7 modifies the Windows size dynamically as the new feature, so we won't suggest you to change the Windows size for this.

    If the issue happens only with specific brand of computers, please try modifying the parameters on the NIC cards to see if there is any changes:

    1. In the run box, input "devmgmt.msc" to open the device manager.

    2. Find the NIC card under the "network adapters".

    3. Right-click the NIC card to choose properties.

    4. Then, click the Advanced Tab.

    5. Disable the Property as below:

    • Large Send Offload(ipv4)
    • Large Send Offloadv2 (ipv4)
    • Large Send Offloadv2(ipv6)
    • Receive Side Scaling
    • TCP/UDP Checksum Offload (ipv4)
    • TCP/UDP Checksum Offload (ipv6)

    Please disable these property on the problematic Pc's NIC cards, then reboot the machine after that.

    Then please check if there is any changes.

    Thanks.

    Best Regards,

    Annie Gu

    Monday, July 23, 2012 7:42 AM
  • hi,

    Thanks for the valuable information. There is no impact on data speed even if i modify above mentioned settings.

    regards,

    DT


    DT

    Wednesday, July 25, 2012 6:30 AM
  • Hi,

     

    Thanks for your reply.

     

    Based on my knowlege, the auto-tuning is different in Windows 7 and was modified dynamically. However, we don't make sure if disabling the auto-tuning can help to resolve the "ack" issue as you said. Please refer to the article below about this new feature in Windows 7:

    http://support.microsoft.com/kb/947239

    http://support.microsoft.com/kb/983528

    To turn off the default auto tuning behavior, (in elevated command prompt) type:
    netsh int tcp set global autotuninglevel=disabled

    After that, it will turn back to the behaviour in Windows XP. Please try this to see if it can improve the performance.

    Besides, as I understand, the purpose of the ticket is to improve the performance for Windows 7. However, it is that the performance will be improved after you see more segment with one ack in the tcp network traffic? I cannot make sure this behaviour can help to improve the perf in Windows 7.

    Previously, I suggest to disable the offload ones in the NIC card is to improve the performance on Windows 7. If that is not helpful, could you please let me know the real impact you have for this ticket? such as slow transmission between two Windows 7 or the other symptoms.

    Thanks.

    Best Regards,

    Annie

    Wednesday, July 25, 2012 9:34 AM
  • hi Annie,

    thanks for the reply.

    let me explain my test scenario. my purpose is the check HTTP single session download speed from a server located in the internet. test PC directly connected gateway router and internet side link capacity is about STM-1. when i check download speed from windows 7 PC ,i could achieve nearly 10Mbps speed from three type of computer brands and one type always limit around 2Mbps. this test carried out with several PCs and and not only a single PC. when i troubleshoot this issue, i can see victim PC always sends one ACK after receiving two segments whereas other PCs behavior is dynamic. they send ACK, say after four segment,five segment etc resulting high speed data transfer. i just want to know how operating system decides ACK message send time.

    1. is it depend on bandwidth X delay product. 

    2. in bandwidth X delay product, how operating system decide bandwidth of the link.

    i feel if operating system let server to send more segments (till maximum receive window) and send ACK will improve ultimate download speed. 

    Thaks

    DT


    DT

    Wednesday, July 25, 2012 2:57 PM
  • hi Anne,

    i feel above issue due to TCP receive window and not related to ACK frequency. Do you have any idea on how windows 7 decide receive window size. 

    DT


    DT

    Thursday, July 26, 2012 7:15 AM
  • Hi,

     

    Thanks for the reply.

    Based on my experience, since windows Vista and windows 7, TCP receive auto-tuning is introduced in order to improve the TCP performance. With autotuning enabled, TCP will automatically enable the TCP window scaling option and select the scaling factor according to the auto-tuning level.  Below table shows the mapping between the auto-tuning level and scaling factor.

    disabled = scale factor 0

    highlyrestricted = scale factor 2

    restricted = scale factor 4

    normal = scale factor 8

    experimental = scale factor 14

    When the receive window auto-tuning feature is enabled, however, older routers, older firewalls, and older operating systems that are incompatible with the receive window auto-tuning feature as these older devices do not comply with the RFC 1323 standard. TCP heuristics or auto-tuning diagnostics feature determines whether a faulty device is in the path from your computer. furthermore with heuristics turned on, the window scaling factor for the outbound connection may vary based on the connection state. WSD will actively monitor the connection state whereby it can work out the appropriate scaling factor for the connection. Generally it will create a profile for each connection with specific destination and port, then record the state of each connection toward the same destination, for example, if the previous connection that has window scaling option presented ends up with being reset by the remote peer, WSD will log the result and make the TCP stack disable the window scaling option when another attempt to the same destination is made subsequently and then reacts according to the result. The symptom in the trace is one example of above behavior as the TCP connection to the same designation was reset in the past. you can also recreate the same symptom by following way:

    1. On windows 7, telnet remote server port 445 or access the remote UNC path. You will notice the initial scaling factor is set to 8 (just clarify the default behavior a bit, with heuristics turned on and auto-receive level set to normal, WSD will first try out outbound connection with default scaling factor 8. If WSD detects the scaling factor is too aggressive for the destination later on, it will reduce the factor to 2. Certainly HTTP by default is not subject to above behavior).

    2. Restart the server service on the remote server and it will essentially reset the connection established and you can find the TCP reset in the sniff trace.

    3. On windows 7, try to connect to the remote server over port 445 again. you will find the TCP window scaling factor is disabled as WSD tries to make an attempt without scaling option and see if it makes a difference.

    Actually WSD will take into various combinations of scenarios like bandwidth/remote peer state/local connection state etc. to work out the best  scaling option value. it is hard for me to provide more details of the algorithm as it is a proprietary implementation in windows as of now. But the effect of turning on TCP heuristics is you may see different scaling factor applied even for the same destination indeed.  turning off heuristics will ensure windows always uses the default scaling factor for the connection   regardless of the destination state.

    Windows will handle HTTP connection on Vista or Windows 7 in different way from other types of connection,  HTTP connection is not subject to TCP receive window auto tuning and windows will use the highly restricted window scaling factor i.e. 2 for the HTTP connection as long as application calls WinINET or WinHTTP API. We can turn off this behavior by editing TCPautotuning registry.

     

    Test:

    With above considered, please follow below ways to make the windows 7 client use the window scaling factor 8 for every TCP connection:

    1. Run command, netsh int tcp show global and verify Receive Window Auto-Tuning level is set to normal

    2. Edit registry to turn off window scaling heuristics

    Value path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters

    Value type: DWORD

    Value name: EnableWsd

    Value data: 0

    3. Turn on the auto-tuning featuring for HTTP connection.

    Value path:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp

    Value type: DWORD

    Value name: TcpAutotuning

    Value data: 1

    4. Reboot the machine to take effect.

    5. It is expected TCP window scaling factor is set to 8 for every TCP connection after making above changes.

    After that, please let me know the result.

    Thanks.

    Annie

    Thursday, July 26, 2012 9:42 AM
  • Hi Annie,

    even through you have mentioned . i can see windows 7 client uses receive window size 64K with scaling factor 4. this results higher download speed. could you please help me to understand this.

    "Windows will handle HTTP connection on Vista or Windows 7 in different way from other types of connection,  HTTP connection is not subject to TCP receive window auto tuning and windows will use the highly restricted window scaling factor i.e. 2 for the HTTP connection as long as application calls WinINET or WinHTTP API."


    DT

    Thursday, July 26, 2012 3:56 PM
  • Hi,

    i tried what u request. i could not find window scaling factor set to 8. i tried 

    1. my PC LAN connection

    2. through mobile broadband connection.

    in both cases window scaling factor not always 8. please find bellow output

    TCP Global Parameters
    ----------------------------------------------
    Receive-Side Scaling State          : enabled
    Chimney Offload State               : automatic
    NetDMA State                        : disabled
    Direct Cache Acess (DCA)            : disabled
    Receive Window Auto-Tuning Level    : normal
    Add-On Congestion Control Provider  : none
    ECN Capability                      : disabled
    RFC 1323 Timestamps                 : disabled


    DT

    Thursday, July 26, 2012 4:54 PM
  • HI,

    Sorry for the late response due to I was out of office.

    With above considered, please follow below ways mentioned:

    1. Run command, input ‘netsh int tcp reset’ and verify Receive Window Auto-Tuning level is set to normal(regardless of what you’ve done on your laptop).
      1. Download the hotfix from http://support.microsoft.com/default.aspx?scid=kb;EN-US;983528 and install it on your laptop.
      2. You may have to restart your computer after you apply this hotfix.

    If you follow the steps above and it dosen’t work, please try to follow the steps manually below:

    1. Run command, input ‘netsh int tcp show global’ and verify Receive Window Auto-Tuning level is set to normal
    2. Edit registry to turn off window scaling heuristics

    Value path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters

    Value type: DWORD

    Value name: EnableWsd

    Value data: 0

    1. Turn on the auto-tuning featuring for HTTP connection.

    Value path:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp

    Value type: DWORD

    Value name: TcpAutotuning

    Value data: 1

    1. Reboot the machine to take effect.
    2. It is expected TCP window scaling factor is set to 8 for every TCP connection after making above changes.

    Note that in order to optimize TCP throughput, the TCP receive window for a connection should be set to a value that reflects both the BDP of the connection's transmission path and the application retrieve rate.

    Thanks.

    Best Regards,

    Annie gu

    Tuesday, July 31, 2012 9:30 AM
  • Hi Annie,

    I'm running Windows 7 and I'm getting a TCP window scaling factor of 2 for every TCP connection made by Internet Explorer (and Firefox and Chrome). The window scaling is set to 8 when I make a TCP connection using SSH. So it sounds like exactly the problem you describe, HTTP connections are setting window scaling to 2 because of calls to WinINET or WinHTTP. I have a fibre internet connection and as I'm located in New Zealand, the BDP is huge, ping to most servers is usually >220ms.

    I've got the Receive Window Auto-Tuning level set to normal, have disabled Window Scaling Heuristics, and have applied the four TcpAutotuning registry entries. The result is the same, the window scaling factor is still 2 for all the browsers.

    I've also tried every other permitted value for Receive Window Auto-Tuning level and also tried using TcpAutoTuning (capital T in Tuning) as this was referenced in another KB article. In every case the window scaling factor was 2, or worse, 0, in the case where window scaling was set to disabled. I've also tried everything else I could find and nothing has helped.

    What should I do to make TCP window scaling factor be set to 8 for every TCP connection?

    Thanks,

    Daniel

    Monday, June 24, 2013 2:43 AM
  • hi Annie,I want to find out the default TCP ACK frequency of Windows7. As we know that it is set to 2 by default in windows xp, which means two TCP data packet is ACKed by one ACK packet in a TCP connection. On windows xp the "TcpAckFrequency" value can change the actions of tcp/ip stack , is it work well on win7?

    thanks a lot

    Tuesday, November 05, 2013 3:28 AM