???? ID: 823764 - ????? ???????: 05 ?????? 2010 - ??????: 2.0

???? ??????????? ???? ?? ?? ?? ?? Windows ??????? API ????????? ?? ????? ?? ?? TCP ????? ?? ??? ???? ?? ?????????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

?????

?? ?? Windows ??????? API ?? ????? ???? ?? ?? ???? ????????? ?? ????? ???, ?? ????? ?? ???? ???? ??????????? ?? ?? ?? TCP ????? ?? ??? ???? ?? ??????????

??? ?? ???? ??????? sniffer ???? Microsoft ??????? ?????? ?? ??? ?? ??????? ????? ???? ?? TCP ????? ????? ?? ?? ?? TCP ACK ??????? acknowledgement ????? (?? ???? ??????? ACK ?????) ??? ?? TCP ???? ?? ?????? ??? TCP ??? ????? segment. ???????? ??? ??, Windows ???????? ???????? ?? ??? ?? ????? ?? ??? ??? ?? 200 ????????? (ms)? ???? ?? 64 ???????? (KB) ?? ????? ?? ??? ??? ??????? ???? ?????? ????? ???? ?? ???? ????? ??:
Client->Server 1460 bytes
Client->Server 1460 bytes
Server->Client ACK
Client->Server 1460 bytes
Client->Server 1460 bytes
Server->Client ACK
....
Client->Server 1460 bytes
Client->Server 1460 bytes
Server->Client ACK-PUSH
Client->Server 1296 bytes
-> delayed ACK 200 ms


????

Windows ??????? API ?? afd.sys ?? architectural ??????? ?? ???? ?? ?????? ???? ??? ?? ?????? ???? ?? ??? ????? ????????? ???? ???:
  • Windows ??????? ????????? ???-???????? ????? ?? ????? ???? ???
  • ???? ??????????? ??WSASend??? whole ?????????? ????? ????? ???? ???? ???

    ?????? ?? ???, ????????? Windows ??????? ?????setsockopt??????? ????? ????????? ???? ?? ??? ?????? ???? ?? ????? 32 KB ???? ????? ?? ????? ??????? routines:
    setsockopt( sock, SOL_SOCKET, 32768, (char *) &val, sizeof( int ) );
    ??? ???, ????????? ???? ?? ????? ??, ?? ?? issues ?????????? ?? ????WSASend??? ?? ????? ?? 64 KB ?? ????? ???????? ???? ?????:
    send(socket, pWrBuffer, 65536, 0);
    ?? ???????? ???, ???????? ??? ????????? ?????? ??????????? ?? 64 KB ?? ???, ????????? ???? ??SOCKET_ERROR?????? ??? ??? ?????????? 32-KB ????? ???? ?? ???? ??? ?? ??? ??? ??? ?? ???? ?? ??? ???WSAGetLastError?????? ?? ???, ????????? ???????WSAEWOULDBLOCK?????? ???. ??????? ????????? Windows ????? ?? ????? ??????? ?????????? ????? ?? ?????? ?? ???? ???? ?? ??? ??? ?? ???????? ???,??? ?????????? ????? ????? ????? ?? ??? ??? ??????? ???? ?? ??????? ??? TCP ACK ??? ??????? ???? ??? ???????? Windows ??????? ???, ?? ?? ???? ?? 200 ms ???? ????? acknowledgement ?????????? ?? ?????
  • ?????? TCP ????? acknowledges ??? TCP ??? ?? ???? ??????? ??? ??? ??? ?? ??? ????? TCP ??? ?? ????? ???

????? ?????????

?? ?????? ?? ????? ??? ???? ?? ??? ????? ??????? ??? ?? ???? ?? ???? ????:

???? 1: ???????? ????? ?? ????? ????

?? ?????? ???? ???-???????? ????? ?? ???? ??? ?? ?? ??? ????? ????? ?? ????? ????, ?? ?????? ??????? ???? ???? ??????? afd.sys ??????? ????? ???? differently. ???????????? ????? ?? ???-???????? ????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ??????????? SDK ?? ???????? ??????

???? 2: ????? ????? ????? ???? ???? ????????? ????? ???? ???? ?? ??? ??

????? ????? ???? ?? ??????? ???? ?? ??? Windows ????? ?? ????? ????getsockopt??????? ????? ????? ???? ???? (SO_SNDBUF) ?? ??? ????? ?? ??? ?????, ?? ???? ??? ?? ????? ????setsockopt?????? ????? ??? ???? ?? ??? ????? ???? ???? ??? ?? ?? ?????? ?? ???, SO_SNDBUF ??? ?? ?? ?? 1 ???? ????????? ????? ???? ???? ?? ???? ???? ?????? ???

??????? ???????????? ??WSASend???? ??? ???? ?? ?? ?? 1 ???? SO_SNDBUF ??? ?? ?? ????????? ???? ?? ??? ??? ????? ?????? ?????? ??? "????" ??? ??? ?? ???? ??, ?? ??????? ?? ???setsockopt??? ???? ?? ??? ????? ???
setsockopt( sock, SOL_SOCKET, 65537, (char *) &val, sizeof( int ) );
?? ??????? ?? ??????????? ???? ?? ??? ????? ???:
send(socket, pWrBuffer, 32767, 0);
?? ?? ????? ?? ???? ?? ?????? ?? ????? ?? ????

???? 3: TCP ????? ?? TCP/IP ???????? ??????? ????

