当前位置:网站首页>UDP reliable transport protocol (quic)
UDP reliable transport protocol (quic)
2022-07-06 03:33:00 【Four in the domain】
UDP And TCP contrast
TCP Sticky subcontracting may occur
UDP impossible , And a frame of data must be read at one time , Otherwise, the unread part will be lost
Reliability mechanism
ACK Mechanism
That is, the response mechanism , Every time you receive a package, you will give it back ack, Let the sender know that the other party has received
Retransmission mechanism
ARQ Three modes of agreement
(1) Stop equation ARQ : wait for ACK, The opposite party was not received within the specified event ACK, Then retransmit the frame
(2) Back off n frame ARQ : Don't wait for the opposite ACK, Each package has a lifecycle , I didn't receive it before the end of my life ACK, Then go back to the package and re contract ( The packet after the error frame has been sent , Still need to resend )
(3) Selective retransmission ARQ : Don't wait for the opposite ACK, Each package has a lifecycle , I didn't receive it before the end of my life ACK, There is no need to go back to the package and re contract , Just resend the package
Flow control
Control the sending rate of the sender , To prevent the recipient from reading data in time , Cause the packet to be discarded after the cache is full
(1) The recipient informs the sender of the remaining cache space , So that the sender can control the sending rate
(2) If the sender stops sending because the other party's cache is full , Then the recipient needs to notify the sender to start sending
4. Congestion control
(1) Slow start : After network congestion , Try sending from a few packets , Gradually send packets exponentially , Until the number of packets returns to the normal number ( Because the bandwidth is getting larger , The scheme has been abandoned )
(2) Fast recovery : After network congestion , Try sending from half the packets , Increase gradually
Serial number mechanism
Rearrangement mechanism
Window mechanism
UDP Reliability design
UDP Window flow control
KCP( For real-time reasons )
RTO Double
TCP The timeout is calculated as RTO Time keeps doubling
KCP The medium super time is calculated as RTO Time is multiplied by 1.5( Empirical value , The test shows that this value is better )Retransmission mechanism
TCP Use fallback N frame ARQ Mechanism ( All retransmission )
KCP Use selective retransmission ARQ MechanismThe fast retransmission
Packet skipping occurs ( The packets received by the receiver are discontinuous , Several tundish are missing ), Don't consider... At this time RTO, Optimize the transmission efficiency in case of packet lossACK Delay
TCP In order to make better use of broadband , Delay to send ACK, such RRT Time is large
KCP You can set whether to delayACK、UNA
5.1 explain UNA: such as UNA 3, Means to inform sender, package 0、1、2 Have received , This is the time sender The swap will be released 0、1、2, If subsequent retransmission is required , These three packets will not enter the retransmission queue ,
5.2 KCP yes ACK+UNA Mechanism
5.3 TCP It's one of twoNo surrender, no flow control
TCP Use The law of fair concession ( Sending window size determinants : Send cache size , The remaining cache size at the receiving end , Packet loss concession , Slow start ),
KCP You can configure skipping Packet loss concession as well as Slow start , Make timeliness more powerfulCode path :https://github.com/skywind3000/kcp
Above for KCP Those who don't clear the explanation can go github Learn from , Again readme The optimized performance part is explained in detail in .
8. KCP The code architecture
QUIC
sketch
- Fast UDP network connections
- Google The proposed experimental network transmission protocol
- be located OSI Network model transport layer
- User mode is based on UDP Implemented transport layer
- To solve TCP The defects of the agreement will eventually replace TCP agreement , Reduce data transmission , Reduce connection setup latency , Speed up Web page transmission
- Document connection :https://quicwg.org/base-drafts/rfc9000.html
advantage
- Flexible congestion control mechanism ( Self actualization , You can also decide whether to use )
- No queue head blocking ( Every stream Separate from each other , Do not affect each other )
- Easy data migration ( After switching the network environment , No need to reconnect , Continue the previous connection channel and continue to transmit data )
- Baotou needs authentication , Data encryption in the package , Safety is better than TLS go beyond
- FEC Forward correction
shortcoming
- Putting it into the kernel has a great impact , All systems should be updated
- Router 、 A firewall 、 There are many intermediate devices that need to be changed
Message format
among Connection ID Is the connection number , It can reduce the number of three handshakes and four waves Frame Type:
- bit01: stream ID length
- bit234: offset length
- bit5 : Yes no Data Length Field
- bit6: Indicates that the stream On the channel Whether sending data has ended , Whether it is half closed
- bit7: Identify whether the frame is stream frame
Stream ID One UDP There can be multiple Stream flow , The integrity of messages in each flow is independent of each other , In order to reduce abnormal times , Number of frames fallback
Establish low latency
边栏推荐
- 【Rust 笔记】18-宏
- three.js网页背景动画液态js特效
- February 14, 2022 Daily: Google long article summarizes the experience of building four generations of TPU
- 【RISC-V】外部中断
- Performance analysis of user login TPS low and CPU full
- ESBuild & SWC浅谈: 新一代构建工具
- Overview of super-resolution reconstruction of remote sensing images
- EDCircles: A real-time circle detector with a false detection control 翻译
- Image super resolution using deep revolutionary networks (srcnn) interpretation and Implementation
- 1、工程新建
猜你喜欢
[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board
Getting started with applet cloud development - getting user search content
真机无法访问虚拟机的靶场,真机无法ping通虚拟机
Tidb ecological tools (backup, migration, import / export) collation
C language judgment, ternary operation and switch statement usage
BUAA喜鹊筑巢
MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
Pointer written test questions ~ approaching Dachang
[concept] Web basic concept cognition
Résumé des méthodes de reconnaissance des caractères ocr
随机推荐
出现Permission denied的解决办法(750权限谨慎使用)
Introduction to DeNO
简述C语言中的符号和链接库
SWC介绍
银行核心业务系统性能测试方法
Crazy, thousands of netizens are exploding the company's salary
Pytoch foundation - (1) initialization of tensors
Eight super classic pointer interview questions (3000 words in detail)
【SLAM】ORB-SLAM3解析——跟踪Track()(3)
Pelosi: Congress will soon have legislation against members' stock speculation
Analyze menu analysis
Overview of OCR character recognition methods
关于非虚函数的假派生
暑期刷题-Day3
ArabellaCPC 2019(补题)
下一个行业风口:NFT 数字藏品,是机遇还是泡沫?
Edcircles: a real time circle detector with a false detection control translation
Remote Sensing Image Super-resolution and Object Detection: Benchmark and State of the Art
2.1 rtthread pin设备详解
SAP ALV颜色代码对应颜色(整理)