Go-Back-N
One frame is lost, two intact ones are thrown away, and six frames cost nine transmissions.
Skip to the animationGo-Back-N lets a sender keep a window of frames outstanding at once, and recovers from a loss by retransmitting the lost frame and everything sent after it — because the receiver kept none of them.
Why not just stop and wait
The simplest reliable protocol sends one frame and waits for its acknowledgement. It is correct, and it is catastrophically slow: on a link with a long round-trip time the sender spends nearly all its time idle, whatever the bandwidth.
Sliding-window protocols fix exactly this. Let the sender have N frames outstanding and the link stays busy while acknowledgements are in flight. The window size needed to saturate a link is the bandwidth-delay product — how many bits fit on the wire at once.
Stop-and-wait is just Go-Back-N with a window of 1. The two are not different protocols so much as different settings of one.
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.
The rules
- Sender may have up to
Nunacknowledged frames outstanding — the window, frombasetobase + N − 1. - Receiver accepts frames strictly in order and keeps no buffer. Anything out of order is discarded, however intact.
- Acknowledgements are cumulative. ACK
nmeans everything up to and includingnarrived, so one ACK can slide the window several places — and a lost ACK is covered by the next one. - One timer, on the oldest unacknowledged frame. When it fires, the sender goes back and resends everything from
baseonward.
Following the animation
- 1Frames 1 and 2 go out and arrive. The window slides forward as their ACKs come back.
- 2Frame 3 is lost in transit. Nothing tells the sender — a lost frame and a slow one look identical from the sending end.
- 3Frames 4 and 5 arrive perfectly intact and are discarded, because the receiver is still waiting for 3 and has nowhere to put them.
- 4The receiver re-acknowledges 2 each time. The sender sees duplicate ACKs and learns nothing new from them.
- 5The timer for frame 3 expires. The sender goes back and resends 3, 4 and 5.
- 6All three arrive in order, and the window finally moves past the gap.
Count the cost: six frames of data took nine transmissions. Two of the three extra were frames that had already arrived undamaged and were thrown away. That is the price of a receiver with no buffer — and it is the entire trade-off the protocol makes.
Against Selective Repeat
| Go-Back-N | Selective Repeat | |
|---|---|---|
| Receiver buffer | none | window-sized |
| Out-of-order frames | discarded | buffered |
| Acknowledgements | cumulative | individual |
| Timers | one, on the oldest | one per frame |
| Retransmitted on loss | the frame and all after it | only the lost frame |
| Max window | 2ᵏ − 1 | 2ᵏ⁻¹ |
Selective Repeat wastes far less bandwidth and is the better choice on a lossy or high-delay link. Go-Back-N buys its simplicity with retransmissions: a trivial receiver, one timer, and no reordering logic. On a link that rarely loses anything, that is a perfectly sensible bargain.
The window limits come from sequence numbers wrapping around. With k bits there are 2ᵏ numbers; Go-Back-N needs one spare to tell a full window from an empty one, and Selective Repeat needs the sender and receiver windows never to overlap after a wrap.
The numbers you will be asked for
- Bandwidth-delay product
bandwidth × round-trip time
How many bits fit on the wire at once. The window must be at least this big to keep the link busy.
- Utilisation, window N
N × Tt ÷ (Tt + 2Tp)
Tt is transmission time, Tp propagation. Capped at 1 — beyond that the window is bigger than it needs to be.
- Stop-and-wait utilisation
Tt ÷ (Tt + 2Tp)
The N = 1 case. On a long link this is a very small number, which is the whole reason windows exist.
- Sequence number bits
N ≤ 2ᵏ − 1
Go-Back-N with k-bit sequence numbers. Selective Repeat needs N ≤ 2ᵏ⁻¹.
Advantages and disadvantages
Advantages
- Keeps the link busy while acknowledgements are in flight — far better utilisation than stop-and-wait.
- The receiver is trivial: no buffer, no reordering, one variable.
- Cumulative acknowledgements make lost ACKs self-correcting.
Disadvantages
- One loss forces retransmission of every frame after it, including ones that arrived intact.
- Wastes badly on high-loss or high-delay links, exactly where throughput matters most.
- The single timer means the sender learns about a loss only after 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.