TCP Congestion Control
The Balancing Act of Throughput
The Congestion Window (CWND)
Regardless of the algorithm, TCP uses a Congestion Window to limit how many packets can be 'in flight'—sent but not yet acknowledged.
TCP Window Scaling
Stop-and-Wait vs. Sliding Window Pipeline
Pipeline (Sliding Window): The server fills the "pipe" with packets. It doesn't wait for ACKs to send the next packet. As long as the window is open, data flows continuously.
The difference between algorithms lies in how they grow and shrink this window.
CUBIC: Growing until Failure
CUBIC is a loss-based algorithm. It increases the window aggressively until it detects Packet Loss. It assumes that loss equals a full buffer. The problem is that in modern networks with huge buffers, CUBIC fills those buffers completely, leading to massive Bufferbloat before it finally slows down.
BBR: Modeling the Physical Limit
BBR is delay-based. Instead of waiting for a packet to drop, it constantly measures the RTT and the delivery rate. If the RTT starts to climb while the delivery rate stays flat, BBR knows the buffers are filling and it stops growing the window *before* loss occurs.
Choosing the right congestion algorithm is a critical step in Reliability Engineering for long-distance data centers.