[p2p-hackers] TCP-like Congestion Control

David Barrett dbarrett at quinthar.com
Sat Sep 17 11:17:18 UTC 2005


Back to everyone's favorite topic, congestion control.  Can you advise 
me how to improve my approach to give better performance and/or behave 
better with TCP?

To review, TCP congestion control has three primary variables:
- cwnd - # of bytes allowed on the network
- pipe - # of bytes currently "in flight" on the network
- ssthresh - Threshold between "slow start" and "congestion avoidance"

I update these variables in the following primary events:

onSend( numBytes )
	- pipe += numBytes

onACK( numBytes )
	- if( cwnd < ssthresh ) cwnd += min( numBytes, MTU )
	- else                  cwnd += MTU*MTU / 2

onDrop( )
	- cwnd     = max( MTU, cwnd/2 )
	- ssthresh = cwnd

onTimeout( )
	- ssthresh = max( pipe/2, MTU*2 )
	- cwnd     = MTU
	- pipe     = 0

My goal is to mimic TCP as closely as possible.  Toward this end I've 
read RFCs 893 and 2581, but I find it rather ambiguous on some points. 
At the moment, the above algorithms seem to occilate more wildly than 
I'd hope.  Can you recommend any improvements?  Thanks!

-david




More information about the P2p-hackers mailing list