Library Operating System with Mainline Linux Network Stack
Hajime Tazaki, Ryo Nakamura, Yuji Sekiya · 2015
Library operating system (LibOS) is a userspace version of Linux kernel to provide an operating system personalization (or ad-hoc network stack) as well as yet-another virtualization primitive. Although the concept of library operating system is not new and was established in back to 90’s, the idea here is adding a hardware independent architecture (i.e., arch/lib) into Linux kernel tree and reusing the rest of networking code as a library for userspace programs in order to avoid ’reinventing the wheel’. Unlike conventional Linux kernel/userspace model, system calls are redirected to the library in the same process or the other userspace processes, but the framework tries to be transparent so that all of the existing userspace applications like nginx and iproute2 are able to be used as-is. The LibOS framework provides several interesting use cases such as 1) a fast-path for the new protocol deployment (no need to replace or insert new kernel code), 2) a feature-rich network stack for a high-speed packet I/O mechanism like Intel DPDK, 3) a continuous integration for testing networking code implemented in Linux kernel tree. Right now, most of in-kernel protocols like TCP, SCTP, DCCP, and MPTCP are tested to work on top of the LibOS. Newly implemented protocol may also work depending on the POSIX API coverage and kernel glue code. This paper covers the introduction of the LibOS framework and two sub projects, Network stack in userspace (NUSE) and Direct Code Execution (DCE), with the internal design of the indirections, and presents the ongoing work on the multiprocess support to share a single userspace network stack (e.g., share a userspace routing table between two processes) via inter-process communication implemented by rumpkernel IPC/RPC framework.