The idea
The previous topic named three ARQ protocols and left them unopened. Stop-and-Wait is the simplest of the three, and its main weakness — one frame in flight at a time — is exactly the problem Go-Back-N is built to fix, so the two belong on the same page.
How it works
Stop-and-Wait ARQ
Stop-and-Wait is the simplest form of flow control. The sending station sends one frame of data, then waits for an acknowledgment from the other station before sending anything further. The receiving party can stop the flow of data at any point, simply by withholding its acknowledgment.
The source may not send a new frame until either:
- the receiver acknowledges the frame already sent, or
- the sender’s timer times out.
Frames are numbered with a sequence number based on modulo-2 arithmetic — 0, 1, 0, 1, 0, 1, and so on. The receiver’s ACK carries the sequence number of the next frame it expects, also modulo-2.
How it works
Why Stop-and-Wait is inefficient
The sender has to wait a full round-trip time (RTT) before it can send another frame — the time required for a frame to travel from source to destination and back. One frame, one full RTT of dead time: that pairing is what makes Stop-and-Wait slow.
Aside
The slides’ case-by-case timeout and retransmission diagrams for Stop-and-Wait did not survive extraction, so this page does not reproduce specific scenario walkthroughs for it — only the mechanism above, which the lecture states in prose.
How it works
Go-Back-N ARQ
To improve on Stop-and-Wait’s efficiency, several frames need to be in transmission at once while the sender waits for acknowledgments. Go-Back-N ARQ can send several frames before receiving any acknowledgment, but it keeps a copy of every frame sent until that frame is acknowledged.
Frames are numbered sequentially, modulo 2^m, where m is the size of the sequence number field in bits.
How it works
Sliding window
The sliding window is an abstract concept defining the range of sequence numbers that concern the sender — the send window — and the receiver — the receive window.
- N
- Send window size, in frames
- m
- Number of bits in the sequence number field
How it works
Send window for Go-Back-N
The send window’s size and location are defined by three variables — Sf, Sn, and Ssize — dividing the possible sequence numbers into four regions. The window can slide forward by one or more slots at once when a valid acknowledgment arrives, because Go-Back-N acknowledgments are cumulative: one ACK can confirm several frames at once. With a 4-bit sequence number field (m = 4), an ACK covering frames 0 through 2 slides the window forward to accommodate the next set of frames.
How it works
Receive window for Go-Back-N
The receive window is 1. The receiver only ever expects one specific frame next.
Worked example
Go-Back-N: a lost frame in the middle of the window
A cumulative ACK acknowledges packets 1 through 3 — the receiver would send an ACK numbered 4, meaning “I have everything up to and including packet 3.”
Packet 1 is lost before it reaches the receiver.
The receiver never generates that ACK, because it never received packet 1 in the first place — a packet arriving out of order is discarded, not buffered.
The sender times out and goes back, resending packets 1, 2 and 3 — every outstanding frame from the lost one onward, whether or not the later ones were originally received intact.
AnswerThe sender goes back and resends frames 1, 2 and 3.
How it works
Send window size
The send window size must be strictly less than 2^m, where m is the sequence number field width in bits.
Where marks get lost
The window is 2^m − 1, not 2^m
It is tempting to size the window at exactly 2^m, since that is how many distinct sequence numbers the field can represent. The lecture is explicit that the window must stay strictly below 2^m — the maximum usable size is 2^m − 1. With m = 2, for instance, the maximum window size is 2^2 − 1 = 3, not 4.
Aside
The slides’ full worked demonstration of why the window has to stay below 2^m — walking through a concrete 4-value example — did not survive extraction. The rule itself (N ≤ 2^m − 1) is stated directly and is safe to use; the worked justification for it is not reproduced here.
| Stop-and-Wait | Go-Back-N | |
|---|---|---|
| Frames in flight | One at a time | Several at once |
| Idle time per frame | A full RTT | Overlapped across the window |
| Acknowledgment | Confirms one frame | Cumulative — confirms several at once |
| On a lost frame | Retransmit that one frame | Resend everything from the lost frame onward |
Aside
Lecture 3 names Stop-and-Wait, Go-Back-N and Selective-Repeat as ARQ terms without developing their window mechanics. This is the lecture where those mechanics actually get taught.
In the exam
- Stop-and-Wait’s cost is a full RTT per frame. Define RTT precisely if asked: time for a frame to travel source to destination and back.
- Sequence numbers under Stop-and-Wait are modulo-2: 0, 1, 0, 1, …
- Maximum window size is 2^m − 1, strictly, not 2^m. This is the most common place to lose a mark in this topic.
- Go-Back-N’s receive window is 1. An out-of-order frame is discarded, not buffered — that is what forces the sender to resend everything from the lost frame forward.
- Go-Back-N acknowledgments are cumulative — one ACK can slide the window by more than one slot.
Check yourself
- Stop-and-Wait sends one frame, waits a full RTT for its ACK, and numbers frames modulo-2.
- Go-Back-N keeps several frames in flight, numbered modulo 2^m, and keeps copies until each is acknowledged.
- The send window’s maximum size is 2^m − 1, never 2^m.
- Go-Back-N’s receive window is 1: anything out of order is discarded, and a lost frame means resending it and everything sent after it.