Lucia
Lucia

Reputation: 371

Differences between TCP and Go Back N

I was reading Computer Networking from Kurose, and while reading in the TCP chapter about the differences between TCP and Go Back N I found something that I don't fully understand. The book says the following about some of the differences between the two protocols:

"many TCP implementations buffer correctly received but out-of-order segs rather than discard.

also, suppose a seqof segs 1, 2, …N, are received correctively in-order,ACK(n), n < N, gets lost, and remaining N-1 acks arrive at sender before their respective timeouts TCP retransmit most one seg, i.e., seg n, instead of pkts, n, n+1, …, N TCP wouldn’t even retransmit seg n if ACK(n+1) arrived before timeout for seg n"

I understand the buffering of out-of-order segments, but I don't understand the other behavior, and I think it is because I don't fully understand Go Back N. Following that example, if ACK(n+t) arrives before Go Back N timeout, the protocol would continue as if seg n was in fact received, which is the case, because of the accumulative ACKS... so, Go Back N wouldn't retransmit that segment either.... or am I missing something?

Upvotes: 9

Views: 23301

Answers (5)

HungNM2
HungNM2

Reputation: 3425

see these links, it is easy to understand about GBN and SR:

Go Back N protocol (GBN): enter link description here

Selective Repeat protocol (SR): https://www.youtube.com/watch?v=Cs8tR8A9jm8

in GBN and SR protocol,the receiver has to send ACK message for all segments which it has received in the slide window.

in TCP protocol, the receiver don't send ACK message for all segments which it has received in the slide window. the receiver only send ACK to get the next segments that it expect. it means that less ACK messages will be sent to the sender. therefore, it is good for reducing network congestion.

in abnormal cases, some segments are lost (by network congestion or bit error), TCP transmission time is longer than GBN and SR because the receiver can not sent 2 ACK messages at the same time.

in my opinion, losing segment rarely happens. so TCP protocol optimizes for normal cases instead of abnormal cases. in normal cases, TCP is better than GBN and SR

Upvotes: 2

walkerlala
walkerlala

Reputation: 1680

I was confused by the statement from the book too, but I think I have found the answer:

Consider also what happens when the sender sends a sequence of segments 1, 2, . . . , N, and all of the segments arrive in order without error at the receiver. Further suppose that the acknowledgment for packet n < N gets lost, but the remaining N – 1 acknowledgments arrive at the sender before their respective timeouts. In this example, GBN would retransmit not only packet n, but also all of the subsequent packets n + 1, n + 2, . . . , N. TCP, on the other hand, would retransmit at most one segment, namely, segment n. Moreover, TCP would not even retransmit segment n if the acknowledgment for segment n + 1 arrived before the timeout for segment n.

Actually, in the above example, even though the ACK for packet n+1 arrives at the sender before its timeout, one has to be aware that the timer for packet n could have timed-out before that arrival. So, because packet n timeout and the GBN has not seen ACK(n+1) or ACK(n+2)... so far, it will trigger the re-transmission of all packets after n .

However, for TCP, the sender would only send packet n again at this specific moment.

P.S. this question has been very old. But, anyway, hopefully that might help anyone.

Upvotes: 1

The Sultan
The Sultan

Reputation: 181

I was looking at this question's answer and after finding it I thought even though this is old, it might help someone, so I copied a fragment from Kurose-Ross Computer Networking - A top down approach:

Is TCP a GBN or an SR protocol? Recall that TCP acknowledgments are cumulative and correctly received but out-of-order segments are not individually ACKed by the receiver. Consequently, the TCP sender need only maintain the smallest sequence number of a transmitted but unacknowledged byte (SendBase) and the sequence number of the next byte to be sent (NextSeqNum). In this sense, TCP looks a lot like a GBN-style protocol. But there are some striking differences between TCP and Go-Back-N. Many TCP implementations will buffer correctly received but out-of-order segments [Stevens 1994]. Consider also what happens when the sender sends a sequence of segments 1, 2, . . . , N, and all of the segments arrive in order without error at the receiver. Further suppose that the acknowledgment for packet n < N gets lost, but the remaining N – 1 acknowledgments arrive at the sender before their respective timeouts. In this example, GBN would retransmit not only packet n, but also all of the subsequent packets n + 1, n + 2, . . . , N. TCP, on the other hand, would retransmit at most one segment, namely, segment n. Moreover, TCP would not even retransmit segment n if the acknowledgment for segment n + 1 arrived before the timeout for segment n.

My conclusion: in practice TCP is a mixture between both GBN and SR.

Upvotes: 18

Jan Wrobel
Jan Wrobel

Reputation: 7089

The quote says that the ACK(n) got lost, not the nth segment got lost. In such case, nothing needs to be re-transmitted, because ACK(n + x) means that everything upto n + x was successfully received.

Upvotes: 1

user207421
user207421

Reputation: 310840

ACK(n) acknowledges arrival of the entire stream up to n. So ACK(n+1) says that everything up to n+1 has arrived, including n.

Upvotes: 0

Related Questions