???????????? ???, ????, ?? ????? ?? ????????? ?? ??????? ???? ?? ??? ????? ????? ??? ???? ???????, ??? ?? ????????? ?? ??? ??? ?? ??????? ???? ??? ?? ????? ???????? ??????? ?? ???? ???.. ?????, ????????? ???? ?? ?? ?? ????? ?? ??????????? ???? ???? ???.. ?????? ??????? ?? ???, ????????? ?? ??????? ???? ?? ???? ???? ??? ?? ???.. ???, ??? ??? ?????? ??????? ???? ?? ?? ?? ????????? ?? ???????????? ?? ???? ???.. ????????? ?? ??? ?? ???? ?? ???????????? ???? ?? ????? ?? ???? ??? ???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
322756  (http://support.microsoft.com/kb/322756/ ) ??? ?? ???? ?? Windows ??? ????????? ?? ???????????? ???? ????


??? TCP ????? ?? ????? acknowledge ???? ?? ??? TCP ????? ?? TCP/IP ???????? ?? ??????? ????? ?? ?????? ???? ????? ???? ?? ??? ??????? ??????? ???? ?? ?? ???? ?? ????????? ??????? ????????? ???? ?? ????, ?? ??????? ??? ??? ????? ???????? ???? ?????? TCP ????? ???? Windows-?????? ????? ?? ???? ??, ?? ??? ???? ?????? ????? ?? ????????? ?? ??????? ???? ????? ???? ???????? ???????? ?? ??? ??????? acknowledgement ????? ?? ????????? ???? ?? ??? ???? ???? ?? ???? ??? ??????? ?? ??? ???????? ?????? ?? ???????? ??????

???? ????? ?? Windows 2000 ??? ???? ??, ?? ????? ????? ?? ???? ????:
  1. ????????? ?????? ???? ???? (Regedit.exe)..
  2. ????? ????????? ??????? ?? ????? ????? ????::
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<interface guid=""></interface>
  3. ????? ?????????????? ??,??? ??????, ?? ???? ??? ????? ????????? ??? ?????:

    ??? ???::TcpDelAckTicks
    ???? ??????::REG_DWORD
    ??? ????:0
  4. ????????? ?????? ?? ???? ??????..
  5. ?????? ??? ???? ?? ??? ?? ???????? ???? ?? ??? Windows ?? ???????? ?????
Windows XP ????? ?? ?? ???? ????? ?? Windows Server 2003, ?? ????? ????? ?? ???? ????:
  1. ????????? ?????? ?? ??????? ????..
  2. ????? ????????? ??????? ?? ????? ????? ????::
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<interface guid=""></interface>
  3. ????? ?????????????? ??,????? ????-????? ????, ?? ???? ???DWORD ???.
  4. ??? ??? ???TcpAckFrequency, ?? ?? ??? 1 ????? ?????
  5. ????????? ?????? ?? ???? ??????..
  6. ?????? ??? ???? ?? ??? ?? ???????? ???? ?? ??? Windows ?? ???????? ?????

???? 4: ???-???????? ????? ?? ??? afd.sys ??? buffering ??????? ??????? ????

???????????? ???, ????, ?? ????? ?? ????????? ?? ??????? ???? ?? ??? ????? ????? ??? ???? ???????, ??? ?? ????????? ?? ??? ??? ?? ??????? ???? ??? ?? ????? ???????? ??????? ?? ???? ???.. ?????, ????????? ???? ?? ?? ?? ????? ?? ??????????? ???? ???? ???.. ?????? ??????? ?? ???, ????????? ?? ??????? ???? ?? ???? ???? ??? ?? ???.. ???, ??? ??? ?????? ??????? ???? ?? ?? ?? ????????? ?? ???????????? ?? ???? ???.. ????????? ?? ??? ?? ???? ?? ???????????? ???? ?? ????? ?? ???? ??? ???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
322756  (http://support.microsoft.com/kb/322756/ ) ??? ?? ???? ?? Windows ??? ????????? ?? ???????????? ???? ????


???:?? ????????? ????? ???? Windows Server 2003 ?????? ??? 1 ?? ???? ??? ?????? ??? ?? ??? ?? ??? ?????? ???
  1. ????? ????,?????????????:Regedit.exe?? ????-????? ????, ?? ???? ???OK.
  2. ????? ????????? ??????? ?? ????? ????? ????::
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters
  3. ????? ?????????????? ??,????? ????-????? ????, ?? ???? ???DWORD ???.
  4. ??? ??? ???NonBlockingSendSpecialBuffering, ?? ?? ??? 1 ????? ?????
  5. ????????? ?????? ?? ???? ????..
  6. ?????? ??? ???? ?? ??? ?? ???????? ???? ?? ??? Windows ?? ???????? ?????

??????

Microsoft ?? ?????? ?? ?? ?? ?? ?? Microsoft ???????? ??? ?? ?????? ?? ?? "???? ???? ???? ???" ?????? ???????? ???..

??????

328890  (http://support.microsoft.com/kb/328890/ ) Windows XP ?? Windows Server 2003 ??? TCP Acknowledgment (ACK) ??????? ?? ????????? ???? ?? ??? ?? ????????? ?????????

???? ???? ???? ??:
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Server
  • Windows Server 2008 Datacenter without Hyper-V
  • Windows Server 2008 Enterprise without Hyper-V
  • Windows Server 2008 for Itanium-Based Systems
  • Windows Server 2008 Standard without Hyper-V
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Standard
  • Windows Web Server 2008
??????: 
kbprb kbmt KB823764 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:823764  (http://support.microsoft.com/kb/823764/en-us/ )