Knowledge

Selective Repeat Protocol: How It Works, Examples, and Benefits

When a network loses or corrupts a packet, a reliable transport method has to decide what to send again. The Selective Repeat protocol takes the efficient route: it retransmits only the specific frames that were lost or damaged, while retaining correctly received frames that arrived out of order. Also called Selective Repeat ARQ (Automatic Repeat reQuest), this sliding-window protocol is a core networking concept. It helps explain how reliable data transfer can remain efficient when links are noisy, delayed, or prone to packet loss.

In this guide, you will learn what the Selective Repeat protocol is, how it works step by step, how it differs from Go-Back-N, and why its sequence-number rules matter.

What is the Selective Repeat protocol?

Selective Repeat is a reliable data-transfer protocol in which the sender may transmit multiple numbered frames before waiting for acknowledgments. If a frame is lost or corrupted, the sender retransmits that frame only instead of resending every later frame.

The receiver accepts valid frames that arrive within its receive window, even if one or more earlier frames are missing. It stores those out-of-order frames in a buffer and delivers them to the application once the missing frame arrives.

The protocol combines two ideas:

  • ARQ: acknowledgments, checksums, timeouts, and retransmissions make delivery reliable.
  • Sliding windows: sender and receiver can manage several in-flight frames at once, keeping the network link productive.

That is the key distinction: Selective Repeat avoids throwing away good data merely because it arrived in a different order.

How Does It Work?

Each data frame carries a sequence number, and both sides maintain a window that represents the range of sequence numbers they can currently handle.

1. The sender transmits frames in its send window

Suppose the sender window covers frames 0 through 3. The sender can send frames 0, 1, 2, and 3 without pausing after each one. It keeps a copy of every unacknowledged frame and starts a timer for it.

2. The receiver checks each arriving frame

The receiver validates the frame, typically using an error-detection field such as a checksum or CRC. A corrupted frame is ignored or negatively acknowledged, depending on the protocol design.

If a valid frame falls inside the receiver’s current window, the receiver accepts it. A frame that arrives before an expected earlier frame is buffered rather than discarded.

3. The receiver sends an acknowledgment for the specific frame

Selective Repeat uses acknowledgments that identify received frames individually. When frame 3 arrives, the receiver can acknowledge frame 3 even if frame 2 has not arrived yet.

This tells the sender not to retransmit frame 3 unnecessarily. The sender marks that individual frame as acknowledged, but retains any still-unacknowledged frames.

4. Only missing or damaged frames are retransmitted

If the timer for frame 2 expires before its acknowledgment arrives, the sender retransmits frame 2 alone. Once the receiver has frame 2, it can place it in sequence with any buffered later frames and deliver the now-contiguous data.

5. Both windows advance

As the receiver obtains the next expected frame, it advances its receive window. The sender advances its window when the earliest outstanding frames have been acknowledged, creating room to transmit new data.

selective repeat protocol

Selective Repeat protocol example

Imagine a sender transmits frames 0, 1, 2, and 3. Frame 1 is lost in transit, but frames 0, 2, and 3 reach the receiver.

Event Receiver action Sender action
Frame 0 arrives Accepts and acknowledges 0 Marks frame 0 as complete
Frame 1 is lost Waits for frame 1 Keeps frame 1 outstanding
Frame 2 arrives Buffers and acknowledges 2 Does not resend frame 2
Frame 3 arrives Buffers and acknowledges 3 Does not resend frame 3
Frame 1 times out Receives retransmitted frame 1 Resends frame 1 only
Frame 1 arrives Delivers frames 1, 2, and 3 in order Advances the send window

With a Go-Back-N approach, the receiver would normally discard frames 2 and 3 because frame 1 is missing. The sender would then have to resend frame 1 and every following unacknowledged frame. Selective Repeat saves bandwidth by preserving frames 2 and 3.

Selective Repeat vs. Go-Back-N

Both protocols use sequence numbers, acknowledgments, timers, and a sliding window. Their response to an out-of-order frame is very different.

Feature Selective Repeat Go-Back-N
Out-of-order frames Receiver accepts and buffers them Receiver usually discards them
Retransmission Sends only missing or damaged frames again Resends the lost frame and later unacknowledged frames
Acknowledgments Specific, per-frame acknowledgments Usually cumulative acknowledgments
Receiver buffering Required Minimal or not required
Timers Typically one timer per outstanding frame Often one timer for the oldest unacknowledged frame
Bandwidth efficiency on lossy links Higher Lower
Implementation complexity Higher Lower

