Fast Retransmit and Fast Recovery are mechanisms within the TCP (Transmission Control Protocol) to improve its performance in the event of packet loss. These techniques help in avoiding slow recovery procedures and reduce the time the network remains underutilized after a packet drop. Here’s a brief overview of both:

  1. Fast Retransmit:
    • Purpose: Speeds up the retransmission of lost packets.
    • Working:
      • Normally, TCP uses a timer to detect packet loss. If an acknowledgment (ACK) for a packet is not received within the expected time, TCP retransmits the packet.
      • However, in a scenario where a receiver receives packets out of order, it sends duplicate ACKs (DUP ACKs) for the packet it expects next (which is presumably the lost one).
      • If the sender receives three consecutive duplicate ACKs, it assumes that a packet has been lost and immediately retransmits the missing packet without waiting for the timer to expire. This mechanism is faster than waiting for a timeout.
  2. Fast Recovery:
    • Purpose: Maintains a higher transmission rate after a packet loss, instead of shrinking the congestion window size drastically.
    • Working:
      • Once Fast Retransmit has sent out the missing packet, Fast Recovery kicks in.
      • Rather than collapsing the congestion window size (which is how much data can be in transit in the network), TCP cuts it in half.
      • For every subsequent duplicate ACK received, the congestion window is slightly increased, allowing TCP to send more packets into the network.
      • Once a new acknowledgment is received (indicating that the retransmitted packet has been received and the gap caused by the lost packet is filled), the congestion window size is set to a value depending on the congestion control algorithm in use (often set to half of its size before the loss was detected).

Benefits:

  • These mechanisms help in maintaining a higher throughput during the packet loss scenario.
  • Reduces the time taken to detect a packet loss.
  • Avoids the traditional global timeout mechanism, which can be slow and inefficient.

In essence, Fast Retransmit and Fast Recovery are crucial for ensuring that TCP performs efficiently in real-world networks where packet losses due to congestion are common. They help to keep the network utilized while also ensuring that lost packets are retransmitted quickly.