Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is Go-Back-N ARQ Protocol?
3.
Sender Window and Receiver Window in Go-Back-N ARQ Protocol
4.
Working of Go-Back-N ARQ Protocol
4.1.
Step 1: Sender's Window Size
4.2.
Step 2: Sending the First Frame
4.3.
Step 3: Expecting Acknowledgment
4.4.
Step 4: Frame 0 Acknowledged
4.5.
Step 5: Acknowledgment for Frame 1
4.6.
Step 6: Continuing to Send Frames
4.7.
Step 7: Timeout and Retransmission
5.
Characteristics of Go-Back-N ARQ
6.
Advantages of Go-Back-N ARQ
7.
Disadvantages of Go-Back-N ARQ
8.
Frequently Asked Questions
8.1.
What is the GBN protocol?
8.2.
What is the formula for Go-Back-N utilization?
8.3.
What is Go-Back-N ARQ protocol for noisy channel?
8.4.
What are the three protocols used for noisy channels?
8.5.
What are the different types of Arq protocols?
9.
Conclusion
Last Updated: Mar 27, 2024
Medium

Go-Back-N ARQ Protocol

Author Sandeep kamila
2 upvotes
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

Go-Back-N Automatic Repeat reQuest (ARQ) is a sliding window protocol used in computer networks. It ensures reliable data transmission by allowing the sender to send multiple frames before receiving acknowledgment. If an acknowledgment is not received, the sender retransmits all unacknowledged frames, enhancing data integrity in network communication.

Go-Back-N ARQ Protocol

The protocols involved in flow control are shown below:

 

protocols involved in flow control

 

In this article, we will discuss the Go-Back-N ARQ protocol which uses the concept of pipelining and is more efficient than the Stop and Wait protocol. Pipelining is a general concept in which the processing of the next task begins before the previous task is completed. 

Also see, Message Switching in Computer Networks.

What is Go-Back-N ARQ Protocol?

Go-Back-N ARQ is a type of ARQ (automatic repetition request protocol) in which the sender process continues to send the number of frames specified by a window size even if the receiver does not provide an acknowledgement (ACK) packet.

  • In Go-Back-N ARQ, the N is the sender window size. Suppose if we say Go-Back-4, the sender window size is 4. It means it can send 4 frames simultaneously before expecting any acknowledgement from the receiver.
  • Go-Back-N ARQ uses the concept of protocol pipelining, i.e. the sender can send multiple frames before receiving the acknowledgement for the first frame.
  • There is a finite number of frames, and the frames are numbered sequentially.
  • The number of frames that can be sent depends on the sender's window size.
  • If the acknowledgement of a frame is not received within a certain period of time, all the frames present in the current window will be transmitted.
  • The sending window size determines the sequence number of the outbound frames.
  • N is the sender's window size; for example: if the sending window size is 4 (2^2), then the sequence numbers will be 0,1,2,3,0,1,2,3,0,1, and so on. 

The flow control protocols are generally divided into two categories i.e.

  1. Stop and wait protocol
  2. Sliding window protocol.
Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Sender Window and Receiver Window in Go-Back-N ARQ Protocol

In the Go-Back-N Automatic Repeat reQuest (ARQ) protocol, sender and receiver windows play crucial roles in managing the flow of data and ensuring reliable communication.

  • Sender Window: The sender window represents a range of sequence numbers assigned to frames awaiting acknowledgment from the receiver. Frames within the sender window have been sent but not yet acknowledged. The sender retains these frames in its buffer, and as acknowledgments are received, it slides the window forward, allowing for the transmission of new frames. For example in Go Back 4 ARQ, the size of the sender window is 4.
     
  • Receiver Window: The receiver window represents a range of acceptable sequence numbers that the receiver is willing to accept. The receiver uses the receiver window to filter incoming frames. It acknowledges correctly received frames within the window and discards out-of-sequence frames. The receiver window helps in reordering frames and detecting and correcting transmission errors.
Sender Window and Receiver Window in Go-Back-N ARQ Protocol

Working of Go-Back-N ARQ Protocol

Suppose there is a sender and a receiver. There are 11 frames to be sent, and the frames are numbered as 0,1,2,3,4,5,6,7,8,9,10. The sequence number of the frames is decided by the size of the window N. For better understanding, we have taken the running numbers.

