A fast sender can send frames faster than a slow receiver can process them. Flow control keeps the sender in step with the receiver, and is combined with error control in ARQ protocols.
Stop-and-Wait
In stop-and-wait, the sender sends one frame and waits for an acknowledgement (ACK) before sending the next. If the ACK does not arrive before a timer expires, the frame is resent (Stop-and-Wait ARQ). Frames are numbered 0 and 1 so that duplicates can be recognised. It is simple but inefficient on long or fast links, since the sender is idle while waiting. Its utilisation is U = 1 / (1 + 2a), where a = propagation delay / transmission time of a frame.
Definition: Sliding window protocol. A flow-control method in which the sender may transmit several frames, up to a window size, before needing an acknowledgement, with the window moving forward as acknowledgements arrive.
Sliding Window
In a sliding-window protocol, the sender may send up to W frames (the window size) before it must wait for an acknowledgement. Frames are numbered with sequence numbers. As acknowledgements arrive, the window slides forward, allowing new frames to be sent. With a large enough window, the sender keeps the link busy, giving utilisation close to 1 when W ≥ 1 + 2a.
Go-Back-N ARQ
In Go-Back-N, the sender may have up to W = 2^m − 1 unacknowledged frames (with m-bit sequence numbers), and the receiver accepts frames only in order. If a frame is lost or damaged, the receiver discards the frames after it, and when the timer expires, the sender goes back and resends that frame and all frames after it. The receiver is simple, but bandwidth is wasted on resending good frames. Acknowledgements are cumulative.
Selective Repeat ARQ
In Selective Repeat, the receiver buffers out-of-order frames and the sender resends only the frames that were lost or damaged, using negative acknowledgements (NAK) or individual timers. The window size is at most 2^(m−1). It uses bandwidth best, but the receiver needs more memory and logic. Piggybacking, in two-way communication, carries acknowledgements inside data frames going the other way, saving bandwidth.
Table 2.3: Flow-control protocols
| Protocol | Sender window | Receiver window | On error |
|---|---|---|---|
| Stop-and-Wait | 1 | 1 | Resend the frame |
| Go-Back-N | 2^m − 1 | 1 | Resend from the lost frame |
| Selective Repeat | 2^(m−1) | 2^(m−1) | Resend only the lost frame |
Example 2.3: Link utilisation
Problem: A link has frame transmission time 1 ms and propagation delay 10 ms. Find the utilisation of stop-and-wait, and the window size needed to keep the link fully busy.
Solution:
- a = propagation / transmission = 10 / 1 = 10.
- Stop-and-wait: U = 1 / (1 + 2a) = 1 / 21 = 0.048, about 4.8 percent.
- Full use needs W ≥ 1 + 2a = 21 frames.
Result: Stop-and-wait uses under 5 percent of the link; a window of 21 frames keeps it fully busy.
t_frame, t_prop = 1.0, 10.0 # milliseconds
a = t_prop / t_frame
print(f"a = {a:.0f}")
print(f"stop-and-wait utilisation = {1 / (1 + 2 * a):.3f}")
for W in (1, 7, 15, 21, 31):
U = min(1.0, W / (1 + 2 * a))
print(f"window {W:>2}: utilisation {U:.2f}")
Output
a = 10
stop-and-wait utilisation = 0.048
window 1: utilisation 0.05
window 7: utilisation 0.33
window 15: utilisation 0.71
window 21: utilisation 1.00
window 31: utilisation 1.00
Common mistakes
- Using a Go-Back-N window of 2^m, which can confuse old and new frames; it must be at most 2^m − 1.
- Thinking Selective Repeat resends all later frames. It resends only the lost ones.
- Ignoring propagation delay when judging stop-and-wait efficiency.
Key takeaways
- Stop-and-wait sends one frame and waits: U = 1 / (1 + 2a).
- Sliding window allows W frames in flight; W ≥ 1 + 2a fills the link.
- Go-Back-N resends from the lost frame; Selective Repeat resends only the lost frame.
- Piggybacking carries ACKs inside data frames.
Practice questions
- Why is stop-and-wait inefficient on long links?
- What is the maximum sender window in Go-Back-N with 3-bit sequence numbers?
- What is piggybacking?
Answers to the practice questions
- The sender is idle for the whole round trip while waiting for each acknowledgement.
- 2^3 − 1 = 7.
- Sending acknowledgements inside data frames travelling in the opposite direction.
Sources
- Official BCA syllabus Computer Networks, course code 26BCA404DS02, Unit II
