当前状态(current state) | 等待事件(expected events) | 下个状态(next state) | 执行动作(action) |
CLOSED
|
本地应用调用CONNECT(active open)
|
SYN_SENT
|
向peer发送SYN消息。 |
CLOSED
|
本地应用调用LISTEN(passive open)
|
LISTEN
|
无
|
SYN_SENT
|
收到peer SYN ACK消息
|
ESTABLISHED
|
向peer发送SYN ACK消息
|
LISTEN
|
收到peerSYN消息
|
SYN_RECEIVED |
向peer发送SYN ACK消息;向peer发送SYN消息;两个消息在一个响应中发送。
|
SYN_RECEIVED |
收到peer SYN ACK消息
|
ESTABLISHED
|
无 |
ESTABLISHED
|
|
|
ESTABLISHED
|
本地应用调用CLOSE(close initiator)
|
FIN_WAIT_1
|
向peer发送FIN消息
|
ESTABLISHED
|
收到peer FIN消息(close responder)
|
CLOSE_WAIT
|
向peer发送FIN ACK消息
|
FIN_WAIT_1
|
收到peer FIN ACK消息
|
FIN_WAIT_2
|
无
|
CLOSE_WAIT
|
本地应用调用CLOSE(close initiator)
|
LAST_ACK
|
向peer发送FIN消息
|
FIN_WAIT_2
|
收到peer FIN消息
|
TIME_WAIT
|
向peer发送FIN ACK消息
|
LAST_ACK
|
收到peer FIN ACK消息
|
CLOSED
|
无
|
TIME_WAIT
|
超时产生,timeout
|
CLOSED
|
无
|
ESTABLISHED
|
本地应用调用CLOSE(close initiator, both sides)
|
FIN_WAIT_1
|
向peer发送FIN消息
|
FIN_WAIT_1
|
收到peer FIN消息
|
CLOSING
|
向peer发送FIN ACK消息 |
CLOSING | 收到peer FIN ACK消息 | TIME_WAIT |
无
|
TIME_WAIT | 超时产生,timeout | CLOSED | 无 |
TCP状态转换图(state transition diagram),布布扣,bubuko.com
TCP状态转换图(state transition diagram)
原文地址:http://blog.csdn.net/zhengleiguo/article/details/37509861