Appendix: Using 64-bit Sequence Numbers
This appendix provides a justification of our statement that 64-bit sequence numbers could prevent the TWA hazards.
The theoretical ISN calculation used by TCP is:
ISN = (R*T) mod 2**n.
where T is the real time in seconds (from an arbitrary origin, fixed when the system is started), R is a constant, currently 250 KBps, and n = 32 is the size of the sequence number field.
The limitations of current TCP are established by n, R, and the maximum segment lifetime MSL = 4 minutes. The shortest time Twrap to wrap the sequence space is:
Twrap = (2**n)/r
where r is the maximum transfer rate. To avoid old duplicate segments in the same connection, we require that Twrap > MSL (in practice, we need Twrap >> MSL).
The clock-driven ISN numbers wrap in time TwrapISN:
TwrapISN = (2**n)/R
For current TCP, TwrapISN = 4.55 hours.
The cases for old duplicates from previous connections can be divided into four regions along two dimensions:
-
Slow vs. fast connections, corresponding to r < R or r >= R.
-
Short vs. long connections, corresponding to duration E < TwrapISN or E >= TwrapISN.
On short slow connections, the clock-driven ISN selection rejects old duplicates. For all other cases, the TIME-WAIT delay of 2*MSL is required so old duplicates can expire before they infect a new incarnation. This is discussed in detail in the Appendix to [RFC-1185].
With this background, we can consider the effect of increasing n to 64. We would like to increase both R and TwrapISN far enough that all connections will be short and slow, i.e., so that the clock-driven ISN selection will reject all old duplicates. Put another way, we want to every connection to have a unique chunk of the seqence space. For this purpose, we need R larger than the maximum foreseeable rate r, and TwrapISN greater than the longest foreseeable connection duration E.
In fact, this appears feasible with n = 64 bits. Suppose that we use R = 233 Bps; this is approximately 8 gigabytes per second, a reasonable upper limit on throughput of a single TCP connection. Then TwrapISN = 68 years, a reasonable upper limit on TCP connection duration. Note that this particular choice of R corresponds to incrementing the ISN by 232 every 0.5 seconds, as would happen with the Berkeley BSD implementation of TCP. Then the low-order 32 bits of a 64-bit ISN would always be exactly zero.