Bottom line: Go-Back-N is easier to implement, while Selective Repeat is usually more efficient when loss or reordering occurs.

Why does Selective Repeat need a limited window size?

Sequence numbers eventually wrap around. For example, a 3-bit sequence-number field can represent only 0 through 7, then it returns to 0. If the sender and receiver windows are too large, a delayed old frame can look identical to a new frame with the same number.

To avoid this ambiguity, the Selective Repeat window size must be no more than half the sequence-number space:

Window size ≤ sequence-number space ÷ 2

If there are N sequence numbers, the maximum safe window size is N/2. With 3-bit sequence numbers, N = 8, so the window can be at most 4 frames.

This rule leaves enough separation between old and new uses of a sequence number. It is one of the most important details to remember when designing or analyzing a Selective Repeat protocol.

Advantages of Selective Repeat

Selective Repeat is especially useful when retransmissions are costly. Its main benefits include:

  • Less wasted bandwidth. Correctly received out-of-order frames are retained, so they do not need to cross the network again.
  • Better performance on lossy links. Resending one frame instead of a block of frames reduces avoidable traffic after an error.
  • Higher throughput on long-delay paths. A sliding window keeps several frames in flight instead of idling while the sender waits for one acknowledgment.
  • Reliable, in-order delivery. The receiver can repair loss underneath the application, then release data in the intended order.

These gains are most visible when bandwidth is limited, round-trip time is high, or random frame errors are frequent.

Limitations and implementation challenges

Selective Repeat earns its efficiency with extra state and logic.

  • Receiver buffer space: out-of-order frames must be stored until missing frames arrive.
  • Per-frame tracking: the sender needs to track which frames are outstanding and which have been acknowledged.
  • Multiple timers: many implementations maintain a separate timeout for each unacknowledged frame.
  • Duplicate handling: retransmitted frames and duplicated acknowledgments need careful handling.
  • Sequence-number discipline: the window-size rule is essential; ignoring it can cause old data to be mistaken for new data.

For simple, reliable links, the added complexity may not be worthwhile. For unreliable or expensive links, it often is.

Is Selective Repeat the same as TCP SACK?

No. They share a similar goal—avoiding unnecessary retransmissions—but they are not the same protocol.

Selective Repeat ARQ is a general reliable-data-transfer design in which a receiver individually accepts, buffers, and acknowledges frames in its window. TCP Selective Acknowledgment (SACK) is an extension that lets a TCP receiver report blocks of data it has received beyond a gap. TCP still uses its own congestion-control, flow-control, acknowledgment, and recovery rules.

It is useful to think of SACK as applying the selective-acknowledgment idea within TCP, rather than treating TCP as a textbook Selective Repeat implementation.

Where is Selective Repeat used?

Selective Repeat is commonly taught as a foundational ARQ and sliding-window protocol. Its principles are relevant to link-layer reliability mechanisms, wireless communication, satellite links, and transport protocols that need to cope with loss or reordering efficiently.

Even when a production protocol does not implement textbook Selective Repeat exactly, the same design trade-off appears repeatedly: should a receiver discard out-of-order data, or retain it and tell the sender precisely what was received?

Key takeaways

The Selective Repeat protocol is a sliding-window ARQ method that makes reliable data transfer more efficient. It lets the receiver buffer valid out-of-order frames and lets the sender retransmit only frames that were lost or corrupted. Its biggest strength is efficiency on imperfect links; its highest cost is complexity in buffering, timers, acknowledgments, and sequence-number management. Remember the core rule: the Selective Repeat window must not exceed half of the sequence-number space. For readers comparing reliable transmission strategies, that balance between efficiency and complexity is the central lesson of Selective Repeat.

Knowledge

Transmit Opportunity (TXOP): How It Improves Wi‑Fi Performance

A transmit opportunity, commonly called TXOP, is a controlled window of time in which a...

QoS Traffic Scheduling: Methods, Benefits, and Best Practices

QoS traffic scheduling is the process of deciding which network packets are transmitted first when...

Dynamic Frequency Selection (DFS): How It Works in Wi‑Fi

Dynamic Frequency Selection (DFS) is a Wi‑Fi feature that lets wireless networks use certain 5...