Stop-and-Wait & Sliding Window
Read this concept as one more decision made about a packet in flight. The widget below lets you change the inputs and watch the consequence instead of memorising the rule.
Why it matters
Stop-and-wait leaves the link idle for most of every RTT, so useful rate collapses as delay grows. A sliding window keeps several unacknowledged packets in flight and makes throughput depend on window size rather than only on RTT.
On the wire
The sender keeps a window of sequence numbers it may transmit before an ACK arrives, and each cumulative ACK slides that window forward. A packet can be dropped or delayed while later packets still advance the window, so the receiver needs buffering and reordering.
When it breaks
With a window smaller than the bandwidth-delay product, the sender stalls and the link stays underutilized even though no packets are lost. With a window too large for the receiver or the path, queues overflow and retransmissions multiply the offered load.
Sliding window lab
ACKs slide the window forward; a lost segment blocks cumulative acknowledgment.
Unacknowledged bytes allowed in flight
Throughput ≈ window / RTT
Each cumulative ACK frees buffer space and slides the window one segment to the right.