Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
TCP/IP State Transition Diagram (RFC793) 
Gordon McKinney (23 Feb 2002) 
 
 
A connection progresses through a series of states during its lifetime. The states are: LISTEN, SYN-SENT, SYN-
RECEIVED, ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT, and 
the fictional state CLOSED. CLOSED is fictional because it represents the state when there is no TCB, and 
therefore, no connection. Briefly the meanings of the states are: 
 
 
LISTEN represents waiting for a connection request from any remote TCP and port. 
 
 
SYN-SENT represents waiting for a matching connection request after having sent a connection request. 
 
 
SYN-RECEIVED represents waiting for a confirming connection request acknowledgment after having both 
received and sent a connection request. 
 
 
ESTABLISHED represents an open connection, data received can be delivered to the user. The normal state 
for the data transfer phase of the connection. 
 
 
FIN-WAIT-1 represents waiting for a connection termination request from the remote TCP, or an 
acknowledgment of the connection termination request previously sent. 
 
 
FIN-WAIT-2 represents waiting for a connection termination request from the remote TCP. 
 
 
CLOSE-WAIT represents waiting for a connection termination request from the local user. 
 
 
CLOSING represents waiting for a connection termination request acknowledgment from the remote 
TCP. 
 
 
LAST-ACK represents waiting for an acknowledgment of the connection termination request previously 
sent to the remote TCP (which includes an acknowledgment of its connection termination 
request). 
 
 
TIME-WAIT represents waiting for enough time to pass to be sure the remote TCP received the 
acknowledgment of its connection termination request. 
 
 
CLOSED represents no connection state at all. 
 
 
A TCP connection progresses from one state to another in response to events. The events are the user calls, 
OPEN, SEND, RECEIVE, CLOSE, ABORT, and STATUS; the incoming segments, particularly those containing 
the SYN, ACK, RST and FIN flags; and timeouts. 
 
 
CLOSED
LISTEN
SYN_RCVD SYN_SENT
ESTABLISHED
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_2
CLOSING
TIME_WAIT
LAST_ACK
data transfer state
starting point
2MSL timeout
passive open
active open
simultaneous close
appl: passive open
send:  appl: active open
send: SYN
appl: send data
send: SYN
rec
v: 
SY
N;
sen
d: 
SY
N,
 AC
K
rec
v: 
RS
T
timeout
send: RST
recv: SYN
send: SYN, ACK
simultaneous open
rec
v: 
SY
N,
 A
CK
sen
d: 
AC
K
appl: close
send: FIN
recv: ACK
send: 
recv: FIN
send: ACK
recv: ACK
send: 
recv: FIN, ACK
send: ACK
recv: ACK
send: 
ap
pl:
clo
se
sen
d: 
FIN
recv: FIN
send: ACK
recv: FIN
send: ACK
appl: close
send: FIN
appl: close
or timeout
recv: ACK
send: 
active close
passive close
normal transitions for client
normal transitions for server
appl: state transitions taken when application issues operation
recv: state transitions taken when segment received
send: what is sent for this transition
TCP state transition diagram.
Reprinted from TCP/IP Illustrated, Volume 2: The Implementation
by Gary R. Wright and W. Richard Stevens,
Copyright © 1995 by Addison-Wesley Publishing Company, Inc.