Go Back N Protocol and Selective Repeat

Published by Keyboard Banger on

  • Let’s define some terms first:
    • outstanding segments = the segments that are sent and still not acknowledged
    • Base: the sequence number of the oldest unacknowledged packet
    • NextSeqNum: the sequence number of the first next packet to be sent
    • N: the size of the window
  • the receiver must deliver in-order bytes of data to the upper layer protocol
  • In GBN protocol,
    • out-of-order received segments are discarded. If the receiver expects a byte with SeqNum, but receives a byte with SeqNum + 1, it sends an ACK for byte SeqNum and discards the SeqNum+1 byte because it will be considered out of order. In other words, the receiver sends an ACK for each received in-order segment.
    • at the sender side, if the application layer gives data to the Transport layer whose sequence number is larger than base + N, TCP signals to the application that it rejected the data because the window is full.
    • Sender maintains only one timer. The timer starts with the oldest-sent-yet-not-acknowledged segment. With each ACK received, the Sender checks if there still are segments that are sent and not acknowledged. If so, the timer restarts. However, if there are no sent-yet-unacknowledged segments, the timer stops
    • if ACK for segment k is not received, then a timeout occurs and the sender retransmits all the segments up to the last sent-yet-not-acknowledged segment. For example, if the sender already sent segment 2 up to 5, and ACK 2 is not received, then in Go Back N the sender retransmits segments 2, 3, 4 and 5.
  • The following diagram describes the operations of the Go Back N protocol.

Figure: simple Go Back N protocol operations




Computer Networking: A Top Down Approach, Kurose and Ross

Categories: Networking Basics

Keyboard Banger

Keyboard Banger is a network engineer from Africa. He has been working in network support and administration since 2008. He started writing study notes about certification exams and technology topics a couple of years ago. When he's not writing articles, he can be found wandering on technical forums.


Leave a Reply

Your email address will not be published. Required fields are marked *