当前位置:网站首页>TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
2022-07-03 02:53:00 【Nineteen (drag on and on)】
TCP Three handshakes and four cell phone swings ,TCP Why three and four handshakes ,TCP Connection establishment failure processing mechanism
List of articles
1:TCP Three times mobile phone system
- The client sends... To the server
SYN
package :
Sign a :SYN
Serial number :Seq=x( Random value ) - The server sends... To the client
SYN
ACK
message :
Sign a :SYN ACK
Serial number :Seq=y
Confirmation no. :Ack=x+1 - The client sends... To the server
ACK
message
Sign a :ACK
Serial number :Seq=x+1
Confirmation no. :Ack=y+1
2:TCP Four waves of mobile phone
- The client sends a disconnection message to the server :
Sign a :FIN
Serial number :Seq=u( Random value ) - The server sends a message to the client :
Sign a :ACK
Serial number :Seq=v
Confirmation no. :Ack=u+1 - The server returns the data to be transferred to the client , Send the data to the client again after sending it TCP message :
Sign a :FIN ACK
Serial number :Seq=w
Confirmation no. :Ack=u+1 - The client sends a message to the server :
Sign a :ACK
Serial number :Seq=u+1
Confirmation no. :Ack=w+1
3:TCP Handshake timeout processing mechanism
3.1: The first handshake failed
The client sends... To the server SYN
Message to establish a connection . If the confirmation message from the server is not received within a period of time , It will wait for some time to continue sending SYN
news . If it still does not receive the server confirmation message , Will continue to repeat the above actions , Until the number of transmissions exceeds the maximum number of retransmissions .
3.2: The second handshake failed
The server sends... To the client SYN ACK
message , At this time, the server will block waiting for the client connection , Waiting for the client to send ACK
message . If the client does not receive the confirmation message , Then the client will send to the server again SYN
message , Execution is similar to The first handshake failed
The handling action of .
3.3: The third handshake failed
Client received SYN ACK
After confirming the message , Send to server ACK
message . If the server does not receive the client's message for a long time ACK
news , It will continue to send to the client SYN ACK
news , Repeat the above , Until the maximum number of retransmissions is exceeded .
4:TCP Why three handshakes
TCP The two handshakes can only let the client know that the data it sends can be received by the server , But the server cannot judge whether the client can receive its own data .
As can be seen from the above figure , Just one client will cause the server to open multiple ports , Cause waste of service side expenses .
5:TCP Why wave four times
TCP Four waves ensure that the server is disconnected when all data has been transmitted .
边栏推荐
- Cron表达式介绍
- Principle and application of database
- [fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
- Sous - système I2C (IV): débogage I2C
- HTB-Devel
- Source code analysis | resource loading resources
- I2C 子系统(三):I2C Driver
- [shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
- How do you adjust the scope of activerecord Association in rails 3- How do you scope ActiveRecord associations in Rails 3?
- ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
猜你喜欢
Linear rectification function relu and its variants in deep learning activation function
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
random shuffle注意
Build a private cloud disk cloudrev
你真的懂继电器吗?
Yiwen takes you to know ZigBee
C语言初阶-指针详解-庖丁解牛篇
搭建私有云盘 cloudreve
Add automatic model generation function to hade
[translation] the background project has joined the CNCF incubator
随机推荐
搭建私有云盘 cloudreve
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
SQL server queries the table structure of the specified table
How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?
Pytest (6) -fixture (Firmware)
HTB-Devel
I2C 子系統(四):I2C debug
用docker 连接mysql的过程
Use optimization | points that can be optimized in recyclerview
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
2022-2028 global splicing display industry research and trend analysis report
The left value and the right finger explain better
where 1=1 是什么意思
SQL statement
Yiwen takes you to know ZigBee
[C language] MD5 encryption for account password
Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
[translation] modern application load balancing with centralized control plane
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)