来自RFC-1185
Avoiding reuse of sequence numbers within the same connection is
simple in principle: enforce a segment lifetime shorter than the
time it takes to cycle the sequence space, whose size is
effectively 2**31.
If the maximum effective bandwidth at which TCP
is able to transmit over a particular path is B bytes per second,
then the following constraint must be satisfied for error-free
operation:
2**31 / B > MSL (secs)
Run Code Online (Sandbox Code Playgroud)
简而言之,TCP 会处理好它。除了此条件之外,TCP 还具有时间戳的概念来处理序列号环绕条件。来自上述 RFC
Timestamps carried from sender to receiver in TCP Echo options can
also be used to prevent data corruption caused by sequence number
wrap-around, as this section describes.
Run Code Online (Sandbox Code Playgroud)
具体来说,TCP 使用 PAWS 机制来处理 TCP 环绕情况。您可以在RFC-1323中找到有关 PAWS 的更多信息
RFC793 第 3.3 节:
重要的是要记住,实际的序列号空间虽然很大,但却是有限的。该空间的范围为 0 到 2* 32 - 1。由于空间是有限的,因此所有处理序列号的算术都必须以 2 * 32 为模进行执行。当序列号再次从 2**32 - 1 循环到 0 时,此无符号算术保留了序列号的关系。计算机模运算有一些微妙之处,因此在编程比较这些值时应格外小心。
对序列号进行的任何算术运算均以 2^32 为模
| 归档时间: |
|
| 查看次数: |
12360 次 |
| 最近记录: |