Introduction

PacketCord SDK implies the idea that networking at the data-plane level should rely on a flow point to receive packets on a port (interface), then match header fields or payload bytes, and make a decision about what action to apply over the packet - modify, transmit, or discard it.

Architecture

The SDK provides abstractions and components for packet processing in pure C. It has been designed to be suitable for purposes across different platforms and architectures: from servers, through embedded systems, to specialised network hardware.

Flow Overview

Based on the above statement how simple network programming should be, the PacketCord SDK packet flow abstaction is designed to be as universal as possible. Think of any networking appliance as a "box" with ports (or interfaces) - and call them flow points. Each flow point can receive and transmit packets. Depending on the flow point type, the developer can also attach cBPF/eBPF filters to it.

Flow Overview

The SDK is organised in the following subcaterogies:

  • Action
  • Conntrack
  • EAL Initer
  • Event Handler
  • Filter
  • Flow Point
  • Match
  • Memory
  • Protocol Headers
  • Table

Flow Point

Currently, we are exposing the following FlowPoint subtypes:

  • DPDK FlowPoint
  • L2 Custom FlowPoint
  • L2 Raw Socket FlowPoint
  • L2 TPACKETv3 FlowPoint
  • L3 Raw Socket FlowPoint
  • L3 Stack Inject FlowPoint
  • L4 UDP FlowPoint
  • L4 TCP FlowPoint
  • L4 SCTP FlowPoint
  • XDP FlowPoint
  • Custom FlowPoint

The PacketCord SDK does not promote a single programming approach for kernel bypass or kernel API utilisation. Intead, the network programmer is the one to chose the strategy, or maybe combine the best of both worlds.

The custom flow point could serve as a skeleton for porting to new software or hardware targets - for instance, embedded devices like Ethernet over SPI, custom radio or optical links over highly-specialised transceivers.

Event Hanlder

The PacketCord SDK relies on the Linux API epoll() event notification mechanism and the DPDK RTE_ETH_FOREACH_DEV (port) loop to handle the input packets entering a flow point. There is also a skeleton for implementing a custom event handler.

Examples

The next pages present some example applications from the repository that can serve as a demonstration of the SDK capabilites - with topology diagrams and deployment hints for running and testing them inside our in-house free PacketCord IDE.