TCP Zero Window Probing Mechanism

TCP Zero Window Probing Mechanism

Description:
TCP's flow control mechanism limits the sender's data transmission based on the window size advertised by the receiver. When the receiver's buffer is full, its advertised window size may become zero, at which point the sender must pause data transmission. However, once the receiver's buffer becomes available again, how does it notify the sender to resume sending data? The Zero Window Probing mechanism addresses this issue: when the sender detects that the receiver's window is zero, it periodically sends probe packets to inquire whether the window has been restored.

Detailed Process:

  1. Triggering Zero Window

    • Due to insufficient buffer space, the receiver sets the window field to zero in the TCP segment sent to the sender.
    • Upon receiving the zero window advertisement, the sender immediately stops sending data (except for probe packets) and starts the Persist Timer.
  2. Sending Probe Packets

    • When the persist timer expires, the sender generates a zero window probe packet (a 1-byte data segment or an empty segment, with the sequence number set to the starting position of the next data to be sent).
    • The probe packet carries the current sequence number, and even if the receiver's window is still zero, it will not discard this packet (TCP requires a response for window updates).
  3. Receiver's Response

    • If the receiver's window is still zero, it replies with a window update packet where the window field remains zero.
    • If the receiver's buffer has freed up space, the replied window field is updated to a non-zero value, and the sender resumes data transmission accordingly.
  4. Adjusting Probe Intervals

    • If the window remains zero after multiple probes, TCP adopts an exponential backoff strategy to extend the probe interval (e.g., doubling the timeout period each time) to avoid excessive invalid packets consuming network resources.
  5. Exception Handling

    • If a probe packet is lost, the persist timer will expire again and retransmit the probe, ensuring reliability.
    • If the receiver crashes or does not respond, the sender will disconnect after multiple retries.

Key Points:

  • Probe packets contain only 1 byte of data (or empty data), ensuring they can be processed by the receiver even when the window is zero.
  • Window updates do not require acknowledgment; if lost, they will be retriggered by subsequent probes.
  • This mechanism operates independently of congestion control and solely addresses the 'deadlock' issue in flow control.