当前位置:网站首页>TCP-三次握手和四次挥手简单理解
TCP-三次握手和四次挥手简单理解
2022-07-04 03:51:00 【我不是萧海哇~~~~】
三次握手(three-way handshaking)
1.背景:TCP位于传输层,作用是提供可靠的字节流服务,为了准确无误地将数据送达目的地,TCP协议采纳三次握手策略。
2.原理:
1)发送端首先发送一个带有SYN(synchronize)标志地数据包给接收方。
2)接收方接收后,回传一个带有SYN/ACK标志的数据包传递确认信息,表示我收到了。
3)最后,发送方再回传一个带有ACK标志的数据包,代表我知道了,表示’握手‘结束。
通俗的说法
1)Client:嘿,李四,是我,听到了吗?
2)Server:我听到了,你能听到我的吗?
3)Client:好的,我们互相都能听到对方的话,我们的通信可以开始了。
四次挥手(Four-Way-Wavehand)
1.意义:当被动方收到主动方的FIN报文通知时,它仅仅表示主动方没有数据再发送给被动方了。但未必被动方所有的数据都完整的发送给了主动方,所以被动方不会马上关闭SOCKET,它可能还需要发送一些数据给主动方后,再发送FIN报文给主动方,告诉主动方同意关闭连接,所以这里的ACK报文和FIN报文多数情况下都是分开发送的。
2.原理:
1)第一次挥手:Client发送一个FIN,用来关闭Client到Server的数据传送,Client进入FIN_WAIT_1状态。
2)第二次挥手:Server收到FIN后,发送一个ACK给Client,确认序号为收到序号+1(与SYN相同,一个FIN占用一个序号),Server进入CLOSE_WAIT状态。
3)第三次挥手:Server发送一个FIN,用来关闭Server到Client的数据传送,Server进入LAST_ACK状态。
4)第四次挥手:Client收到FIN后,Client进入TIME_WAIT状态,接着发送一个ACK给Server,确认序号为收到序号+1,Server进入CLOSED状态,完成四次挥手
通俗的说法
1)Client:我所有东西都说完了
2)Server:我已经全部听到了,但是等等我,我还没说完
3)Server:好了,我已经说完了
4)Client:好的,那我们的通信结束l
链接:https://www.jianshu.com/p/d3725391af59
边栏推荐
- Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
- Redis cluster view the slots of each node
- Database SQL statement summary, continuous update
- postgresql 用户不能自己创建表格配置
- JS实现文字滚动 跑马灯效果
- [paddleseg source code reading] paddleseg calculation dice
- Evolution of MySQL database architecture
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Programmers' telecommuting is mixed | community essay solicitation
- Why is the probability of pod increasing after IPtable
猜你喜欢
如何有效远程办公之我见 | 社区征文
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
1289_FreeRTOS中vTaskSuspend()接口实现分析
User defined path and file name of Baidu editor in laravel admin
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool
Introduction to asynchronous task capability of function calculation - task trigger de duplication
*. No main manifest attribute in jar
Katalon中控件的参数化
ctf-pikachu-CSRF
随机推荐
[Yugong series] go teaching course 002 go language environment installation in July 2022
VIM add interval annotation correctly
Myslq delete followed by limit
Pytest multi process / multi thread execution test case
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Restore the subtlety of window position
毕业设计:设计秒杀电商系统
如何有效远程办公之我见 | 社区征文
2022-07-03: there are 0 and 1 in the array. Be sure to flip an interval. Flip: 0 becomes 1, 1 becomes 0. What is the maximum number of 1 after turning? From little red book. 3.13 written examination.
还原窗口位置的微妙之处
Evolution of MySQL database architecture
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
Katalon框架测试web(二十六)自动发邮件
SQL语句加强练习(MySQL8.0为例)
Flink学习8:数据的一致性
'2'>' 10'==true? How does JS perform implicit type conversion?
[untitled]
STM32 external DHT11 display temperature and humidity
SDP中的SPA
Database SQL statement summary, continuous update