Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Fast Recovery Technique For Loss Recovery in TCP
Transmission Control Protocol (TCP) is a widely used protocol for data transmission over the internet. However, data transmission over TCP is not always error-free. Transmission can be disrupted due to several reasons such as network congestion, packet loss, or failure of intermediate devices. In such cases, TCP uses a loss recovery technique to recover lost data and retransmit it. This technique is crucial in ensuring reliability of data transmission over the internet.
Understanding TCP Loss Recovery
TCP uses a three-way handshake mechanism to establish a connection between two devices. Once the connection is established, data transmission begins. TCP divides data into segments and sends them over the network. The receiver acknowledges receipt of each segment. If the sender does not receive acknowledgment of a segment, it assumes that the segment has been lost and retransmits it.
TCP uses a congestion control mechanism to avoid congestion in the network. If a sender receives three duplicate acknowledgments for the same segment, it assumes that the segment has been lost and reduces its sending rate to avoid congestion. This mechanism triggers either slow start or fast recovery depending on the network conditions.
Fast Recovery Technique
Fast Recovery is a mechanism that allows the sender to recover quickly from packet loss without going into slow start. Unlike slow start, which drastically reduces the transmission rate, fast recovery maintains a higher throughput during loss recovery.
How Fast Recovery Works
When the sender receives three duplicate acknowledgments, it:
-
Sets the threshold Sets
ssthreshto half of the current congestion window size -
Adjusts congestion window Sets
cwndtossthresh + 3(accounting for the three duplicate ACKs) -
Retransmits lost segment Immediately retransmits the presumed lost packet
-
Inflates window For each additional duplicate ACK, increments
cwndby one segment -
Exits fast recovery When a new ACK arrives, deflates
cwndback tossthresh
Fast Recovery vs Slow Start
| Aspect | Fast Recovery | Slow Start |
|---|---|---|
| Trigger | 3 duplicate ACKs | Timeout or connection start |
| Window reduction | Halves, then maintains | Resets to 1 segment |
| Recovery speed | Fast | Slow |
| Network assumption | Mild congestion | Severe congestion |
Advantages and Limitations
Advantages
-
Quick recovery Maintains higher throughput during packet loss compared to slow start
-
Network efficiency Avoids unnecessary dramatic reduction in transmission rate
-
Performance in high-speed networks Particularly beneficial where bandwidth-delay product is large
Limitations
-
Assumes congestion-based loss May not handle random packet loss effectively
-
Potential for increased congestion If loss is not due to congestion, fast recovery may worsen the situation
-
Limited to single packet loss Multiple packet losses in the same window can cause performance degradation
Practical Example
Consider a sender with a congestion window of 16 segments. If the sender receives three duplicate ACKs for segment 10:
Initial state: cwnd = 16, ssthresh = 32 After 3 dup ACKs: - Set ssthresh = cwnd/2 = 8 - Set cwnd = ssthresh + 3 = 11 - Retransmit segment 10 For each additional dup ACK: cwnd++ When new ACK arrives: cwnd = ssthresh = 8
This approach maintains a higher transmission rate compared to slow start, which would reset the congestion window to 1 segment.
Conclusion
Fast Recovery is a critical TCP mechanism that enables quick recovery from packet loss without the dramatic throughput reduction of slow start. By maintaining a higher congestion window during loss recovery, it significantly improves network performance, especially in high-bandwidth environments where complete window reset would be wasteful.
