TCP State Machine (TCP/IP Illustrated vol. 1) W. Richard Stevens
CLOSED
LISTEN
SYN_SENT
SYN_RCVD
ESTABLISHED
CLOSE_WAIT
LAST_ACK
CLOSING
FIN_WAIT_1
TIME_WAIT
FIN_WAIT_2
Starting point
Appl: passive open
send: <nothing.
Appl: active open
send: SYN
Appl: close
Or timeout
App: send data
Send:SYN
Recv:RST
Recv:SYN; send:SYN-ACK
Recv: SYN; send:SYN-ACK
simultaneous open
Recv:ACK; send:<nothing.
Recv:SYN,ACK
Send:ACK
Data transfer state
Appl : close
Send:
FIN
passive close
Recv:ACK
Send:
nothing
Appl:
close
Close:
FIN
Appl: close
Send:FIN
Recv:FIN
send: ACK
Recv:FIN,ACK;
send:ACK
Recv:FIN
send:ACK
Recv: ACK
send:
<nothing>
Recv: ACK
send: nothing
Simultaneous close
2MSL timeout
Active close
Client transitions
Server transitions
Back to first slide
View graphic version