140 likes | 259 Views
Recap. Slow start introduced cwnd Can transmit up to min( cwnd, offered window ) Flow control by the sender cwnd increases by 1 (MSS) for every new ack. Recap. Exponential increase of cwnd Eventually, packet drop Detected by time-out
E N D
Recap • Slow start introduced cwnd • Can transmit up to min( cwnd, offered window ) • Flow control by the sender • cwnd increases by 1 (MSS) for every new ack
Recap • Exponential increase of cwnd • Eventually, packet drop • Detected by time-out • Let x = min ( cwnd, offered window ) at this point • After time-out cwnd = 1 again • Recover the lost packet
Recap • In the next cycle, cwnd allowed to increase exponentially till (1/2)*x • Motivation for multiplicative decrease • Over several RTTs, exponential decrease • Counteracting exponential increase in load
Congestion Avoidance • The parameter where (1/2)*x is stored ssthresh • Slow startthreshold: The value till which cwnd increases exponentially in the next cycle
cwnd 1 2 4 8 Time-out observed ssthresh = (1/2)*8 = 4 Next cycle: cwnd increases rapidly (by 1 for each new ack) till ssthresh After reaching ssthresh, cwnd increases more gently
Congestion Avoidance time Loss (timeout) cwnd reaches ssthresh; henceforth, different rule for incrementing cwnd Loss (timeout) SS cwnd=1 cwnd=1 SS SS Store related value in ssthresh; ssthresh=(1/2)*cwnd Store related value in ssthresh; ssthresh=(1/2)*cwnd Incrementing cwnd more conservatively, after it is = ssthresh; loss detection by timeout; next cycle begins with cwnd=1
Congestion Avoidance • Incrementing cwnd afterit has reached ssthresh • For each new ack, increment = 1/cwndsegment
Congestion Avoidance SS cwnd time RTT Congestion avoidance begun At this point, cwnd increases to (cwnd+1) Exponential increase with RTT in Slow Start but additive increase with RTT in Congestion Avoidance
SS and CA combined • SS and CA are found together in implementations • Upon reception of new ack if (cwnd <= ssthresh) /* slow start */ cwnd += 1 else /* congestion avoidance */ cwnd += 1/cwnd • SS and CA are distinct algorithms with different objectives, but both update the same parameter: cwnd
SS and CA • Slow start • Get the ack clock started • Congestion avoidance • Adapt to the congestion on the path • Congestion leads to packet loss • Loss indicated by timeout
n:n+s (s) n+s:n+2s (s) n+2s:n+3s (s) Congestion Avoidance • After Congestion Avoidance has been implemented, are there aspects that can yet be improved? • Loss detection still by timeout • A cycle always begins in Slow Start, with cwnd=1 Last ack carried no. n X Ack = n Ack = n
Duplicate acks • Early detection of congestion by watching for duplicate acks • Instead of detecting congestion via time-outs • Every time-out is followed by cwnd = 1, and this means the window has to be built up again • When bandwidth-delay product is large, this means considerable wastage
Fast Retransmit • Early retransmission, or “Fast Retransmit” • If K dup acks are observed, conclude that a packet was dropped and retransmit the packet • K: a small fraction of the bandwidth-delay product • Most implementations set K=3 • K is called the duplicate ack threshold
Bandwidth delay product (BDP) = 8 segments Also called “pipe capacity”