5.4. Timers
There are three timers associated with this protocol. Their purpose will now be briefly discussed as will the actions taken when a timer expires. The particular nature these timeouts take and the methods by which they are set is the responsibility of the protocol implementation.
5.4.1. User Timeout
For practical implementation reasons it is desirable to have a user controllable timeout associated with the successful opening of a connection, successful acknowledgment of data, and successful closing of a connection. Consider the situations in which a connection is so noisy that no data gets through, or a connection is physically cut. Without an overriding timeout these situations would result in unbounded retransmissions.
When this timeout expires the user is informed "Error: Connection aborted due to user timeout.", all queues are flushed, the TCB is deleted, and the CLOSED state is entered.
5.4.2. Retransmission Timeout
This timer ensures that any packet sent for which the SN is significant is acknowledged. When such a packet is sent it is placed in a retransmission queue and the retransmission timer is begun. If an acknowledgment has not arrived within the timer's period then the packet is retransmitted and the timer is restarted. If the acknowledgment does arrive in time then the timer is stopped and the packet is removed from the retransmission queue. The next packet with a significant SN may now be sent.
This timeout is expected to operate in conjunction with a counter which keeps track of the number of times a packet has been retransmitted. Normally an upper limit is set on retransmissions. If that limit is exceeded then the connection is aborted. This event is similar to the user timeout. The user is informed "Error: Connection aborted due to retransmission failure", all queues are flushed, the TCB is deleted, and the CLOSED state is entered.
5.4.3. TIME-WAIT Timeout
This timeout is used to catch any FIN packets which might be retransmitted from the other end of a connection in response to a dropped acknowledgment packet. The timeout period should be at least as long as 2*SRTT. After this timeout expires the other end of the connection is assumed to be closed, the TCB is deleted, and this end enters the CLOSED state also.