当前位置:网站首页>Why does TCP establish three handshakes and four waves
Why does TCP establish three handshakes and four waves
2022-06-13 06:39:00 【A-linWeb】
What is? TCP?
TCP: Transmission control protocol It's a connection oriented protocol . Before sending and receiving data , Both sides should establish a reliable connection . One TCP The connection must be made three times “ dialogue ” To build it up .
A brief description of the three handshakes
The first handshake was successful Let the server know that the client has the ability to send .
The second handshake succeeded Let the client know that the server has the ability to receive and send . But at this time, the server does not know whether the client has received its own information
The third handshake succeeded The server side knows that the client side receives information , Establishing a connection
Brief description of four waves
First wave The client sends one FIN message , Used to close the transfer of data from the client to the server , At this time, the client is in FIN_WAIT_1 state
Second wave Server side received FIN message , Will send ACK message , And a second wave When the server receives FIN after , Will send ACK message , And add the serial number of the client 1 As ACK The value of the message's serial number , Indicates that a message has been received from the client , At this time, the server side is in CLOSE-WAIT state
Third wave If the server agrees to close the connection , Will send a message to the client FIN message , And specify a serial number , At this time, the server side is in LAST-ACK The state of
Fourth wave When the client receives ACK after , be in FIN-WAIT-2 state . To be received FIN When sending a message ACK Message as reply , And the serial number value of the server side +1 As myself ACK The value of the message's serial number , At this time, the client is in TIME-WAIT state . After waiting for a period of time, you will enter CLOSE state , When the server receives ACK After the message , It will become CLOSE state , At this point, the connection is officially closed .
Why did you establish connection communication three times , It took four times to disconnect ?
Because when the server is terminated FIN After the message , Sent ACK The message is only used for answering , It does not mean that the server side also wants to close the connection immediately .
When only the server sends all the messages , Will send FIN message , Tell the client that the connection can be disconnected .
边栏推荐
- Common websites and tools
- DataGridView data export to excel (in case of small amount of data)
- Thread correlation point
- 线程池学习
- Ijkplayer code walk through H264 unpacker application details
- 景联文科技提供一站式智能家居数据采集标注解决方案
- Multithreading tests network conditions. Machines in different network segments use nbtstat to judge whether they are powered on
- Wechat applet custom tabbar (session customer service) vant
- App performance test: (III) traffic monitoring
- 时间格式化工具----moment.js(网页时间实时展示)
猜你喜欢
[FAQs for novices on the road] about technology management
MFS details (VII) -- MFS client and web monitoring installation configuration
【Kernel】驱动编译的两种方式:编译成模块、编译进内核(使用杂项设备驱动模板)
JVM基础
The web server failed to start Port 7001 was already in use
'ipconfig' is not an internal or external command, nor is it a runnable program or batch file.
The processing and application of C language to documents
Analyzing server problems using jvisualvm
MFS详解(七)——MFS客户端与web监控安装配置
MFS explanation (V) -- MFS metadata log server installation and configuration
随机推荐
[case] a super easy-to-use tool -- a calculator for programmers
Relationship between fragment lifecycle and activity
MFS详解(七)——MFS客户端与web监控安装配置
Solutions to common problems in small program development
Explication détaillée du triangle Yang hui
[JS] handwriting call(), apply(), bind()
Comprehensive overview of ijkplayer contour features for ijkplayer code walk through
App performance test: (II) CPU
线程相关点
JVM基础
[JS] array flattening
Omron Ping replaces the large domestic product jy-v640 semiconductor wafer box reader
Data storage in memory (C language)
景联文科技:数据标注行业现状及解决方案
Scrcpy development environment construction and source code reading
【js】var、let、const
In kotlin?,!,?:,:, - & gt;、== Brief description of symbols
无刷直流电机矢量控制(四):基于滑模观测器的无传感器控制
Notepad++ settings delete current line shortcut
Jfinal uses freemaker to output map.