How opendataplane/odp works
Project type and purpose
• This is OpenDataPlane (ODP), a C-language SDK and runtime library that provides a portable, high-performance data-plane abstraction for packet processing across multiple CPU architectures and platforms.
• It is not a web application or microservice; it is a core library (libodp) plus helper library (libodphelper), examples, and a comprehensive test suite.
High-level architecture and file-structure analysis
• Top-level components/directories:
• /odp/api – public C headers defining the ODP API (abstract data-plane functions)
• /odp/api/abi-default + include/odp/api/spec + include/odp/arch/* – ABI and architecture-specific interfaces
• arch/… – architecture-agnostic API dispatch stubs
• platform/linux-generic/… – core implementation of ODP functionality, subdivided into modules (atomic, packet, event, crypto, pktio, scheduler, timer, traffic_mngr, etc.) and platform drivers (DPDK, pcap, socket, etc.)
• helper/ – utility library implementing CLI tools, checksum routines, thread/process helpers (libodphelper)
• example/ – sample applications demonstrating how to link and call the public ODP API
• test/ & platform/linux-generic/test/ – unit, validation, and performance tests organized by API module and example
• scripts/, .github/, Makefile.am, configure.ac, m4/ – build and CI infrastructure
Key relationships and data flows
• Application code (user or example/test) links against libodp and libodphelper.
• At runtime, application calls a function in the ODP API header (e.g., odp_queue_deq()).
• API call is forwarded through a generic dispatcher stub in arch/ that selects the platform implementation.
• Platform implementation (in platform/linux-generic/) invokes the chosen driver (e.g., pktio/pcap.c or pktio/dpdk.c for packet I/O) or core module (atomic, crypto, event).
• Architecture-specific inlines/ABI files in include/odp/api/abi-default or include/odp/arch/* provide optimized implementations per architecture.
• Helper library functions provide non-API services (CLI, debug, checksums) and are statically or dynamically linked.
• Build system (bootstrap → configure → make) invokes autotools, configures modules and external dependencies (OpenSSL, DPDK, libconfig), compiles architecture and platform files, and assembles libodp, libodphelper, examples, and tests.
• CI pipelines and GitHub actions orchestrate multi-architecture builds, code style checks, coverage, and deployment of Doxygen docs.
Important architectural patterns and design principles
• Layered modularity: public API → dispatcher → core modules → drivers
• Pluggable backends: pktio, crypto, scheduler choices are selected at configure-time
• ABI/architecture separation: generic API in headers with architecture-specific inline overrides
• Clear separation of concerns: helper utilities separated from core data-plane logic
• Extensive testing: unit, validation, and performance tests ensure API conformance across platforms
Elements
• Clear labels: “Application”, “ODP API”, “Dispatcher (arch)”, “Core Modules”, “Drivers”, “Helper Lib”
• Application → ODP API → Dispatcher → Core Module → Driver
• Build system → compiles and links all layers
• CI pipeline → triggers build system and test suite
a. A stack of 4 layers (Application, API, Implementation, Drivers).
b. In the Application layer, place “Examples/Tests” and “User App”.
e. In the Implementation layer, subdivide into named modules (atomic, packet/pktio, event, crypto, queue, scheduler, timer, traffic_mngr).
f. In the Drivers layer, place “pktio backends (DPDK, pcap, socket, null)”, “crypto backends (OpenSSL, IPsecMB, Null)”, “platform services (shmem, CPU info)”.