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.

相关推荐
fly-phantomWing2 小时前
Maven的安装与配置的详细步骤
java·后端·maven·intellij-idea
学编程的小鬼5 小时前
SpringBoot 自动装配原理剖析
java·spring boot·后端
码事漫谈6 小时前
SIMD编程入门:让性能飞起来的实践指南
后端
码事漫谈6 小时前
从汇编角度看C++优化:编译器真正做了什么
后端
老葱头蒸鸡7 小时前
(28)ASP.NET Core8.0 SOLID原则
后端·asp.net
拾忆,想起8 小时前
AMQP协议深度解析:消息队列背后的通信魔法
java·开发语言·spring boot·后端·spring cloud
PH = 78 小时前
Spring Ai Alibaba开发指南
java·后端·spring
不会吃萝卜的兔子9 小时前
springboot websocket 原理
spring boot·后端·websocket
Fency咖啡9 小时前
Spring Boot 内置日志框架 Logback - 以及 lombok 介绍
spring boot·后端·logback
karry_k11 小时前
什么是Fork/Join?
java·后端