当前位置:网站首页>Modify TCP timestamp to optimize transmission performance
Modify TCP timestamp to optimize transmission performance
2022-07-04 06:33:00 【dog250】
TCP Unilateral optimization is CDN Great taboo , But I can't help but say . Conventional unilateral optimization enables CDN The server , But for scenes such as client upload , This will make it impossible . What do I do ?
It can be modified at the receiving end for uploading data And ack The timestamp , In order to reduce the rtt, Finally reduce its TLP,RTO,RACK etc. timer Timeout time , The goal is to trigger retransmission as quickly as possible . The practice is briefly described as follows .
- When TCP The sender sends data, Will do the following assignment :
data.TSval = $now + delta - When TCP The receiving end pairs data reply ack, Will do the following assignment :
ack.TSecr = data.TSval - When TCP The sender receives ack, Instantaneous... Will be calculated iRTT:
iRTT = $now + delta - ack.TSecr - TCP The sender then uses iRTT Calculation sRTT And each timer Timeout time .
From the above process, we can see , If you add ack.TSecr, It will reduce iRTT, As for how to increase ack.TSecr And how much more , This is what the server as the receiving end should do .
To ensure ack.TSecr It will not exceed the sending end $now + delta, The receiver needs to know the real sRTT, For one-way transmission ,rcv_rtt It's not believable , The receiving end needs to actively send the carrier SYN Flag message to detect , According to the following :
RFC 5961 4.2: If the SYN bit is set, irrespective of the sequence number, TCP MUST send an ACK (also referred to as challenge ACK) to the remote peer.
Record what the receiver gets RTT by rRTT, Take the following example (1/4 Adjustable ) Calculate and assign :
ack.TSecr = data.TSval + 1/4*rRTT
In this way, things can be done .
The impact of this on the sender is as follows :
- The sending end runs Reno/BIC/CUBIC, Yes cc No influence , Just optimize TLP/RTO/RACK.
- The sending end runs BBR, Except optimization TLP/RTO/RACK Outside , You can also cancel ProbeRTT avoid inflight Reduced to 4, It can also affect minRTT Acquisition timing , The risk is to cwnd The impact is negative , watch out cwnd limited.
- The sender runs other cc, Unknown .
about Reno family (Reno/BIC/CUBIC),AIMD Not directly used RTT The number , So reduce RTT Yes AI Process of cwnd No influence , But for the BBR, But there are interesting idea.
BBR( At least Linux Realization ) Not with RTT Participate in calculation delivery rate, But manage it by yourself , So change RTT Pair acquisition delivery rate No influence , meanwhile BBR use minRTT Calculation BDP And then we derive cwnd, So change RTT May change cwnd, The reduction was described earlier RTT Then what is it , But worry about reducing RTT Will compress cwnd, Why not increase RTT, Only twice or more 10s The cycle is reduced once RTT Help the sender collect once minRTT, This does not affect the sender pacing rate Calculation , It can also be increased in most cases cwnd, It is a good strategy to promote radical transmission at the sending end .
It's done , Crack a new topic , A little explanation TCP The form of timestamps .
TCP Timestamps use independent relative times , And if necessary, add something unknown to the opposite end delta, Here's why :
- There is no need to synchronize the time at both ends , Each can calculate RTT.
- Random delta It can avoid peer guessing the local time .
The first point is to get rid of the synchronization constraint , Focus on the second point .
If you directly take the startup time as the timestamp , Even if the opposite end knows ? how :
- How long the machine hasn't been restarted will be exposed , If there are kernel security updates during , The opposite end knows that the machine is not patch.
- Native characters will be exposed , If on 180 God , Probably the server , If less than a day , Then for PC, Mobile phones can also guess .
- if PC or mobile phone , The opposite end can detect the owner's living habits , For example, at midnight , In the morning .
- Oh …
so, Initialize different random for each connection delta, The goal is not to talk to strangers .
Zhejiang Wenzhou leather shoes wet , It's not fat when it's raining .
边栏推荐
- MySQL的information_schema数据库
- Download kicad on Alibaba cloud image station
- [Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
- JSON Web Token----JWT和传统session登录认证对比
- Sleep quality today 78 points
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- Nexus 6p downgraded from 8.0 to 6.0+root
- Nexus 6p从8.0降级6.0+root
- Tsinghua University product: penalty gradient norm improves generalization of deep learning model
- AWT常用组件、FileDialog文件选择框
猜你喜欢
How to solve the component conflicts caused by scrollbars in GridView
Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
C语言练习题(递归)
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
Learning multi-level structural information for small organ segmentation
27-31. Dependency transitivity, principle
Uninstall Google drive hard drive - you must exit the program to uninstall
SQL injection SQL lab 11~22
MySQL learning notes 3 - JDBC
Arcpy 利用updatelayer函数改变图层的符号系统
随机推荐
The width of the picture in rich text used by wechat applet exceeds the problem
[problem record] 03 connect to MySQL database prompt: 1040 too many connections
AWT常用组件、FileDialog文件选择框
Leakage detection relay jy82-2p
How to solve the component conflicts caused by scrollbars in GridView
剑指 Offer II 038. 每日温度
Realize IIC data / instruction interaction with micro batg135
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
Sleep quality today 78 points
Variables d'environnement personnalisées uniapp
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
Matlab remainder
C实现贪吃蛇小游戏
27-31. Dependency transitivity, principle
Impact relay jc-7/11/dc110v
Understanding of cross domain and how to solve cross domain problems
2022.7.3-----leetcode.556
Invalid bound statement (not found): com. example. mapper. TblUserRecordMapper. login
buuctf-pwn write-ups (8)