open source address : https://github.com/alibaba/xquic
What is XQUIC?
XQUIC[1] is an IETF QUIC standardized transport protocol library developed by Alibaba. XQUIC is a UDP transmission framework based on the IETF QUIC protocol. It includes encrypted reliable transmission and HTTP/3. It provides reliable, secure and efficient data transmission for applications, which can greatly improve weak network and mobile network products. user network experience. This technology research and development is initiated and led by the Da Taobao platform technical team. Currently, many teams such as the XG laboratory of the Dharma Academy and Alibaba Cloud CDN are involved.
There are many open source implementations of QUIC today. Why choose the road of standard protocol + self-developed implementation? We have been following Google's practice on QUIC since 2014 (mobile Taobao fully applied HTTP/2 in 2016), followed up and tried to implement GQUIC[2] in e-commerce scenarios from the end of 2017, and started to shop pictures on hand at the end of 2018 , short video and other scenarios landed on GQUIC and got a certain network experience benefit. However, in the process of using the open source solution, some problems have been encountered more or less, such as the package size is too large, the dependencies are complex, and so on. Ultimately pushes us to embark on the road of self-research and realization.
Why choose the protocol version of the IETF QUIC[3] standardization draft? In the past, we have also tried self-developed private protocols. In scenarios where end-to-end is controlled internally, private protocols are indeed very convenient, and can rapidly iteratively evolve with the needs of business scenarios; however, private protocol solutions are difficult to go out and establish One ecosystem/or combined with other application ecosystems (following the same standardized protocol to achieve interconnection); on the other hand, from the perspective of cloud vendors, private protocols are also difficult to communicate with external customers; at the same time, due to the working mode of IETF open discussion , the protocol will have more comprehensive considerations in terms of security and scalability. Therefore, we chose the IETF QUIC standardization draft version to implement. Up to now, the IETF working group has released the QUIC v1 version [4] RFC, XQUIC has supported this version, and can interoperate with other open source implementations based on QUIC v1.
Advantages of XQUIC
XQUIC is a lightweight, high-performance, standardized cross-platform protocol library:
Lightweight:
- The compiled products of XQUIC on both Android/iOS ends are less than 400KB
- Except TLS/1.3 capability depends on SSL library, there are no other external dependencies, which can be easily deployed to mobile devices and various embedded devices
- It is suitable for mobile APP scenarios that require high performance but are sensitive to package size at the same time (in order to reduce the installation cost of new users, mobile APP hopes to minimize the APP package size)
High-performance transmission:
- XQUIC has achieved large-scale use of core shopping guides and short video links on mobile Taobao, and optimized 20% of the network request time compared to kernel-mode TCP+HTTP/2
- Support 0-RTT function
- Support multi-channel transmission acceleration capability[5]
standardization:
- XQUIC implements a complete set of IETF QUIC standard protocols, including transport layer, encryption layer, and application layer protocol stack
- Protocol version supports QUIC version 1, and draft-29
- The SSL library is compatible with BoringSSL or BabaSSL (you can choose one of them)
Ease of use:
- Cross-platform: Support Linux/Android/iOS/Mac and other platforms, and will also support Windows platform adaptation in the future, and the client can easily access and use it through the SDK.
- Support Wireshark parsing, qlog event log standard, easy to troubleshoot
- Complete documentation (Chinese/English), demo examples and single tests
XQUIC core introduction
module design
XQUIC is a C protocol library implementation of the IETF QUIC draft version. The end-to-end overall link architecture design is shown in the following figure. XQUIC contains the implementation of QUIC-Transport (transport layer), QUIC-TLS (encryption layer, docking with TLS/1.3) and HTTP/3.0 (application layer). In addition to the functional modules of the protocol stack at each layer, XQUIC also supports the qlog[5] log standard in the public module part.
Congestion Control Algorithm Framework
The congestion control algorithm module assumes the function of the engine in the transmission protocol stack. In order to easily implement multiple sets of congestion control algorithms and facilitate optimization for various typical scenarios, we abstract the congestion control algorithm process into 7 callback interfaces, of which the two core interfaces, onAck and onLost, are used to allow the algorithm to achieve The processing logic when the packet is acked and packet loss is detected. XQUIC internally implements multiple sets of congestion control algorithms, including the most common Cubic, New Reno, and the more popular BBR v1 and v2. Each algorithm only needs to implement these seven callback interfaces to implement the complete algorithm logic.
In order to facilitate data-driven network experience optimization, we sample and analyze the connection packet loss rate, RTT, bandwidth and other information, combined with the algorithm adjustment of each version to analyze the effect. At the same time, the network environment distribution of real users is simulated in the experimental environment to better pre-evaluate the improvement effect of algorithm adjustment on network experience.
Transport layer capabilities and application protocol negotiation
XQUIC provides two sets of interfaces, which are the 7-layer interface using standard HTTP3 and the 4-layer interface that directly uses the transport layer capabilities. At the same time, XQUIC supports the ALPN[6] negotiation mechanism. You can register a new application layer protocol callback with the ALPN interface, and Compatibility of multiple sets of application layer protocols is achieved through negotiation during the handshake.
The scalability and ease of use of the 7-layer protocol: In the interface of XQUIC, QUIC Transport events are classified as general transport layer events and application layer protocol-oriented events. Connection session and Stream events are defined for Application-Layer-Protocol; and the remaining general transport layer events are highly common among different application layer protocols and can be reused. This design ensures that when extending a variety of Layer 7 protocols, developers only need to pay attention to the processing of connection sessions and Stream data by Layer 7 protocols, and do not need to repeatedly develop common events at the QUIC transport layer.
TLS layer design
The QUIC Transport layer has the following dependencies on the TLS module: encryption handshake negotiation, data encryption and decryption, key update, session resumption, 0-RTT, transmission parameters, and ALPN negotiation. The TLS layer needs to rely on the underlying SSL library to support the above functions. Therefore, the TLS module has the diversity of data and the diversity of dependencies, and the data flow and code structure will be more complicated. The TLS layer needs to categorize these data streams to simplify upstream and downstream dependencies and reduce code complexity.
XQUIC adapts to the two underlying ssl libraries, babassl and boringssl, and provides a unified interface upward, thereby eliminating the differences in interfaces and processes between them, and abstracting it into a unified internal data process, only for different ssl libraries. Layer configuration, reduce the code logic of repeated adaptation, and achieve the effect of reducing code complexity and improving maintainability. At the same time, XQUIC also provides a compilation option, which is convenient for developers to choose their own dependent libraries according to their own application conditions.
XQUIC open source history
Why do XQUIC
From around 18 years ago, we began to explore the direction from TCP to UDP. The earliest is based on GQUIC, which is mainly used in the content distribution scenarios such as pictures and short videos on hand Taobao. At the end of 2018 and the beginning of 2019, everyone had a common judgment that they should take the road of standardization. On the one hand, the design and security of the entire standardized protocol had more complete considerations, and on the other hand, from the perspective of network acceleration products, private protocol solutions The solution is more difficult to be accepted by users. After deciding to choose the standardization path, there was no IETF QUIC protocol stack implementation that was particularly mature and suitable for mobile terminals at that time, so Hand Tao started the self-developed XQUIC project.
After one and a half years of research and development and polishing, it was fully launched in June 2020, and it was verified on a large scale in the core shopping guide RPC request scenario of Hand Tao in August 2020. In early 2021, it was connected with CDN IETF QUIC products, and began to gradually apply IETF QUIC technology in short video scenarios. In September last year, we realized the large-scale application of the entire IETF QUIC protocol stack in short video scenarios. After that, we have experienced the test of Double Eleven in 2021, and the performance and stability of XQUIC have been well verified. Therefore, on January 7 this year, we will complete the open source of XQUIC, and will continue to update iterative open source in the future. Version.
Why we open source XQUIC
Open source can help the entire community to better understand this technology, can help us improve, and can promote this technology through the influence of the community. Feedback from the community can also help us absorb more input from demand scenarios and help us better iterate on this technology. We expect XQUIC to actively give back to the society while serving Taobao technology. We also welcome fans of network technology research and development to join the open source community to communicate with us.
Application scenarios and effects
At present, XQUIC is already in the official version of Android/iOS dual-end, as well as the large-scale application of the group's unified access gateway. For example, we open the homepage of mobile Taobao, or search for the products we are interested in, or open the website to browse experts. video, XQUIC provides faster network data transmission for these scenarios, and provides end-to-end acceleration capability for more than 10 billion network requests every day. During the Double Eleven Shopping Festival in 2021, XQUIC has also undergone large-scale verification in the core shopping guide links and short video scenarios.
Subsequent Roadmaps
We plan to release a stable version every 1-2 months, the current plan is as follows:
New features:
- Complementary interoperability functions, including Key update, Retry, and ECN
- Multipath feature support for WG draft version
- Adapt to the module support of open source Tengine
- Unreliable datagram support
- Masque feature support
Since the current Multi-path QUIC[5] draft is in the process of being accepted by the IETF QUIC Working Group, and the WG draft version is partially different from the multi-path version previously supported by XQUIC, we have temporarily removed this part of the function in the open source version . In the future, we will update the multi-path function based on the Working Group draft version in February.
Performance optimization:
- UDP performance optimization feature
- XUDP adaptation support
Cross-platform support:
- windows platform support
Supporting tools:
- Network Performance Measurement Tool
Documents and Chinese materials:
- The open source repository has provided the Chinese translation of the draft based on draft-34 revision, and the Chinese translation of RFC8999-9002 will be updated successively in the future.
Addendum:
[1] XQUIC: https://github.com/alibaba/xquic
[2] GQUIC: Refers to the Google QUIC version, which is somewhat different from the IETF QUIC draft version
[3] IETF QUIC: Refers to the QUIC standard advanced by the IETF working group https://datatracker.ietf.org/wg/quic/documents/, including RFC8999~9002, as well as HTTP/3.0, QPACK, etc. that are still in progress Series content
[4] QUIC v1: QUIC protocol version described by RFC8999~9002
[6] ALPN negotiation: https://datatracker.ietf.org/doc/html/rfc7301
team introduction
The XQUIC team is affiliated to the Da Taobao platform technology-mobile technology middle-stage team, hoping to bring a smoother experience to users through the evolution of network technology. If you are interested in XQUIC, network technology, high-performance network transmission and other fields, please click "Read the original text" to follow our GitHub repository:
https://github.com/alibaba/xquic
If you encounter problems in using XQUIC related products, welcome to join the XQUIC community Dingding group for feedback & exchanges:
If you want to join us, please submit your resume to miaoji.lym#alibaba-inc.com (please replace # with @ when submitting your resume)
pay attention to [Alibaba Mobile Technology] WeChat public account, 3 mobile technology practice & dry goods every week for you to think about!
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。