A lightweight user-space packet processing runtime inspired by DPDK, leveraging AF_XDP/XDP for high-performance kernel bypass.
- Build a mini kernel-bypass runtime.
- Process packets in user space with minimal latency and high throughput.
- Implement core data-plane abstractions:
mbuf,mempool, and lock-free rings.
graph TD
App[Application Layer] --> API[Lite Runtime API]
API --> Buffers[Packet Buffer Layer: mbuf-lite]
Buffers --> Rings[Lock-Free Ring Queues]
Rings --> Backend[AF_XDP Backend]
Backend --> XDP[XDP Program: Kernel Fast Path]
XDP --> NIC[NIC Hardware]
src/: Core implementation files (af_xdp.c,mbuf.c,mempool.c,ring.c,poller.c).include/: Header files defining the internal and public APIs.xdp/: eBPF/XDP program source.tests/: Unit tests and functional validation.benchmarks/: Performance measurement scripts and baseline socket implementations.
- Responsible for socket creation (
xsk_socket__create). - UMEM management (registration, mapping).
- Ring management (RX, TX, Fill, Completion).
- Preallocated memory blocks to avoid dynamic allocation in the fast path.
lite_mbufstructure containing data pointer, length, and metadata.
- SPSC (Single Producer Single Consumer) rings for zero-contention communication between the poll engine and the application.
- Main execution loop using a "burst" (batch) processing model.
- Polling-based I/O instead of interrupt-driven I/O.
- Goal: Establish a working "echo" or loopback using AF_XDP.
- Complexity: High (requires understanding AF_XDP UMEM and ring mechanics).
- Goal: Replace raw UMEM pointers with a structured
mbufsystem andmempoolallocator. - Complexity: Medium.
- Goal: Abstract the backend into a clean API that looks like a "mini-DPDK".
- Complexity: Medium.
- Goal: Add XDP filtering, CPU affinity, and zero-copy support.
- Complexity: Medium.
- Throughput: Measured in Packets Per Second (PPS) using
iperf3or custom traffic generators. - Latency: Measured using round-trip time (RTT) for small packets.
- Baseline: Comparison against standard Linux
AF_INETandAF_PACKETsockets.
- Loopback Test: Verified by sending packets to the NIC and receiving them back.
- Batching Test: Verify that the burst API correctly handles varying numbers of packets.