当前位置:网站首页>Why is ack=seq+1 when TCP shakes hands three times
Why is ack=seq+1 when TCP shakes hands three times
2022-07-27 11:42:00 【anlian523】
from Telnet The agreement says

This example comes from 《 Top down method of computer network 》 The first 6 edition 3.5.2 Section .
Above picture , Because the mainframe A Sent a character C Host computer B, So as the receiver B Feedback of ACK by 42+1.
Above picture , Because the mainframe B Sent a character C Host computer A, So as the receiver A Feedback of ACK by 79+1.
And in the last transmission , Because I didn't carry any data , actually Seq = 43 It doesn't make sense . But because of this fixed field, you have to put a value in it , So put a Next Sequence Number Here is the most suitable . That is to say, the serial number is not consumed in this transmission .
The only meaningful thing is ACK = 80, This tells the host B: I have successfully accepted At least the serial number is 79 And the length is 1 The data of .
Possible next transmission

If the next time is the host A Send data again , Packet Seq It will be 43, Because the last time the host A The sending of did not consume the serial number ( namely Len = 0), So the mainframe A The sequence number of the sent packet should still be from 43 Start .
If the next time is the host B Send data again , Packet ACK It will be 43, Because the last time the host A The sending of did not consume the serial number ( namely Len = 0), So the mainframe B Or expect the other party to 43 The starting sequence number .
Three handshakes ACK
This is the three handshakes between this machine and Baidu .
First look at the first two packets , The first packet is Len = 0, But the second packet ACK Still Seq = 0 On the basis of 1 了 . That's strange , Because according to the logic of the previous chapter , Not carrying data , that ACK It should be equal to Seq Of .
Look at the last two packets , alike , The first packet is Len = 0, But the second packet ACK Still Seq = 0 On the basis of 1 了 .
explain
The server responds to the client with a sequence number of zero, as this is its first packet in this TCP session, and a relative acknowledgement number of 1. The acknowledgement number is set to 1 to indicate the receipt of the client’s SYN flag in packet #1.
Notice that the acknowledgement number has been increased by 1 although no payload data has yet been sent by the client. This is because the presence of the SYN or FIN flag in a received packet triggers an increase of 1 in the sequence. (This does not interfere with the accounting of payload data, because packets with the SYN or FIN flag set do not carry a payload.)
In short , Feedback from the receiver ACK The reason to add 1, Because the sender contains SYN Flag bit or FIN Sign a .
in other words , As long as the sender contains SYN Flag bit or FIN Sign a , Even if it does not contain data , The receiving party must also consider The sender consumed a serial number .
in addition , with SYN Flag bit or FIN Message segment of flag bit ( Three handshakes and four waves ), It is also not allowed to carry data .
边栏推荐
- 美现首例孕妇猴痘病例:新生儿被注射免疫球蛋白,已安全出生
- Gaussian elimination acwing 884. Gaussian elimination for solving XOR linear equations
- C programming language (2nd Edition) -- Reading Notes -- 1.5.1
- The difference between extern and static
- 82.(cesium之家)cesium点在3d模型上运动
- 多家银行调整现金管理类理财产品申赎规则:申赎确认时效“T+0”变“T+1”
- N ¨UWA: Visual Synthesis Pre-training for Neural visUal World creAtionChenfei
- USB 网卡驱动数据流
- Japan Fukushima waste dump safety monitoring agreement will recognize the "safety" of the sea discharge plan
- Game theory acwing 892. Step Nim game
猜你喜欢

你真的会写二分查找吗——变种二分查找
![[unity entry program] creator kitfps: first person shooting 3D game](/img/2b/78b535973b2898f53752ceeb25ef01.png)
[unity entry program] creator kitfps: first person shooting 3D game

Why choose smart TV?

Redis simple to use

origin如何作一张图中多张子图是柱状图(或其他图)

Could not load dynamic library ‘libcudnn.so.8‘;

VSCode复制代码时去掉样式/语法高亮/代码高亮/黑色背景

Analysis of the use of JUC framework from runnable to callable to futuretask

SMA TE: Semi-Supervised Spatio-Temporal RepresentationLearning on Multivariate Time Series

Gaussian elimination acwing 883. solving linear equations with Gaussian elimination
随机推荐
Matlab S-function详解
Wilcoxon rank-sum 和 signed-rank
MATLAB画带延时系统的伯德图
什么是私域流量?
哈希表 详细讲解
剑指 Offer 笔记: T45. 把数组排成最小的数
Maker paper data search training notes
The C programming language (2nd) -- Notes -- 1.7
Analysis of the use of JUC framework from runnable to callable to futuretask
Maker Hongmeng application development training 04
makefile模板
剑指 Offer 笔记: T53 - I. 在排序数组中查找数字
LeetCode 03: T58. 最后一个单词的长度(简单); 剑指 Offer 05. 替换空格(简单); 剑指 Offer 58 - II. 左旋转字符串(简单)
The C programming language -- (2nd) -- Notes -- 4.11.2
微博评论爬虫+可视化
Stack acwing 3302. Expression evaluation
暂用 Solo,博客选择困难
美现首例孕妇猴痘病例:新生儿被注射免疫球蛋白,已安全出生
1.Flume 简介及基本使用
(9) Shell I / O redirection