学技术学英语:TCP的三次握手和四次挥手
| 单词 | 汉语意思 | 音标 |
|---|---|---|
| acknowledge | 承认,确认 | /əkˈnɒl.ɪdʒ/ |
| acknowledgment | 确认,承认 | /əkˈnɒl.ɪdʒ.mənt/ |
| duplex | 双向的 | /ˈdjuː.pleks/ |
| establish | 建立 | /ɪˈstæb.lɪʃ/ |
| handshake | 握手,握手协议 | /ˈhænd.ʃeɪk/ |
| re-transmission | 重传 | /ˌriː.trænsˈmɪʃ.ən/ |
| receiver | 接收者 | /rɪˈsiː.vər/ |
| reliable | 可靠的 | /rɪˈlaɪ.ə.bəl/ |
| sequence | 序列,顺序 | /ˈsiː.kwəns/ |
| segment | 段,片段 | /ˈseg.mənt/ |
| synchronize | 同步 | /ˈsɪŋ.krə.naɪz/ |
| termination | 终止,结束 | /ˌtɜː.mɪˈneɪ.ʃən/ |
| transmit | 传输 | /trænzˈmɪt/ |
| transmitter | 发送者 | /trænzˈmɪt.ər/ |
| synchronize | 同步 | /ˈsɪŋ.krə.naɪz/ |
| termination | 终止,结束 | /ˌtɜː.mɪˈneɪ.ʃən/ |
| handshake | 握手,握手协议 | /ˈhænd.ʃeɪk/ |
| duplex | 双向的 | /ˈdjuː.pleks/ |
| acknowledgment | 确认,承认 | /əkˈnɒl.ɪdʒ.mənt/ |
| retransmission | 重传 | /ˌriː.trænsˈmɪʃ.ən/ |
TCP Connection (A 3-way handshake)
Handshake refers to the process to establish connection between the client and server. Handshake is simply defined as the process to establish a communication link. To transmit a packet, TCP needs a three way handshake before it starts sending data. The reliable communication in TCP is termed as PAR (Positive Acknowledgement Re-transmission). When a sender sends the data to the receiver, it requires a positive acknowledgement from the receiver confirming the arrival of data. If the acknowledgement has not reached the sender, it needs to resend that data. The positive acknowledgement from the receiver establishes a successful connection.
Here, the server is the server and client is the receiver. The above diagram shows 3 steps for successful connection. A 3-way handshake is commonly known as SYN-SYN-ACK and requires both the client and server response to exchange the data. SYN means synchronize Sequence Number and ACK means acknowledgment. Each step is a type of handshake between the sender and the receiver.
The diagram of a successful TCP connection showing the three handshakes is shown below:

The three handshakes are discussed in the below steps:
Step 1: SYN
SYN is a segment sent by the client to the server. It acts as a connection request between the client and server. It informs the server that the client wants to establish a connection. Synchronizing sequence numbers also helps synchronize sequence numbers sent between any two devices, where the same SYN segment asks for the sequence number with the connection request.
Step 2: SYN-ACK
It is an SYN-ACK segment or an SYN + ACK segment sent by the server. The ACK segment informs the client that the server has received the connection request and it is ready to build the connection. The SYN segment informs the sequence number with which the server is ready to start with the segments.
Step 3: ACK
ACK (Acknowledgment) is the last step before establishing a successful TCP connection between the client and server. The ACK segment is sent by the client as the response of the received ACK and SN from the server. It results in the establishment of a reliable data connection.
After these three steps, the client and server are ready for the data communication process. TCP connection and termination are full-duplex, which means that the data can travel in both the directions simultaneously.
TCP Termination (A 4-way handshake)
Any device establishes a connection before proceeding with the termination. TCP requires 3-way handshake to establish a connection between the client and server before sending the data. Similarly, to terminate or stop the data transmission, it requires a 4-way handshake. The segments required for TCP termination are similar to the segments to build a TCP connection (ACK and SYN) except the FIN segment. The FIN segment specifies a termination request sent by one device to the other.
The client is the data transmitter and the server is a receiver in a data transmission process between the sender and receiver. Consider the below TCP termination diagram that shows the exchange of segments between the client and server.
The diagram of a successful TCP termination showing the four handshakes is shown below:

