Javatpoint Logo
Javatpoint Logo

Difference Between Go-Back-N and Selective Repeat Protocol

Go-Back-N Protocol

It is an example of the Automatic Repeat Request (ARQ) protocol. In this protocol, the sender node continuously transmits a defined number of data frames in the network. The window size determines the number of nodes. The sender can transmit these frames without receiving an acknowledgment from the receiver node. This is a special case of sliding window protocol where the sender window size is N, and the receiver window size is 1.

The receiver node keeps track of the sequence number of the next frame to be received by the receiver node. The receiver discards any data frame with a different sequence number. This means that it deletes any duplicate frame already acknowledged by the receiver or any frame out of order that is expected to receive later by the node. It only accepts in-order delivery of nodes. It then transmits an acknowledgment for the last data frame that was transmitted in the correct order. Once the sender node transmits all the data frames in the window, it searches for all the frames since the first data frame was lost during transmission. The sender node then goes to the sequence number of the last frame acknowledged by the receiver, and it then fills the window beginning with this frame and continues the transmission process.

Selective Repeat Protocol

This protocol is also known as Selective Repeat Automatic Repeat Request. This protocol is implemented in the data link layer of the node in the network. This protocol uses a sliding window method that ensures reliable delivery of data frames from the sender node to the receiver node. The good data frames are received and buffered by the receiver node. This protocol is more efficient as it only retransmits the corrupted data frames during transmission in the network.

In order to implement Selective Repeat Protocol requires, two windows of the same size. The sending window stores the data frames to be transmitted by the sender node. At the same time, the receiving window is responsible for storing the data frames received by the receiving node.

The window size is kept at half of the maximum sequence number of the data frame. For example, if the sequence number ranges from 0-15, the window size for both the sender and receiver node will be 8.

Working Principle for Go-Back-N and Selective Repeat Protocol

Go-Back-N Protocol

Go-Back-N ARQ provides for sending multiple frames before receiving the acknowledgment for the first frame. The frames are sequentially numbered and have a finite number of frames. 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, all frames starting from that frame are retransmitted.

The size of the sending window determines the sequence number of the outbound frames. If the sequence number of the frames is an n-bit field, then the range of sequence numbers that can be assigned is 0 to 2n?1. Consequently, the size of the sending window is 2n?1. Thus to accommodate a sending window size of 2n?1, an n-bit sequence number is chosen.

Selective Repeat Protocol

It enables the sender node to transmit multiple data frames in the network. The data frames transmitted depend upon the availability of data frames in the sending window. The next frame can be transmitted in the network without waiting for the acknowledgment of the previous data frame. The size of the sender window determines the number of frames that can be transmitted simultaneously.

The receiver node stores the sequence number of the first incorrect or corrupted frame or the node not received by the receiver node. The receiver node then fills the receiving window with upcoming frames received by the node once the current window is filled. Then the receiver nodes transmit the sequence number of the corrupt or missing frame with the acknowledgment frame.

The sender node continuously transmits the available frame in the sender window. Once all the data frames stored in the sender window are transmitted to the receiver node, it re-sends the data frames whose sequence numbers are provided by the acknowledgment. Once the re-transmission is completed, it continues transmitting to the other network nodes.

Difference Between Go-Back-N and Selective Repeat

The two sliding window protocol also differs in their function and working. The difference between Go-Back-N and Selective Repeat protocols are as follows:

BASIS FOR COMPARISON GO-BACK-N SELECTIVE REPEAT
Basic Retransmits all the frames that are sent after the frame which is suspected to be damaged or lost. Retransmits only those frames that are suspected to be lost or damaged.
Bandwidth Utilization If the possibility of error in transmission is high or a lot of corrupt frames are transmitted, then this protocol wastes a lot of bandwidth. Since only the erroneous or corrupted data frames are retransmitted in the network. It saves network bandwidth and is more efficient than the Go-Back-N protocol.
Complexity The implementation of this protocol is simpler than selective repeat. It is less complex because of its less logical implementation. It is more complex than the Go-Back-N protocol as additional logic and sorting algorithm is applied at both the sender and receiver node. Moreover, it also requires additional storage to work efficiently.
Minimum Sequence Number The possible minimum sequence number for the Go-Back-N protocol is N+1. Here N is the number of a data frame transmitted by the sender. The possible minimum sequence number for the Selective Repeat protocol is 2N. Here N is the number of a data frame transmitted by the sender.
Sender Window Size The window size of the sender node is N in the Go-Back-N protocol. It is also N for selective repeat protocol. The Window size of the sender node is greater than 1.
Receiver Window Size The size of the receiver window is 1. The size of both the sender and receiver window is equal to implement selective repeat. Thus, it is N in this protocol.
Window size N-1 <= (N+1)/2
Sorting The data frames are not sorted at either end of the transmission. The sorting of data frames is done at the receiving end. Maintaining the correct sequential order of the data frame is necessary to ensure the correct frame is requested.
Storing Receivers do not store the frames received after the damaged frame until the damaged frame is retransmitted. The receiver stores the frames received after the damaged frame in the buffer until the damaged frame is replaced.
Searching It does not perform a search as all the nodes in the current window are represented if the sender does not receive acknowledgment of a frame. Search is not performed at either end of transmission. The sender must perform a search operation as only the requested node is retransmitted in the network.
Supported Order It only accepts in-order delivery at the receiver node in this protocol. In Selective Repeat ARQ, the receiver node only accepts out-of-order delivery in the network.
Type of Acknowledgement It sends a cumulative acknowledgment for the data frames to the sender node. In selective repeat, the acknowledgment is individual for each frame.
ACK Numbers NAK number represents the expected frame number of the next data frame in the network. NAK number represents the number of the data frame that is lost during transmission.
Re-transmission The sender node retransmits all the data frames in the current window if it does not receive the acknowledgment for the data frame. Thus, the number of re-transmission is N. In selective repeat protocol, only the erroneous data frames are retransmitted. Thus, the number of re-transmission is 1.
Efficiency of the Protocol The formula to compute the efficiency is N/(1+2*a), where a represents the ratio of propagation delay to transmission delay and N represents the data packets transmitted in the network. The formula to compute the efficiency is N/(1+2*a), where a represents the ratio of propagation delay to transmission delay and N represents the data packet transmitted in the network.
Use It is more used because it is less complex and requires less storage. It is less implemented. It is used where the bandwidth is limited, and efficiency is important.

Conclusion

The selective Repeat protocol is the more efficient as it does not waste network resources on the data frames that the sender correctly transmits to the receiver node.

The Go Back N protocol is more used because it is less complex to implement in the network. Moreover, it is comparatively less expensive as it requires less storage.

If the window size is equal for both Go-Back-N and selective repeat protocol, then the efficiency of both these protocols is almost equal. The resources' usage and availability determine that either protocol will be implemented.

Selective Repeat Protocol has the advantages of both Stop and Wait and Go Back N protocol.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA