Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Go-Back-N ARQ
Go-Back-N Automatic Repeat reQuest (Go-Back-N ARQ) is a data link layer protocol that uses a sliding window method for reliable and sequential delivery of data frames. It is a case of sliding window protocol having a send window size of N and receiving window size of 1.
This protocol allows multiple frames to be transmitted before receiving acknowledgments, but requires retransmission of all frames starting from the first unacknowledged frame if any frame is lost or corrupted.
Working Principle
Go-Back-N ARQ uses the concept of protocol pipelining, sending multiple frames before receiving acknowledgment for the first frame. The frames are sequentially numbered with a finite sequence number space. The maximum number of frames that can be sent depends upon the size of the sending window.
If the acknowledgment of a frame is not received within an agreed upon time period, all frames starting from that frame are retransmitted. This is the key characteristic that gives the protocol its name.
Sequence Number Calculation
The size of the sending window determines the sequence number range of outbound frames. If the sequence number uses an n-bit field, then the range is 0 to 2n−1, and consequently, the maximum sending window size is 2n−1.
The sequence numbers are numbered as modulo-2n. For example, if the sending window size is 4, then the sequence numbers will be 0, 1, 2, 3, 0, 1, 2, 3, and so on. This requires 2 bits to generate the binary sequence 00, 01, 10, 11.
Sender Site Algorithm
begin
frame s; //s denotes frame to be sent
frame t; //t is temporary frame
S_window = power(2,m) - 1; //Assign maximum window size
SeqFirst = 0; // Sequence number of first frame in window
SeqN = 0; // Sequence number of Nth frame window
while (true) //check repeatedly
do
Wait_For_Event(); //wait for availability of packet
if ( Event(Request_For_Transfer)) then
//check if window is full
if (SeqN-SeqFirst >= S_window) then
doNothing();
end if;
Get_Data_From_Network_Layer();
s = Make_Frame();
s.seq = SeqN;
Store_Copy_Frame(s);
Send_Frame(s);
Start_Timer(s);
SeqN = SeqN + 1;
end if;
if ( Event(Frame_Arrival) then
r = Receive_Acknowledgement();
if ( AckNo > SeqFirst && AckNo < SeqN ) then
while ( SeqFirst <= AckNo )
Remove_copy_frame(s.seq(SeqFirst));
SeqFirst = SeqFirst + 1;
end while
Stop_Timer(s);
end if
end if
// Resend all frames if acknowledgement haven't been received
if ( Event(Time_Out)) then
TempSeq = SeqFirst;
while ( TempSeq < SeqN )
t = Retrieve_Copy_Frame(s.seq(SeqFirst));
Send_Frame(t);
Start_Timer(t);
TempSeq = TempSeq + 1;
end while
end if
end while
end
Receiver Site Algorithm
Begin
frame f;
RSeqNo = 0; // Initialise sequence number of expected frame
while (true) //check repeatedly
do
Wait_For_Event(); //wait for arrival of frame
if ( Event(Frame_Arrival) then
Receive_Frame_From_Physical_Layer();
if ( Corrupted ( f.SeqNo )
doNothing();
else if ( f.SeqNo = RSeqNo ) then
Extract_Data();
Deliver_Data_To_Network_Layer();
RSeqNo = RSeqNo + 1;
Send_ACK(RSeqNo);
end if
end if
end while
end
Advantages and Disadvantages
| Advantages | Disadvantages |
|---|---|
| Simple receiver implementation (window size = 1) | Inefficient bandwidth usage due to retransmission |
| Maintains order of frames automatically | May retransmit correctly received frames |
| Suitable for channels with low error rates | Poor performance on high error-rate channels |
Conclusion
Go-Back-N ARQ provides reliable data transmission using a sliding window protocol with sender window size N and receiver window size 1. While simple to implement, it may be inefficient due to unnecessary retransmissions when frames are lost or corrupted.
