Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications.

Related tags

Miscellaneous cndp
Overview

CNDP - Cloud Native Data Plane

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

  • Cloud Network Function (CNF) and Cloud Application developers: Those who create applications based on CNDP. CNDP hides the low-level I/O, allowing the developer to focus on their application.

  • CNF and Cloud Application consumers: Those who consume the applications developed by the CNF developer. CNDP showcases deployment models for their applications using Kubernetes.

CNDP Characteristics

CNDP follows a set of principles:

  • Functionality: Provide a framework for cloud native developers that offers full control of their application.

  • Usability: Simplify cloud native application development to enable the developer to create applications by providing APIs that abstract the complexities of the underlying system while still taking advantage of acceleration features when available.

  • Interoperability: The CNDP framework is built primarily on top of AF_XDP. Other interfaces, such as memif, are also supported, however building on AF_XDP ensures it is possible to move an application across environments wherever AF_XDP is supported.

  • Portability/stability: CNDP provides ABI stability and a common API to access network interfaces.

  • Performance: Take advantage of platform technologies to accelerate packet processing or fall-back to software when acceleration is unavailable.

  • Observability: Provide observability into the performance and operation of the application.

  • Security: Security for deployment in a cloud environment is critical.

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.

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
Issues
  • testcne: add functional tests for cne lib to testcne

    testcne: add functional tests for cne lib to testcne

    Add functional tests relevant to lib/core/cne/cne.[ch] to testcne. Functions which are covered by other testcne tests are not covered.

    Signed-off-by: Sushma Sitaram [email protected]

    opened by sushmasi 4
  • Minor doc issues with libbpf installation instructions

    Minor doc issues with libbpf installation instructions

    I followed the CNDP instructions here: https://github.com/CloudNativeDataPlane/cndp/blob/main/INSTALL.md but had an issue with the libbpf step:

    Install libbpf from source

    https_proxy="https://user:[email protected]:port" git clone https://github.com/libbpf/libbpf.git
    cd libbpf
    git checkout ...
    make -C src
    sudo make -C src install
    

    There are 2 issues here. First I don't think the https_proxy needs to be there. Secondly this gives a version of libbpf (0.8.0/??) which seems incompatible with cndp:

    $ make
    "/work/cndp/tools/cne-build.sh" build
    Build environment variables and paths:
      CNE_SDK_DIR     : /work/cndp
      CNE_TARGET_DIR  : usr/local
      CNE_BUILD_DIR   : /work/cndp/builddir
      CNE_DEST_DIR    : /work/cndp
      PKG_CONFIG_PATH : /usr/lib64/pkgconfig
      build_path      : /work/cndp/builddir
      target_path     : /work/cndp/usr/local
    
    >>> Release build in '/work/cndp/builddir'
    >>> Ninja build in '/work/cndp/builddir' buildtype='release'
    usage: meson [-h] {setup,configure,dist,install,introspect,init,test,wrap,subprojects,help,rewrite,compile,devenv} ...
    meson: error: unrecognized arguments: 
    ninja: Entering directory `/work/cndp/builddir'
    [10/54] Compiling C object lib/core/xskdev/libcne_xskdev.so.p/xskdev.c.o
    FAILED: lib/core/xskdev/libcne_xskdev.so.p/xskdev.c.o 
    cc -Ilib/core/xskdev/libcne_xskdev.so.p -Ilib/core/xskdev -I../lib/core/xskdev -Ilib/include -I../lib/include -Ilib/core/osal -I../lib/core/osal -Ilib/core/log -I../lib/core/log -I. -I.. -Ilib/core/cne -I../lib/core/cne -Ilib/common/uds -I../lib/common/uds -Ilib/core/mmap -I../lib/core/mmap -Ilib/core/mempool -I../lib/core/mempool -Ilib/core/pktmbuf -I../lib/core/pktmbuf -I/usr/include/libnl3 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -O3 -g -Wno-pedantic -Wcast-qual -Wdeprecated -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -include cne_build_config.h -march=native -DCC_AVX2_SUPPORT -fPIC -MD -MQ lib/core/xskdev/libcne_xskdev.so.p/xskdev.c.o -MF lib/core/xskdev/libcne_xskdev.so.p/xskdev.c.o.d -o lib/core/xskdev/libcne_xskdev.so.p/xskdev.c.o -c ../lib/core/xskdev/xskdev.c
    ../lib/core/xskdev/xskdev.c: In function 'configure_busy_poll':
    ../lib/core/xskdev/xskdev.c:122:5: error: 'xsk_socket__fd' is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
      122 |     int fd            = xsk_socket__fd(rxq->xsk);
          |     ^~~
    In file included from ../lib/core/xskdev/xskdev.h:11,
                     from ../lib/core/xskdev/xskdev.c:27:
    /usr/include/bpf/xsk.h:257:5: note: declared here
      257 | int xsk_socket__fd(const struct xsk_socket *xsk);
          |     ^~~~~~~~~~~~~~
    
    

    This is a useful hint buried there but it isn't obvious:

     error: 'xsk_socket__fd' is deprecated: libbpf v0.7+: AF_XDP
    

    In order to get cndp to compile I had to use libbpf 0.6.1. I don't know if that is the preferred version but it worked.

    cd libbfp
    git checkout v0.6.1
    make -C src && sudo make -C src install
    
    documentation 
    opened by john-mcnamara-intel 4
  • Rust bindings and high level library for CNDP CNE.

    Rust bindings and high level library for CNDP CNE.

    • Add cne-sys rust API bindings for CNP CNE C library.
    • Add cne high level rust API library based on cne-sys.
    • Add test cases in rust cne-sys and cne library crate.
    • Example loop back application which uses cne rust library APIs.
    • Sample scripts to run test cases and example application.
    • Add README.md file.

    Signed-off-by: Manoj Gopalakrishnan [email protected]

    opened by manojgop 3
  • msgchan:add message channels

    msgchan:add message channels

    Adding support for message channels using two lockless rings. The rings are used to send and receive data from a thread to another thread. The go binding code needs a method to communicate between Go <--> C in a fast and simple way. The library is not limited to Go <--> C and can be used to create a pipe like interface between two or more threads.

    The msgchan code mc_create() allows for one thread to create the channel, which allows other threads to locate and attach to the msgchan as children.

    Signed-off-by: Keith Wiles [email protected]

    opened by KeithWiles 2
  • fix heap buffer overflow

    fix heap buffer overflow

    By fuzzing mempool_create(), a heap buffer overflow was detected in ring[] while in the ENQUEUE_PTRS macro of the __cne_ring_do_enqueue function. This was because the actual memory that was allocated for the ring was only the size of the struct cne_ring. This happened because of an integer overflow error in the calculation of ring size in cne_ring_get_memsize_elem. The multiplication of count * esize was evaluating to zero.

    Typecasting the unsigned int count to be ssize_t ensured that the multiplication of count and esize did not evaluate to zero (because of the integer overflow), the correct ring size memory was allocated and the heap buffer overflow was fixed.

    Signed-off-by: Elza Mathew [email protected]

    opened by elzamath 2
  • cndpgo ipv4 checksum verify example, module name changes

    cndpgo ipv4 checksum verify example, module name changes

    Signed-off-by: Dakshina Ilangovan [email protected]

    Two changes

    1. Added a flow to receive packets, compute and verify checksum in packet if ipv4 and drop The summation loop reduces performance
    2. Changed cndpgo module names
    opened by dakshinai 2
  • Unit test fixes

    Unit test fixes

    • Fix bug in lport group umem setup
    • Fix bug in jcfg test that exits early if a file cannot be parsed
    • Fix pktcpy test and disable color output when using meson test since it writes to a file, not a terminal
    • Update the GitHub Smoke test action to upload the resulting testlog.txt to help debug errors
    opened by jeffreybshaw 1
  • pmd memif fix overwriting mbuf header.

    pmd memif fix overwriting mbuf header.

    This change came from DPDK and the following commit message.

    "The 'dst_off' was reset in multi segment case. This caused memif buffer segment to write to beginning of mbuf, overwriting previous data. Fix it with this patch.

    Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") Cc: [email protected]

    Reported-by: Ferruh Yigit [email protected] Signed-off-by: Joyce Kong [email protected] Reviewed-by: Ruifeng Wang [email protected]"

    Signed-off-by: Keith Wiles [email protected]

    opened by KeithWiles 1
  • tcp:add tcp support to CNET

    tcp:add tcp support to CNET

    Update and rework the TCP support for CNET using a set of graph nodes to manage the TCP protocol. The TCP protocol support can be enabled via the meson_options.txt file.

    Testing the TCP protocol using wireguard and other applications i.e wireshark, socat, telnet, ... to verify the protocol and data managment is correct.

    In this change a few examples needed to be update to support TCP and the changes to the channel APIs. One change to the channel API is when the application is called back to process Rx packets is the callback does not pass mbufs back in the call. The packets are now placed on a receive queue and a call to chnl_recv() needs to be done to get packets.

    Note: TCP active opens are not test yet. This PR is for anyone wanting to understand the changes or would like to test the code. It does take a bit of effort to test, so please ask any questions if you want to test the code.

    Also this is one big PR and I will break this down into smaller PR's when I get closer to submitting the changes.

    Signed-off-by: Keith Wiles [email protected]

    opened by KeithWiles 1
  • Echo server example using cne and libpnet.

    Echo server example using cne and libpnet.

    • Example echo server implementation using cne and libpnet library.
    • CNE receives and sends layer 2 packets using AF-XDP socket.
    • libpnet receives and sends layer 2 packets using AF_PACKET.
    • This application requires a load generator (s/w or h/w) to send packets to required n/w interface.

    Signed-off-by: Manoj Gopalakrishnan [email protected]

    opened by manojgop 1
  • CI: Add docker image push to GHCR

    CI: Add docker image push to GHCR

    This makes use of the docker build-push-action [1] GitHub Action to push docker images to GitHub Container Registry. Merges to master trigger both docker builds and pushes to GHCR. Also, images for pull requests are pushed to allow for testing of docker images for those PRs.

    [1] https://github.com/docker/build-push-action

    Signed-off-by: Kyle Mestery [email protected]

    opened by mestery 1
  • add external pktmbuf metadata API

    add external pktmbuf metadata API

    The metadata was contained in the headroom of the pktmbuf and it is limited in size to max headroom size normally 128 bytes. The headroom size is also used for adding protocol headers and if the room is consumed by the metadata then headers can not be added.

    Created a new API pktmbuf_pool_cfg_create() to be able to create a external metadata buffer array indexed by the pktmbuf_t.metadata_idx value. The new metadata array of buffers must be a multiple of a cacheline (64 bytes) and the number of buffers will match the number of pktmbuf_t buffers in the mempool.

    If the new API pktmbuf_pool_cfg_create() is not used the metadata buffer will be part of the headroom in the pktmbuf buffer.

    Signed-off-by: Keith Wiles [email protected]

    opened by KeithWiles 1
  • tcp:add tcp support to CNET

    tcp:add tcp support to CNET

    Update and rework the TCP support for CNET using a set of graph nodes to manage the TCP protocol. The TCP protocol support can be enabled via the meson_options.txt file. Currently, the TCP support experimental. I attempted to reduce the number of changes in one PR, but that seemed to be very difficult to create PRs which would be functional.

    A number of changes to the code affects a number of files, which include:

    • add new CNET documentation, but is a WiP.
    • remove the TCP send graph node as it is not required now.
    • create a chnl_priv.h file to hold internal items.
      • adding the new header touched a number of files to include the file.
    • change the channel APIs to use the new channel descriptor index value.
      • the change from pointer to index affected a number of files more below.
    • the cnet-graph and cnet-quic examples needed to change to support TCP and/or to use the new callback support with the channel descriptor changes.
    • add more doxygen documentation for APIs which did not have comments.
    • remove a number of channel options as they are not required now.
    • add a number of options to the meson_options.txt file to help configure and enable some TCP debug code. The change enable removing some defines in the code to now be configurable.
    • reworked some of the locking in channel and stack code, which helped to fix a number of klocwork issues.
    • ran klocwork and fixed a number of issues

    Testing the TCP protocol using applications i.e socat, telnet, ... to verify the protocol and data management is correct.

    The Channel APIs no longer use a 'struct chnl' pointer, replaced with a channel descriptor index similar to file descriptors. The change affected many files to now support using a descriptor value instead of a pointer. Internally the CNET stack will use a 'struct chnl *' value, but public interfaces must use the channel descriptor index value.

    The CNET stack uses a callback method to keep packet processing to the same thread as the graph node handling the packets. Using a callback helps to avoid locks and other complexity issues with the CNET stack.

    Signed-off-by: Keith Wiles [email protected]

    opened by KeithWiles 1
  • Rust language bindings and directory structure needs cleanup and restructure

    Rust language bindings and directory structure needs cleanup and restructure

    Hi Folks I recently started looking through the Rust language bindings for CNDP and ran into a few issues. Following the readme things don't work out of the box. In addition the directory structure is completely confusing (there's no real structure to what's an example vs what's the set of libraries I can use as part of my Rust application). Also I believe the naming should be libcndp-sys for the directory that contains the language bindings (cne is only a small library set of what CNDP has to offer).

    The current dir structure is shown below:

    .
    ├── README.md
    ├── bindings
    │   ├── cne
    │   │   ├── Cargo.toml
    │   │   ├── README.md
    │   │   ├── examples
    │   │   │   └── loopback
    │   │   │       ├── Cargo.toml
    │   │   │       ├── run.sh
    │   │   │       └── src
    │   │   │           └── main.rs
    │   │   ├── fwd.jsonc
    │   │   ├── run_test.sh
    │   │   └── src
    │   │       ├── config.rs
    │   │       ├── error.rs
    │   │       ├── instance.rs
    │   │       ├── lib.rs
    │   │       ├── packet.rs
    │   │       ├── port.rs
    │   │       └── util.rs
    │   ├── cne-sys
    │   │   ├── Cargo.toml
    │   │   ├── README.md
    │   │   ├── build.rs
    │   │   └── src
    │   │       ├── bindings
    │   │       │   ├── bindings.c
    │   │       │   ├── bindings.h
    │   │       │   ├── meson.build
    │   │       │   └── wrapper.h
    │   │       └── lib.rs
    │   └── examples
    │       └── echo_server
    │           ├── Cargo.toml
    │           ├── fwd.jsonc
    │           ├── run.sh
    │           └── src
    │               └── main.rs
    ├── helloworld
    │   └── main.rs
    ├── mmap
    │   ├── Cargo.toml
    │   └── src
    │       └── lib.rs
    ├── mmap-cndp
    │   ├── Cargo.toml
    │   ├── build.rs
    │   ├── src
    │   │   └── lib.rs
    │   └── wrapper.h
    ├── pktfwd
    │   ├── Cargo.toml
    │   ├── build.rs
    │   ├── fwd.jsonc
    │   ├── jcfg_parse
    │   │   ├── fwd.h
    │   │   ├── meson.build
    │   │   ├── parse-jsonc.c
    │   │   ├── rust_helper.c
    │   │   ├── rust_helper.h
    │   │   └── stats.c
    │   ├── runcmd.sh
    │   ├── src
    │   │   ├── cndp.rs
    │   │   ├── main.rs
    │   │   ├── packet.rs
    │   │   └── util.rs
    │   └── wrapper.h
    ├── ring_test
    │   ├── Cargo.toml
    │   ├── build.rs
    │   ├── src
    │   │   ├── lib.rs
    │   │   └── main.rs
    │   └── wrapper.h
    └── wireguard
        └── patch
            ├── 0001-Integrate-CNDP-Cloud-Native-Data-Plane-with-Wireguar.patch
            ├── 0002-Rename-variable-private-to-priv_-to-fix-build-error.patch
            └── 0003-Remove-extra-argument-from-pktmbuf_dump.patch
    

    Finally - there's only a handful of APIs that have been converted to Rust and the naming is separate to the C libraries - so tracking what's where is going to be difficult.

    Is there a plan to cleanup the Rust implementation and port more libraries?

    enhancement 
    opened by maryamtahhan 7
Owner
Cloud Native Data Plane
Cloud Native Data Plane (CNDP)
Cloud Native Data Plane
A collection of user-space Linux kernel specific guided fuzzers based on LKL

kBdysch kBdysch is a collection of fast Linux kernel specific fuzzing harnesses supposed to be run in userspace in a guided fuzzing manner. It was des

Anatoly Trosinenko 59 Jun 14, 2022
Sloth 🦥 is a coverage guided fuzzing framework for fuzzing Android Native libraries that makes use of libFuzzer and QEMU user-mode emulation

Sloth ?? Sloth is a fuzzing setup that makes use of libFuzzer and QEMU’s user-mode emulation (qemu/linux-user) on x86_64/aarch64 host to emulate aarch

Chaithu 71 Jun 25, 2022
Visual Studio native debugger extension to help debug native applications using Mono.

Unity Mixed Callstack UnityMixedCallstack is a Visual Studio 2017/2019 extension to help debug native applications embedding Mono, like Unity. If you

Unity Technologies 66 Jun 25, 2022
A native plugin for Unity that provides simple packet division and restoration.

uPacketDivision This is a native plug-in that divides a given data (System.IntPtr or array) into specified sizes and restores them regardless of the i

hecomi 4 Feb 20, 2022
Suite of C++ libraries for radio astronomy data processing

Casacore A suite of C++ libraries for radio astronomy data processing. Installation Debian / Ubuntu Casacore is now part of Debian and Ubuntu, use apt

null 93 Jun 16, 2022
A data plane framework that supports any layer-7 protocols.

中文 meta-protocol-proxy Why MetaProtocol is needed? Almost all open source and commercial Service Meshes currently support only two Layer-7 protocols -

Aeraki 48 Jun 25, 2022
A framework for implementing block device drivers in user space

BDUS is a Linux 4.0+ framework for developing block devices in user space. More specifically, it enables you to implement block device drivers as regu

Alberto Faria 26 May 24, 2022
our supper awesome kernel and user space system

osakauss our super awesome kernel and user space system memory layout The kernel is loaded at 0x00100000. kmalloc initially uses 'placement' allocatio

Eduard 8 Aug 26, 2021
User space configuration tool for RME HDSPe MADI / AES / RayDAT / AIO and AIO Pro cards driven by the snd-hdspe driver.

hdspeconf User space configuration tool for RME HDSPe MADI / AES / RayDAT / AIO and AIO Pro cards, driven by the snd-hdspe driver. Building hdspeconf

Philippe Bekaert 9 Jun 15, 2022
Project Etnaviv is an open source user-space driver for the Vivante GCxxx series of embedded GPUs.

Introduction Project Etnaviv is an open source user-space driver for the Vivante GCxxx series of embedded GPUs. This repository contains reverse-engin

null 199 Jun 24, 2022
Selective user space swap (kubernetes swap / kubeswap)

BigMaac ?? ?? ( Big Malloc Access And Calloc ) because sometimes a happy meal is not big enough BigMaac can be used in userspace (e.g. inside Kubernet

Misko 7 Jun 6, 2022
POCO C++ Libraries are powerful cross-platform C++ libraries for building network

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

POCO C++ Libraries 6.2k Jun 21, 2022
Mod - MASTERS of DATA, a course about videogames data processing and optimization

MASTERS of DATA Welcome to MASTERS of DATA. A course oriented to Technical Designers, Technical Artists and any game developer that wants to understan

Ray 32 Apr 5, 2022
Recognize stairs with lidar. Project the laser points to X-Z plane and use least squares for linear fitting.

stairs_recogniton Recognize stairs with lidar. Project the laser points to X-Z plane and use least squares for linear fitting. Dependencies PCL 1.8 Ei

Junyi Ma 8 Jan 27, 2022
A repository for experimenting with elf loading and in-place patching of android native libraries on non-android operating systems.

droidports: A repository for experimenting with elf loading and in-place patching of android native libraries on non-android operating systems. Discla

João Henrique 21 Jun 13, 2022
React Native polyfill for crypto.getRandomValues. Used in libraries like uuid.

react-native-random-values-jsi-helper React Native polyfill for crypto.getRandomValues. Used in libraries like uuid. Installation yarn add react-nativ

Matei Oprea 27 May 29, 2022
A collection of post-processing shaders written for ReShade.

ReShade FX shaders This repository aims to collect post-processing shaders written in the ReShade FX shader language. Installation Download this repos

null 729 Jun 26, 2022
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 112 May 19, 2022
A collection of tools, libraries, and tests for Vulkan shader compilation.

Shaderc A collection of tools, libraries and tests for shader compilation. At the moment it includes: glslc, a command line compiler for GLSL/HLSL to

Google 1.3k Jun 22, 2022