分类: 系统运维
2012-06-19 09:24:33
1. A retransmission timer is used when expecting an
acknowledgment from the other end. This chapter looks at this timer in
detail, along with related issues such as congestion avoidance.
2. A persist timer keeps window size information flowing even if the other end closes its receive window.
3. A keepalive timer detects when the other end on an otherwise idle connection crashes or reboots.
4. A 2MSL timer measures the time a connection has been in the TIME_WAIT state.
Round-Trip Time Measurement
Fundamental
to TCP's timeout and retransmission is the measurement of the
round-trip time (RTT) experienced on a given connection. We expect this
can change over time, as routes might change and as network traffic
changes, and TCP should track these changes and modify its timeout
accordingly.
First TCP must measure the RTT between sending a byte with a
particular sequence number and receiving an acknowledgment that covers
that sequence number. Normally there is not a one-to-one correspondence
between data segments and ACKs.
The timing is done by
incrementing a counter every time the 500-ms TCP timer routine is
invoked. This means that a segment whose acknowledgment arrives 550 rns
after the segment was sent could end up with either a 1 tick RTT
(implying 500 ms) or a 2 tick RTT (implying 1000 ms).
In addition
to this tick counter for each connection, the starting sequence number
of the data in the segment is also remembered. When an acknowledgment
that includes this sequence number is received, the timer is turned off.
If the data was not retransmitted when the ACK arrives, the smoothed
RTT and smoothed mean deviation are updated based on this new
measurement.