# uccmisl/godashbed architecture

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

- Interactive diagram: https://gitdiagram.com/uccmisl/godashbed
- Repository: https://github.com/uccmisl/godashbed

## Overview

##### Project type and purpose
- Project type: A network‐emulation testbed for HTTP Adaptive Streaming (HAS) and VoIP experimentation. It orchestrates Mininet, configures network conditions from trace files, launches HTTP/QUIC servers and clients (goDASH), and collects performance metrics.
- Use case: Researchers run repeatable DASH/VoIP experiments over emulated TCP/QUIC links, varying bandwidth, delay, queue disciplines, and number of clients.

##### File structure
- Top‐level scripts (goDashBed.py, hypercorn_*.py) implement the orchestration “control plane.”
- caddy‐config/ houses Caddyfile variants for WSGI servers (TCP and QUIC).
- config/configure.json holds runtime settings (URLs, modes).
- tc_*.sh and get_your_movies.sh are helper scripts for traffic shaping and content setup.
- traces/ holds CSV network‐trace inputs.
- urls/ defines Python modules listing MPD URLs for TCP vs. QUIC clients.

##### README for architectural clues
- Two server modes:
– WSGI Caddy (TCP/QUIC) using Caddyfiles in caddy-config
– ASGI Hypercorn/QuartTrio (TCP/QUIC) via hypercorn_goDASHbed scripts
- Clients: goDASH video clients + D-ITG voice clients, spawned in Mininet hosts.
- Mininet emulates topology, applies tc delay/fifo per trace.

##### Main components & their interactions
a. Orchestrator (Python scripts goDashBed.py / hypercorn_goDASHbed.py)
- Parses CLI flags, loads configure.json, picks traces and URL modules.
- Spawns Mininet topology, applies traffic‐control (tc_delay.sh, tc_fifo.sh) using trace CSV.
- Launches server processes on one Mininet host:
– Caddy (WSGI) or Hypercorn (ASGI) with appropriate transport (TCP/QUIC).
- Launches goDASH video clients and D-ITG VoIP clients on other Mininet hosts.
- Collects logs/metrics and repeats per numruns.

b. Network Emulator (Mininet)
- Single‐switch or linear topology, with a bottleneck link configured via tc.
- Hosts are logical VMs: one “server” host, multiple “client” hosts.

c. HTTP/QUIC Servers
- Content store at /var/www/html populated via get_your_movies.sh.
- Caddy server configured by caddy-config/Tesbed*/Caddyfilev2* for TLS certs and QUIC.
- Hypercorn/QuartTrio alternative (ASGI).

d. Clients
- Video clients (goDASH engine) fetch adaptive streams from the server using URLs from urls/mpdURL.py or mpdURLquic.py.
- VoIP clients (D-ITG) generate UDP traffic to server or external sink.

