Winsock send buffer size (windows 7)
Hi, I just upgraded to Windows 7 x64 Ultimate and got a network problem with application (Flash Media Encoder) which sends video (RTMP data) over TCP/IP to the server with high latency (~120ms). This application worked flawlessly before OS upgrade but now it drops around 10% of video frames because of network delays. Windows 7 sends data of this application in ~16K chunks while Windows XP uses upto 1MB chunks. So I think its some problem (or feature?) with default send buffer or flush interval of Winsock in Seven. What I need is some registry key or other way to set default send buffer size of Winsock. Thank you in advance for any help.
September 24th, 2010 3:02am

Hi, based on my search, there is a way to configure the winsock default send and receive buffer size: Configure the winsock default send- and receive-buffer size Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information. Hope it works. Regards, Leo HuangPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
September 27th, 2010 1:07am

Hi, Sorry, forgot to mention that I tried this key before asking here. It doesn't seem to work in Windows 7... Or maybe I wrong and this is not buffer problem. Maybe its multithreading behaviour of new winsock? Here is tcpdump ouput. Windows XP sends data in this way (bulk send->bunch of ACKs receive->bulk send): 05:07:12.042968 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 380362:381822(1460) ack 0 win 64833 05:07:12.043124 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 381822:383282(1460) ack 0 win 64833 05:07:12.043266 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 383282:384742(1460) ack 0 win 64833 05:07:12.044837 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 384742:386202(1460) ack 0 win 64833 05:07:12.045030 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 365762:367222(1460) ack 0 win 64833 05:07:12.045191 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 386202:387662(1460) ack 0 win 64833 05:07:12.045341 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 387662:389122(1460) ack 0 win 64833 05:07:12.045876 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 389122:390582(1460) ack 0 win 64833 05:07:12.046487 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 390582:392042(1460) ack 0 win 64833 05:07:12.047543 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 392042:393502(1460) ack 0 win 64833 05:07:12.236643 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 373062 win 65535 05:07:12.237001 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 373062 win 65535 <nop,nop,sack 1 {371602:373062}> 05:07:12.237082 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 374522 win 65535 05:07:12.237143 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 374522 win 65535 <nop,nop,sack 1 {373062:374522}> 05:07:12.237197 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 375982 win 65535 05:07:12.237943 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 375982 win 65535 <nop,nop,sack 1 {374522:375982}> 05:07:12.238027 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 377442 win 65535 05:07:12.238087 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 377442 win 65535 <nop,nop,sack 1 {375982:377442}> 05:07:12.238143 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 377442 win 65535 <nop,nop,sack 1 {358462:359922}> 05:07:12.238197 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 377442 win 65535 <nop,nop,sack 1 {358462:359922}> 05:07:12.238249 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 378902 win 65535 05:07:12.238303 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 378902 win 65535 <nop,nop,sack 1 {377442:378902}> 05:07:12.239485 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 380362 win 65535 05:07:12.239572 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 380362 win 65535 <nop,nop,sack 1 {378902:380362}> 05:07:12.239634 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 381822 win 65535 05:07:12.239688 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 381822 win 65535 <nop,nop,sack 1 {380362:381822}> 05:07:12.240202 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 383282 win 65535 05:07:12.240287 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 383282 win 65535 <nop,nop,sack 1 {381822:383282}> 05:07:12.240348 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 384742 win 65535 05:07:12.240405 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 384742 win 65535 <nop,nop,sack 1 {383282:384742}> 05:07:12.241667 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 386202 win 65535 05:07:12.241729 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 386202 win 65535 <nop,nop,sack 1 {384742:386202}> 05:07:12.241786 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 386202 win 65535 <nop,nop,sack 1 {365762:367222}> 05:07:12.241842 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 386202 win 65535 <nop,nop,sack 1 {365762:367222}> 05:07:12.244430 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 387662 win 65535 05:07:12.244510 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 387662 win 65535 <nop,nop,sack 1 {386202:387662}> 05:07:12.244566 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 389122 win 65535 05:07:12.244620 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 389122 win 65535 <nop,nop,sack 1 {387662:389122}> 05:07:12.244675 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 390582 win 65535 05:07:12.244730 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 390582 win 65535 <nop,nop,sack 1 {389122:390582}> 05:07:12.244781 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 392042 win 65535 05:07:12.244833 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 392042 win 65535 <nop,nop,sack 1 {390582:392042}> 05:07:12.246144 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 393502 win 65535 05:07:12.246226 IP live5.justin.tv.1935 > 172.30.5.208.4782: . ack 393502 win 65535 <nop,nop,sack 1 {392042:393502}> 05:07:12.260913 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 393502:394962(1460) ack 0 win 64833 05:07:12.261618 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 394962:396422(1460) ack 0 win 64833 05:07:12.262279 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 396422:397882(1460) ack 0 win 64833 05:07:12.262984 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 397882:399342(1460) ack 0 win 64833 05:07:12.263448 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 377442:378902(1460) ack 0 win 64833 05:07:12.264468 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 399342:400802(1460) ack 0 win 64833 05:07:12.265182 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 400802:402262(1460) ack 0 win 64833 05:07:12.265770 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 402262:403722(1460) ack 0 win 64833 05:07:12.269093 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 403722:405182(1460) ack 0 win 64833 05:07:12.269283 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 405182:406642(1460) ack 0 win 64833 05:07:12.269435 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 406642:408102(1460) ack 0 win 64833 05:07:12.269581 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 408102:409562(1460) ack 0 win 64833 05:07:12.269719 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 386202:386436(234) ack 0 win 64833 05:07:12.270644 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 409562:411022(1460) ack 0 win 64833 05:07:12.270835 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 411022:412482(1460) ack 0 win 64833 05:07:12.271435 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 412482:413942(1460) ack 0 win 64833 05:07:12.272293 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 413942:415402(1460) ack 0 win 64833 05:07:12.272749 IP 172.30.5.208.4782 > live5.justin.tv.1935: P 415402:416862(1460) ack 0 win 64833 05:07:12.273164 IP 172.30.5.208.4782 > live5.justin.tv.1935: . 416862:418322(1460) ack 0 win 64833 While Windows 7 does it in this way (outgoing packets and ACKs are messed): 05:16:29.167181 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 508530:509990(1460) ack 16 win 63522 05:16:29.168400 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 489691 win 65535 05:16:29.168438 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 489691 win 65535 <nop,nop,sack 1 {488231:489691}> 05:16:29.169208 IP 172.30.5.208.50715 > live4.justin.tv.1935: P 509990:511450(1460) ack 16 win 63522 05:16:29.169385 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 491151 win 65535 05:16:29.169425 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 491151 win 65535 <nop,nop,sack 1 {489691:491151}> 05:16:29.170266 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 511450:512910(1460) ack 16 win 63522 05:16:29.170103 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 492611 win 65535 05:16:29.170621 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 492611 win 65535 <nop,nop,sack 1 {491151:492611}> 05:16:29.170691 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 494071 win 65535 05:16:29.170716 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 494071 win 65535 <nop,nop,sack 1 {492611:494071}> 05:16:29.170742 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 495390 win 65535 05:16:29.170768 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 495390 win 65535 <nop,nop,sack 1 {494071:495390}> 05:16:29.172110 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 512910:514370(1460) ack 16 win 63522 05:16:29.171767 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 496850 win 65535 05:16:29.171799 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 496850 win 65535 <nop,nop,sack 1 {495390:496850}> 05:16:29.171825 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 498310 win 65535 05:16:29.171852 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 498310 win 65535 <nop,nop,sack 1 {496850:498310}> 05:16:29.173037 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 514370:515830(1460) ack 16 win 63522 05:16:29.171938 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 499770 win 65535 05:16:29.171964 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 499770 win 65535 <nop,nop,sack 1 {498310:499770}> 05:16:29.174063 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 515830:517290(1460) ack 16 win 63522 05:16:29.173407 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 501230 win 65535 05:16:29.173437 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 501230 win 65535 <nop,nop,sack 1 {499770:501230}> 05:16:29.174636 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 517290:518750(1460) ack 16 win 63522 05:16:29.174873 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 518750:520210(1460) ack 16 win 63522 05:16:29.175346 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 520210:521670(1460) ack 16 win 63522 05:16:29.175602 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 521670:523130(1460) ack 16 win 63522 05:16:29.175842 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 523130:524590(1460) ack 16 win 63522 05:16:29.355080 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 502690 win 65535 05:16:29.355333 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 502690 win 65535 <nop,nop,sack 1 {501230:502690}> 05:16:29.355828 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 524590:526050(1460) ack 16 win 63522 05:16:29.358799 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 504150 win 65535 05:16:29.359048 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 504150 win 65535 <nop,nop,sack 1 {502690:504150}> 05:16:29.359515 IP 172.30.5.208.50715 > live4.justin.tv.1935: P 526050:527510(1460) ack 16 win 63522 05:16:29.361694 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 505610 win 65535 05:16:29.361951 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 505610 win 65535 <nop,nop,sack 1 {504150:505610}> 05:16:29.362431 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 527510:528970(1460) ack 16 win 63522 05:16:29.362592 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 507070 win 65535 05:16:29.362629 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 507070 win 65535 <nop,nop,sack 1 {505610:507070}> 05:16:29.363363 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 528970:530430(1460) ack 16 win 63522 05:16:29.363522 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 508530 win 65535 05:16:29.363562 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 508530 win 65535 <nop,nop,sack 1 {507070:508530}> 05:16:29.363979 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 509990 win 65535 05:16:29.364020 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 509990 win 65535 <nop,nop,sack 1 {508530:509990}> 05:16:29.364676 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 530430:531890(1460) ack 16 win 63522 05:16:29.365177 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 531890:533350(1460) ack 16 win 63522 05:16:29.365839 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 511450 win 65535 05:16:29.366146 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 511450 win 65535 <nop,nop,sack 1 {509990:511450}> 05:16:29.366645 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 533350:534810(1460) ack 16 win 63522 05:16:29.366982 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 512910 win 65535 05:16:29.367021 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 512910 win 65535 <nop,nop,sack 1 {511450:512910}> 05:16:29.367759 IP 172.30.5.208.50715 > live4.justin.tv.1935: . 534810:536270(1460) ack 16 win 63522 05:16:29.368594 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 514370 win 65535 05:16:29.368895 IP live4.justin.tv.1935 > 172.30.5.208.50715: . ack 514370 win 65535 <nop,nop,sack 1 {512910:514370}>
September 27th, 2010 2:21am

Looks like afd.sys of windows 7 uses new registry key named HKLM\SYSTEM\CurrentControlSet\Services\AFD\Parameters\DynamicSendBufferDisable (DWORD) Setting it to zero forces winsock to use larger buffers.. Vista's afd.sys doesn't use this key btw.
Free Windows Admin Tool Kit Click here and download it now
September 29th, 2010 7:49am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics