×
Community Blog HTTP/3 Version RPC Protocol by Apache Dubbo, Improving Unstable Network Efficiency by up to 6 Times

HTTP/3 Version RPC Protocol by Apache Dubbo, Improving Unstable Network Efficiency by up to 6 Times

This article describes the support for HTTP/3 in the Triple protocol, including its design goals, practical application cases, performance testing results, and source code architecture analysis.

By Xin Yang (Haixing), An Apache Dubbo Committer and former Alibaba senior technical expert

After Apache Dubbo 3.3.0, the official team released the newly upgraded Triple X protocol, which fully supports HTTP/1, HTTP/2, and HTTP/3 protocols. This article will focus on the support for HTTP/3 in the Triple protocol, including its design goals, practical application cases, performance testing results, and source code architecture analysis.

1. Introduction to Triple X Protocol

In the early applications of Dubbo, although it showed excellent performance in service intercommunication within the data center, with the evolution of technology and the expansion of application scenarios, the original architecture gradually exposed some bottlenecks. These bottlenecks are particularly evident in cross-region and cross-cloud environments, especially in the frequent switching between Web and RPC frameworks, where development complexity and system performance are affected.

The pain points of traditional architecture are mainly reflected in:

  1. Application scenarios limited to data centers: In cross-region or cross-cloud applications, the traditional architecture of Dubbo lacks native support for wide-area environments. As a result, developers need to switch between multiple protocols and frameworks, which increases complexity.
  2. North-south and east-west traffic challenges: In modern microservices architectures, the traditional RPC framework tends to focus more on north-south traffic optimization, while the performance requirements of inter-service (east-west) communication are increasing, which poses new challenges to the traditional Dubbo architecture.
  3. Cloud-native and cross-language interoperability requirements: With the widespread use of cloud-native technologies, the system needs to have deeper support for the HTTP protocol and the ability to communicate across languages. However, traditional Dubbo is not natively optimized in this regard.

Transformation and breakthroughs of Triple X: The advent of Triple X directly responds to these pain points. It not only continues Dubbo's consistent high-performance communication capabilities but also achieves full compatibility with the gRPC protocol. By supporting protocols such as HTTP/1, HTTP/2, and HTTP/3, Triple X provides a more flexible and efficient solution for a wide range of cross-cloud and cross-region application scenarios.

1.1 Http/3: A New Impetus for Modern Network Communication

HTTP/3 is a new version of the Hypertext Transfer Protocol designed to improve the speed, security, and reliability of modern networks. It is built based on Google's QUIC protocol and utilizes UDP instead of the traditional TCP for data transmission, fundamentally solving some performance bottlenecks in HTTP/2.

Building an RPC (Remote Procedure Call) protocol based on HTTP/3 has significant technical advantages.

Firstly, the low latency and fast connection establishment mechanisms of HTTP/3 can significantly shorten the response time of RPC calls, especially in mobile networks or cross-regional invocation scenarios where the performance is particularly prominent.

Secondly, the multiplexing feature of HTTP/3 allows multiple RPC requests to share a single connection without being affected by the blocking of a single request, thereby enhancing concurrency and transmission efficiency.

In addition, the built-in TLS 1.3 encryption mechanism ensures the security of data transmission and simplifies the security configuration at the application layer.

More importantly, HTTP/3 is sensitive to network packet loss, which enables RPC calls to maintain stable performance in complex network environments.

These features give RPC protocols based on HTTP/3 an inherent advantage in scenarios that demand high performance and high reliability.

2. Official Support for HTTP/3 by Triple X

The Triple protocol has implemented support for the HTTP/3 protocol, allowing both RPC and REST requests to be transmitted via HTTP/3. With the adoption of HTTP/3, the Triple protocol has seen significant improvements in the following areas:

Performance enhancement: By leveraging the QUIC protocol, HTTP/3 reduces latency and speeds up request response times, especially in high-latency or complex network environments, significantly enhancing the overall performance of services.

Reliability strengthening: HTTP/3 avoids head-of-line blocking through multiplexing and connection migration, maintaining connection stability even in poor network conditions, and ensuring reliable service delivery.

Security improvement: HTTP/3 mandates TLS1.3 encryption, providing more secure communication compared to the optional encryption in traditional HTTP/2.

Adaptation to unstable network environments: In the case of high packet loss rates or unstable bandwidth, HTTP/3 can maintain higher connection quality and service performance, enhancing performance in unstable network environments.

