Beruflich Dokumente
Kultur Dokumente
Chia-tai Tsai
tai@cis.nctu.edu.tw
Introduction
Connection-Establishment Timer
Establish a new connection. If a response isnt received within 75 seconds, the connection establishment is aborted.
Retransmission Timer
Based on Round-Trip Time (RTT). TCP sends data. When this timer expires, TCP retransmit the data.
Introduction cont.
Persist Timer
Based on RTT Triggered when a null window is advertised If timer expires, sender issues a probe (between 5 and 60 s, never gives up)
Introduction cont.
Keepalive Timer
socket option SO_KEEPALIVE. Tests if the other end is still up and running Expires after 2 hours
FIN_WAIT_2 Timer
Introduction cont.
MSL (Maximum Segment Life) 30s to 4 min Triggered when connection (client) enters TIME_WAIT state During 2MSL, the socket pair cannot be reused. (packets arriving during this state are discarded)
Timer Function
Fast timer
Slow timer
tcp_canceltimers Function
tcp_timer.c Triggered when enters TIME_WAIT state. All 4 timers counters are set to 0.
tcp_fasttime Function
tcp_timer.c Delay ACK Timer If TF_DELACK flag is set, it is cleared and TF_ACKNOW flag is set instead.
tcp_slowtime Function
Check each timer counter in all TCPCB Check if TCPCB has been deleted
Keepalive FIN_WAIT_2
tcp_now
tcp_timers Function
2MSL Timers
FIN_WAIT_2 timer
Keepalive timer
Expired after 2 hours of idle time Drop connection who no response Send a keepalive probe Reset keepalive timer
rtt var rtt var delta rtt var RTO srtt 4 rtt var
t_rttvar
t_rxtcur t_rttmin t_rxtshift
ticks x 4
ticks ticks null
24
12 2 0
3
6 1
tcp_setpersist Function
{1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64}
tcp_xmit_timer Function
tcp_timer.c
Source introduction
Increment shift count (t_rxtshift) Calculate new RTO Ask IP to find a new route Clear estimators Force retransmission of oldest unacknowledged data