Difference between Stop and Wait, GoBackN and Selective Repeat
One of the main issues in computer networking is the transfer of data in an accurate manner. The control over this service department rests with TCP. They use Stop and Wait, Go Back N and Selective Repeat as their main flow control protocols.
We must first understand the error control mechanism in order to comprehend the stop-and-wait protocol. The error control mechanism is used to ensure that the received data is identical to that sent by the sender. The two types of error control mechanisms are Stop and Wait ARQ and Sliding Window. The sliding window is further separated into the Go Back N and Selective Repeat categories. People choose the error control method—stop and wait or sliding window—based on the usage.
Stop and Wait Protocol
The sender sends the packet and then waits for the packet’s ACK (acknowledgement). The next consecutive packet is sent once the ACK has been received by the sender. It sends the previous packet again if the ACK is not received.
Go-Back-N
The Go-Back-N ARQ protocol is a variant of the automatic repeat request (ARQ) protocol. Even if the recipient does not reply with an acknowledgement (ACK) packet, the sender still sends a number of frames determined by the window size. A specific instance of the fundamental sliding window protocol has a transmit window size of N and a receive window size of 1. Before asking for an acknowledgement, it can send N frames to the peer.
It operates under the principle of protocol pipelining, which permits the delivery of multiple frames before the first frame is acknowledged. Go-Back-N ARQ provides multiple brackets at once, necessitating a numbering strategy to distinguish one frame from another, so the shelves are sequentially numbered. Sequential numbers are the name given to these numbers.
The sender’s window size has a direct impact on the number of frames that can be sent at once. If a frame’s acknowledgement is not received within the specified time frame, all structures in the current window will be resent.
Because Go-Back-N would retransmit an entire window even if just one packet were lost, it uses more bandwidth. If the rate of error is high, then Go-Back-N will consume a lot of bandwidth.
Cumulative acknowledgements are used by Go-Back-N, which can reduce traffic, but there is always a chance of losing the cumulative acknowledgement. If this occurs, all of the corresponding packets’ acknowledgements are lost.
Selective Repeat
Window size N packets are sent by the sender and all packets, regardless of whether they arrived in order or not, are acknowledged by the receiver. In this scenario, the receiver maintains and sorts an out-of-order packet buffer. The sender advances the window while sending the lost packet again in a selective manner.
Properties | Stop and Wait | Go Back N | Selective Repeat |
---|---|---|---|
Sender window size | 1 | N | N |
Receiver Window size | 1 | 1 | N |
Minimum Sequence number | 2 | N+1 | 2N |
Efficiency | 1/(1+2*t) | N/(1+2*t) | N/(1+2*t) |
Type of Acknowledgement | Individual | Cumulative | Individual |
Supported order at the Receiving end | – | In-order delivery only | Out-of-order delivery as well |
Number of retransmissions in case of packet drop | 1 | N | 1 |
Transmission Type | Half duplex | Full duplex | Full duplex |
Implementation difficulty | Low | Moderate | Complex |
Where,
- t = Ratio of Propagation delay and Transmission delay,
- At N=1, Go Back N is effectively reduced to Stop and Wait,
- Go Back N rejects out-of-order packets while acknowledging the cumulatively packed packets,
- Selective Repeat uses Independent Acknowledgement to acknowledge the packets because it supports receiving out-of-order packets (it sorts the window after receiving the packets).
Conclusion
Sliding Window protocols like Go-Back-N and Selective Repeat enable the spontaneous transmission of multiple frames without the need to wait for receiver acknowledgements. In contrast, the Stop-and-Wait protocol only permits the sender to send one frame at a time, and it requires the sender to wait for the receiver to acknowledge it before sending a second frame.