16

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

Jan
  • 175
  • 1
  • 1
  • 5
  • Are you designing a protocol here? Or does it have a name, in which case, please state it. Just to make clear: you're talking about TCP, are you? – cxxl Nov 30 '12 at 13:48
  • https://stackoverflow.com/questions/28444055/go-back-n-window-size, please have a look this post. – Sun_Rider Jun 12 '18 at 06:33

1 Answers1

13

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.

spacewanderer
  • 356
  • 3
  • 7
Lyle
  • 1,238
  • 14
  • 16
  • 4
    hi, sorry to bring this post from the dead, but I believe there's a problem with your answer - in GBN the window size indeed should be up to 255, and not 256. consider the following example - the sender sent packets 0-255 (the whole window), the receiver gets them and send an ACK. unfortunately, the ACK is lost so after a timeout occurs, the sender re-sends those packets. but now the receiver waits to another sequence of packets starting with 0, so we have a problem. with window size of 255 it doesn't happen. consider watching this: http://webmuseum.mi.fh-offenburg.de/index.php?view=exh&src=73 – noamgot Feb 21 '17 at 09:20
  • this link is forbidden – Jun Yu Aug 09 '23 at 11:32