[e2e] Need help: setting winsock receive low watermark while using completion port and TCP

Sireen Habib Malik s.malik at tuhh.de
Wed Aug 24 06:30:18 PDT 2005

>I have a TCP connection handled by the completion port IO model. What is
>happening is in case I specify a large buffer for receiving (WSARecv),
>the operation completes only after the buffer is full, not after
>receiving about 500 bytes (a packet), so a significant delay is
>introduced. In case of small buffers, performance degrades. Any advice
>on this? Completion port model is a must.
No idea what a "completion port model" is! Here are some hints for your 

Large delay for large buffer is intuitively clear. For the small 
buffers, consider the relation:

Maximum Window (Wmax) = BufferSize+ Capacity*RTT
(assuming error-free medium, and that Capacity is the speed of the ONLY 

For the more common TCP versions, Wmax should not be so small that TCP 
does not get a chance to get out of the Slow-Start phase. For 
triple-duplicates to arrive, there should be atleast 3 packets 
successfully delievered after the lost packet. Otherwise, TCP time-outs. 
If your client access-speed is small, give your connection enough 
buffer-space to "atleast" get to the saw-tooth behavior.

The other possibility is that with a large buffer the connection can 
operate at the Maximum Congestion Window, however, with a small buffer 
you are  forcing it go into the saw-tooth congestion control. So poorer 
performance, relatively speaking.

Hope that helps.


More information about the end2end-interest mailing list