- 論壇徽章:
- 1
|
回復(fù) #1 jiufei19 的帖子
我把rfc1323中如何計(jì)算出14為最大伸縮因子的文字列出,請(qǐng)大家?guī)兔纯?br />
--------------------------------------------------------------------------------------
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次冪的結(jié)果是最關(guān)鍵的地方,這個(gè)明白了,后面的就說得通了,我就是看不懂這個(gè)地方,我的疑問是既然tcp的序號(hào)空間范圍是32bit,超過后會(huì)回繞序號(hào),那么2**31次冪的意思就是將該范圍劃分為相等的2部分,即2**32/2=2**31,為啥是這樣呢?
另外,我對(duì)原文中所提到的“old”和“new”的含義不是很明白其準(zhǔn)確含義?
[ 本帖最后由 jiufei19 于 2010-1-16 11:01 編輯 ] |
|