The realationship between window size and sequence number

Jan picture Jan · Feb 18, 2012 · Viewed 19.9k times · Source

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

Answer

Lyle picture Lyle · Oct 13, 2013

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.