Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The realationship between window size and sequence number

Tags:

tcp

pipeline

The question is :

We have a transport protocoll that uses pipelining and use a 8-bit long sequence number (0 to 255)

What is the maximum window size sender can use ? (How many packets the sender can send out on the net before it muse wait for an ACK?)

Go-Back-N the maximum window size is: w= 2^m -1 w=255.

Selective Repeat the maximu window size is: w=(2^m)/2 w=128.

I do not know which is correct and which formula shall I use.

Thanks for help

like image 355
Jan Avatar asked Feb 18 '12 14:02

Jan


People also ask

Why window size should be less than half of seq number?

This is to avoid packets being recognized incorrectly. If the windows size is greater than half the sequence number space, then if an ACK is lost, the sender may send new packets that the receiver believes are retransmissions.

Can a window size be too large for a sequence number space GBN?

GBN requires full duplex link since during the forward transmission, backward ACKs are also in progress. The choice of window size : Window size should be large enough to contain all the sequence numbers of frames on their way to the receiver.

What is the need of sequence numbers in the sliding window protocol?

It is also used in TCP (Transmission Control Protocol). In this technique, each frame has sent from the sequence number. The sequence numbers are used to find the missing data in the receiver end. The purpose of the sliding window technique is to avoid duplicate data, so it uses the sequence number.

What is window size in Go-Back-N?

Go-Back-N protocol, also called Go-Back-N Automatic Repeat reQuest, is a data link layer protocol that uses a sliding window method for reliable and sequential delivery of data frames. It is a case of sliding window protocol having to send window size of N and receiving window size of 1.


1 Answers

Those two are different protocols having different issues.

In case of Go-Back-N, you are correct. The window size can be up to 255. (2^8-1 is the last seq # of packets to send starting from 0. And it's also the maximum window size possible for Go-Back-N protocol.)

However, Selective Repeat protocol has limitation of window size up to half of the max seq # since the receiver cannot distinguish a retransmitted packet having the same seq # with an already ack'ed packet but lost and never reached to sender in previous window. Hence, the window size must be in half range of seq # so that the consecutive windows cannot have duplicated seq # each other.

Go-Back-N doesn't have this issue since the sender pushes n packets up to window size (which is at max: n-1) and never slides the window until it gets cumulative acks up to n. And those two protocol have different max size windows.

Note: For Go-Back-N, the maximum window size is maximum number of unique sequence numbers - 1. If the window is equal to the maximum number of unique sequence numbers, if all the acknowledgements are lost, the receiver will accept all the retransmitted messages as a separate set of messages and relays the messages an additional time to it's application. To avoid this inconsistency, maximum window size = maximum number of unique sequence numbers - 1. This answer has been updated according to the fact provided in the comment by @noamgot.

like image 86
Lyle Avatar answered Sep 29 '22 07:09

Lyle