当前位置:网站首页>Transport layer uses sliding window to realize flow control
Transport layer uses sliding window to realize flow control
2022-06-30 19:56:00 【Foxconn quality inspector zhangquandan】
Sliding window mechanism
Traffic buffering : Solve the speed mismatch problem ( Client and server , The speeds at these two ends are completely inconsistent , Inconsistent machine performance , At this time, the processing speed is not matched )
TCP Use sliding window to realize flow control . Flow control is to control the sending rate of the sender , To ensure that the receiving party can receive .
TCP Both sides of the session maintain a sending window and a receiving window . The size of the receive window depends on the application 、 System 、 Hardware limitations . The sending window depends on the receiving window of the peer notification .
In the confirmation message sent by the receiver window Field can be used to control the size of the sender's window , Thus, the transmission rate of the sender is affected . Send the receiver's confirmation message window Field set to 0, Then the sender cannot send data .

TCP Header contains window Field ,16bit position , It represents the byte capacity of the window , The maximum is 65535. This field tells the sender how many buffers it has to receive data . So the sender can send data according to the processing power of the receiver , The receiver will not be unable to handle it . The size of the receiving window is approximately equal to the size of the transmitting window .
Flow control means that the sender sends to the receiver too fast , The receiver can tell it to slow down .( Sliding window to achieve flow control , Flow control is that the receiver controls the sender )
Receiving end setting window , The sending end sets the sending window according to the window of the receiving end , The window can be adjusted during the whole communication process .

There are window fields when the above connection is established 64240 Bytes , The largest data segment is 1460, The maximum transmission unit of the network card MTU The largest transmission unit in the data link layer is 1500 Bytes , The first part of the network layer is 20 Bytes , The first part of the transport layer is 20 Bytes , Then the data becomes 1460 Bytes . So slide the window 64240/1460 You can send it continuously 44 A packet .
At the same time, it can also support selective confirmation SACK_PERM=1.
In establishment TCP These parameters can be negotiated when connecting , How big is the receiving window ,MSS How much is the , Then support selective confirmation .
Confirm that the length of the data inside is 0 Of , The window size is specified when the confirmation is given , You can see that the window can be resized . When the receiving window becomes smaller, the sending window becomes smaller , The sender doesn't send it so fast .

b tell a, Its acceptance window is 400, The maximum length of the segment is 100 Bytes , In the hair 1 2 here we are 3 lost , Confirm it , Let it send a third packet , Then the window starts moving , Then send a message 4 5 A second time 3 individual , Confirm to it after receiving ........
The window becomes 0 After that, I stopped sending it , The sender stops , Send confirmation after processing , The window is adjusted to 400.
边栏推荐
猜你喜欢
随机推荐
【ICCV 2019】特征超分检测:Towards Precise Supervision of Feature Super-Resolution for Small Object Detection
[jetsonnano] [tutorial] [introductory series] [i] how to enable VNC sharing
KubeVela 1.4:让应用交付更安全、上手更简单、过程更透明
MySQL billing Statistics (Part 1): MySQL installation and client dbeaver connection
Tencent conference application market was officially launched, with more than 20 applications in the first batch
【已解决】抖音如何取消关注已注销的账户
IT外包驻场人员怎么定位自己的痛点?
Conditional compilation
Abaqus 2022软件安装包和安装教程
【多线程】使用线程池、实现一个简单线程池
VR全景添加对比功能,让差异化效果展示更直观!
【LeetCode】【SQL】刷题笔记
matlab Delaunay 三角剖分内的查询点
永远不要使用Redis过期监听实现定时任务!
Code shoe set - mt3111 · assignment
说实话ThreadLocal真不是啥高级的东西
笔记软件的历史、选择策略以及深度评测
为什么一定要从DevOps走向BizDevOps?
Force deduction ----- count the string containing the given prefix
启动PHP报错ERROR: [pool www] cannot get uid for user ‘@[email protected]’