Since HTTP/3 is based on the QUIC protocol (UDP), it may be blocked by firewalls or gateways. Therefore, triple has implemented and enabled HTTP/3 negotiation capabilities by default. The connection is first established through HTTP/2. If the connection is successful and the server returns the Alt-Svc header indicating support for HTTP/3, the client will automatically switch to HTTP/3.

3. Practical Case: Enable Http/3 Communication for Applications

This section describes how to enable HTTP/3 communication support for a common Dubbo application. First, ensure that you are using the Triple RPC protocol. You only need to add the following configurations to enable the HTTP/3 feature.

There is a complete example for an in-depth study in the 2-advanced/dubbo-samples-triple-http3 directory of the dubbo-samples open-source repository.

3.1 Configure HTTP/3 Transport Support

dubbo:
    protocol:
        name: tri
        triple:
            http3:
                enabled: true

3.2 Add HTTP/3 Protocol Parsing Dependency Packages

<dependencys>
    <dependency>
        <groupId>io.netty.incubator</groupId>
        <artifactId>netty-incubator-codec-http3</artifactId>
        <version>0.0.28.Final</version>
    </dependency>

    <!-- To support self-signed certificates, if the certificate is configured that does not require -->
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk15on</artifactId>
        <version>1.70</version>
    </dependency>
</dependencys>

3.3 Run the Sample Code and Test the Effects

If you have downloaded the complete sample source code from the preceding sample source code repository, you can directly enable the sample after you modify the preceding two configurations. In this case, the sample communication is based on HTTP/3.

After the sample is successfully enabled, you can run the curl command to test it.

Please note that curl needs to be upgraded to a new version that supports HTTP/3. For more information, please refer to the reference.

curl --http3 -vk 'https://localhost:50052/org.apache.dubbo.demo.GreeterService/sayHelloAsync?request=world'
# The output is as follows
#* QUIC cipher selection: TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_CCM_SHA256
#* Skipped certificate verification
#* using HTTP/3
#* [HTTP/3] [0] OPENED stream for https://localhost:50052/org.apache.dubbo.demo.GreeterService/sayHelloAsync?request=world
#* [HTTP/3] [0] [:method: GET]
#* [HTTP/3] [0] [:scheme: https]
#* [HTTP/3] [0] [:authority: localhost:50052]
#* [HTTP/3] [0] [:path: /org.apache.dubbo.demo.GreeterService/sayHelloAsync?request=world]
#>
#* Request completely sent off
#< HTTP/3 200
#< content-type: application/json
#<
#"Hello world"

4. Performance Comparison: Unstable Network Communication Efficiency Improved by up to 6 Times

Apache Dubbo introduces support for HTTP/3 in its new Triple protocol, which significantly improves communication performance in cross-cloud, cross-region, and unstable network environments. For instance, by reducing latency through the QUIC protocol, Dubbo's efficiency in unstable network conditions is increased by up to 6 times. The Triple protocol is compatible with HTTP/1, HTTP/2, and HTTP/3, enabling developers to flexibly respond to different scenario requirements while simplifying the system architecture. Through these innovations, Dubbo further strengthens its leading position in high-performance distributed services.

1

4.1 Impact of Packet Loss Rate on QPS

4.2 Impact of Packet Loss Rate on RT

2

5. Source Code Analysis: Dubbo HTTP/3 Implementation Architecture

The following is the architecture of Triple X protocol support for HTTP/1, HTTP/2, and HTTP/3. Interested developers can refer to the source code for in-depth study.

3

6. Summary

The introduction and application of HTTP/3 have brought significant technological advancements to network communication. As one of the core protocols of modern networks, HTTP/3 solves the performance bottlenecks of previous protocols in complex environments such as high latency and weak networks through its QUIC-based design. Especially in the construction of the RPC protocol, the features of HTTP/3 such as low latency, multiplexing, packet loss sensitivity, and forceful encryption, have significantly improved the efficiency, security, and reliability of communication.

Taking the Triple protocol of Apache Dubbo as an example, the HTTP/3-based architecture not only expands cross-cloud and cross-region application scenarios but also achieves a performance improvement by up to 6 times in unstable network environments. Dubbo, with its protocol flexibility, provides a more efficient and secure solution for distributed services, paving the way for the further development of modern microservices architecture.

0 0 0
Share on

You may also like

Comments

Related Products