Selective Repeat ARQ: Window Rules, Worked Example and Exam Question Patterns

Build a reliable Selective Repeat trace from sender and receiver state, then test the window rule and utilisation formula with worked numbers.

KnowledgeGate Team

Exam prep & CS education

Updated 18 Sep 20265 min read

Selective Repeat ARQ sounds simple: retransmit only the missing frame. It gets confusing when sender and receiver windows move independently, frames are buffered, and sequence numbers wrap. Selective Repeat uses independent sender and receiver windows, a half-space rule, and efficiency calculations.

Related reading: Selective Repeat MCQs and Go-Back-N ARQ.

Selective Repeat ARQ: what the protocol is solving

An unreliable data link may lose or damage a frame or ACK. Automatic Repeat reQuest (ARQ) uses numbered frames, ACKs, and retransmission timers. An m-bit sequence field repeats modulo 2^m.

Selective Repeat buffers valid out-of-order frames. The sender tracks ACKs and keeps a timer per outstanding frame. An expiry retransmits only that frame.

Keep three states separate:

  • Received: the receiver obtained a valid frame.

  • Acknowledged: its ACK reached the sender.

  • Delivered: the receiver passed it upward in order.

The Computer Networks guide places these states in the wider data-link context.

Selective Repeat window size and sequence-number rule

An m-bit field provides sequence numbers 0 through 2^m - 1. For equal sender and receiver windows:

W <= 2^(m-1)

More generally, W_s + W_r <= 2^m. Equal windows reduce this to the half-space rule.

For m = 3, the sequence space is 0, 1, 2, 3, 4, 5, 6, 7. Therefore, the largest equal window is W = 2^(3-1) = 4.

Why is W = 5 illegal? After old frames 0 to 4 are accepted, the receive base becomes 5 and its new window is [5,6,7,0,1]. Positions 0 and 1 overlap the old window [0,1,2,3,4]. A delayed old frame 0 now looks like new frame 0 after wraparound.

Sequence-number ring for m=3 showing why a window of 5 reuses old positions 0 and 1, so the legal equal window is W=4.

Selective Repeat ARQ worked example: frame 1 is lost

Let m = 3 and W = 4. Both windows start at [0,1,2,3]. Frames 0,1,2,3 are sent in order. Frame 1 is lost; every other frame and ACK arrives. Each outstanding frame has a timer.

Event

Sender state

Receiver action

ACK

Receiver base

Send 0,1,2,3

Window [0,1,2,3] outstanding

Frame 1 is lost

None

0

Receive 0

Await ACKs

Deliver 0; window becomes [1,2,3,4]

ACK 0

1

Receive 2

1,2,3 outstanding

Buffer 2

ACK 2

1

Receive 3

1,2,3 outstanding

Buffer 3

ACK 3

1

Sender gets ACK 0

Window becomes [1,2,3,4]; send 4

No change

None

1

Sender gets ACK 2,3

Mark 2,3 ACKed; base stays 1

No change

Received

1

Receive 4

1 unACKed; 2,3 ACKed

Buffer 4

ACK 4

1

Sender gets ACK 4

Mark 4 ACKed; base stays 1

No change

Received

1

Timer 1 expires

Retransmit only 1

Waiting for 1

None

1

Receive 1

Await ACK 1

Deliver 1,2,3,4; window becomes [5,6,7,0]

ACK 1

5

Sender gets ACK 1

ACKs 1 to 4 contiguous; base becomes 5

No change

Received

5

ACKs 2, 3, and 4 cannot move the sender past base 1. ACK 1 closes the gap and exposes the contiguous ACKed run.

Selective Repeat trace with frame 1 lost: receiver buffers 2, 3 and 4, then retransmits only frame 1 and delivers 1 to 4 in order.

Selective Repeat efficiency: a complete numerical

Assume no loss, negligible ACK transmission and processing time, frame transmission time T_t, one-way propagation T_p, and a = T_p/T_t. Ideal utilisation is:

U = min(1, W/(1 + 2a))

A 1,000-byte frame contains 1,000 x 8 = 8,000 bits. On a 1 Mbps link:

T_t = 8,000/1,000,000 = 0.008 s = 8 ms

With T_p = 20 ms, a = 20/8 = 2.5, so 1 + 2a = 1 + 5 = 6. For W = 4:

U = 4/6 = 0.6667, or about 66.7%.

Under the same assumptions, stop-and-wait gives 1/6 = 0.1667, or about 16.7%.

Full ideal utilisation needs W >= 6. A 3-bit field caps legal equal windows at 4. The smallest usable field is m = 4, since 6 <= 2^(4-1) = 8. Loss, ACK overhead, and processing reduce throughput.

Selective Repeat ARQ versus Go-Back-N

With frame 1 lost, Go-Back-N discards later frames and retransmits the suffix from 1. Selective Repeat buffers 2,3,4 and retransmits only 1.

Feature

Selective Repeat

Go-Back-N

Receiver window

More than 1

1

Out-of-order frames

Buffered

Discarded

ACK bookkeeping

Per frame

Usually cumulative

Timer model

Per outstanding frame

Timer for oldest outstanding frame

After one loss

Retransmit the missing frame

Retransmit from the missing frame onward

Textbook m-bit limit

Equal windows at most 2^(m-1)

Sender window at most 2^m - 1

For transport-layer reliability and ordering, continue with TCP vs UDP: Transport Layer Explained. TCP must not be equated mechanically with classroom Selective Repeat.

Selective Repeat ARQ traps that change the answer

  • ACK is not delivery. ACK 2 says frame 2 was received, not that it reached the upper layer.

  • A gap blocks the sender base. ACKed frames above base 1 cannot slide the sender past unacknowledged frame 1.

  • Buffering is not reordering delivery. Frames can arrive out of order, but delivery remains in order.

  • Range checks are modulo checks. A window such as [5,6,7,0] is contiguous in a modulo-8 space.

If ACK 1 is lost after the receiver reaches base 5, a duplicate frame 1 must be recognised, ACKed again where required, and never delivered twice.

After every event, write S_base, R_base, the sender ACK bitmap, and receiver buffer. Move a base only across a contiguous run, then choose the timer that expires.

Selective Repeat ARQ exam question patterns

Practise four forms: maximum W from m; minimum m from W; buffering, ACK, delivery, and retransmission traces; and ideal utilisation from frame size, rate, propagation, and window.

Two rapid checks:

  1. For m = 4, maximum equal SR window is 2^(4-1) = 8.

  2. For required W = 9, minimum m is 5: 9 > 2^(4-1) = 8, while 9 <= 2^(5-1) = 16.

Now lose frame 3 instead. Frames 0,1,2 deliver, frame 4 may be buffered after the window opens, and only 3 is retransmitted. KnowledgeGate has over 20 live practice questions on this topic; use Computer Networks MCQs after reproducing the trace unaided. is retransmitted. KnowledgeGate has over 20 live practice questions on this topic; use Computer Networks MCQs after reproducing the trace unaided.

Selective Repeat ARQ: the short version and next step

  • Buffer valid out-of-order frames.

  • ACK frames individually.

  • Retransmit only what is missing.

  • Keep equal windows within half the sequence space.

Delivery remains in order even when arrival and ACK order do not. Use GATE Guidance by Sanchit Sir for a structured route through the wider CS syllabus. For timed, topic-wise practice, use the GATE Test Series.

Redraw the frame-1-loss timeline from memory. Then change m, W, and the lost-frame number, and recompute every window instead of memorising one trace.