e. Configuration & Data
- configure.json drives runtime parameters (bandwidth, delay, URLs, server mode).
- traces/*.csv provide time‐series link capacities.
- urls/*.py list content URLs for client selection.

##### Architectural patterns & principles
- Orchestrator + worker pattern: single master script delegating tasks to network, server, and client workers.
- Plugin‐like transport abstraction: SERVER_MODE flag picks WSGI vs. ASGI; TM flag picks TCP vs. QUIC.
- Separation of concerns: network shaping, server hosting, client execution, logging are distinct modules.

– Group related files (urls/*.py, caddy-config/*) inside “Configuration” sub-area.
– Call out dependencies: godash (video engine), D-ITG (VoIP), Mininet.
– Annotate iterations: numruns and per-trace loops can be shown as loops on the Orchestrator.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Orchestrator" 
        O1["WSGI/TCP & QUIC: goDashBed.py"]:::orchestrator
        O2["ASGI/TCP: hypercorn_goDASHbed.py"]:::orchestrator
        O3["ASGI/QUIC: hypercorn_goDASHbed_quic.py"]:::orchestrator
    end

    subgraph "Configuration & Data" 
        CFG["configure.json"]:::data
        TRC["traces/*.csv"]:::data
        URL1["urls/mpdURL.py"]:::data
        URL2["urls/mpdURLquic.py"]:::data
        CADDY1["Caddyfile (WSGI)"]:::data
        CADDY2["CaddyFile (TCP)"]:::data
        CADDY3["CaddyFilev2TCP"]:::data
        CADDY4["CaddyFilev2QUIC"]:::data
        GMV["get_your_movies.sh"]:::data
        TC1["tc_delay.sh"]:::data
        TC2["tc_fifo.sh"]:::data
    end

    subgraph "Network Emulator (Mininet)" 
        MN["Mininet Framework"]:::network
    end

    subgraph "Server Host" 
        CAG["Caddy (WSGI)"]:::server
        HYP["Hypercorn/QuartTrio (ASGI)"]:::server
        CS["Content Store (/var/www/html)"]:::data
    end

    subgraph "Client Hosts" 
        CL1["goDASH Video Clients"]:::client
        CL2["D-ITG VoIP Clients"]:::client
    end

    O1 -->|loads config & traces & URLs| CFG
    O1 --> CFG
    O1 --> TRC
    O1 --> URL1
    O1 --> URL2
    O1 --> TC1
    O1 --> TC2
    O1 --> GMV
    O1 --> MN
    O2 --> MN
    O3 --> MN

    MN -->|"launch server"| CAG
    MN -->|"launch server"| HYP
    CAG --> CS
    MN -->|"spawn clients"| CL1
    MN -->|"spawn clients"| CL2

    CL1 -->|"HTTP/TCP"| CAG
    CL1 -->|"HTTP/QUIC"| CAG
    CL1 -->|"HTTP/TCP"| HYP
    CL1 -->|"HTTP/QUIC"| HYP
    CL2 -->|"D-ITG UDP"| CAG
    CL2 -->|"D-ITG UDP"| HYP

    %% Click Events
    click O1 "https://github.com/uccmisl/godashbed/blob/master/goDashBed.py"
    click O2 "https://github.com/uccmisl/godashbed/blob/master/hypercorn_goDASHbed.py"
    click O3 "https://github.com/uccmisl/godashbed/blob/master/hypercorn_goDASHbed_quic.py"
    click CADDY1 "https://github.com/uccmisl/godashbed/tree/master/caddy-config/Testbed/Caddyfile"
    click CADDY2 "https://github.com/uccmisl/godashbed/tree/master/caddy-config/TestbedTCP/CaddyFile"
    click CADDY3 "https://github.com/uccmisl/godashbed/tree/master/caddy-config/TestbedTCP/CaddyFilev2TCP"
    click CADDY4 "https://github.com/uccmisl/godashbed/tree/master/caddy-config/TestbedTCP/CaddyFilev2QUIC"
    click TC1 "https://github.com/uccmisl/godashbed/blob/master/tc_delay.sh"
    click TC2 "https://github.com/uccmisl/godashbed/blob/master/tc_fifo.sh"
    click CFG "https://github.com/uccmisl/godashbed/blob/master/config/configure.json"
    click TRC "https://github.com/uccmisl/godashbed/blob/master/traces/*.csv"
    click URL1 "https://github.com/uccmisl/godashbed/blob/master/urls/mpdURL.py"
    click URL2 "https://github.com/uccmisl/godashbed/blob/master/urls/mpdURLquic.py"
    click GMV "https://github.com/uccmisl/godashbed/blob/master/get_your_movies.sh"

    classDef orchestrator fill:#9fdf9f,stroke:#333,stroke-width:2px;
    classDef network fill:#9fcfff,stroke:#333,stroke-width:2px;
    classDef server fill:#ffcc99,stroke:#333,stroke-width:2px;
    classDef client fill:#d1b3ff,stroke:#333,stroke-width:2px;
    classDef data fill:#fff59f,stroke:#333,stroke-width:2px;
```
