The Wayback Machine - https://web.archive.org/web/20220321202553/https://www.geeksforgeeks.org/difference-between-stop-and-wait-gobackn-and-selective-repeat/
Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Difference between Stop and Wait, GoBackN and Selective Repeat

  • Difficulty Level : Easy
  • Last Updated : 18 Oct, 2021

Reliable data transfers are one of the primary concerns in computer networking. This service department lies in the hands of TCP. Their major flow control protocols – Stop and Wait, Go Back N, and Selective Repeat. 
 

  1. Stop and Wait – 
    The sender sends the packet and waits for the ACK (acknowledgement) of the packet. Once the ACK reaches the sender, it transmits the next packet in a row. If the ACK is not received, it re-transmits the previous packet again. 
     
  2. Go Back N – 
    The sender sends N packets which is equal to the window size. Once the entire window is sent, the sender then waits for a cumulative ACK to send more packets. On the receiver end, it receives only in-order packets and discards out-of-order packets. As in case of packet loss, the entire window would be re-transmitted. 
     
  3. Selective Repeat – 
    The sender sends packets of window size N and the receiver acknowledges all packets whether they were received in order or not. In this case, the receiver maintains a buffer to contain out-of-order packets and sorts them. The sender selectively re-transmits the lost packet and moves the window forward. 
     

Differences: 

PropertiesStop and WaitGo Back NSelective Repeat
Sender window size1NN
Receiver Window size11N
Minimum Sequence number2N+12N
Efficiency1/(1+2*a)N/(1+2*a)N/(1+2*a)
Type of AcknowledgementIndividualCumulativeIndividual
Supported order at the Receiving end–In-order delivery onlyOut-of-order delivery as well
Number of retransmissions in case of packet drop1N1

Where, 
 

  • a = Ratio of Propagation delay and Transmission delay,
  • At N=1, Go Back N is effectively reduced to Stop and Wait,/li> 
     
  • As Go Back N acknowledges the packed cumulatively, it rejects out-of-order packets,
  • As Selective Repeat supports receiving out-of-order packets (it sorts the window after receiving the packets), it uses Independent Acknowledgement to acknowledge the packets.

Reference –
Book – Computer Networks by Tanenbaum

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!