Skip to content

Architecture Overview

This repository implements protocol stacks from silicon to cloud every layer of the networking and embedded stack, built from first principles.

Layer Map

graph TB
    subgraph Cloud/Transport
        QUIC[QUIC 0-RTT]
        TCP[TCP Stack]
        UDP[UDP Multicast]
    end

    subgraph Network
        EPOLL[epoll Reactor]
        RAW[Raw Sockets]
        ZC[Zero-Copy I/O]
        DPDK[DPDK]
    end

    subgraph Industrial
        MODBUS[Modbus RTU/TCP]
        ECAT[EtherCAT]
        PNET[PROFINET]
    end

    subgraph Aerospace
        A429[ARINC 429]
        A664[ARINC 664 AFDX]
        A653[ARINC 653 APEX]
        A665[ARINC 665]
        A615[ARINC 615A]
    end

    subgraph Embedded
        UART[UART RS-232/485]
        SPI[SPI Master]
        I2C[I2C Bus]
        CAN[CAN Bus/FD]
        GPIO[GPIO]
    end

    subgraph Concurrency
        RB[Ring Buffer]
        SPSC[SPSC Queue]
        MP[Memory Pool]
    end

    TCP --> EPOLL
    UDP --> RAW
    A664 --> RAW
    A429 --> UART
    MODBUS --> UART
    ECAT --> RAW
    EPOLL --> RB
    ZC --> MP

Module Contract

Every module in this repository adheres to a strict contract:

Requirement Description
Header Public API in *.h with static inline functions
Source Implementation + verification in *.c
Makefile Standalone build, callable from root or independently
Documentation Protocol spec, memory model, build commands inline
No Dependencies Only libc, libpthread, kernel headers
No Heap in Hot Path All buffers pre-allocated at init
Deterministic Bounded worst-case execution time

Key Design Decisions

Why Header-Only APIs?

All protocol implementations use static inline functions in headers. This allows:

  1. Zero function-call overhead compiler inlines directly into call site
  2. Link-time optimization no separate compilation unit boundaries
  3. No library management just #include the header
  4. Whole-program optimization compiler sees all code at once

Why No External Libraries?

External dependencies introduce:

  • Non-deterministic latency (malloc paths, exception handling)
  • Version conflicts in embedded environments
  • Audit complexity for safety-critical (DO-178C) certification
  • Binary bloat from unused features

This repository depends only on the Linux kernel ABI, which is stable and well-documented.

Why C11 over C++20?

Criteria C11 C++20
Embedded/kernel-adjacent code ✅ Preferred ⚠️ No RTTI/exceptions
Low-level bit manipulation ✅ Natural ✅ With std::bit_cast
Hardware register access ✅ Direct ✅ Direct
Template metaprogramming ✅ For type-safe containers
Compile time ✅ Fast ⚠️ Templates slow

Rule: Use C11 for embedded/protocol/bit-level code. Reserve C++20 for high-level networking orchestration that benefits from templates and constexpr.