Go-Back-N Automatic Repeat reQuest
Retransmission Behavior
Read aloud is unavailable in this browser.
The 'Go Back' in Go-Back-N
The name Go-Back-N reveals the protocol's defining characteristic: when error recovery is needed, the sender doesn't simply retransmit the lost frame—it "goes back" to that frame and retransmits all subsequent frames as well, even if those frames were already received correctly by the receiver.
This behavior, at first glance, appears wasteful. Why retransmit correctly received frames? The answer lies in a deliberate design trade-off: simplicity at the receiver outweighs efficiency in retransmission. By keeping the receiver stateless (no buffering of out-of-order frames), the protocol sacrifices bandwidth during error recovery but gains implementation simplicity and guaranteed in-order delivery.
This page dissects the retransmission mechanism in detail: what triggers retransmission, exactly which frames are resent, how the receiver handles the arriving duplicates, and the bandwidth cost of this approach compared to selective retransmission.
By the end of this page, you will understand the precise mechanics of Go-Back-N retransmission, be able to trace through complex retransmission scenarios, quantify the bandwidth overhead compared to Selective Repeat, and appreciate when this overhead is acceptable and when it motivates more sophisticated protocols.
Retransmission Triggers
In the standard Go-Back-N protocol, there is one primary trigger for retransmission: timeout expiration. The sender maintains a single timer associated with the oldest unacknowledged frame. When this timer expires without receiving an acknowledgment that advances the window, retransmission begins.
Timer Semantics:
- Timer starts when the first frame enters an empty window (
send_base == nextseqnumtransitions tosend_base < nextseqnum) - Timer restarts when
send_baseadvances (new oldest outstanding frame) - Timer stops when all frames are acknowledged (
send_base == nextseqnum) - Timer expires after a protocol-specific duration (timeout value)
What Timeout Indicates:
A timeout can result from several underlying causes:
- Frame loss: The data frame was lost in transit (never reached the receiver)
- Frame corruption: The frame arrived but failed error checking (discarded)
- ACK loss: The frame arrived correctly, but the ACK was lost
- ACK delay: Network congestion delayed the ACK beyond the timeout
From the sender's perspective, all these cases are indistinguishable—the expected ACK simply didn't arrive in time.
If timeout is set too short, the sender retransmits unnecessarily (the ACK was just delayed). If set too long, the sender waits excessively when the frame was actually lost. Optimal timeout balances these concerns, typically set slightly above the observed round-trip time.
Enhanced Trigger: Duplicate ACKs (Optional)
Some implementations extend GBN with a fast retransmit mechanism inspired by TCP:
if (3 consecutive duplicate ACKs received for ack_num == send_base - 1):
// Don't wait for timeout; retransmit immediately
retransmit_from(send_base)
The rationale: receiving multiple duplicate ACKs indicates that subsequent frames are arriving at the receiver, but the expected frame is missing. This strongly suggests frame loss rather than delay.
Standard GBN vs. Enhanced GBN:
| Trigger | Standard GBN | Enhanced GBN | TCP Comparison |
|---|---|---|---|
| Timeout expiration | Yes | Yes | Yes |
| Duplicate ACKs (×3) | No | Yes | Yes (fast retransmit) |
| NACK (negative ACK) | No | Some variants | Not in TCP (uses SACK) |
| Proactive sensing | No | Rare | RACK algorithm |
The Go-Back Mechanism in Detail
When retransmission is triggered, the sender executes the defining behavior of Go-Back-N:
Retransmission Algorithm:
procedure retransmit_all_outstanding():
restart_timer()
for i = send_base to nextseqnum - 1:
send(buffer[i mod N])
What Gets Retransmitted:
Every frame with sequence number in the range [send_base, nextseqnum - 1] is resent. This includes:
- The frame that presumably triggered the timeout (might be lost)
- All frames sent after it (might have been received correctly)
Example:
Window size N = 5, sender has transmitted frames 3, 4, 5, 6, 7 (send_base = 3, nextseqnum = 8).
Frame 4 was lost. The receiver accepted frame 3, then saw frames 5, 6, 7 arrive out of order and discarded them.
Timeout occurs (no ACK for frame 4). Sender retransmits:
- Frame 3? No—if ACK(3) arrived, send_base = 4
- Frame 4: Yes (the lost frame)
- Frame 5: Yes (correctly received but discarded)
- Frame 6: Yes (correctly received but discarded)
- Frame 7: Yes (correctly received but discarded)
Four frames are retransmitted, but only one (frame 4) was actually lost. The other three were correctly received on the first transmission!
The receiver discarded frames 5, 6, 7 because it operates in strict in-order mode with no buffer for out-of-order frames. Even if only frame 4 were retransmitted, the receiver couldn't process frames 5, 6, 7 because they were already discarded. The sender MUST resend them.
The Receiver's Role in Retransmission Handling
When retransmitted frames arrive at the receiver, their handling depends on the receiver's current state:
Case 1: Retransmitted Frame Matches Expected
If the retransmitted frame's sequence number equals expectedseqnum, the frame is accepted:
Receive Frame 4 (retransmission):
expectedseqnum == 4? Yes!
Accept frame, deliver data
Send ACK(4)
expectedseqnum = 5
This is normal operation—the retransmission successfully recovered the lost frame.
Case 2: Retransmitted Frame Is Behind Expected
If the receiver has already moved past this sequence number (perhaps due to delayed original transmission), the frame is a duplicate:
Receive Frame 3 (retransmission due to lost ACK):
expectedseqnum == 5? No, 3 < 5
Recognize as duplicate/old frame
Discard frame
Send ACK(4) — highest received in-order
Case 3: First-Time Frame After Successful Recovery
After the lost frame is successfully retransmitted, subsequent retransmissions (frames 5, 6, 7 in our example) arrive as expected:
Receive Frame 5 (retransmission):
expectedseqnum == 5? Yes!
Accept frame, deliver data
Send ACK(5)
expectedseqnum = 6
Even though frame 5 was received correctly the first time (and discarded), this retransmission is now accepted because expectedseqnum has advanced.
| Frame Seq# | Expected Seq# | Relation | Action | ACK Sent |
|---|---|---|---|---|
| 4 | 4 | Match | Accept & deliver | ACK(4) |
| 5 | 5 | Match | Accept & deliver | ACK(5) |
| 3 | 5 | Behind (duplicate) | Discard | ACK(4) |
| 6 | 5 | Ahead (out-of-order) | Discard | ACK(4) |
The receiver maintains only expectedseqnum—no buffer, no bitmap of received frames, no history. This extreme simplicity is GBN's defining characteristic. Every arriving frame is either exactly expected (accept) or not (discard). No decisions require remembering past frames.
Quantifying the Bandwidth Cost
The "go back" retransmission behavior wastes bandwidth by resending correctly received frames. Let's quantify this cost.
Worst-Case Scenario:
With window size N, if the first frame in the window is lost while all subsequent N-1 frames are received correctly:
- Frames lost by channel: 1
- Frames retransmitted by sender: N
- Redundant retransmissions: N - 1
The redundancy ratio in worst case:
Redundancy = (frames retransmitted) / (frames actually lost)
= N / 1 = N
With N = 127 (extended HDLC), the worst case retransmits 127 frames to recover 1!
Average Case Analysis:
Assuming uniform random frame loss at position k within the window (k = 0, 1, ..., N-1):
- If position 0 (first) is lost: retransmit N frames, waste N - 1
- If position 1 (second) is lost: retransmit N - 1 frames, waste N - 2
- ...
- If position N-1 (last) is lost: retransmit 1 frame, waste 0
Average wasted frames per loss = (1/N) × Σ(k=0 to N-1) k = (N - 1) / 2
Average wasted retransmissions = (N - 1) / 2. With N = 127, each loss wastes on average 63 frames. On lossy channels, this becomes significant. A 1% frame loss rate means roughly 0.63% additional redundant traffic—not catastrophic, but not negligible either.
Comparison with Selective Repeat:
In Selective Repeat ARQ, the receiver buffers out-of-order frames, and the sender retransmits only the specific lost frame. This drastically reduces retransmission overhead:
| Metric | Go-Back-N | Selective Repeat |
|---|---|---|
| Frames lost per 1000 | 10 | 10 |
| Frames retransmitted per loss (worst) | 10 | 1 |
| Frames retransmitted per loss (avg) | 5.5 | 1 |
| Total retransmissions per 1000 frames | ~55 | ~10 |
| Effective overhead | 5.5% | 1% |
When GBN's Cost Is Acceptable:
Despite the overhead, Go-Back-N remains appropriate when:
- Low error rate: If P(loss) is very small (< 0.1%), redundant retransmissions are rare
- Small window: With small N, the waste per error is bounded
- Simple receiver required: Embedded systems, sensors, low-power devices benefit from receiver simplicity
- In-order delivery critical: Applications requiring strict ordering without buffering
- Implementation resource constraints: Memory for buffering is expensive or unavailable
When to Choose Selective Repeat:
- High error rate: Lossy channels (wireless, congested networks) amplify GBN's waste
- Large window: High bandwidth-delay products require large N; waste grows proportionally
- Receiver resources available: Modern systems can afford buffering
- Throughput is paramount: When every bit of bandwidth matters
Handling Multiple Frame Losses
When multiple frames within a single window are lost, Go-Back-N's behavior depends on which frames are lost and their relative positions.
Scenario 1: Consecutive Losses
Frames 4 and 5 are both lost (sender transmitted 3, 4, 5, 6, 7).
- Timeout triggers retransmission from frame 4
- Retransmit 4, 5, 6, 7
- Frame 4 arrives → ACK(4), expectedseqnum = 5
- Frame 5 arrives → ACK(5), expectedseqnum = 6
- Frame 6 arrives → ACK(6), expectedseqnum = 7
- Frame 7 arrives → ACK(7), expectedseqnum = 8
Recovery is straightforward—one retransmission round handles both losses.
Scenario 2: Non-Consecutive Losses
Frames 4 and 6 are lost (sender transmitted 3, 4, 5, 6, 7).
First retransmission cycle:
- Timeout triggers retransmission from frame 4
- Retransmit 4, 5, 6, 7
- Frame 4 arrives → ACK(4)
- Frame 5 arrives → ACK(5)
- Frame 6 LOST AGAIN? If channel is persistently lossy...
Problematic Pattern: Loss During Retransmission
If frame 6 is lost again during retransmission:
- Receiver gets 4, 5, then expects 6
- Frame 7 arrives out of order → discarded
- Timeout triggers ANOTHER retransmission from frame 6
- This can cascade if channel remains lossy
On a very lossy channel, Go-Back-N can enter a pathological state where retransmissions themselves are lost, triggering more retransmissions. Throughput collapses toward zero. This is why GBN is unsuitable for high-error-rate environments.
Mathematical Model: Retransmissions Under Random Loss
Let p = probability of frame loss. Let N = window size.
Expected number of transmission attempts for a single frame to succeed:
E[attempts] = 1 / (1 - p)
But in GBN, when a frame is lost, we retransmit N frames. If any of those N frames is lost again, we retransmit all N again.
Probability that all N frames in a retransmission succeed:
P(all succeed) = (1 - p)^N
Expected retransmission rounds:
E[rounds] = 1 / (1 - p)^N...approximately.
For p = 0.1 (10% loss) and N = 10:
P(all succeed) = (0.9)^10 ≈ 0.349
E[rounds] ≈ 1 / 0.349 ≈ 2.9 rounds on average!
This means even moderate loss rates with large windows cause significant retransmission cycles.
- •Reduce window size — Smaller N means fewer frames in each retransmission burst
- •Use Forward Error Correction (FEC) — Add redundancy to recover errors without retransmission
- •Employ ARQ/FEC hybrid — Combine error correction with retransmission for residual errors
- •Upgrade to Selective Repeat — For lossy channels, SR's per-frame retransmission is far more efficient
- •Implement fast retransmit — React to duplicate ACKs before timeout; less time for additional losses
Retransmission and Flow Control Interaction
An often-overlooked aspect of Go-Back-N retransmission is its interaction with flow control—particularly when the receiver's processing capacity is limited.
The Problem:
When the sender retransmits a burst of N frames, the receiver must:
- Process each frame as it arrives (error check, sequence number check)
- Decide to accept or reject
- Send ACK
- If accepted, deliver to upper layer
If the receiver's upper layer is slow (e.g., application can't consume data fast enough), accepted frames might cause buffer overflow at the receiver—even though Go-Back-N's receiver itself doesn't buffer.
Wait—Doesn't GBN Receiver Not Buffer?
The GBN receiver doesn't buffer out-of-order frames. But it still needs to pass accepted in-order frames to the upper layer. If the upper layer's buffer is full:
- Receiver cannot accept the frame (would cause overflow)
- Receiver must signal sender to slow down
This is the domain of flow control, overlapping with but distinct from error control.
Flow Control Mechanisms in GBN:
-
Window-based flow control: Receiver advertises available buffer space; sender window is the minimum of sender's N and receiver's advertised window
-
Explicit feedback: Receiver sends a "pause" or "RNR" (Receive Not Ready) signal when overwhelmed
-
Implicit signaling: Receiver simply doesn't send ACKs; sender times out but this wastes bandwidth
HDLC (using GBN) provides explicit flow control through supervisory frames:
• RR (Receive Ready): Normal ACK, ready for more frames • RNR (Receive Not Ready): Acknowledged frames up to N, but don't send more yet • REJ (Reject): Explicit negative acknowledgment, request retransmission
These provide finer control than pure timeout-based retransmission.
Retransmission While Flow-Controlled:
A subtle issue arises when flow control limits the window during retransmission:
- Sender has 10 frames outstanding (send_base = 0, nextseqnum = 10)
- Frame 3 is lost; frames 4-9 are discarded by receiver
- Receiver sends ACK(2) with window = 5 (flow control)
- Timeout triggers retransmission
- Sender should retransmit frames 3-9 (7 frames)
- But receiver only has space for 5 frames!
Resolution:
- Sender retransmits min(outstanding, receiver_window) frames
- Or sender retransmits all outstanding but receiver applies flow control by delaying ACKs or sending RNR
- Protocol design must specify exact behavior
In practice, implementations often retransmit all outstanding frames in one burst and let the receiver's flow control feedback throttle subsequent new transmissions.
Summary: Retransmission Behavior
The retransmission mechanism is the heart of Go-Back-N, defining its character and trade-offs. Let's consolidate the essential insights:
- •Timeout is the primary trigger — Single timer for oldest outstanding frame; enhanced versions may use duplicate ACKs
- •All outstanding frames are retransmitted — From send_base to nextseqnum - 1, regardless of which was lost
- •Receiver discarded subsequent frames — Because it only accepts in-order; retransmission is necessary, not wasteful by design
- •Bandwidth cost is proportional to N — Average (N-1)/2 wasted frames per error; significant for large windows
- •Multiple losses can cascade — Each failed retransmission round triggers another full burst
- •Flow control interacts with retransmission — Receiver capacity limits must be respected during bursts
What's Next:
With the complete operational picture—from fundamental concepts through window limits and retransmission behavior—we're ready for the capstone: efficiency analysis. The next page derives the mathematical model for GBN throughput, comparing it with Stop-and-Wait and Selective Repeat to answer the quantitative question: how much does pipelining help, and when is Go-Back-N the right choice?
You now understand Go-Back-N's distinctive retransmission mechanism: timeout-triggered full retransmission of outstanding frames, receiver handling of retransmissions, bandwidth cost quantification, and interaction with flow control. This completes the behavioral foundation for the efficiency analysis that follows.
KEEP LEARNING
There’s more to understand.
You’re reading the introduction. Create a free account to read the complete lesson, save notes and keep track of your progress.