2.4 Sliding Window Protocol: Go-Back-N (GBN) ARQ
💡 Core Intuition: The Strict Librarian Analogy
🍳 The Everyday Analogy: The Single-Slot Inspection Desk
Imagine ordering a 5-volume encyclopedia set from a book supplier:
- You are a strict librarian with a physical desk that has room for exactly one book at a time ().
- The supplier sends Volumes 1, 2, 3, 4, and 5 in rapid succession.
- Volume 1 arrives in perfect condition; you log it and place it on the shelf.
- Volume 2 is damaged or lost in the mail.
- Next, Volume 3 arrives intact. However, because you only accept books in strict sequential order and have zero storage space to hold Volume 3 while waiting for Volume 2, your policy forces you to immediately reject and discard Volume 3!
- When Volume 4 arrives, you discard it too.
- When the supplier's timeout timer for Volume 2 expires, the supplier must "Go-Back-N" and re-ship Volume 2, Volume 3, Volume 4, and Volume 5 all over again!
💻 Bridging to Computer Science
This is the fundamental operational trade-off of Go-Back-N (GBN): by keeping the receiver implementation ultra-simple (zero memory buffering required for out-of-order packets), the sender bears the heavy burden of retransmitting all outstanding frames when a single frame is lost.
📑Table of Contents
- 🚀 The Motivation: Channel Pipelining
- 🪟 Go-Back-N Architecture & Window State Pointers
- 📬 Cumulative Acknowledgments & Timer Operations
- 🔄 Interactive Flagship Blueprint: Go-Back-N ARQ Space-Time Protocol Ladder
- 🔒 The Mathematical Constraint: Why Must W_S \le 2^k - 1?
- 📐 Derivation of Go-Back-N Efficiency & Optimal Window Size
- 🏭 Real-World Production Context
- 📐 Numerical Applications & Worked Examples
- 🎯 Exam & Interview Pitfall Check
🚀 The Motivation: Channel Pipelining
In Stop-and-Wait, the efficiency is governed by:
When transmitting over high-speed networks or long-distance links (such as satellite channels), . The channel sits empty and idle for over of the time.
The Pipelining Solution
Instead of waiting for an ACK after sending every single frame, the sender transmits multiple frames concurrently into the physical channel before pausing. This technique is called Pipelining. The sender maintains a Sliding Window of outstanding frames.
🪟 Go-Back-N Architecture & Window State Pointers
In Go-Back-N, the sender and receiver maintain sliding windows defined over a circular sequence number space.
Go-Back-N Sliding Window State Partitions
Dynamic partitions of the circular sequence number space at the transmitter
Sent & Confirmed
Frames < Sf: successfully received and acknowledged; purged from buffer.
Sent, Awaiting ACK
Frames [Sf, Sn): in transit across the physical link; timer running.
Eligible to Send
Frames within [Sn, Sf + Ws): ready for immediate transmission.
Outside Window
Cannot be transmitted until oldest frame Sf is acknowledged.
Key Window Variables
- (Send Window, First): Points to the sequence number of the oldest unacknowledged frame.
- (Send Window, Next): Points to the sequence number of the next frame ready to be sent.
- (Send Window Size, ): The maximum number of unacknowledged frames permitted in flight ().
- (Receive Window, Next Expected): Points to the sequence number of the single frame the receiver is currently awaiting ().
Transmission Rule
The sender can transmit new frames as long as the number of outstanding frames does not exceed the window capacity:
📬 Cumulative Acknowledgments & Timer Operations
1. Cumulative ACKs
In Go-Back-N, acknowledgments are Cumulative:
- An acknowledgment labeled announces:
- Robustness to ACK Loss: If the sender transmits Frames 0, 1, and 2, and the receiver issues , and :
- If and are lost or destroyed in the channel, but arrives safely at the sender, Frames 0, 1, and 2 are all confirmed simultaneously! The sliding window slides forward past Frame 2 with zero retransmission penalty.
2. Single-Timer Management
To keep sender memory overhead minimal, Go-Back-N uses only one single timer:
- The timer is tied strictly to the oldest unacknowledged frame ().
- When advances due to an incoming ACK:
- If there are still outstanding frames in flight (), the timer is restarted for the new oldest frame.
- If all frames have been acknowledged (), the timer is stopped.
- When the timer expires:
- The sender infers that Frame was lost.
- The sender Goes Back : it retransmits all frames in the range !
3. Discarding Out-of-Order Frames
Because the receiver window size is strictly :
- If Frame is lost, but subsequent Frames arrive undamaged at the receiver:
- The receiver checks the incoming frame's sequence number against .
- Since the arriving sequence number does not match , the receiver discards Frames !
- The receiver does not buffer out-of-order frames, keeping receiver memory hardware simple and inexpensive.
🔄 Interactive Flagship Blueprint: Go-Back-N ARQ Space-Time Protocol Ladder
The interactive space-time protocol ladder below traces the hallmark behavior of Go-Back-N (): sender transmits a pipelined burst of frames, Frame 1 is lost in the noisy channel, the receiver discards subsequent out-of-order Frames 2 and 3, the sender's Frame 1 timer expires, and the sender rolls back to retransmit Frames 1, 2, and 3.
Go-Back-N ARQ: Frame Loss, Out-of-Order Discard & Retransmission Ladder
Space-time protocol ladder showing pipelined burst transmission, Frame 1 loss, receiver out-of-order discards, timeout, and Go-Back-N recovery
Sender transmits Frame 0 as the first frame of its window and starts its retransmission timer. Frame 0 arrives intact at the receiver.
🔒 The Mathematical Constraint: Why Must ?
If bits are allocated in the frame header for sequence numbers, the total available sequence space is (values ).
Theorem: The maximum sender window size in GBN is .
Proof by Contradiction:
Suppose we set . Consider a system with bits sequence numbers (), and choose :
- Full Burst: Sender transmits Frames 0, 1, 2, and 3.
- Receiver Processing: The receiver ingests all 4 frames in perfect order, delivers the payloads to the Network Layer, and advances cyclically: (wraps around to ). The receiver sends cumulative (requesting Frame 0 of the next round).
- Catastrophic Failure: All acknowledgments (including ) are destroyed by channel noise!
- Timeout: Sender timer for Frame 0 expires. Sender retransmits duplicate Frame 0 of the previous round.
- The Ambiguity Collision:
- The receiver is awaiting .
- When duplicate Frame 0 arrives, the receiver assumes this is the brand-new Frame 0 of the upcoming round!
- The receiver accepts duplicate Frame 0 as fresh data, permanently corrupting the upper-layer stream.
- The Resolution: By capping , if all ACKs are lost, the sender retransmits Frame 0. However, the receiver's window has only advanced to (not ). The receiver identifies that incoming Frame 0 falls outside its current window, recognizes it as an old duplicate, and safely discards it!
- Summary of Window Sizes in GBN:
📐 Derivation of Go-Back-N Efficiency & Optimal Window Size
In Go-Back-N, the sender transmits frames during one round-trip cycle time ():
1. General Efficiency Formula
Dividing the numerator and denominator by and using :
2. Optimal Window Size for Line Utilization ()
To achieve efficiency ():
- The optimal sender window size needed to completely fill the link capacity is:
3. Minimum Number of Sequence Bits ()
Since :
🏭 Real-World Production Context
Why Early 2G/3G Cellular Networks & HDLC Satellites Used Go-Back-N
In early wireless networks (GSM / GPRS Radio Link Control) and legacy satellite transceivers:
- Embedded base station terminals had minuscule microcontrollers with severely restricted RAM (often under ).
- Managing out-of-order buffer reassembly queues would require substantial memory and complex heap fragmentation logic.
- Engineers selected Go-Back-N because the receiver requires zero packet buffer memory beyond the single currently clocked frame (), slashing hardware costs while achieving high throughput on low-loss channels.
📐 Numerical Applications & Worked Examples
Example 1: Sizing Sender Window for 100% Efficiency on High-Delay Links
Problem Statement:
Consider a network connecting two communication hosts located apart. The link bandwidth is . The propagation velocity through the transmission line is . The system transmits packets of size . If a sliding window protocol is employed, determine the minimum sender window size required to achieve link utilization.
Step-by-Step Solution:
- List the Parameters:
- Distance .
- Velocity .
- Bandwidth .
- Frame size .
- Calculate Propagation Delay ():
- Calculate Transmission Delay ():
- Calculate Parameter :
- Calculate Optimal Window Size ():
- Since window size must be an integer:
- Final Result: A sender window size of is sufficient to achieve full channel capacity.
Example 2: Determining Minimum Sequence Bits for Geostationary Satellite Channels
Problem Statement:
A satellite link connects two earth stations. The orbital altitude of the satellite is and signal propagation speed is . Frame size is . If Go-Back-N ARQ is deployed to achieve maximum channel utilization, determine the minimum number of sequence number bits required in the packet header.
Step-by-Step Solution:
- Given Parameters:
- Bandwidth .
- Distance .
- Speed .
- Frame size .
- Calculate and :
- Calculate Parameter and Optimal Window Size:
- Calculate Minimum Sequence Number Bits ():
- Final Result: At least are required for the sequence number field.
Example 3: Tracking Total Retransmissions under Go-Back-N Frame Drop
Problem Statement:
Station A transmits sequential packets (numbered 0 to 9) to Station B using Go-Back-N sliding window protocol with window size . Suppose packet 3 is corrupted and lost during initial transmission, but all other frames and acknowledgments travel successfully. Calculate the total number of frames transmitted by Station A.
Step-by-Step Solution:
- Initial Window Transmission:
- Sender transmits Packets 0, 1, 2, 3 (4 frames).
- Packets 0, 1, 2 are acknowledged.
- Sender window slides, transmitting Packets 4, 5, 6 (3 frames).
- Total packets sent in initial pass = frames.
- Receiver Behavior on Loss:
- Packet 3 was lost in the channel.
- Receiver accepted Packets 0, 1, 2 ().
- When Packets 4, 5, 6 arrive, Receiver discards all three because they are out-of-order ().
- Go-Back-N Retransmission:
- Sender timer for Packet 3 expires.
- Sender rolls back to and retransmits Packets 3, 4, 5, 6, 7, 8, 9 (7 frames).
- Total Frame Count:
🎯 Exam & Interview Pitfall Check
Question 1: "Why does Go-Back-N ARQ perform poorly on noisy transmission channels?"
Key Focus Points:
- In Go-Back-N, the receiver discards all valid, undamaged frames that arrive out of order following a lost frame.
- On a noisy channel with high error rates, a single lost packet triggers the retransmission of an entire window of frames.
- This repeated retransmission of already-received frames wastes substantial bandwidth, causing efficiency to collapse.
Question 2: "Can Go-Back-N use Negative Acknowledgments (NAK)?"
Key Focus Points:
- Yes. If the receiver receives an out-of-order frame (e.g., receives Frame 2 when awaiting Frame 1), it can immediately send a .
- The alerts the sender that Frame 1 was lost without having to wait for the slow sender-side retransmission timer to expire, accelerating error recovery.
Question 3: "What is the receiver window size () in Go-Back-N, and why?"
Key Focus Points:
- In Go-Back-N, is strictly .
- The receiver accepts frames in strict sequential order only () and maintains no buffer memory for out-of-order frames. Any frame with sequence number is discarded.
Trap 1: "If the sender window size is , can we use bits for sequence numbers?"
Answer: Yes! For , the sequence space is . The maximum allowed window size is . Thus, fits within bits. But if , bits would cause ambiguity and protocol failure!
Trap 2: "Does an ACK in Go-Back-N specify the sequence number of the frame received or the next frame expected?"
Answer: In standard networking conventions, it specifies the NEXT frame expected. An informs the sender that all frames up to have been received and the receiver is now awaiting Frame .