CloudNativeDataPlane / cndp

Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications using AF_XDP sockets as the primary I/O..
BSD 3-Clause "New" or "Revised" License
90 stars 32 forks source link

CNDP - Cloud Native Data Plane

Smoke Test cppcheck License

Overview

Cloud Native Data Plane (CNDP) is a collection of userspace libraries for accelerating packet processing for cloud applications. It aims to provide better performance than that of standard network socket interfaces by taking advantage of platform technologies such as Intel(R) AVX-512, Intel(R) DSA, CLDEMOTE, etc. The I/O layer is primarily built on AF_XDP, an interface that delivers packets straight to userspace, bypassing the kernel networking stack. CNDP provides ways to expose metrics and telemetry with examples to deploy network services on Kubernetes.

CNDP Consumers

CNDP Characteristics

CNDP follows a set of principles:

CNDP background

CNDP was created to enable cloud native developers to use AF_XDP and other interfaces in a simple way while providing better performance as compared to standard Linux networking interfaces.

CNDP does not replace DPDK (Data Plane Development Kit), which provides the highest performance for packet processing. DPDK implements user space drivers, bypassing the kernel drivers. This approach of rewriting drivers is one reason DPDK achieves the highest performance for packet processing. DPDK also implements a framework to initialize and setup platform resources i.e. scanning PCI bus for devices, allocating memory via hugepages, setting up Primary/Secondary process support, etc.

In contrast to DPDK, CNDP does not have custom drivers. Instead it expects the kernel drivers to implement AF_XDP, preferably in zero-copy mode. Since there are no PCIe drivers, there's no PCI bus scanning, and does not require physically contiguous and pinned memory. This simplifies deployment for cloud native applications while gaining the performance benefits provided by AF_XDP.

Development

In order to make contributions to CNDP, you need to have the following installed:

You can install pre-commit by running the following command:

pip install pre-commit

After installing pre-commit, you need to install the pre-commit hooks by running the following command:

pre-commit install

To run pre-commit manually

pre-commit run --all-files

CNDP notable directories

The following shows a subset of the directory structure.

.
├── ansible          # Ansible playbook to install in a system(s)
├── containerization # Container configuration and setup scripts for Docker/K8s
├── doc              # Documentation APIs, guides, getting started, ...
├── examples         # Example applications to understand how to use CNDP features
├── lang             # Language bindings and examples
│   ├── go           # Go Language bindings to CNDP and tools (WIP)
│   └── rs           # Rust Language bindings for CNDP/Wireguard (WIP)
├── lib              # Set of libraries for building CNDP applications
│   ├── cnet         # Userspace network stack
│   ├── common       # Libraries used by core and applications libraries
│   ├── core         # Core libraries for CNDP
│   ├── include      # Common headers for CNDP and applications
│   └── usr          # User set of libraries that are optional for developer
├── test             # Unit test framework
│   ├── common       # Common test code
│   ├── fuzz         # Fuzzing (WIP)
│   └── testcne      # Functional unit testing application
├── tools            # Tools for building CNDP
│   └── vscode       # Configuration files for vscode
└── usrtools         # Tools for users
   ├── cnectl        # Remote CLI for CNDP applications
   └── txgen         # Traffic Generator using AF_XDP and CNDP