Skip to content

Aegis: High-Performance Zero-Copy Packet Processing Framework

Welcome to the official documentation site for Aegis.

Aegis is a low-latency, multi-threaded Deep Packet Inspection (DPI) and packet filtering framework inspired by architectural patterns commonly used in high-performance packet processing systems, quantitative trading infrastructure, and network security software.


Technical Highlights

  • Zero Heap Allocation on the Hot Path: Pre-allocated contiguous memory pools (PacketBufferPool) manage packet memory. All components pass cache-aligned indices and zero-copy packet slices rather than allocating dynamic arrays or buffers.
  • Lock-Free Producer/Consumer Queues: Uses bounded, single-producer single-consumer (LockFreeSPSCQueue) structures aligned to 64-byte CPU cache lines (alignas(64)) to completely eliminate mutex contention and false sharing.
  • Zero-Copy Packet Parsing: Designed PacketView containing offsets and nested sub-views directly mapping to raw packet header bytes, avoiding string copying.
  • Flow Affinity: Distributes packets to dedicated worker cores using 5-tuple consistent hashing, ensuring flow affinity and enabling local connection tracking without cross-core locks.
  • Deterministic Latency: All critical path algorithms use bounded structures, avoiding dynamic memory expansion or locks that introduce latency spikes.
  • Benchmark-Driven Optimization: Optimization iterations are verified against microbenchmarks measuring nanosecond-level components.

Pipeline Architecture

Aegis stages are connected by bounded lock-free ring buffers to pipeline packet ingestion and analysis without mutex contention:

               [ Ingest / PCAP Reader ]
                 Lock-Free SPSC Queue
                   [ Load Balancer ]
             ┌─────────────┴─────────────┐
             │                           │
    Lock-Free SPSC              Lock-Free SPSC
             │                           │
      [ Worker Core 0 ]           [ Worker Core N ]
             │                           │
    Lock-Free SPSC              Lock-Free SPSC
             └─────────────┬─────────────┘
                    [ Polling Writer ]
                   [ Output PCAP / File ]

Getting Started

Core Design Specifications

Performance & Metrics

Developer Reference