In: Computer Science
The window size must be less than or equal to half the size of the sequence number space for SR protocols to avoid packets being recognized incorrectly.
If the window 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.
For example, if our sequence number range is 0-3 and the window size is 3, this situation can occur.
A -> 0 -> B
A -> 1 -> B
A -> 2 -> B
A <- 2ack <- B (this is lost)
A -> 0 -> B
A -> 1 -> B
A -> 2 -> B
After the lost packet, B now expects the next packets to have sequence numbers 3, 0, and 1.
But, the 0 and 1 that A is sending are actually retransmissions, so B receives them out of order.
By limiting the window size to 2 in this example, we avoid this problem because B will be expecting 2 and 3, and only 0 and 1 can be retransmissions.
I hope you liked my work. Please do upvote!