Subject: [tcpm] Q about window scale factor limitation

From: Yoshifumi Nishida <[email-masked]>
Date: Fri, 5 Dec 2014 01:01:00 -0800

Hi folks,

I start wondering why window scaling factor is limited to 14.
I guess this question might have come up before(e.g.
https://www.ietf.org/mail-archive/web/tcpm/current/msg05787.html)
But, I'm still wondering it might be worth discussing a bit more.
Please point out if I miss something.

We know the window scale factor is limited to 14 as described in RFC7323.

   TCP determines if a data segment is "old" or "new" by testing whether
   its sequence number is within 2^31 bytes of the left edge of the
   window, and if it is not, discarding the data as "old".  To insure
   that new data is never mistakenly considered old and vice versa, the
   left edge of the sender's window has to be at most 2^31 away from the
   right edge of the receiver's window.  The same is true of the
   sender's right edge and receiver's left edge.  Since the right and
   left edges of either the sender's or receiver's window differ by the
   window size, and since the sender and receiver windows can be out of
   phase by at most the window size, the above constraints imply that
   two times the maximum window size must be less than 2^31, or

                             max window < 2^30

However, I'm not very sure TCP determines if a data segment is old or new.
In my understanding, TCP checks if a segment is inside of the window
or not. It doesn't care if a segment is too old or too new as long as
it's outside of the window.

In order to discuss this more, I would like to think about the
following example.
Let's say, sender and receiver windows are completely out of sync.
The sender's left edge is S and the right edge is S+W. (W is window size)
The receiver's left edge is S+W+1 and the right edge is S + 2W +1.
Now the segment S arrives at the receiver.

In case of W >= 2^31, we can easily see it will be problematic.
However, I would like to think about the case where W = 2^31 - X.
Because if we allow window scale factor = 15, max window size will be
2^31 - 2^15.

In this case, when the receiver checks the left edge, it considers S
is in the left side of the left edge as W+1 < 2^31. It means S is
outside of the window.
When the receiver checks the right edge, it considers S is in the
right side of the right edge as S - 2X +1 < S. this also means S is
outside of the window.
Here, as the RFC points out, the right edge check cannot detect S is
old packet, however, this doesn't affect the result.

If we think in this way, I'm thinking that scale factor=15 might be possible.
Please let me know if I misunderstand something.

Regards,
--
Yoshi