当前位置:网站首页>TCP fastopen is used inside the origin server to quickly return to the source
TCP fastopen is used inside the origin server to quickly return to the source
2022-06-23 07:34:00 【Video cloud live broadcast helper】
background
The threshold for each live broadcast platform anchor to start broadcasting is very low , There are a lot of unpopular anchors , There are also very few anchors that produce quality content . The main flow is concentrated in the head 5%~10% Our live room , Therefore, there are a large proportion of unpopular rooms , The number of visitors is very small .
A lot of cdn Or origin station , It's all multilayer , Most of the data transmission before the layer is through the external network . In order to reduce the loss of internal data transmission , Without an audience , Both the edge and the middle layer will stop pulling , Only the central node has live stream data . When an audience comes to watch , It will go back to the source step by step . Each level will recreate a new back to source connection .tcp The connection establishment phase is at least 1+RTT, Multi level connection establishment , Add up , The time spent will be more objective .
Solution
In order to reduce the time of returning to the source , It is suggested that tcp When the connection is established , Turn on tcp fastopen.
The following figure shows the normal connection establishment , And launch http get Request . stay ack When , launch http get request , Time consuming 1RTT+.
The following figure shows the opening tcp FastOpen, It can be done 0RTT. Greatly reduce the time to establish a connection .
The process when the client first establishes a connection :
1、 The client sends SYN message , The message contains Fast Open Options , And this option is Cookie It's empty , This indicates that the client requests Fast Open Cookie;
2、 Support TCP Fast Open The server generated Cookie, And put it in SYN-ACK In the packet Fast Open Option to send back to the client ;
Client received SYN-ACK after , Local cache Fast Open Options Cookie.
therefore , First launch HTTP GET On request , Still need the normal three times handshake process .
after , If the client establishes a connection to the server again :
1、 The client sends SYN message , The message contains 「 data 」( For non TFO Ordinary TCP Handshake process ,SYN The message does not contain 「 data 」) And what was recorded before Cookie;
2、 Support TCP Fast Open The server will receive Cookie check : If Cookie It works , The server will be SYN-ACK In the message SYN and 「 data 」 Confirm , The server will then 「 data 」 Delivery to the appropriate application ; If Cookie Invalid , The server will discard SYN The message contains 「 data 」, And then it sent out SYN-ACK The message will only confirm SYN The corresponding serial number of ;
3、 If the server accepts SYN In the message 「 data 」, The server can send 「 data 」, This reduces the amount of handshake 1 individual RTT Time consumption of ;
4、 The client will send ACK Confirm that the server sent back SYN as well as 「 data 」, But if the client is in the initial SYN Sent in a message 「 data 」 Not confirmed , The client will resend 「 data 」;
5、 After that TCP Connect the data transfer process and non TFO The normal situation is consistent with .
therefore , And then it started HTTP GET On request , You can bypass three handshakes , This reduces the amount of handshake 1 individual RTT Time consumption of .
tcp fastopen be relative to quic, No additional development and adaptation is required , Reuse existing architecture , Can be realized 0RTT.
The optimization effect
according to 3 Layer back to source , Between servers RTT about 20ms, In the cold flow scenario , Can be reduced by about 40ms Delay . Server clusters are generally cross regional , The optimization effect will be more obvious .
边栏推荐
- 898. subarray bitwise OR operation
- 微信多人聊天及轮盘小游戏(websocket实现)
- Here comes the dry goods | PAAS collection to see first ~
- The List
- Nacos适配oracle11g-修改Nacos源码
- 都是硬盘分区 C盘和D盘到底有什么区别?
- U-Net: Convolutional Networks for Biomedical Image Segmentation
- MySQL (11) - sorting out MySQL interview questions
- C WPF realizes dynamic loading of controls through binding
- 896. monotonic sequence
猜你喜欢

Data types in tensorflow

JUnit unit test reports an error org junit. runners. model. InvalidTestClassError: Invalid test class ‘xxx‘ . No runnable meth

TensorFlow中的数据类型
![[* * * array * * *]](/img/fe/2520d85faab7d1fbf5036973ff5965.png)
[* * * array * * *]

【***数组***】

Flannel 工作原理

Initialization layer implementation

Deep learning series 47: Super sub model real esrgan

Deeplab V3 code structure diagram

PSP code implementation
随机推荐
Principle of skip table
User mode and kernel mode
用户态和内核态
干货来了|《PaaS》合辑抢先看~
How flannel works
链游飞船开发 农民世界链游开发 土地链游开发
跳跃表原理
Redis setting password
In depth learning series 46: face image super score gfp-gan
Nacos适配oracle11g-建表ddl语句
MySQL (II) - MySQL data type
The original cloud landed in deep water, and the cloud product family of Boyun container released four values
Difference between char and varchar
论文写作之WPS安装Mathtype插件编写数学公式
3dmax插件开发环境配置及FileExport和Utilities模板测试
Simpledateformat thread safety issues
Sstable details
微信多人聊天及轮盘小游戏(websocket实现)
[game theory] basic knowledge
小爱音箱连接网络异常解决办法