[p2p-hackers] TCP-like Congestion Control
David Barrett
dbarrett at quinthar.com
Sat Sep 17 19:06:52 UTC 2005
Lars-Åke Larzon wrote:
>
> 17 sep 2005 kl. 13.17 skrev David Barrett:
>>
>> onACK( numBytes )
>> - if( cwnd < ssthresh ) cwnd += min( numBytes, MTU )
>> - else cwnd += MTU*MTU / 2
>
> Why do you divide by two? AFAIK, you should divide by cwnd if you're in
> the congestion avoidance phase.
Good catch. What about the others -- do they look right?
onSend( numBytes )
- pipe += numBytes
onACK( numBytes )
- if( cwnd < ssthresh ) cwnd += min( numBytes, MTU )
- else cwnd += MTU*MTU / cwnd
onDrop( )
- cwnd = max( MTU, cwnd/2 )
- ssthresh = cwnd
onTimeout( )
- ssthresh = max( pipe/2, MTU*2 )
- cwnd = MTU
- pipe = 0
-david
More information about the P2p-hackers
mailing list