[ee122] pseudo-code for TCP congestion control

vern at cs.berkeley.edu vern at cs.berkeley.edu
Mon Nov 5 23:33:06 PST 2007


There's a bug in the pseudo-code here:

> function FastRetransmit()
> 	# Multiplicative decrease.
> 	SSTHRESH <- CWND / 2
> 
> 	# We do not cut CWND all the way down to the beginning of
> 	# a Slow Start.  Instead, we just halve it and will proceed
> 	# in Congestion Avoidance.
> 	CWND <- SSTHRESH

The comment about CWND is (essentially) correct for a refinement to
Fast Retransmission that we will meet in lecture this Wednesday, termed
"Fast Recovery".  However, for Fast Retransmission the correct code is
CWND <- MSS.

This next part remains, though:

> 	# Note that unlike how we handled a retransmission timeout,
> 	# here we do *not* alter MaxSent.  This means that if we
> 	# receive an ack for just the packet we're retransmitting,
> 	# instead of an ack further along that includes some of the
> 	# packets we sent earlier, then we might not be able to send
> 	# anything new in response to that ack.  Basically, we're
> 	# betting here that only a single packet has been lost, and
> 	# once we retransmit it the receiver will send us an ack
> 	# all the way up to MaxSent.  If that's not the case, then
> 	# we will stall until RTO goes off for a timeout retranmissions.

So after the single packet is retransmitted, CWND is too small to send
anything further upon any future acks unless they happen to be for all the
way up MaxSent.

I'll send corrected pseudo code in the next message.

		Vern


More information about the ee122 mailing list