Selective Repeat
The same loss as Go-Back-N, but the receiver buffers — so it costs seven transmissions instead of nine.
Skip to the animationSelective Repeat gives the receiver a buffer, so out-of-order frames are kept rather than discarded and only the frame that was actually lost is ever retransmitted.
Fixing Go-Back-N's waste
Go-Back-N throws away perfectly good frames because its receiver has nowhere to put them. Selective Repeat's answer is exactly as blunt as it sounds: give it somewhere to put them.
This run loses the same frame, over the same link, with the same window as the Go-Back-N topic — so the numbers are directly comparable. Go-Back-N needed nine transmissions for six frames. This needs seven.
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.
What changes
| Go-Back-N | Selective Repeat | |
|---|---|---|
| Out-of-order frame | discarded | buffered |
| Acknowledgements | cumulative | individual |
| Timers | one, on the oldest | one per outstanding frame |
| Resent after a loss | the frame and all after it | only the lost frame |
| Receiver complexity | one variable | a window-sized buffer plus reordering |
| Max window for k bits | 2ᵏ − 1 | 2ᵏ⁻¹ |
Acknowledgements have to become individual, because a cumulative ACK cannot express "I have 4 and 5 but not 3" — which is the exact situation the buffer creates.
The moment it pays off
Watch t = 10. Frame 3 finally arrives, and three frames are delivered upward in a single step — 3, plus the 4 and 5 that had been sitting in the buffer since t = 6 and t = 7. Nothing but frame 3 was ever retransmitted.
Delivery to the application is still strictly in order. The buffer changes when frames are handed up, never the order in which they are.
Why the window is halved
With k-bit sequence numbers Selective Repeat allows a window of only 2ᵏ⁻¹, half what Go-Back-N allows. The reason is that the receiver accepts frames out of order, so it must be able to tell a new frame from a retransmission of an old one after the numbers wrap around.
If the sender's and receiver's windows could overlap after a wrap, a duplicate old frame would look like a legitimate new one and be buffered as such. Keeping the window to half the sequence space makes that impossible.
The numbers you will be asked for
- Utilisation, window N
N × Tt ÷ (Tt + 2Tp)
Same as Go-Back-N — the window sets throughput. The difference is what a loss costs, not what a clean run costs.
- Sequence number bits
N ≤ 2ᵏ⁻¹
Half of Go-Back-N's limit, because sender and receiver windows must never overlap after a wrap.
Advantages and disadvantages
Advantages
- Only the lost frame is retransmitted — much less waste on a lossy link.
- Frames arriving out of order are kept, so a single loss does not invalidate a whole window.
- The best throughput of the three under loss, which is why TCP's selective acknowledgement option exists.
Disadvantages
- The receiver needs a real buffer and reordering logic.
- One timer per outstanding frame instead of one in total.
- The window is capped at half the sequence space.
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.