#openEulerBasics – Gazelle

GazelleHigh-performance User-mode Network Protocol Stack

Over the past few years, network hardware I/O capabilities have seen rapid development. Due to factors like network interface card (NIC) interrupts, unavoidable context switches, and the intricacies of the netfilter control plane, kernel network protocol stacks cannot fully utilize the I/O capacity of network hardware even when leveraging features like NIC multi-queue support and hardware offloading.

Among the various technologies for network I/O acceleration, user-mode network protocol stacks stand out as a common and effective approach. Unlike kernel network protocol stacks, which necessitate context switching within the data stream path, a user-mode stack offers a key performance advantage: it eliminates the need for context switches. In this model, network I/O threads and service threads operate within the same context, avoiding data sharing and resource locking during data stream processing. Therefore, network performance is optimized to its full potential.

While a user-mode stack offers the above advantages, its inability to seamlessly adapt to various thread models employed by different applications poses challenges in achieving both high performance and universality.

Gazelle has risen to these challenges. This protocol stack is lightweight and operates in user mode and is highly versatile due to its extensive compatibility and ease of use.

Gazelle directly reads and writes NIC packets in user mode, leveraging the Data Plane Development Kit (DPDK) for optimized performance. It transmits these packets through shared hugepage memory, which facilitates data handling and minimizes latency. Additionally, it employs the Lightweight IP (LwIP) protocol stack to further enhance its functionality. This approach significantly boosts the network I/O throughput of applications and accelerates database network interactions, leading to improved overall system performance and responsiveness.

Gazelle enables high performance and versatility. In openEuler 24.03 LTS, support for the UDP protocol and related APIs has been integrated into Gazelle, further enhancing the user-mode protocol stack.

Gazelle Features:

High performance

  • Ultra-lightweight: The high-performance, lightweight protocol stack is built using DPDK and LwIP.
  • Superb performance: A highly linearizable concurrent protocol stack is implemented using technologies like regional hugepage splitting, dynamic core binding, and full-path zero-copy.
  • Hardware acceleration: TCP Segmentation Offload (TSO), checksum (CSUM) offload, Generic Receive Offload (GRO), and other offload technologies streamline the vertical acceleration of software and hardware.

Versatility

  • POSIX compatibility: With full compatibility with POSIX APIs, there’s no need to modify applications. The UDP recvfrom and sendto APIs are supported.
  • General networking model: Adaptive scheduling of the networking model uses mechanisms like fd router and wake-up proxy. The UDP multi-node multicast model meets the needs of any network application scenario.

User-friendliness

  • Plug-and-play: LD_PRELOAD facilitates cost-free deployment by eliminating the need for service adaptation.
  • Easy O&M: Comprehensive O&M methods, including traffic statistics, metric logs, and CLI commands, are available.

In conclusion, Gazelle stands out as a robust solution for enhancing network performance through its innovative use of user-mode packet processing. Its high performance, versatility, and user-friendliness make it an excellent choice for applications requiring efficient network I/O, such as databases and other network-intensive services. By leveraging Gazelle, organizations can achieve significant improvements in network throughput and overall application performance.

If you have any further questions or need additional information, join the openEuler community!