The TIME-WAIT state is required for two main reasons.
The first is to provide enough time to ensure that the ACK is received by the other device, and to retransmit it if it is lost.
The second is to provide a “buffering period” between the end of this connection and any subsequent ones. If not for this period, it is possible that packets from different connections could be mixed, creating confusion.
The standard specifies that the client should wait double a particular length of time called the maximum segment lifetime (MSL) before finishing the close of the connection.
TCP performance problem 3
the 16-bit port space limits the rate to 2**16/240 transactions per second
more practically, an excessive amount of kernel space would be occupied by TCP state blocks in TIME-WAIT state.
Solutions for TCP performance problems
T/TCP solves these two performance problems for transactions, by
(1) bypassing the 3-way handshake (3WHS)
(2) shortening the delay in TIME-WAIT state.
Bypassing the Three-Way Handshake
T/TCP introduces a 32-bit incarnation number, called a "connection count" (CC)
A distinct CC value is assigned to each direction of an open connection
A T/TCP implementation assigns monotonically increasing CC values to successive connections that it opens actively or passively
TCP Accelerated Open (TAO)
A T/TCP server keeps a cache containing the last valid CC value
If an initial <SYN> segment from a particular client host carries a CC value larger than the corresponding cached value, the <SYN> segment must be new and can therefore be accepted immediately
Otherwise it executes a normal 3WHS
new TCP options
CC – for bypassing 3WHS
Receiving a CC.NEW causes the server to invalidate its cache entry and do a 3WHS
When a server sends a <SYN,ACK> segment, it echoes the connection count from the initial <SYN> in a CC.ECHO option, which is used by the client to validate the <SYN,ACK> segment.
TCP Accelerated Open Client Server CC[A] = X SYN, data1, CC=x SYN, ACK(data1), data2, CC=y, CC.ECHO=x CC[A] = X0 X>X0, TAO OK
Minimal TCP transaction Client Server CC[A] = X SYN, data1, FIN, CC=x SYN,ACK(FIN),data2,FIN,CC=y,CC.ECHO=x CC[A] = X0 X0>X, TAO OK ACK(FIN),CC=x closed Syn-sent Time-wait Listen Closed Close-wait
Truncation of TIME- WAIT Client Server CC[A] = X SYN, data1, FIN, CC=x SYN,ACK(FIN),data2,FIN,CC=y,CC.ECHO=x CC[A] = X0 X0>X, TAO OK ACK(FIN),CC=x closed Syn-sent Time-wait Listen Closed Close-wait SYN,data3, FIN, CC=z Syn-sent