Go Back N - Sliding Window Protocol
Last Updated :
01 Oct, 2025
Go-Back-N (GBN) is a sliding window ARQ protocol that allows the sender to transmit multiple frames (up to a defined window size) without waiting for individual acknowledgments.
- If a packet is lost or corrupted, the sender retransmits that packet and all subsequent packets in the window.
- Example: If packets 1–5 are sent and packet 3 is lost, then packets 3, 4, and 5 are retransmitted.
This mechanism ensures reliability, but may waste bandwidth if errors occur frequently.
The three main characteristic features of GBN are:
1. Sender Window Size (Ws)
It is N itself. If we say the protocol is GB10, then Ws = 10. N should be always greater than 1 in order to implement pipelining. For N = 1, it reduces to the Stop and Wait protocol.
Efficiency Of GBN = N/(1+2a)
where,
a = Tp/Tt
Tp = Propagation Delay
Tt = Transmission Delay of sender
What will be the efficiency if processing delay, queuing delay and transmission delay of acknowledgement is not zero?
Efficiency = N * (Useful time) / (Total Time)
where, useful time=Tt
Total time = Tt + 2 * Tp + Pr + Pq + Tt(ack)
where,
- Tt =Transmission delay of sender side
- Tp = Propagation Delay
- Pr = Processing Delay
- Pq = Queuing Delay
- Tt(ack) = Transmission Delay of Acknowledgement
If B is the bandwidth of the channel, then
Effective Bandwidth or Throughput
= Efficiency * Bandwidth
= (N/(1+2a)) * B
2. Receiver Window Size (WR)
- Always 1 in GBN.
- Receiver only accepts the next expected packet.
- Out-of-order packets are discarded.
3. Acknowledgements
Acknowledgments (ACKs) are signals sent by the receiver to confirm successful receipt of data packets. They ensure reliable communication between sender and receiver. If an ACK is not received within a set time, the sender assumes the packet is lost and retransmits it.
Types of ACKs
Cumulative ACK
- A single acknowledgment confirms receipt of all packets up to a certain point.
- Advantage: Less traffic (fewer ACKs).
- Disadvantage: Less reliable if one ACK is lost, multiple packets appear unacknowledged.
Independent ACK
- Each packet is acknowledged individually.
- Advantage: High reliability.
- Disadvantage: Higher traffic due to more ACKs.
Working of GB-N Protocol
Sender Side
- Maintains a window of size N (e.g., GB4 window size = 4).
- Can send up to N unacknowledged packets.
- Each transmitted packet has a timer.
- If an ACK is received, the window slides forward.
- If a timeout occurs (for a missing packet), the sender retransmits that packet and all subsequent ones in the window.
Receiver Side
- Maintains a window size of 1 (WR = 1).
- Accepts only the expected packet in sequence.
- If the correct packet arrives: sends an ACK and moves to the next expected sequence number.
- If an out-of-order packet arrives: discards it and resends ACK for the last correctly received packet.
Relationship Between Window Size and Sequence Numbers
The window size and sequence numbers in a sliding window protocol, like Go-Back-N or Selective Repeat, are closely related.
- The window size determines how many packets the sender can transmit without needing an acknowledgment. It’s like a limit on how much data can be sent before the sender has to stop and wait for confirmation.
- Sequence numbers are used to label packets so the receiver knows their order and can detect any missing packets.
The window size should be smaller than or equal to the range of available sequence numbers. If the window size is too large compared to the sequence number range, the receiver might get confused because the same sequence number could be reused before the first one is acknowledged. This would make it hard to know if a packet is new or a duplicate.
Relation between window size and sequence number is given by the formula:
Ws + WR <= ASN
where, Ws is sender window size and WR is receiver window size, and ASN is available sequence number.
Ws + 1 <= ASN because WR = 1 in GB-N protocol
So minimum sequence numbers required in GBN = N + 1
Bits Required in GBN = ⌈ log2 (N + 1)⌉
The extra 1 is required in order to avoid the problem of duplicate packets.
Example of GB-N Protocol
Consider an Example of GB4.
- Sender window size is 4 therefore we require a minimum of 4 sequence numbers to label each packet in the window.
- Now suppose receiver has received all the packets(0, 1, 2 and 3 sent by sender) and hence is now waiting for packet number 0 again (We can not use 4 here as we have only 4 sequence numbers available since N = 4).
- Now suppose the cumulative ack for the above 4 packets is lost in the network.
- On sender side, there will be timeout for packet 0 and hence all the 4 packets will be transmitted again.
- Problem now is receiver is waiting for new set of packets which should have started from 0 but now it will receive the duplicate copies of the previously accepted packets.
- In order to avoid this, we need one extra sequence number.
- Now the receiver could easily reject all the duplicate packets which were starting from 0 because now it will be waiting for packet number 4 (We have added an extra sequence number now).
This is explained with the help of the illustrations below. Trying with Sequence numbers 4.
Now, trying with one extra sequence number.
Now it is clear as to why we need an extra 1 bit in the GBN protocol.
Advantages of GBN Protocol
- Simple to implement and effective for reliable communication.
- Better performance than stop-and-wait protocols for error-free or low-error networks.
Disadvantages of GBN Protocol
- Inefficient if errors are frequent, as multiple frames might need to be retransmitted unnecessarily.
- Bandwidth can be wasted due to redundant retransmissions.
Sliding Window Protocol - Go Back N (GBN)
Go Back N ARQ in Computer Network
Explore
Computer Network Basics
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer & Presentation Layer
Application Layer
Advanced Topics
Practice