Open Source Address : https://github.com/alibaba/xquic
What is XQUIC?
XQUIC is Ali’s self-developed IETF QUIC standardized transport protocol library.XQUIC is a UDP transport framework implemented based on the IETF QUIC protocol, including encrypted reliable transmission, HTTP/3 two main blocks, to provide applications with reliable, secure and efficient data transmission capabilities, which can greatly improve the user network experience of products in weak and mobile networks. This technology research and development is initiated and led by the Taobao platform technology team, and currently there are several teams participating in it, such as Dharma Institute XG Lab and AliCloud CDN.
There are many open source implementations of QUIC today, why choose the path of standard protocol + self-research implementation? We started to pay attention to Google’s practice on QUIC in 14 years (mobile Taobao fully applied HTTP/2 in 16 years), followed up and tried to implement GQUIC in e-commerce scenarios from the end of 17, and implemented GQUIC in scenarios such as Handao pictures and short videos at the end of 18 and got some network experience gains. However, in the process of using open source solutions, more or less encountered some problems, such as excessive package size, complex dependencies and so on. Eventually, we started to develop our own implementation.
Why choose the protocol version of the IETF QUIC standardization draft? In the past, we have also tried to develop our own private protocols. In a scenario where the end-to-end control is internal, private protocols are indeed convenient and can evolve quickly and iteratively according to the needs of the business scenario; however, it is difficult for private protocol solutions to go out and establish an ecosystem / or combine with other application ecosystems (following the same standardized protocols to achieve interoperability); on the other hand, from the cloud vendor’s perspective, private protocols are On the other hand, from the cloud vendor’s perspective, private protocols are difficult to connect with external customers; at the same time, due to the IETF’s open discussion mode of work, the protocols will have more comprehensive and sufficient consideration in terms of security and scalability. Therefore, we choose the IETF QUIC standardized draft version to implement. As of now, the IETF working group has released the QUIC v1 version RFC, which XQUIC already supports and is able to interoperate with other open source implementations based on QUIC v1.
The XQUIC Advantage
XQUIC is a lightweight, high-performance, standardized cross-platform protocol library that.
- XQUIC compiled products in both Android/iOS are less than 400KB
- No external dependencies other than TLS/1.3 capability dependency on SSL library, which can be easily deployed to mobile devices and various embedded devices
- Suitable for mobile APP scenarios that require high performance but are also sensitive to package size (to reduce the installation cost for new users, mobile APPs want to minimize APP package size)
High performance transmission.
- XQUIC has been implemented in the mobile Taobao core guide, short video link large-scale use, and relative to the kernel state TCP + HTTP/2 optimization of 20% of the network request time consumption
- Support 0-RTT function
- Support for multi-channel transmission acceleration capability 
- XQUIC implements the entire IETF QUIC standard protocol, including the transport layer, encryption layer, and application layer protocol stack
- Protocol version support QUIC version 1, and draft-29
- SSL library is compatible with BoringSSL or BabaSSL (you can choose either one)
Ease of use.
- Cross-platform: Support Linux/Android/iOS/Mac and other platforms, will also support Windows platform adaptation, the client can easily access and use through the SDK way.
- Support Wireshark parsing, qlog event log standard, easy to troubleshoot problems
- Perfect documentation (Chinese/English control), demo examples and single test
XQUIC Core Introduction
XQUIC is a C-protocol library implementation of the IETF QUIC draft version, with the overall end-to-end link architecture design shown below. xQUIC internally contains implementations of QUIC-Transport (transport layer), QUIC-TLS (encryption layer, interfacing with TLS/1.3), and HTTP/3.0 (application layer). In addition to the functional modules of the protocol stack for each layer, XQUIC also supports the qlog logging standard in the public module section.
Congestion Control Algorithm Framework
The congestion control algorithm module assumes the engine function in the transport protocol stack. In order to facilitate the implementation of multiple congestion control algorithms and optimize them for various typical scenarios, we abstract the congestion control algorithm process into seven callback interfaces, of which the two core interfaces, onAck and onLost, are used to allow the algorithm to implement the processing logic when a packet is received and when a packet loss is detected. Cubic, New Reno, and the more popular BBR v1 and v2. Each algorithm only needs to implement these 7 callback interfaces to achieve the complete algorithm logic.
In order to facilitate data-driven network experience optimization, we analyze the effect of connection packet loss rate, RTT, bandwidth and other information through sampling and analysis, combined with the algorithm adjustment of each version. The network environment distribution of real users is also simulated in the experimental environment to better pre-evaluate the effect of algorithm tuning on the improvement of network experience.
Transport layer capability and application protocol negotiation
XQUIC provides two sets of interfaces, a layer 7 interface using standard HTTP3 and a layer 4 interface using direct transport layer capabilities. XQUIC also supports the ALPN negotiation mechanism, which allows multiple application layer protocols to be compatible by registering new application layer protocol callbacks to the ALPN interface and by negotiating during the handshake.
Extensibility and ease of use of 7-layer protocols: The interface of XQUIC categorizes QUIC Transport events into generic transport layer events and application-layer-protocol oriented events. Connection session and Stream events are defined towards Application-Layer-Protocol; while the remaining generic transport layer events can be reused because they have a high degree of commonality between different application layer protocols. This design ensures that when extending multiple Layer-7 protocols, developers only need to focus on the Layer-7 protocols for Connection Session and Stream data processing, and do not need to duplicate the development of QUIC transport layer generic events.
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, transport parameters, ALPN negotiation, while the TLS layer needs to rely on the underlying SSL library to support the above functions. The TLS layer needs to categorize these data flows to simplify the upstream and downstream dependencies and reduce the complexity of the code.
XQUIC adapts two underlying ssl libraries, babassl and boringssl, and provides a unified interface upwards, thus eliminating the differences in interfaces and processes between them, and abstracting them into a unified internal data flow, providing only a light adaptation layer for different ssl libraries, reducing the code logic of repeated adaptations, and achieving the effect of reducing code complexity and improving maintainability. At the same time XQUIC also provides compilation options to facilitate developers according to their own applications , choose the right dependency library .
XQUIC open source history
We started exploring the direction of moving from TCP to UDP around 2018, first based on GQUIC, mainly applied in the scenario of content distribution such as pictures and short videos in Handao. At the end of 2018 and the beginning of 2019, there was a common judgment to take the standardized road, on the one hand, the entire standardized protocol design and security have more complete considerations, on the other hand, because from the perspective of network acceleration products, private protocol solutions are more difficult to be recognized by users. After deciding to choose the standardization path, there was no particularly mature and mobile-ready IETF QUIC protocol stack implementation on the market, so Handao launched its own XQUIC project.
After 1.5 years of R&D and polishing, it was fully launched in June 2020, and was validated at scale in August 20 in the core Handao shopping guide RPC request scenario. At the beginning of 2011, we interfaced with CDN IETF QUIC product and started to gradually apply IETF QUIC technology in short video scenario. In September last year, we realized the scale application of the IETF QUIC complete protocol stack in the short video scenario. After that, we experienced the test of 2021 Double 11, the performance and stability of XQUIC have been well verified, so in January 7th of this year, we completed the open source of XQUIC to the public, and will continue to update the iterative open source version.
Why we open source XQUIC
Open source can help the whole community to better understand the technology, can help us to improve, and can promote the technology through the influence of the community. The feedback from the community will also help us absorb more input from the requirements scenarios and help us iterate on the technology. We expect XQUIC to serve Taobao technology while actively giving back to the community, and welcome web technology development enthusiasts to join the open source community to communicate with us.
Application Scenarios and Effects
Currently, XQUIC has been used in the official version of Handao Android/iOS and the group’s unified access gateway. For example, when we open the home page of Taobao, or search for products we are interested in, or open the video of browsing experts, XQUIC provides faster network data transmission for these scenarios, and provides stable network requests of more than 10 billion every day. End-to-end acceleration capability. XQUIC is also massively proven in the core shopping links and short video scenarios in the Double 11 shopping festival in 2021.
Follow up Roadmap
We plan to release a stable version every 1~2 months, the current plan is as follows.
For new functional features.
- Interoperability feature additions, including Key update, Retry, and ECN
- Multi-path support in WG draft version
- Module support for open source Tengine
- Non-reliable transfer datagram support
- Masque feature support
Since the Multi-path QUIC  draft is currently 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 supported by XQUIC, we have temporarily removed this feature from the open source version. We will update the multipathing feature in February based on the Working Group draft version.
- UDP performance optimizationfeature
- XUDP adaptation support
- windows platform support
Supporting tools: * Network performance measurement tools
- Network performance measurement tools
Documentation and Chinese information.
- The open source repository has provided a Chinese translation of the draft based on draft-34 calibration, and the Chinese translation of RFC8999-9002 will be updated successively.