- 论坛徽章:
- 1
|
回复 #1 jiufei19 的帖子
我把rfc1323中如何计算出14为最大伸缩因子的文字列出,请大家帮忙看看
--------------------------------------------------------------------------------------
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.
Similarly with 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 2 * the max window size
must be less than 2**31, or
max window < 2**30
Since the max window is 2**S (where S is the scaling shift count)
times at most 2**16 - 1 (the maximum unscaled window), the maximum
window is guaranteed to be < 2**30 if S <= 14. Thus, the shift
count must be limited to 14 (which allows windows of 2**30 = 1
Gbyte). If a Window Scale option is received with a shift.cnt
value exceeding 14, the TCP should log the error but use 14
instead of the specified value.
可以看出2**31次幂的结果是最关键的地方,这个明白了,后面的就说得通了,我就是看不懂这个地方,我的疑问是既然tcp的序号空间范围是32bit,超过后会回绕序号,那么2**31次幂的意思就是将该范围划分为相等的2部分,即2**32/2=2**31,为啥是这样呢?
另外,我对原文中所提到的“old”和“new”的含义不是很明白其准确含义?
[ 本帖最后由 jiufei19 于 2010-1-16 11:01 编辑 ] |
|