Skip to content

Risk Register & Mitigations: Aegis Packet Engine

Low-latency systems development requires identifying potential engineering bottlenecks, system failures, and platform limitations early. This document outlines identified risks, their severity, mitigation strategies, and fallback behaviors for the Aegis framework.


1. Technical Risk Register

Risk ID Description Severity Probability Mitigation Strategy Fallback Behavior
R-01 No DPDK (libpcap Performance): Capturing live packets via standard libpcap socket interfaces causes kernel-to-user context switches, limiting throughput to ~1-2 Mpps. High High Implement memory-mapped PCAP parsing (mmap PCAP reader) for offline replay testing and performance benchmarking. Fall back to standard libpcap for functional live capture, relying on zero-copy userspace parsing once the packet crosses the boundary.
R-02 Queue Overflow under Heavy Traffic: SPSC worker queues or pool buffers become full during traffic spikes. Medium Medium Implement fixed-size pool limits and track packet drops. Provide backpressure by having the Load Balancer thread spin/yield. If live mode: drop packet and increment drop count. If offline mode: pause ingestion reader until queues drain.
R-03 Single-Core Ingestion Bottleneck: Ingestion thread running libpcap or reading file cannot dispatch packets fast enough to feed multiple Fast Path workers. Medium Medium Offload checksum validation and parsing pre-calculation to workers. Keep the ingestion and LB threads extremely lightweight. Profile using perf and pin ingestion to a dedicated physical CPU core (non-hyperthreaded).
R-04 Rule Table Memory Exhaustion: Large domain wildcard prefix lists or subnets consume excessive L2/L3 cache space. Low Low Design rule maps to use contiguous arrays. Suffix matching Tries are compressed (Radix tree structure). Swap rules atomically (double buffering) and log rule memory footprint.
R-05 Platform Portability Issues (Windows/macOS): CPU thread pinning and high-resolution timing assemblies differ across OS platforms. Low High Standardize concurrency code with standard std::thread. Wrap platform-specific calls (pthread_setaffinity_np) in preprocessor blocks (#ifdef __linux__). Disable pinning on non-Linux platforms, relying on the OS scheduler while issuing compile-time warning logs.

2. Known Limitations

  1. Dynamic Scaling: The thread count, queue sizes, and memory pools are fixed at startup and cannot be scaled dynamically without restarting the engine. This is a deliberate design choice to maintain zero allocation and lock-freedom during runtime.
  2. TCP State Depth: Stream reassembly only supports standard reassembly of handshake records. We do not reassemble full multi-megabyte streams to avoid unbounded memory allocations.
  3. Hardware offloads: Aegis does not implement NIC hardware offloads (e.g. RSS - Receive Side Scaling) in this user space simulation, but models it via the Load Balancer thread.