# martimy/netlab_ospf_frr architecture

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

- Interactive diagram: https://gitdiagram.com/martimy/netlab_ospf_frr
- Repository: https://github.com/martimy/netlab_ospf_frr

## Overview

##### Project type and purpose
- This “project” is not a traditional software stack but rather a tutorial repository for NetLab—a Python-based orchestration tool that automates virtual network labs with Containerlab (Docker) and Ansible to spin up FRR routers running OSPF.
- Its sole code artifact is a topology definition (topology.yml) and a README that walks you through installing NetLab, defining a three-node OSPF lab, deploying containers, and cleaning up.

##### File structure
- Top level:
- README.md – full walkthrough, component descriptions, commands
- topology.yml – the YAML spec driving Containerlab/NetLab to create the lab
- No “src/” or “lib/” directories—this repo serves purely as a configuration tutorial. All heavy lifting happens inside the NetLab, Containerlab, Docker, Ansible, and FRR components on the host.

##### README for architectural insights
- Describes four main actors:
a. NetLab CLI (Python utility)
b. Containerlab (clab) + Docker (container runtime)
c. Ansible (configuration deployment)
d. FRRouting (FRR) instances as containers simulating routers
- The topology is defined in topology.yml; NetLab generates clab.yml and Ansible inventories, then invokes containerlab deploy and Ans­ible playbooks to configure OSPF.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Host and Orchestration Layer
    subgraph "Host OS (Ubuntu VM)" 
        style Host fill:#f9f,stroke:#333,stroke-width:2px
        README["README.md"]:::file
        TopologyDef["topology.yml"]:::file
        NetLabCLI["NetLab CLI"]:::orchestration
        Containerlab["Containerlab"]:::orchestration
        Docker["Docker Daemon"]:::orchestration
        Ansible["Ansible Control Plane"]:::orchestration
    end

    %% Network Topology Tier
    subgraph "Deployed Virtual Network Topology"
        direction TB
        r1["r1 (FRR Router)"]:::router
        r2["r2 (FRR Router)"]:::router
        r3["r3 (FRR Router)"]:::router
        LAN1["LAN: 172.16.0.0/24"]:::network
        Link12["eth2: 10.1.0.0/30"]:::network
        Link23["eth3: 10.1.0.4/30"]:::network
    end

    %% Control Plane Flow
    README -->|"guides install & usage"| NetLabCLI
    TopologyDef -->|"feeds topology.yml"| NetLabCLI
    NetLabCLI -->|"generates clab.yml & inventory"| Containerlab
    Containerlab -->|"deploy containers"| Docker
    NetLabCLI -->|"invokes playbooks"| Ansible
    Ansible -->|"push configs via gRPC/SSH"| r1
    Ansible -->|"push configs via gRPC/SSH"| r2
    Ansible -->|"push configs via gRPC/SSH"| r3

    %% Data Plane Connections (dashed)
    r1 ---|eth2| Link12
    r2 ---|eth2| Link12
    r2 ---|eth3| Link23
    r3 ---|eth3| Link23
    r1 ---|eth1| LAN1
    r2 ---|eth1| LAN1

    %% Legend
    subgraph Legend
        direction LR
        Orch["Orchestration Tools"]:::orchestration
        Netw["Network Links/LANs"]:::network
        Rou["FRR Router Containers"]:::router
        File["Configuration Files"]:::file
    end

    %% Click Events
    click TopologyDef "https://github.com/martimy/netlab_ospf_frr/blob/master/topology.yml"
    click README "https://github.com/martimy/netlab_ospf_frr/blob/master/README.md"

    %% Classes
    classDef orchestration fill:#d0e1f9,stroke:#036,stroke-width:1px;
    classDef network fill:#d9ead3,stroke:#2e7d32,stroke-width:1px,stroke-dasharray: 5 5;
    classDef router fill:#ffe0b2,stroke:#e65100,stroke-width:1px;
    classDef file fill:#eeeeee,stroke:#888888,stroke-width:1px;
```
