tcp 状态机

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,
  • 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(app).

  • 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.

相关推荐
卷福同学17 小时前
去掉手机APP开屏广告,李跳跳2.2下载使用
java·后端·算法
程序猿阿越18 小时前
Kafka4源码(三)Share Group共享组
java·后端·源码阅读
Slow菜鸟19 小时前
Spring Cloud 教程(四) | OpenFeign 的作用
后端·spring·spring cloud
GetcharZp19 小时前
告别付费云盘!这款开源 AI 相册神器,颜值与实力双飞,满足你对私人云端的一切幻想!
后端
朦胧之19 小时前
AI 编程工具使用浅谈
前端·后端
架构谨制@涛哥19 小时前
《哥谭神话-Palantir故事篇》Palantir 产品战略与架构全景
后端·系统架构·软件构建
Flandern111120 小时前
Go程序员学习AI大模型项目实战02:给 AI 装上“大脑”:从配置解包到流式生成的深度拆解
人工智能·后端·python·学习·golang
逸风尊者21 小时前
2026 主流 Claw 类产品技术报告
人工智能·后端·算法
宸津-代码粉碎机21 小时前
Spring Boot 4.0 实战技巧全解析
java·大数据·spring boot·后端·python
0xDevNull21 小时前
Spring 核心教程:@Component vs @Bean 深度解析
java·后端