F-Stack 2.0 Networking Stack Running In User Space Published

The project F-Stack 2.0 has been released, developing an edition of the FreeBSD network stack, adapted for isolated work in user space in the form of a library. The project was created by China’s largest telecommunications company Tencent and is used in its products and services. The code is written in C and is distributed under the BSD license. Supports work on Linux and FreeBSD. The project also supports editions of Nginx 1.28 and the Redis 6.2.6 DBMS that have been converted to use F-Stack, demonstrating performance superior to conventional assemblies running on top of the system network stack.

F-Stack allows you to use your own local network in applications a stack that is independent of the operating system’s network stack, operates in user space and directly works with network equipment. F-Stack is positioned as a solution to improve the performance of network request processors in conditions where the standard TCP/IP stack of the Linux kernel becomes a bottleneck and limits scaling. Theoretically, F-Stack allows you to reach the ceiling of network performance possible for the network card used, and in some situations makes it possible to significantly increase the number of processed small network requests.

Increased performance is achieved by eliminating operations such as copying network packets, scheduling threads, handling interrupts and calling system calls. To interact with a network card, bypassing the operating system kernel interfaces, the DPDK (Data Plane Development Kit) framework is used, which develops a set of libraries for low-level work with network adapters. DPDK makes it possible to reduce overhead and meet the minimum number of CPU cycles when receiving or sending network packets.

The functionality of the TCP/IP stack corresponds to the FreeBSD 15 network stack and is separated from this operating system into an independent library. To develop applications you can use the standard POSIX API (socket, epoll, kqueue) or your own programming interface based on microthreads, which simplifies the creation of network applications and allows you to do without the complex logic of asynchronous request processing. Can be used with unmodified applications loaded via LD_PRELOAD.

The most notable changes in the new release:

  • Network stack components upgraded to FreeBSD 15 (previously used FreeBSD 13).
  • A multi-threaded mode has been implemented (thread_mode=1) in one process, complementing the previously available multi-process mode.

/Reports, release notes, official announcements.