当前位置:网站首页>What is the TCP 3-time handshake process?
What is the TCP 3-time handshake process?
2022-06-27 11:50:00 【long_ songs】
Now we mainly use TCP( Transmission control protocol ) Data transmission in a connection oriented network . But have you ever thought about it , Why do we prefer TCP Not any other agreement ?
actually ,TCP It provides us with a safe and reliable connection link between the two devices . and , This only occurs during the establishment and closing of a connection between two devices TCP Medium 3 Only during the first handshake . seeing the name of a thing one thinks of its function , There are three steps to establishing and closing a connection . therefore , In this blog , We will understand TCP 3 The second handshake process and the different steps involved .
TCP 3 The handshake process
3-Way Handshake The process is TCP A set of defined steps that occur in , Used to create a secure and reliable communication link and close it . actually ,TCP Use before transferring data 3 The second handshake process establishes a connection between two devices . Once the connection is established , Data transmission between devices . Then you need to terminate the connection , This is also done by using 3 The second handshake process is completed . A secure and reliable connection is established to preserve the equipment CPU、 Buffer and bandwidth to communicate normally . therefore , These resources must be released by terminating the connection after data transmission . therefore , have access to TCP 3 The second handshake process establishes and terminates the connection in the network in a secure way .
Here is TCP Figure displaying the header .

TCP There are some elements in the header file for 3 The handshake process , They are :
- Serial number : The serial number is a random 32 position ( The scope is 0 To (2^32 -1)) The number of , Assigned to the first bit of data . Usually , A serial number is used only once in a connection . For other data transfers in the same connection , Other random serial numbers can be used .
- Confirmation no. : It is the next serial number that the sending device expects from the sender . It is usually larger than the serial number received from the sender 1.
- Window size : The window size is the buffer size . It is the maximum amount of data that can be received in the buffer .
- Maximum segment size : It is the maximum size of each data segment that the connecting device can accept . Over this size , The device will not be able to receive data segments .
- SYN sign : SYN On behalf of the synchronization . It can be described as a request to establish a connection . If SYN by 1, It means that the device needs to establish a secure connection , Otherwise not .
- ACK sign : ACK The representative confirmed . Can be said to be SYN Response . If ACK by 1, The device has received SYN Message and confirm , Otherwise no .
- FIN sign : FIN The representative has completed . When the data transmission is complete , The device has to use FIN Flag to terminate the connection . If FIN by 1, Then the device will terminate the connection , Otherwise not .
Here's how to use 3 Figure displaying how to establish a connection during the second handshake .

Here are the USES TCP Medium 3 The three steps involved in establishing a connection in the second handshake process :
- The client sends to the server SYN: When the client wants to connect to the server . It will “SYN” Flag set to 1 And send the message to the server . This message has some additional information , Like serial number ( Any random 32 Digit number )、 Here ACK Set to 0、 Window size and maximum segment size . for example , If the window size is 2000 position , The maximum segment size is 200 position , At most... Can be transmitted in the connection 10 Data segments (2000/200 = 10).
- The server replies to the client SYN and ACK: After the server receives the synchronization request from the client , By way of ACK Flag set to “1” Send a confirmation to the client .ACK The confirmation number of is one greater than the received serial number . for example , If the client sends a serial number = 1000 Of SYN, Then the server will send a confirmation number = 10001 Of ACK. Besides , Server will SYN Flag set to “1” And send it to the client , If the server also wants to establish a connection . Here for SYN The serial number of will be the same as that of the client SYN Different . The server also notifies the client of its window size and maximum segment size . When this is done , The client to server connection is established .
- The client sends to the server ACK: client Received from the server SYN after , take ACK Flag set to '1', And greater than the server SYN Serial number confirmation number 1 Send to client . ad locum ,SYN The flag remains “0”. After completing this step , Now the connection from the server to the client is also established . Once the connection is established , The minimum of the maximum segment sizes of the sender and receiver will be considered for data transmission .
Here's how to use 3 Figure displaying how the secondary handshake process terminates the connection .

Here are the USES TCP Medium 3 The third handshake process involves three steps to terminate the connection :
- The client sends to the server FIN: When the client wants to terminate the connection . It will FIN Flag set to “1”, And use the random serial number to send the message to the server . here ,ACK Set to 0.
- The server replies to the client FIN and ACK: After the server receives the termination request from the client , By way of ACK Flag set to “1” Send a confirmation to the client .ACK The confirmation number of is one greater than the received serial number . for example , If the client sends a serial number = 1000 Of FIN, Then the server will send a confirmation number = 10001 Of ACK. Besides , Server will FIN Flag set to “1” And send it to the client , If the server also wants to terminate the connection . Here for FIN The serial number of will be the same as that of the client FIN Different . After completing this step , The connection from the client to the server is terminated .
- The client sends to the server ACK: client Received from the server FIN after , take ACK Flag set to '1', And with a larger than the server FIN Serial number confirmation number 1 Send to client . here ,FIN The flag remains “0”. After completing this step , The connection from the server to the client is now terminated .
This is about TCP Used in the protocol 3 The whole contents of the second handshake process and its steps .
边栏推荐
- After Jerry's sleep, the regular wake-up system continues to run without resetting [chapter]
- C/s architecture
- pull request
- AutoCAD - three pruning methods
- VPT模型视频讲解
- Leetcode 177 The nth highest salary (June 26, 2022)
- Popular science of device review: popular science of innovative medical device series - sternum plate products
- 15+ urban road element segmentation application, this segmentation model is enough!
- Xuri 3sdb, installing the original ROS
- QStyle类用法总结(二)
猜你喜欢

15+城市道路要素分割应用,用这一个分割模型就够了!

"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?

Mqtt protocol stack principle and interaction flow chart
![[worthy of collection] centos7 installation MySQL complete operation command](/img/23/7c4b69e1abc3a3ceba9b79cebe1c9b.png)
[worthy of collection] centos7 installation MySQL complete operation command

【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍

How to deploy jupyterlab in methodot?

"Internet +" contest topic hot docking | I figure to understand 38 propositions of Baidu

Drive to APasS!使用明道云管理F1赛事

Codeforces Round #786 (Div. 3) ABCDE

【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
随机推荐
Deep learning in finance in cross sectional sectional predictions for random forests
【TcaplusDB知识库】TcaplusDB OMS业务人员权限介绍
Naacl 2022 | TAMT: search the transportable Bert subnet through downstream task independent mask training
c/s 架构
等等, 怎么使用 SetMemoryLimit?
Wait, how do I use setmemorylimit?
Microsoft cloud technology overview
Unity Shader学习(一)认识unity shader基本结构
面试突击60:什么情况会导致 MySQL 索引失效?
R语言fpc包的dbscan函数对数据进行密度聚类分析、plot函数可视化聚类图
优博讯出席OpenHarmony技术日,全新打造下一代安全支付终端
QStyle类用法总结(二)
AUTOCAD——三种修剪方式
The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the AIC function is used to compare the AIC values of the two models (simple
Precautions for use of IO interface interrupt of Jerry [chapter]
Unity Shader学习(二)第一个Shader
deep learning statistical arbitrage
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction
Open source model library of flying propeller industry: accelerating the development and application of enterprise AI tasks
【TcaplusDB知识库】TcaplusDB分析型文本导出介绍
