DEV Community

Binary Dose
Binary Dose

Posted on Originally published at binarydose.in

Why Does TCP Use a Sliding Window? (Flow Control vs BDP)

Why Does TCP Use a Sliding Window?

Over high-latency networks, naive Stop-and-Wait throughput collapses because the physical pipe sits empty for most of the Round Trip Time (RTT).

⚡ The Bandwidth-Delay Product (BDP)

$$\text{BDP} = \text{Bandwidth} \times \text{RTT}$$

On a 10 Gbps transatlantic link with 100ms RTT, BDP = 125 MB! Stop-and-Wait wastes 99.9% of that capacity.

🧠 4 Buffer Window Zones

  1. Zone 1 (ACKed): Safe to discard from RAM.
  2. Zone 2 (In-Flight): Emitted, awaiting ACK.
  3. Zone 3 (Usable): Permitted to send immediately.
  4. Zone 4 (Blocked): Outside advertised window.

Read the full interactive visualizer on Binary Dose.

Top comments (0)