Difference between Go-Back-N and Selective Repeat

In computer networks, protocols are important for ensuring reliable data transmission over various sub-networks and channels. These protocols are known as Automatic Repeat Request (ARQ) protocols. Go-Back-N and selective repeat are two of the most standard ARQ protocols used widely for their efficiency.

While both approaches are made for error recovery, they have key differences in their mechanisms and efficiency. Understanding these key differences is crucial for deploying the perfect protocol for your computer network.

Go-Back-N protocol

Go-Back-N is a famous ARQ protocol that is particularly used in data communication systems for error recovery. It is commonly used in scenarios where low error rates are preferred, along with a less complex implementation.

Working principle

In Go-Back-N, cumulative acknowledgmentsMultiple acknowledgements can be sent and received at the same time, proving the receiver has received all the packets enroute. are used. This means the sender can transmit multiple packets at a time frame without particularly waiting for individual acknowledgments.

When the receiver receives a packet, it sends an acknowledgment for all the previous packets in the sequence, including the latest one received. However, if a packet is lost or damaged during transmission, the receiver discards it, and the sender is required to retransmit all the packets starting from the lost one, according to the sequence.

Go-Back-N: sender

Go-Back-N uses a sliding window concept. the sender maintains a window of size N, where N should always be greater than 1 to maintain pipelining.

The sliding window is implemented in the following manner.

Go-Back-N Sender
Go-Back-N Sender

The sender maintains a timer for the longest in-flight packet; if the timer expires before the sender receives a cumulative acknowledgment, then the sender will retransmit all the unacknowledged packets again.

Go-Back-N: receiver

Go-Back-N uses cumulative acknowledgments, where the receiver sends a single acknowledgment for a group of packets. The receiver's window size is set to 1, allowing it to accept only the next expected packet in the sequence.

While this simple buffer management reduces complexity, it may lead to potential inefficiencies.

Go-Back-N in action

Here's a simplified version of how Go-Back-N works during transmission:

Sending first window packets
1 of 6

If you want to learn more about Go-Back-N protocol, read this.

Selective Repeat

Another type of ARQ protocol is Selective Repeat, designed to handle packet losses and transmission errors. It is mainly used in high-speed networks where a single lost packet is preferred over the retransmission of multiple packets.

Working principle

The sender can send multiple data packets without waiting for an acknowledgment from the receiver. The receiver, upon receiving a packet, sends an acknowledgment to the sender to confirm the receipt.

However, if the packet's timeout happens before receiving an ack, the sender retransmits that specific packet to the receiver again.

Selective Repeat: sender

Selective Repeat maintains a window of fixed size at both the sender and the receiver. This window represents the range of acceptable sequence numbers of packets.

The sender's window indicates the range of unacknowledged packets that can be sent.

Selective repeat Sender
Selective repeat Sender

Selective Repeat: receiver

The Selective Repeat receiver's window shows the acceptable range of incoming packets.

Selective Repeat receiver
Selective Repeat receiver

Selective Repeat in action

Here's how Selective Repeat works:

Sending first window packets
1 of 6

If you want to learn more about Selective Repeat protocol, read this.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved