当关闭TCP连接时,在TIME-WAIT状态下2 * MSL的延迟会将套接字对占用4分钟(请参阅[Postel81]的3.5节。基于TCP的应用程序会关闭一个连接并打开一个新连接(例如,使用Stream模式的FTP数据传输连接)必须每次都选择一个新的套接字对。此延迟有两个不同的用途:
(a) Implement the full-duplex reliable close handshake of TCP.
The proper time to delay the final close step is not really
related to the MSL; it depends instead upon the RTO for the
FIN segments and therefore upon the RTT of the path.*
Although there is no formal upper-bound on RTT, common
network engineering practice makes an RTT greater than 1
minute very unlikely. Thus, the 4 minute delay in TIME-WAIT
state works satisfactorily to provide a reliable full-duplex
TCP close. Note again that this is independent of MSL
enforcement and network speed.
The TIME-WAIT state could cause an indirect performance
problem if an application needed to repeatedly close one
connection and open another at a very high frequency, since
the number of available TCP ports on a host is less than
2**16. However, high network speeds are not the major
contributor to this problem; the RTT is the limiting factor
in how quickly connections can be opened and closed.
Therefore, this problem will no worse at high transfer
speeds.
(b) Allow old duplicate segements to expire.
Suppose that a host keeps a cache of the last timestamp
received from each remote host. This can be used to reject
old duplicate segments from earlier incarnations of the
*注:可以说发送FIN的一方知道它需要多少可靠性,因此,它应该能够确定FIN接收者的TIME-WAIT延迟的长度。这可以通过在FIN段中使用适当的TCP选项来完成。
connection, if the timestamp clock can be guaranteed to have
ticked at least once since the old conennection was open.
This requires that the TIME-WAIT delay plus the RTT together
must be at least one tick of the sender's timestamp clock.
Note that this is a variant on the mechanism proposed by
Garlick, Rom, and Postel (see the appendix), which required
each host to maintain connection records containing the
highest sequence numbers on every connection. Using
timestamps instead, it is only necessary to keep one quantity
per remote host, regardless of the number of simultaneous
connections to that host.