当前位置:网站首页>【图解】三次握手,四次挥手 —— 用心看这一篇就够了
【图解】三次握手,四次挥手 —— 用心看这一篇就够了
2022-07-27 19:26:00 【InfoQ】
概述
基础理论
传输控制协议
️TCP 特点

️TCP 报文首部

[0,2 ^ 32-1]mod2^32[0,2^16-1]TCP 连接的建立与释放
三次握手
TCPTCPTCP
ACK:确认报文段
ack:确认号
SYN:发送连接请求 / 接收报文段`
seq:发送数据的第一个字节的序号
SsSaServer sendServer acceptCsCaClient sendClient accept

TCP
ISN四次挥手
TCPLISTENSYNACKSYNFIN- 立即关闭
- 继续发送一些数据给客户端后,再发送
FIN报文给客户端(表示同意关闭连接),是否立刻关闭发送数据通道,需交由上层应用决定
ACKFINESTABLISHED
FIN:连接终止位
seq:发送的第一个字节的序号
ACK:确认报文段
ack:确认号
- 客户端发送第一次挥手,之后由
ESTABLISHED状态转为FIN_WAIT1状态
- 服务器收到客户端的第一次挥手之后,发送第二次挥手给服务器,服务器进入
CLOSE_WAIT状态,等待服务器自身的SOCKET关闭等处理
- 客户端收到服务器的第二次挥手,进入
FIN_WAIT2状态,等待服务器关闭
- 服务器发送第三次挥手,然后进入
LAST_ACK状态
- 客户端收到第三次挥手,发送第四次挥手,客户端进入
TIME_WAIT状态;
- 服务器收到第四次挥手,进入
CLOSED状态,客户端等待 2MSL 后,进入CLOSED状态

总结
TCPTCPSYNFIN
边栏推荐
- ApacheSpark-命令执行(CVE-2022-33891) 漏洞复现
- 云原生微服务第三章之Haproxy+Keepalived
- Exception -exception
- Array expansion, sorting, nested statement application
- 2021-11-05 understanding of class variables and class methods
- 项目分析(从技术到项目、产品)
- Interview questions that big companies need to prepare
- Regular expression exercise
- Huaneng Fujian company and Huawei digital energy deepen strategic cooperation and jointly build a low-carbon smart county
- Station B collapsed. What did the developer responsible for the repair do that night?
猜你喜欢

In depth understanding of recursive method calls (including instance maze problem, tower of Hanoi, monkey eating peach, fiboracci, factorial))

华能福建公司与华为数字能源深化战略合作,共建低碳智能县域

vs2019 release模式调试:此表达式有副作用,将不予计算。

Learn the use principle and core idea of thread pool from the source code

Why do server programs need to listen first

2022 2nd cyber edge cup cyber security competition Web

How to use Fiddler for weak network testing

Encapsulate an array into a class

学完4种 Redis 集群方案要多久?我一口气给你说完

B站崩了,那晚负责修复的开发人员做了什么?
随机推荐
Log4j 漏洞仍普遍存在?
Live broadcast software app development, uniapp scroll view hidden scroll bar
An2021软件安装及基本操作(新建文件/导出)
7行代码让B站崩溃3小时
8000字讲透OBSA原理与应用实践
[question 22] dungeons and Warriors (Beijing Institute of Technology / Beijing Institute of Technology / programming methods and practice / primary school)
Matlab draws the statistical rose chart of wind speed and direction
极化继电器
Inertial navigation principle (VII) -imu error classification (II) -allan variance analysis method +imu test + calibration introduction
STM32 project Sharing -- mqtt intelligent access control system (including app control)
Nine days later, we are together to focus on the new development of audio and video and mystery technology
The source code of live broadcast app system, and the rotation diagram of upper and lower layers
Leetcode-309- best time to buy and sell stocks, including freezing period
How long will it take to learn the four redis cluster solutions? I'll finish it for you in one breath
高频继电器
8000 word explanation of OBSA principle and application practice
JVM memory model interview summary
Apachespark command execution (cve-2022-33891) vulnerability recurrence
Go language learning notes - mutex start go language from scratch
视频直播源码,uni-app实现广告滚动条