惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
C
Cisco Blogs
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
S
Security Affairs
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
WordPress大学
WordPress大学
小众软件
小众软件
Security Latest
Security Latest
AWS News Blog
AWS News Blog
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
F
Full Disclosure
S
Schneier on Security
L
LangChain Blog
MyScale Blog
MyScale Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
Google Online Security Blog
Google Online Security Blog
Scott Helme
Scott Helme
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
A
Arctic Wolf
Martin Fowler
Martin Fowler
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
The Register - Security
The Register - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
Latest news
Latest news
F
Fortinet All Blogs
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
Hacker News: Ask HN
Hacker News: Ask HN

vzard's blog

二叉搜索树的一些性质 - vzard's blog 跳表 - vzard's blog redis的事务 - vzard's blog redis数据类型及使用场景 - vzard's blog 二叉树非递归遍历统一写法 - vzard's blog 灵魂七问 - vzard's blog XPath线索追踪技术 - vzard's blog cron表达式小记 - vzard's blog 计算广告核心问题总结 - vzard's blog 实现一个简单的http服务器 - vzard's blog Js原型链解读 - vzard's blog 统计知识(1) - vzard's blog 同步Github上的fork - vzard's blog Http协议杂谈 - vzard's blog JAVA虚拟机的类加载机制 - vzard's blog HashMap源码剖析 - vzard's blog Java中的锁 - vzard's blog 关于volatile - vzard's blog 修复hexo博客的一个bug - vzard's blog
由三次握手想到的... - vzard's blog
vzardlloo · 2017-12-01 · via vzard's blog

由三次握手想到的...

tcp.png
上面是一个tcp链接的过程,也就是俗称的三次握手,图上把每次握手做了什么也表示的比较清楚,不过这种表述的方式比较僵硬,没有自然而然的说明三次握手中“三次”的充分性和必要性。在建立可靠通信的准备过程中,客户端和服务端都要确认这样四件事:1、自己拥有发送信息的能力,2、自己拥有接受信息的能力,3、对方拥有发送信息的能力,4、对方拥有接受信息的能力。

  • 在第一次握手时(也就是客户端发送信息给服务端,服务端接受到信息那一刻),这个时候服务端明确了这样两件事,即对方(客户端)具有发送信息的能力,自己具有接受信息的能力。
  • 在第二次握手的时候(也就是服务端返回信息给客户端,客户端接受到信息那一刻),这个时候客户端可以明确这样四件事:由于自己之前发出的信息有了反馈,可以推断出自己之前的信息发送成功,即自己拥有发送信息的能力,对方接受到信息并给出反馈,说明对方具有接受信息和发送信息的能力,自己接受到反馈说明自己拥有接受信息的能力。
  • 在第三次握手的时候(服务端发送确认信息给服务端,服务端接受到信息那一刻),服务端可以明确这样两件事:由于自己发送的信息有了反馈可以推断出自己拥有发送信息的能力,对方具有接受信息的能力。

这样通过三次握手双方都恰好完成了自己在建立可靠通信需要明确的四件事,所以可以进行可靠通信。那么可以做一下推广,三点,四点,乃至N点建立可靠通信需要握几次手呢?先看一下三点,三点就是在两点的基础上再加一点,那么对于第三点来说,对方(点一,点二)的接受和发送信息的能力均已经得到了验证,所以他只需验证自己的接受和发送信息的能力即可,那么验证自己的发送信息和接受信息的能力需要握几次手呢?答案是三次,因为接受信息的能力需要一次握手来验证,发送信息的能力需要两次握手来验证(先发送,等待反馈,接受到反馈说明具有接受发送信息的能力)。所以对于四点也是这样,只要通过三次握手确认自己的发送信息和接受信息的能力,就可以加入已有的三点可靠通信网络,推广一下就是N点可靠通信网络的建立需要[3*(n-1)]次握手,当N=2时,就是3次握手。