Stop-and-Wait
One frame at a time. Simple, correct, and mostly spent waiting — plus the duplicate that explains sequence numbers.
Skip to the animationStop-and-Wait sends one frame and refuses to send another until that one is acknowledged — the simplest reliable protocol there is, and the slowest.
The whole protocol
- 1Send frame N and start a timer.
- 2Wait. Send nothing else, whatever happens.
- 3If the acknowledgement arrives, move to frame N+1.
- 4If the timer expires first, resend frame N and start again.
That is genuinely all of it, and it is correct: no frame is ever lost, duplicated or delivered out of order. The problem is entirely one of speed.
The vocabulary
- Protocol data unit
- What the thing is called at each layer: segment at transport, packet at network, frame at link. Different names for the same bytes with different amounts of header wrapped round them.
- Encapsulation
- A layer treats everything it receives from above as opaque payload and prepends its own header. It never looks inside, which is precisely what makes layers replaceable.
- Peer layers
- A layer only ever meaningfully talks to the same layer at the other end. TCP at one end reads the header TCP at the other end wrote, and nothing in between touches it.
- Propagation vs transmission delay
- Propagation is how long a bit takes to travel the distance — set by physics. Transmission is how long it takes to push all the bits out — set by bandwidth. Only the second improves when you buy a faster link.
- Round-trip time (RTT)
- Send to reply. Every acknowledgement-based protocol is ultimately paced by this, which is why the interesting question is always how much you can send before one arrives.
Two failures that look identical
The animation loses two different things, and the pair is the point:
- Frame 2 is lost. The timer expires and the sender retransmits. Straightforward.
- The ACK for frame 3 is lost. The timer expires and the sender retransmits — identically. But this time the receiver already has frame 3, and gets a second copy.
The sender cannot distinguish these cases and does not need to. It is the receiver that must cope, and it copes by checking the sequence number — which is exactly why frames carry one.
Without a sequence number the receiver would hand the same bytes up twice and silently corrupt the stream. One bit is enough for Stop-and-Wait, since only two frames are ever in question — this is the Alternating Bit Protocol.
Why it is too slow to use
The sender is busy for the transmission time and idle for the round trip. On a satellite link with a 500 ms round trip and a 1 ms transmission time, utilisation is under half a percent — the link is idle 99.5% of the time, and buying more bandwidth makes it worse, not better.
The fix is to have more than one frame outstanding, which is precisely what Go-Back-N and Selective Repeat do. Stop-and-Wait is not really a rival to them; it is the N = 1 case of the same idea.
The numbers you will be asked for
- Utilisation
Tt ÷ (Tt + 2Tp)
Transmission time over the whole send-and-wait cycle. Approaches zero as the link gets longer or faster.
- Window needed to fix it
N ≥ 1 + 2Tp ÷ Tt
How many frames must be outstanding to keep the link busy — the bandwidth-delay product in frames.
Advantages and disadvantages
Advantages
- As simple as reliable transfer gets: one timer, one outstanding frame, a one-bit sequence number.
- The receiver needs no buffer and no reordering logic at all.
- Flow control comes free — the sender can never outrun the receiver.
Disadvantages
- Utilisation collapses on any link with meaningful delay.
- Throughput is capped by round-trip time, so more bandwidth buys nothing.
- One loss stalls everything for a full timeout.
Watch it work
Check yourself
question 1 / 4
One question at a time. Pick an answer to see why it is right or wrong, then move on — there is no score to keep and nothing is saved.