Release of the F-Stack 1.13 network stack, implemented in user space

After a year and a half of development the project release F-Stack 1.13, developing a high-performance network stack operating in user space based on the framework DPDK and the TCP/IP stack of FreeBSD (F-Stack is not tied to FreeBSD and considers Linux as its primary platform for application). The project is used in various products and services Tencent, the largest telecommunications company in China. Code is distributed under the BSD license. Supports operation in Linux and FreeBSD.

F-Stack enables the organization of network interaction in applications by using its own network stack, functioning in user space and directly interacting with network hardware, instead of the operating system's network stack. Specialized editions of Nginx and Redis are provided, translated to use F-Stack.

For application development is supported both as a native Posix API (Socket, Epoll, Kqueue), simplifying the migration of existing applications to F-Stack, and its own programming interface based on coroutines (micro-threads), facilitating the creation of network applications and allowing for the avoidance of complex asynchronous request processing logic. F-Stack also provides tools to simplify usage in applications with a multi-process architecture.

To interact with the network card, bypassing the operating system kernel interfaces, the DPDK Data Plane Development Kit (DPDK) framework is used, providing a set of libraries for low-level work with network adapters, interaction in multi-core systems, and utilizing ring buffers and large memory pages (‘huge page’). The use of DPDK enables the reception and transmission of network packets with minimal CPU cycles (about 80 cycles per packet) and the development of high-performance components of the network stack. The functionality of the TCP/IP stack is directly borrowed from FreeBSD 11.1 and isolated in an operating system-independent library.

F-Stack is marketed as a solution that can be used to enhance the performance of network request handlers in scenarios where the standard TCP/IP stack of the Linux kernel becomes a bottleneck and limits scalability. The use of F-Stack provides a noticeable optimization and can, in some cases, significantly increase the number of handled small requests.

Release of the F-Stack 1.13 network stack, implemented in user space

Release of the F-Stack 1.13 network stack, implemented in user space

Performance improvement is achieved by eliminating operations such as network packet copying, thread scheduling, interrupt handling, and system calls. F-Stack allows reaching the ceiling of network performance possible for the used network card. For instance, F-Stack-based solutions have demonstrated the capacity to handle 10 million simultaneous connections, 5 million requests per second, and 1 million connections per second.

In the new release:

  • Added support for VLAN;
  • Ensured the ability to operate in isolated Docker containers;
  • Implemented interfaces ff_dup, ff_dup2, ff_ioctl_freebsd, ff_getsockopt_freebsd, and ff_setsockopt_freebsd;
  • Added the "idle_sleep" parameter to reduce CPU load in the absence of incoming packets;
  • Added support for building for the ARM64 architecture;
  • In the Nginx version translated to F-Stack, the handlers getpeername, getsockname, and shutdown have been replaced;
  • Migrated to the new version DPDK 17.11.4 LTS;
  • Included is a utility traffic to display the current traffic processed by applications based on F-Stack (similar to trafshow).

Plans for the future include support for IPv6, provision of API for Python, PHP, and Go languages, support for Cyptodev API (Intel QAT), utilization of zerocopy in packet sending, support for SPDK , and the ability to run as a background process.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster