Exploring TCP state machine by graphs
来源:互联网 发布:天刀太白捏脸数据下载 编辑:程序博客网 时间:2024/05/20 18:45
States
TCP includes 11 states, they are:
LISTEN
SYN_SENT
SYN_RECV
ESTABLISHED
FIN_WAIT1
CLOSE_WAIT
FIN_WAIT2
LAST_ACK
TIME_WAIT
CLOSED
CLOSING
@include/net/tcp_states.h:
/* Definitions for the TCP protocol sk_state field. */#ifndef _LINUX_TCP_STATES_H#define _LINUX_TCP_STATES_Henum { TCP_ESTABLISHED = 1, TCP_SYN_SENT, TCP_SYN_RECV, TCP_FIN_WAIT1, TCP_FIN_WAIT2, TCP_TIME_WAIT, TCP_CLOSE, TCP_CLOSE_WAIT, TCP_LAST_ACK, TCP_LISTEN, TCP_CLOSING, /* Now a valid state */ TCP_MAX_STATES /* leave at the end! */};#define TCP_STATE_MASK 0xF#define TCP_ACTION_FIN (1 << 7)enum { TCPF_ESTABLISHED = (1 << 1), TCPF_SYN_SENT = (1 << 2), TCPF_SYN_RECV = (1 << 3), TCPF_FIN_WAIT1 = (1 << 4), TCPF_FIN_WAIT2 = (1 << 5), TCPF_TIME_WAIT = (1 << 6), TCPF_CLOSE = (1 << 7), TCPF_CLOSE_WAIT = (1 << 8), TCPF_LAST_ACK = (1 << 9), TCPF_LISTEN = (1 << 10), TCPF_CLOSING = (1 << 11)};#endif /* _LINUX_TCP_STATES_H */
View of Server
Passive open and passive close often performed by Server, the normal routine is illustrated as follow.
I denote the passive open/close transitions with a blue line (normal transitions are in bold).
View of Client
Ative open and Active close often performed by Client, the normal routine is illustrated as follow.
I denote the active open/close transitions with a green line (normal transitions are in bold).
As a whole
We know while most TCP state transitions are normal, it also has some unnormal transitions, including:
simultaneous open
simultaneous close
RST and etc.
I use dashed line to denote this kind of transitions.
Sequence chart
(1)Normal sequence chart (including active open/close, passive open/close)
(2)simultaneous open
(3)simultaneous close
Author
zhangskd @ csdn blog
- Exploring TCP state machine by graphs
- state machine
- State Machine
- State machine
- 有限状态机(finity state machine)
- FSM(finite state machine)
- OpenGL&D3D State Machine
- experiment: State machine
- Regal State Machine
- EtherCAT State Machine Transitions
- The finite state machine
- The State Machine Framework
- Unity3D,Finite State Machine
- Finite State Machine
- State Machine 实现
- Nova state machine simplification
- wpa_supplicant-0.8 state machine
- CocosCreator使用state-machine
- monotouch包住framework与dylib
- #define、const和enum
- JQuery js / Fullscreen.js
- linux的物理内存与线性地址空间布局--1
- Android API学习 SoundPool 和 MediaPlayer
- Exploring TCP state machine by graphs
- 字符串全排列
- 张西雨 你妹的——社会化工具下的个人安全问题
- java web 实现上传下载
- linux的物理内存与线性地址空间布局--2
- 迈出从3K到1W的重要一步——掌握设计模式
- Solr3.6.1 在tomcat6下的环境搭建
- QT安装不使用dll的全局钩子
- c#两种方式 dataset 与byte[] 字节的转换