# cisco/exanic-software architecture

> Architecture diagram of the GitHub repository cisco/exanic-software, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cisco/exanic-software
- Repository: https://github.com/cisco/exanic-software

## Overview

##### Main Components
a. Hardware Layer:
- ExaNIC ultra-low-latency network cards (e.g., ExaNIC X25, X100, etc.)
b. Kernel-Space Components:
- Linux Kernel (the environment in which the card is integrated).
- Kernel modules (in the “modules” directory): These include two sets – one for the “exanic” driver and one for “exasock” which accelerates sockets operations.
c. User-Space Libraries:
- libexanic (in libs/exanic) – to access low-level card functionality.
- exasock library (in libs/exasock) – for applications to bypass the standard kernel networking stack.
d. Utilities & Control Applications:
- Tools such as exanic-config, exanic-capture, exanic-clock-sync, exanic-fwupdate (found in the “util” directory), which allow configuration, capture, clock synchronization, and firmware updates.
e. Example Applications and Performance Test Tools:
- Examples (located in “examples” with subdirectories for advanced usage, exasock examples, filters, and devkit examples).
- The “perf-test” directory indicates stand-alone performance measurement tools.
f. Packaging & Deployment:
- Packaging scripts and spec files (found in “debian”, “redhat”, “exanic.spec”) help with distribution and installation.

##### Establish Relationships and Interactions
- Inside the Kernel layer, include connections between the Linux network stack and the loaded kernel modules (exanic and exasock drivers).
- Utilities (exanic-config, capture, clock-sync, fwupdate) as separate components interfacing with the libraries (or directly with the driver interfaces) to perform configuration, monitoring, and management.
- Example applications, demonstrating how developers can interact, with communication paths connecting them to the user-space libraries.
- For the performance testing tools, illustrate how they feed data into the system/integrate with the libraries or drivers to measure latency and throughput.

##### Recognize Architectural Patterns and Technologies
- Layered architecture – from hardware up through kernel modules to user applications.
- Extensibility points: the driver separation (modules), the dedicated libraries (libexanic and exasock) and the examples demonstrating custom filtering, FPGA-based reconfiguration (as indicated in README), and performance testing.
- Integration with standard Linux networking APIs while also providing custom APIs for high-performance operations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Hardware Layer
    subgraph "Hardware Layer"
        NIC["ExaNIC NIC"]:::hardware
    end

    %% Kernel-Space Layer
    subgraph "Kernel Space"
        LK["Linux Kernel"]:::kernel
        ED["ExaNIC Driver (Kernel Module)"]:::kernel
        ES["exasock Driver (Kernel Module)"]:::kernel
    end

    %% User-Space Layer
    subgraph "User Space"
        LEX["libexanic Library"]:::library
        EXS["exasock Library"]:::library
        UTIL["Utilities (exanic-config, capture, clock-sync, fwupdate)"]:::utility
        EXAPP["Example Applications"]:::example
        PERF["Performance Test Tools"]:::example
    end

    %% Packaging & Deployment Layer
    subgraph "Packaging & Deployment"
        DEB["Debian Packaging"]:::packaging
        RH["RedHat Packaging"]:::packaging
        SPEC["ExaNIC Spec"]:::packaging
    end

    %% Data Flow Connections
    NIC -->|"registers"| LK
    LK -->|"loads"| ED
    LK -->|"loads"| ES
    ED -->|"exposes"| LEX
    ES -->|"exposes"| EXS
    UTIL -->|"configures"| LEX
    UTIL -->|"configures"| EXS
    EXAPP -->|"uses"| LEX
    EXAPP -->|"uses"| EXS
    PERF -->|"feeds data to"| LEX

    %% Packaging integration (deployment feeds utilities)
    DEB -->|"packages"| UTIL
    RH -->|"packages"| UTIL
    SPEC -->|"defines"| UTIL

    %% Click Events
    click ED "https://github.com/cisco/exanic-software/tree/master/modules/exanic/"
    click ES "https://github.com/cisco/exanic-software/tree/master/modules/exasock/"
    click LEX "https://github.com/cisco/exanic-software/tree/master/libs/exanic/"
    click EXS "https://github.com/cisco/exanic-software/tree/master/libs/exasock/"
    click UTIL "https://github.com/cisco/exanic-software/tree/master/util/"
    click EXAPP "https://github.com/cisco/exanic-software/tree/master/examples/"
    click PERF "https://github.com/cisco/exanic-software/tree/master/perf-test/"
    click DEB "https://github.com/cisco/exanic-software/tree/master/debian/"
    click RH "https://github.com/cisco/exanic-software/tree/master/redhat/"
    click SPEC "https://github.com/cisco/exanic-software/blob/master/exanic.spec"

    %% Styles
    classDef hardware fill:#f9c74f,stroke:#333,stroke-width:2px;
    classDef kernel fill:#8ecae6,stroke:#333,stroke-width:2px;
    classDef library fill:#bde0fe,stroke:#333,stroke-width:2px;
    classDef utility fill:#caffbf,stroke:#333,stroke-width:2px;
    classDef example fill:#ffadad,stroke:#333,stroke-width:2px;
    classDef packaging fill:#ffca3a,stroke:#333,stroke-width:2px;
```
