Computer Networks · TEE · papers

Q2(b) · Stop-and-Wait versus Go-Back-N

2025-12-05 · 2022-23

Actual paper; 100 marks attempted. Current-syllabus alignment is stated per question.

Q2(b). Explain the stop and Wait ARQ and the Go Back N ARQ method. Which method is superior and why? [10 marks]

Answer

Stop-and-Wait ARQ permits only one outstanding frame. The sender stores its frame, transmits it and starts a timer. A valid matching ACK advances the sender; a timeout retransmits the stored frame.

Swipe across the diagram to read its labels ↔
Stop-and-Wait: lost ACK and duplicate rejection
Diagram: Stop-and-Wait: lost ACK and duplicate rejection. Labels: Stop-and-Wait: lost ACK and duplicate rejection | Stop-and-Wait: lost ACK and duplicate rejection | Sender | Receiver | Frame 0 → accepted, delivered once | ACK 1 lost on return path | Timeout: resend frame 0 → duplicate | Repeat ACK 1; duplicate not delivered | Frame 1 → next new frame | ACK k means next expected sequence k in this diagram.
Lost ACK causes a duplicate transmission, not duplicate delivery.
  1. Use alternating sequence numbers 0 and 1. The receiver remembers the next expected number. Here ACK k means the next sequence expected.
  2. Normal: send frame 0, receiver accepts it and sends ACK 1; sender then sends frame 1.
  3. Damaged/lost data: receiver cannot accept the missing valid frame. The sender eventually times out and retransmits.
  4. Lost ACK: the receiver already accepted the frame, but the sender times out and retransmits it. The receiver detects the duplicate by sequence number, does not deliver it twice, and repeats the ACK.
  5. A damaged ACK must not advance the sender. The timer provides eventual recovery. Waiting each round trip limits utilization on high-delay links.

Yaad rakho: One frame outstanding; duplicate ko acknowledge karo, deliver dobara nahi.

Go-Back-N (GBN) ARQ pipelines up to W outstanding frames. For m-bit sequence numbers, textbook GBN uses W ≤ 2m−1 and receiver window 1. The receiver accepts only the next in-order frame; out-of-order frames are discarded. ACK k here cumulatively acknowledges all frames before k and means “next expected is k”.

Swipe across the diagram to read its labels ↔
GBN W=7: loss and cumulative ACKs
Diagram: GBN W=7: loss and cumulative ACKs. Labels: GBN W=7: loss and cumulative ACKs | GBN W=7: loss and cumulative ACKs | Sender | Receiver | Frames 0,1 → accept in order | ACK 2: next expected is 2 | Frame 2 lost | Frames 3,4,5,6 → discard out of order | ACK 2 repeated | Timer for 2 expires: resend 2,3,4,5,6 | ACK 7: frames through 6 accepted | Receiver window = [2] while waiting; no out-of-order buffering. | Sender retains all unacknowledged frames from base 2 onward.
GBN example: frame 2 lost; frames 3–6 discarded; timeout resends 2–6.
  1. For W=7 with m=3, the sequence space is 0…7. Initially the sender can transmit 0…6. It stores every unacknowledged frame; a timer tracks the oldest one.
  2. Normal: after receiving 0 and 1, cumulative ACK 2 advances the sender base to 2. The sender can fill newly opened window slots.
  3. Lost data: if frame 2 is lost, frames 3…6 arrive out of order and are discarded. Repeated ACK 2 says frame 2 is still expected. On timeout the sender retransmits all outstanding frames starting at 2, here 2…6.
  4. Lost ACK: if ACK 2 is lost but ACK 3 arrives, the later cumulative ACK confirms frames 0…2 and avoids unnecessary retransmission. If no later useful ACK arrives before timeout, the sender retransmits from its oldest outstanding frame; the receiver rejects duplicates and sends its current ACK.
  5. After sequence 7, numbers wrap to 0. The bound W ≤ 7 leaves one sequence value outside the sender’s current window, preventing the all-ACKs-lost ambiguity of a full eight-frame window in the textbook model.
Swipe across the diagram to read its labels ↔
GBN W=7: normal window movement
Diagram: GBN W=7: normal window movement. Labels: GBN W=7: normal window movement | GBN W=7: normal window movement | Sender | Receiver | Frame 0 from sender window [0…6] | ACK 1 → sender window [1…7] | Frame 1 arrives; receiver now expects 2 | ACK 2 → sender window [2…7,0] | Receiver window progresses [0] → [1] → [2]. | Sequence labels wrap modulo 8; sender window contains 7 slots.
Normal transmission: both windows advance as frames are cumulatively acknowledged.
Swipe across the diagram to read its labels ↔
GBN: a later cumulative ACK covers a lost ACK
Diagram: GBN: a later cumulative ACK covers a lost ACK. Labels: GBN: a later cumulative ACK covers a lost ACK | GBN: a later cumulative ACK covers a lost ACK | Sender | Receiver | Frame 0 accepted; receiver expects 1 | ACK 1 is lost | Frame 1 accepted; receiver expects 2 | ACK 2 arrives before timeout | Sender advances base to 2; continues | ACK 2 confirms frames 0 and 1; no retransmission needed. | Without a later useful ACK, oldest-frame timeout triggers resend.
A later cumulative ACK can cover an earlier lost ACK.

Yaad rakho: GBN receiver one; gap ke baad discard; timeout pe outstanding suffix repeat.

PropertyStop-and-WaitGo-Back-NSelective Repeat
Outstanding sender frames1Up to 2^m−1Up to 2^(m−1), equal windows
Receiver window11Same maximum as sender in standard equal-window SR
ACK convention used hereNext expectedCumulative, next expectedIndividual frame accepted
Out-of-order dataNot deliveredDiscardedBuffered within valid window
After timeoutRepeat the one frameRepeat outstanding frames from baseRepeat only timed-out frame
Buffer/tracking costLowSender window; simple receiverSender and receiver windows; per-frame tracking
TradeoffSimple but idle during RTTGood pipelining, waste after lossEfficient loss recovery, greater complexity

Every comparison assumes finite sequence numbers, correct duplicate handling and the textbook protocol models. The same text “ACK 3” can mean different things under different ACK conventions; state its meaning before explaining a trace.

Which is superior, and why?

Go-Back-N is usually superior in link utilization when propagation delay is significant: it sends several frames before waiting, whereas Stop-and-Wait leaves the link idle during much of the round trip. Its cumulative ACKs also simplify receiver tracking. This is not an unconditional reliability ranking: GBN needs sender buffering and may retransmit correctly received later frames after one loss. Stop-and-Wait is simpler and can suffice for low-rate, short-delay exchanges. Both recover loss correctly when their timers and sequence-number rules are followed.