View Single Post
Old 03-05-2003, 03:24 PM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

I've noticed the same issue in winsock. Sending buffer larger than X to system Y with one send() call may cause noticable performance decrease (where system Y is running operating system made by microsoft.. some of my users have suggested that send size should be limited to RWIN size - tcp header size... but again, you can have no idea what receivers RWIN is, if he has 'tweaked' it.. [god bless those lamers who are ruining application compatability with their tweaks, and then blaming developers])

The TCP Receive Window size is the amount of receive data (in bytes) that can be buffered at one time on a connection. The sending host can send only that amount of data before waiting for an acknowledgment and window update from the receiving host. Matching the receive window to even increments of the MSS increases the percentage of full-sized TCP segments utilized during bulk data transmission. MSS is the MaxMTU - 40 bytes for TCP and IP headers.

My assumption is that when sending from winsock to winsock, send() is trying to pass too large chunk of data in one window. So when you're sending 64kb and RWIN size on receiver is 8KB, 56kbytes will be rejected. On 100mbit network this means that your max speed will be capped to 8/64*100mbits = 12,5mbits = 1560kb/s. However TCP also reduces send speed temporarily when it receives error => your speeds will be much less than 1560kb/s.

Possible solutions: dump the windows, sue microsoft, kill tweakers, kill yourself, set your rwin to 64kbytes.
darkone is offline