Go Back N Protocol and Selective Repeat

  • 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

Be First to Comment

Leave a Reply

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