![]() Generally, busy servers prefer to be free from these bookkeeping requirements of TIMEWAIT, so many protocols are designed so that it is the client that initiates the active close. If a host is a server, however, accepting connections on a standardized port, and happens to be the side that initiates the active close and thus later goes into TIMEWAIT, then its TIMEWAIT list for that port can grow quite long. If a host is connecting as a client, this list likely will amount to a list of recently used ports no port is likely to have been used twice within the TIMEWAIT interval. If A connects to B and closes the connection, A is free to connect again to B using a different port at A’s end.Ĭonceptually, a host may have many old connections to the same port simultaneously in TIMEWAIT the host must thus maintain for each of its ports a list of all the remote ⟨IP_address,port⟩ sockets currently in TIMEWAIT for that port. TIMEWAIT only blocks reconnections for which both sides reuse the same port they used before. As with TFTP, it is possible (though unlikely) for the final ACK to be lost as well as all the retransmitted final FINs sent during the TIMEWAIT period should this happen, one side thinks the connection closed normally while the other side thinks it did not. As long as A remains in state TIMEWAIT, it can appropriately reply to a retransmitted FIN from B with a duplicate final ACK. If host A sends its final ACK to host B and this is lost, then B will eventually retransmit its final packet, which will be its FIN. After the expiration of the TIMEWAIT interval, an old duplicate cannot arrive.Ī second function of TIMEWAIT is to address the lost-final-ACK problem ( 16.3 Fundamental Transport Issues). ![]() TIMEWAIT requires that between closing and reopening a connection, a long enough interval must pass that any packets from the first instance will disappear. One function of TIMEWAIT is to solve the external-old-duplicates problem. Traditionally MSL was taken to be 60 seconds, but more modern implementations often assume 30 seconds (for a TIMEWAIT period of 60 seconds). It is to last for a time 2×MSL, where MSL = Maximum Segment Lifetime is an agreed-upon value for the maximum lifetime on the Internet of an IP packet. The TIMEWAIT state is entered by whichever side initiates the connection close in the event of a simultaneous close, both sides enter TIMEWAIT. TCP offers a fix for this (Protection Against Wrapped Segments, or PAWS), but it was introduced relatively late we return to this in 18.4 Anomalous TCP scenarios. However, if we take the MSL to be 60 seconds, sequence-number wrap requires sending 2 32 bytes in 60 seconds, which requires a data-transfer rate in excess of 500 Mbps. TCP is also vulnerable to sequence-number wraparound: arrival of an old duplicates from the same instance of the connection. T/TCP ( 18.5 TCP Faster Opening) introduced a connection-count field for this. Solutions to the old-duplicates problem generally involve setting an upper bound on the lifetime of any packet, the MSL, as we shall see in the next section. Nonetheless, many of the design details of TCP represent attempts to minimize this risk. The diagram above ignores that.Īs with TFTP, coming up with a possible scenario accounting for the generation of such a late packet is not easy. Later, of course, B is likely to receive a seq=N packet from the new instance of the connection, but that packet will be seen by B as a duplicate (even though the data does not match), and (we will assume) be ignored.įor TCP, it is the actual sequence numbers, rather than the relative sequence numbers, that would have to match up. At some point in the second connection, when an arriving packet with seq=N would be acceptable at B, the old duplicate shows up. The connection is closed, and then another instance is reopened, that is, a connection is created using the same ports. One packet from A to B is duplicated and unduly delayed, with sequence number N. Suppose a TCP connection is opened between A and B. Conceptually, perhaps the most serious threat facing the integrity of TCP data is external old duplicates ( 16.3 Fundamental Transport Issues), that is, very late packets from a previous instance of the connection.
0 Comments
Leave a Reply. |