VR

TCP/IP Reference


TCP Flags

FlagMeaningWhen set
SYNSynchronizeConnection initiation
ACKAcknowledgeEvery packet after handshake
FINFinishGraceful connection close
RSTResetAbrupt connection close (error)
PSHPushDeliver data to application immediately (no Nagle delay)
URGUrgentUrgent data pointer (rarely used)

TCP Connection States

StateDescription
CLOSEDNo connection
LISTENServer waiting for incoming connections
SYN_SENTClient sent SYN, waiting for SYN-ACK
SYN_RECEIVEDServer received SYN, sent SYN-ACK
ESTABLISHEDConnection active, data can flow
FIN_WAIT_1Sent FIN, waiting for ACK
FIN_WAIT_2Received ACK of FIN, waiting for remote FIN
TIME_WAITWaiting 2×MSL after FIN exchange
CLOSE_WAITReceived FIN, not yet sent own FIN
LAST_ACKSent FIN in CLOSE_WAIT, waiting for ACK

Key Timers and Durations

TimerDefaultPurpose
MSL (Maximum Segment Lifetime)30–60sMax time a TCP segment lives
TIME_WAIT2×MSL = 60–120sPrevents delayed packet reuse
TCP keepalive idle7200s (2h)After this idle time, send keepalive probes
TCP keepalive interval75sBetween keepalive probes
TCP keepalive count9 probesBefore declaring connection dead
Nagle delayup to 40msWait to coalesce small writes
SYN timeout~75s (with retries)Connection attempt timeout

RTT Latencies (Approximate)

PathRTT
Loopback (127.0.0.1)<0.1ms
Same host, different process<0.1ms
Same rack (LAN)0.1–0.5ms
Same datacenter0.5–2ms
Same region, different AZ2–10ms
US West → US East40–80ms
US → Europe80–120ms
US → Asia150–200ms