Let’s understand the working of Go-Back-N ARQ with an example.

Step 1: Sender's Window Size

Imagine the sender's window size is 4. This means the sender can send up to 4 frames without needing acknowledgments for each frame.

Sender's Window Size

Step 2: Sending the First Frame

The sender begins by sending the first frame, which we'll call frame 0. At this point, only frame 0 is within the sender's current window. Since the window size is 4, the sender continues to send the next frames in its buffer (1, 2, 3) without waiting for acknowledgments.

Sending the First Frame

Step 3: Expecting Acknowledgment

The sender now expects an acknowledgment from the receiver for frame 0.

Expecting Acknowledgment

Step 4: Frame 0 Acknowledged

Once the receiver acknowledges frame 0, the current window size becomes 3. The sender then sends the next frame from its buffer, which is frame 4, and the window slides forward.

Frame 0 Acknowledged

Step 5: Acknowledgment for Frame 1

With a current window size of 4, the receiver acknowledges frame 1.

Acknowledgment for Frame 1

Step 6: Continuing to Send Frames

The sender sends the next frame from its buffer, which is frame 5, and the window slides forward. However, let's assume the sender doesn't receive an acknowledgment for frame 2. This could be because frame 2 got lost or the acknowledgment itself was lost.

Continuing to Send Frames

Step 7: Timeout and Retransmission

The sender waits for a set period. If it doesn't receive an acknowledgment for frame 2 during this time, it "goes back" to frame 2. It then retransmits all frames in the current window (2, 3, 4, 5), even though frames 4 and 5 have already been sent. This retransmission ensures that all frames are received correctly, including the ones that might have been sent previously but not acknowledged due to the issue with frame 2.

Timeout and Retransmission

You can also read about mime protocol.

Characteristics of Go-Back-N ARQ

The following are the characteristics of Go-Back-N ARQ:

  1. The sender's window size in Go-Back-N ARQ is N
     
  2. The receiver's window size is 1
     
  3. If the sender doesn't receive an acknowledgment for a single frame, it retransmits the entire window, beginning with the problematic frame

Advantages of Go-Back-N ARQ

The following are the advantages of Go-Back-N ARQ:

  1. In Go-Back-N ARQ, when a sender detects that a frame it has sent is corrupted (e.g., due to transmission errors), it doesn't just retransmit the corrupted frame. Instead, it retransmits the entire window of unacknowledged frames, starting with the corrupted frame
     
  2. It allows the sender to send multiple frames consecutively without waiting for acknowledgments after each frame
     
  3. Pipelining is present, which means that the sender can send a continuous stream of frames within the window without waiting for individual acknowledgments

Disadvantages of Go-Back-N ARQ

The following are the disadvantages of Go-Back-N ARQ:

  1. If acknowledgement of one frame is not received, the entire window is retransmitted instead of only the corrupted frame
     
  2. Retransmitting the entire window on detection of a corrupted frame increase congestion and time consumption

Read about - Lock based protocol in DBMS

Frequently Asked Questions

What is the GBN protocol?

Go-Back-N (GBN) is a sliding window protocol used in computer networks, ensuring reliable data transmission by allowing the sender to resend unacknowledged frames.

What is the formula for Go-Back-N utilization?

The formula for Go-Back-N utilization is, Utilization = Efficiency × (1 - BER)^N, where BER is the Bit Error Rate and N is the window size.

What is Go-Back-N ARQ protocol for noisy channel?

In a noisy channel, Go-Back-N ARQ (Automatic Repeat reQuest) retransmits frames if they are corrupted, enhancing data reliability.

What are the three protocols used for noisy channels?

Three protocols for noisy channels include Stop-and-Wait ARQ, Go-Back-N ARQ, and Selective Repeat ARQ.

What are the different types of Arq protocols?

Automatic Repeat reQuest (ARQ) protocols include Stop-and-Wait, Go-Back-N, and Selective Repeat, each addressing error recovery in data communication.

Conclusion

In this article, we have discussed the Go-Back-N ARQ Protocol. We have also discussed what are sender and receiver window in this protocol. Then we looked at the working of it. Then we discussed the advantages and disadvantages associated with it.

Recommended Readings:


Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, etc.

Previous article
Ethernet in Computer Networks
Next article
Virtual LAN (VLAN)
Live masterclass