"Fast Retransmit" in TCP
Fast retransmit is a modification to the congestion avoidance algorithm. As in Jacobson's fast retransmit algorithm, when the sender receives 3rd duplicate ACK, it assumes that the packet is lost and retransmit that packet without waiting for a retransmission timer to expire. After retransmission, the sender continues normal data transmission. That means TCP does not wait for the other end to acknowledge the retranmission.
2. How this protocol works.. ( From "TCP/IP Illustrated, Volume1" p312)
1) When the third duplicate ACK is received, set ssthresh to one-half of the minimum of the current congestion window (cwnd) and the receiver's advertised window. Retransmit the missing segment. Set cwnd to ssthresh plus 3 times the segment size.
2) Each time another duplicate ACK arrives, increment cwnd by the segment size and transmit a packet (if allowed by the new value of cwnd)
3) When the next ACK arrives that acknowledges new data, set cwnd to ssthresh (the value set in step 1). This should be the ACK of the retransmission from step 1, one round-trip time after the retranmission. Additionally, this ACK should acknowledge all the intermediate segments sent between the lost packet and the receipt of the third duplicate ACK. This step is congestion avoidance, since we're slowing down to one-half the rate we were at when the packet was lost.
The fast retransmit algorithm appeared in the 4.3BSD Reno release.
3. How it is shown in nam (network animator)..
Here is some scenario to explain "fast retransmit" with a simulated Internet environment. Look the retranmit time and cwnd & ssthres value changes.
Environmental parameters : The bandwidth between
node 0 & 1 and between node 2 & 3 is 5Mb, and that between node
1 & 2 is just 0.5Mb. Queue limit between node 1 & 2 is 5. Frame
losses can be predictable.
|
Node 0 sends one packet to node 3.
cwnd = 1
|
|
....... |
|
There are some loss of packets when cwnd=16 and ssthresh =20.
The sender gets to know that there was a collision when it receives third duplicated ACK. By the time the cwnd and ssthresh values are.. cwnd = 20.199
|
|
|
|
After receiving 3rd ACK, the sender retransmit that lost packet and
change cwnd and ssthresh values as follows.
cwnd = 10
( Notice, ssthresh value is decreased half of cwnd before congestion. cwnd was 20.199 ) |
|
|
|
The sender receives an ACK. As it is not a duplicated ACK nor the last
frame ACK the sender sent, the sender should wait till the time out.
cwnd = 10.10
|
|
After timeout, the sender retransmit the last acknowledged packet.
cwnd = 1
|
|
Then the sender increases its window size by 1 each time it gets the
whole ACKs for the previous packets untill cwnd value reaches ssthresh
value.
Once cwnd value reaches ssthresh, it follows "congestion window avoidance" algorithm. So, the sender increases its window size by 1/cwnd whenever it receives ACK. |
|
|
With nam-graph, we could see the whole traffic pattern.
|
1st RED Circle : As you see, after 3rd duplicated ACK, the sender retransmit
the packet (which is indicated in red color).
2nd RED Circle : It is retransmitted because of timeout. And after then, the sender increases its window size by 1. The left most points mean the packets that the sender sends.
|
Here is ns script for this simulation. You can also download ns script and nam file and run it by yourself.