Let's discuss the TCP termination process with the help of six steps that includes the sent requests and the waiting states. The steps are as follows:
Step 1: FIN
FIN refers to the termination request sent by the client to the server. The first FIN termination request is sent by the client to the server. It depicts the start of the termination process between the client and server.
Step 2: FIN_ACK_WAIT
The client waits for the ACK of the FIN termination request from the server. It is a waiting state for the client.
Step 3: ACK
The server sends the ACK (Acknowledgement) segment when it receives the FIN termination request. It depicts that the server is ready to close and terminate the connection.
Step 4: FIN _WAIT_2
The client waits for the FIN segment from the server. It is a type of approved signal sent by the server that shows that the server is ready to terminate the connection.
Step 5: FIN
The FIN segment is now sent by the server to the client. It is a confirmation signal that the server sends to the client. It depicts the successful approval for the termination.
Step 6: ACK
The client now sends the ACK (Acknowledgement) segment to the server that it has received the FIN signal, which is a signal from the server to terminate the connection. As soon as the server receives the ACK segment, it terminates the connection.
中文总结:
-
TCP连接建立(三次握手):
-
SYN(同步序列号):客户端向服务器发送连接请求。
-
SYN-ACK:服务器回应,确认收到请求并准备连接。
-
ACK(确认):客户端确认服务器的响应,连接建立。
-
-
TCP连接的特点:
-
使用PAR(Positive Acknowledgement with Retransmission)来确保可靠通信。
-
连接是双向的(全双工),数据可以同时双向传输。
-
-
TCP连接终止(四次握手):
-
FIN(终止请求):客户端发出终止连接的请求。
-
FIN_ACK_WAIT:客户端等待服务器的ACK。
-
ACK:服务器确认收到FIN请求。
-
FIN_WAIT_2:客户端等待服务器的FIN信号。
-
FIN:服务器发送FIN信号,表示准备终止连接。
-
ACK:客户端确认收到FIN,连接终止。
-
相关文章:
学技术学英语:TCP的三次握手和四次挥手
单词 汉语意思 音标 acknowledge 承认,确认 /əkˈnɒl.ɪdʒ/ acknowledgment 确认,承认 /əkˈnɒl.ɪdʒ.mənt/ duplex 双向的 /ˈdjuː.pleks/ establish 建立 /ɪˈstb.lɪʃ/ handshake 握手,握手协议 /ˈhnd.ʃeɪk…...
xiao esp32 S3播放SD卡wav音频
本文旨在使用xiao esp32 S3 播放SD卡上的音频文件 1 硬件准备 SD卡 2 代码实现 2.1 依赖库 ESP32-audioI2S-master 2.2 代码 #include "Arduino.h" #include "Audio.h" #include "SD.h"// Digital I/O used #define I2S_DOUT 6 #defi…...
Unity中实现伤害跳字效果(简单好抄)
第一步骤安装并导入Dotween插件(也可以不用导入之后直接下载我的安装包) 官网DOTween - 下载 第二步: 制作跳字预制体 建议把最佳适应打开,这样就不怕数字太大显示不全了。 第三步:创建一个空对象并编写脚本JumpNumbe…...
GaussDB日常维护操作
GaussDB日常维护操作 日常维护检查操作系统参数数据库健康状态日志收集日志清理应用连接数表的例行维护索引重建慢SQL诊断 日常维护检查 实例状态检查: #检查集群实例状态 gs_check -U omm -i CheckClusterStatecm_ctl query -Cvipd#检查主备DN的角色和同步状态 g…...
redis实现限流
令牌桶逻辑 计算逻辑: 代码: import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool;/*** ClassName RedisRateLimiterTokenBucket* Description TODO* Author zhang zhengdong* DATE 2025/1/17 20:22* Version 1.0*/ public class…...
基于SpringBoot和PostGIS的各国及所属机场信息检索及可视化实现
目录 前言 一、空间数据简介 1、全球国家信息表 2、机场信息表 3、国家机场检索实现 二、SpringBoot后台实现 1、模型层实现 2、控制层实现 三、WebGIS可视化实现 1、Leaflet界面实现 2、国家及其机场可视化成果 3、全球机场数量排行榜 四、总结 前言 新春佳节即将…...
python http server运行Angular 单页面路由时重定向,解决404问题
问题 当Angular在本地ng server运行时候,可以顺利访问各级路由。 但是运行ng build后,在dist 路径下的打包好的额index.html 必须要在服务器下运行才能加载。 在服务器下我们第一次访问路由页面时是没有问题的,但是尝试刷新页面或手动输入路…...
GPT-4o背后的语音技术
GPT-4o背后的语音技术 GPT-4o是一个any2any的多模态模型,能够接受文本、音频、图像、视频等多模态输入,也能够生成包含文本、语音、图像和视频等混合内容的多模态输出。本文主要谈语音多模态的实现,并分享一些对于语音研究未来发展的看法。 GPT-4o (“o” 代表 “omni”) …...
微透镜阵列精准全检,白光干涉3D自动量测方案提效70%
广泛应用的微透镜阵列 微透镜是一种常见的微光学元件,通过设计微透镜,可对入射光进行扩散、光束整形、光线均分、光学聚焦、集成成像等调制,进而实现许多传统光学元器件难以实现的特殊功能。 微透镜阵列(Microlens Array&#x…...
Spring boot框架下的RocketMQ消息中间件
1. RocketMQ 基础概念 1.1 核心概念 以下是 RocketMQ 核心概念在 Spring Boot 的 Java 后端代码中的实际使用方式: Producer(生产者) 定义:Producer 是负责发送消息到 RocketMQ 的组件。它可以将消息发送到指定的 Topic。 实…...
记录一次 centos 启动失败
文章目录 现场1分析1现场2分析2搜索实际解决过程 现场1 一次断电,导致 之前能正常启动的centos 7.7 起不来了有部分log , 关键信息如下 [1.332724] XFS(sda3): Internal error xfs ... at line xxx of fs/xfs/xfs_trans.c [1.332724] XFS(sda3): Corruption of in-memory data…...
C++学习第五天
创作过程中难免有不足,若您发现本文内容有误,恳请不吝赐教。 提示:以下是本篇文章正文内容,下面案例可供参考 一、构造函数 问题1 关于编译器生成的默认成员函数,很多童鞋会有疑惑:不实现构造函数的情况下…...
openharmony标准系统方案之瑞芯微RK3568移植案例
标准系统方案之瑞芯微RK3568移植案例 本文章是基于瑞芯微RK3568芯片的DAYU200开发板,进行标准系统相关功能的移植,主要包括产品配置添加,内核启动、升级,音频ADM化,Camera,TP,LCD,…...
深入理解 SSH 端口转发:本地 vs 远程 vs 动态转发
🌟 简介 SSH 端口转发(SSH Port Forwarding)作为一种强大而灵活的技术,不仅可以帮助我们安全地访问远程服务,还能轻松突破网络限制。本文将带你深入了解 SSH 端口转发的原理、类型和实战应用。 🌈 目录 &a…...
postman请求参数化
postman界面介绍 一、使用环境变量(Environment Variables)进行参数化 1、在请求中使用环境变量 在请求的url、请求头(Headers)、请求体(Body)等部分都可以使用环境变量。 URL 部分示例 点击 Postman 界面右上角的 “眼睛” 图标(Environment Quick Look)打开环境管理…...
基于 WEB 开发的汽车养护系统设计与实现
标题:基于 WEB 开发的汽车养护系统设计与实现 内容:1.摘要 本文介绍了基于 WEB 开发的汽车养护系统的设计与实现。文章首先阐述了系统的背景和目的,即随着汽车保有量的增加,汽车养护需求日益增长,传统的汽车养护方式已经无法满足人们的需求&…...
Nginx正向代理配置
Nginx 正向代理默认只支持 http 协议,不支持 https 协议,需借助 "ngx_http_proxy_connect_module" 模块实现 https 正向代理,详情请参考: https://github.com/chobits/ngx_http_proxy_connect_module 安装Nginx某些模块…...
本地仓库管理之当前分支内的操作
以刚搭建好的git仓库为例,刚搭建完的仓库只有master分支,使用git branch查看当前的分支情况。 elfubuntu:~/work/example/hello$ git branch *所在分支为当前分支,即master分支 当前分支进行源码修改时简单流程图如下: 在当前分…...
《内网穿透:网络拓展与安全防护的平衡艺术》
一、引言:开启内网穿透的大门 在当今数字化浪潮席卷全球的时代,网络已成为人们生活和工作中不可或缺的一部分。我们日常使用的网络,如同一个庞大而复杂的生态系统,其中内网和外网犹如两个相互关联却又有所区别的世界。 想象一下…...
【python写个可以运行的2048小游戏】
写一个完整的2048小游戏在Python中是一个相对复杂的任务,因为它涉及到用户界面、事件处理、游戏逻辑等多个方面。为了简化这个过程,我们可以使用Python的图形库,比如pygame。下面是一个简单的2048游戏的实现。 首先,确保你已经安…...
【车载嵌入式】TBOX:智能汽车的“云端神经中枢”与数据引擎
1. TBOX:智能汽车的“云端神经中枢”是什么? 想象一下你的爱车突然有了“超能力”——能自动报告故障、远程启动空调、甚至预测保养时间。这些神奇功能的背后,都离不开一个藏在仪表盘下方的小盒子:TBOX(Telematics BOX…...
解决标准工程库中遇到少了STM32F1 固件包
keil中编译后出现下面错误: ../Core/Inc/stm32f1xx_hal_conf.h(338): error: #5: cannot open source input file "stm32f1xx_hal_uart.h": No such file or directory 整个项目都找不到 stm32f1xx_hal_uart.h 这个文件。 要么 UART 的 HAL 驱动文件没有…...
内网环境下的Conan服务器搭建:基于Artifactory的完整配置指南
内网环境下的Conan服务器搭建:基于Artifactory的完整配置指南 在企业级C/C开发中,依赖管理一直是困扰开发团队的痛点。当项目规模扩大、团队协作需求增加时,如何高效管理第三方库和内部组件成为关键挑战。特别是在金融、军工等对网络安全要求…...
技术重构:OpenCore Legacy Patcher如何为老Mac注入新生命
技术重构:OpenCore Legacy Patcher如何为老Mac注入新生命 【免费下载链接】OpenCore-Legacy-Patcher Experience macOS just like before 项目地址: https://gitcode.com/GitHub_Trending/op/OpenCore-Legacy-Patcher 作为一名系统改造工程师,我经…...
ClearerVoice-Studio语音增强实战教程:3步完成会议录音降噪(FRCRN/MossFormer2)
ClearerVoice-Studio语音增强实战教程:3步完成会议录音降噪(FRCRN/MossFormer2) 1. 开篇:告别嘈杂会议录音的烦恼 你是否曾经遇到过这样的情况:重要的会议录音因为背景噪音而听不清楚,或者多人讨论的录音…...
MongoDB(90)如何使用Mongoose进行ORM操作?
Mongoose 是一个 MongoDB 对象建模工具,提供了一种在 Node.js 环境中优雅地与 MongoDB 进行交互的方法。它提供了数据验证、查询构建、业务逻辑挂钩等功能。下面详细介绍如何使用 Mongoose 进行 ORM 操作。 一、安装和配置 Mongoose 1. 安装 Mongoose 通过 npm 安装…...
Adafruit GFX Library:嵌入式图形开发的终极开源解决方案
Adafruit GFX Library:嵌入式图形开发的终极开源解决方案 【免费下载链接】Adafruit-GFX-Library Adafruit GFX graphics core Arduino library, this is the core class that all our other graphics libraries derive from 项目地址: https://gitcode.com/gh_mi…...
从原理到实战:在虚拟环境中重现永恒之蓝对Win7的攻防
1. 永恒之蓝漏洞的前世今生 2017年那场席卷全球的网络风暴,至今仍让很多IT从业者心有余悸。当时一个名为"永恒之蓝"的漏洞利用工具被公开,随即引发了WannaCry勒索病毒的全球大爆发。医院系统瘫痪、企业数据被锁、政府机构停摆...这些场景都源于…...
Axure中文界面终极解决方案:5分钟实现设计工具完全本地化
Axure中文界面终极解决方案:5分钟实现设计工具完全本地化 【免费下载链接】axure-cn Chinese language file for Axure RP. Axure RP 简体中文语言包。支持 Axure 11、10、9。不定期更新。 项目地址: https://gitcode.com/gh_mirrors/ax/axure-cn 还在为Axur…...
3步破解限速难题:Mac版百度网盘极速方案深度解析
3步破解限速难题:Mac版百度网盘极速方案深度解析 【免费下载链接】BaiduNetdiskPlugin-macOS For macOS.百度网盘 破解SVIP、下载速度限制~ 项目地址: https://gitcode.com/gh_mirrors/ba/BaiduNetdiskPlugin-macOS 还在为Mac版百度网盘的龟速下载而苦恼&…...
