# boss-server-ops/minindn architecture

> Architecture diagram of the GitHub repository boss-server-ops/minindn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/boss-server-ops/minindn
- Repository: https://github.com/boss-server-ops/minindn

## Overview

##### Project Type & Purpose
- Mini-NDN is essentially an emulation and experimental platform for NDN networks, wrapping around Mininet and integrating core NDN components (such as NFD and NLSR).
- It supports testing and research via simulation and experimentation of network protocols and behaviors.
- The README confirms its role to help users build, run, and experiment with emulated NDN networks.

##### File Structure to Define Architectural Domains
- Core Emulation & Orchestration:
– The “minindn” directory is a Python package that contains the orchestration logic (app manager, configurations, and helper modules for interfacing with NFD, NLSR, and tshark).
– Also in “minindn” are subdirectories for applications and network monitoring (for example, the “helpers” and “wifi” folders).

- Application Implementations:
– The “apps” directory (and its subdirectories like “algorithm”) hold many C++ based components that implement network functions such as producers, consumers, aggregators, and routing algorithms (e.g., k-means, network simplex, aggregation trees).
– “catapps”, “putapps”, and “yulongapp” provide additional app implementations and tests, likely representing different approaches or experimental modules that interact with the underlying NDN simulation.

- Topology and Configuration:
– The “topologies” directory houses various configuration files that define network topologies (data centers, ISP topologies, binary trees, WiFi layouts) that will be used to configure the emulated networks.
– Also, “experiments” and “examples” provide scripts and Jupyter notebooks that demonstrate usage as well as experimental setups.

- Deployment & Build:
– Docker-related files (Dockerfile, the docker directory) and Vagrant configurations illustrate containerized deployment options, helping the system run in a consistent environment.
– Makefiles in “apps”, “catapps”, “putapps”, and documentation in “docs” outline the build and documentation processes.
– The “requirements.txt” and “setup.py” point to Python dependencies which are crucial for the orchestration layer.

##### Key Components & Their Relationships
a. Emulation Orchestrator (minindn package):
– Acts as the master control unit where simulation parameters, application orchestration, and experiment management are handled.
– Interfaces with external NDN components (NFD, NLSR) as well as system utilities (e.g., tshark for packet monitor).

b. Application Nodes:
– The C++-based “apps” (and variations like “catapps”, “putapps”, “yulongapp”) implement the functionalities of NDN routing, data aggregation, and network behavior tests.
– They are “plugged” into the emulation environment defined by the orchestration layer.
– Specific modules under “apps/algorithm” indicate the use of sophisticated algorithms (aggregation, k-means clustering, network simplex, etc.) for network optimization and simulation.

c. Topology/Configuration Files:
– Define the network topology (node connectivity, link parameters) and experiment settings, providing the input for the orchestration layer.
– The relationship is that once a topology is selected, the emulation orchestrator configures the simulation accordingly.

d. Deployment & Build Tools:
– Tools like Docker, Vagrant, and Makefiles ensure that the system can be built, tested, and deployed consistently across environments.
– They are not part of the runtime architecture but are critical for the development and deployment lifecycle.

##### Architectural Patterns & Design Principles
- Layered Separation: The design clearly separates the emulation/orchestration layer (Python modules) from the performance-critical application implementations (C++ apps).
- Modular and Extensible: The presence of multiple “apps” directories and diverse topology configurations suggests that the system is designed for plug-and-play testing scenarios.
- Deployment Abstraction: Docker and Vagrant support a containerized and virtualized architecture, so include these as “environment provisioning” modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration Layer
    subgraph "Configuration Layer"
        T["Topology Files & Experiment Configurations"]:::config
    end

    %% Emulation/Orchestration Layer
    subgraph "Emulation/Orchestration Layer"
        O["minindn Orchestrator"]:::orchestrator
        AM["App Manager"]:::orchestratorDetail
        NFDI["NFD Interface"]:::orchestratorDetail
        NLSRI["NLSR Interface"]:::orchestratorDetail
        TS["Tshark Interface"]:::orchestratorDetail
    end

    %% Application Nodes
    subgraph "Application Nodes"
        CPP["C++ App Implementations (apps & algorithm)"]:::cpp
        CAT["App Variant: catapps"]:::cpp
        PUT["App Variant: putapps"]:::cpp
        YUL["App Variant: yulongapp"]:::cpp
    end

    %% External NDN Services
    subgraph "External NDN Services"
        extNFD["NFD"]:::external
        extNLSR["NLSR"]:::external
    end

    %% Deployment/Build Environment
    subgraph "Deployment/Build Environment"
        DOCK["Docker & Containerization"]:::deployment
        VAGR["Vagrant Virtualization"]:::deployment
        BUILD["Build Scripts & Dependencies"]:::deployment
    end

    %% Connections
    T -->|"feeds_config"| O

    O -->|"runs"| AM
    O -->|"calls"| NFDI
    O -->|"calls"| NLSRI
    O -->|"monitors"| TS

    O -->|"controls"| CPP
    O -->|"controls"| CAT
    O -->|"controls"| PUT
    O -->|"controls"| YUL

    O -->|"integrates"| extNFD
    O -->|"integrates"| extNLSR

    DOCK -->|"provisions"| O
    VAGR -->|"provisions"| O
    BUILD -->|"supports"| CPP
    BUILD -->|"supports"| CAT
    BUILD -->|"supports"| PUT
    BUILD -->|"supports"| YUL

    %% Click Events
    click O "https://github.com/boss-server-ops/minindn/blob/main/minindn/minindn.py"
    click AM "https://github.com/boss-server-ops/minindn/blob/main/minindn/apps/app_manager.py"
    click NFDI "https://github.com/boss-server-ops/minindn/blob/main/minindn/apps/nfd.py"
    click NLSRI "https://github.com/boss-server-ops/minindn/blob/main/minindn/apps/nlsr.py"
    click TS "https://github.com/boss-server-ops/minindn/blob/main/minindn/apps/tshark.py"
    click T "https://github.com/boss-server-ops/minindn/tree/main/topologies/"
    click CPP "https://github.com/boss-server-ops/minindn/tree/main/apps/"
    click CAT "https://github.com/boss-server-ops/minindn/tree/main/catapps/"
    click PUT "https://github.com/boss-server-ops/minindn/tree/main/putapps/"
    click YUL "https://github.com/boss-server-ops/minindn/tree/main/yulongapp/"
    click DOCK "https://github.com/boss-server-ops/minindn/tree/main/Dockerfile"
    click VAGR "https://github.com/boss-server-ops/minindn/tree/main/vagrant/"
    click BUILD "https://github.com/boss-server-ops/minindn/blob/main/setup.py"

    %% Style Definitions
    classDef config fill:#ccf,stroke:#000,stroke-width:2px;
    classDef orchestrator fill:#fcf,stroke:#000,stroke-width:2px;
    classDef orchestratorDetail fill:#ff9,stroke:#000,stroke-width:2px;
    classDef cpp fill:#cfc,stroke:#000,stroke-width:2px;
    classDef external fill:#fdd,stroke:#000,stroke-width:2px;
    classDef deployment fill:#cff,stroke:#000,stroke-width:2px;
```
