# theerthananda/rudp-network-simulator architecture

> Architecture diagram of the GitHub repository theerthananda/rudp-network-simulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/theerthananda/rudp-network-simulator
- Repository: https://github.com/theerthananda/rudp-network-simulator

## Overview

RUDP Network Simulator combines a browser-based experiment dashboard with real UDP file transfer. The main workflow is upload and configure a transfer, run it through sender, impairment/network and receiver stages, reconstruct and verify the file, then inspect live events and analysis. The README documents the browser-to-bridge flow and product capabilities; source excerpts establish session orchestration and several internal calls. Some frontend/API wiring and unsampled reliability details are therefore shown only where documented, with uncertain links omitted.

Main entry points: [`frontend/js/app.js`](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/app.js) (Dashboard), [`backend/transfer/session.py`](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/session.py) (Transfer session), [`backend/sender/sender.py`](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/sender/sender.py) (UDP sender), [`backend/receiver/receiver.py`](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/receiver/receiver.py) (UDP receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser experience"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_animations["Packet animation<br/>[animation.js]"]
  node_received_ui["Received files UI<br/>[received-files.js]"]
  node_simulator_ui["Network controls<br/>[simulator.js]"]
end

subgraph group_service["Transfer service"]
  node_bridge["HTTP and SSE bridge<br/>[web_bridge.py]"]
  node_session["Transfer session<br/>[session.py]"]
end

subgraph group_transport["Transport and reliability"]
  node_sender["UDP sender<br/>[sender.py]"]
  node_gateway["UDP gateway<br/>[gateway.py]"]
  node_impairment["Network conditions<br/>[conditions.py]"]
  node_legacy_sim["Network simulator<br/>[simulator.py]"]
  node_receiver["UDP receiver<br/>[receiver.py]"]
  node_reliability["Reliability algorithms<br/>[session.py]"]
  node_congestion["Congestion control<br/>[congestion.py]"]
end

subgraph group_integrity["File integrity"]
  node_packet["Packet framing and CRC<br/>[packet.py]"]
  node_crc["CRC-32 helper<br/>[checksum.py]"]
  node_splitter["File packetization<br/>[file_splitter.py]"]
  node_reassembler["File reconstruction"]
  node_sha["SHA-256 verification<br/>[file_checksum.py]"]
  node_output["Output path handling<br/>[output_paths.py]"]
end

subgraph group_analysis["Experiment analysis"]
  node_visuals["Graphs and metrics<br/>[graphs.js]"]
  node_forensics["Packet forensics<br/>[forensics.js]"]
  node_metrics_ui["Metrics display<br/>[metrics.js]"]
end

node_user(("Experimenter"))

node_user -->|"configures and uploads"| node_dashboard
node_dashboard -->|"sends requests"| node_bridge
node_bridge -->|"starts transfer"| node_session
node_session -->|"owns endpoint"| node_sender
node_sender -->|"sends datagrams"| node_gateway
node_gateway -->|"plans delivery"| node_impairment
node_gateway -->|"delivers datagrams"| node_receiver
node_session -->|"runs strategy"| node_reliability
node_session -->|"updates window"| node_congestion
node_sender -->|"packetizes file"| node_splitter
node_sender -->|"serializes packets"| node_packet
node_receiver -->|"parses packets"| node_packet
node_packet -->|"calculates and verifies"| node_crc
node_receiver -->|"stores chunks"| node_reassembler
node_receiver -->|"verifies reconstructed file"| node_sha
node_session -->|"chooses output paths"| node_output
node_session -->|"emits transfer events"| node_bridge
node_bridge -->|"streams live events"| node_dashboard
node_dashboard -->|"configures conditions"| node_simulator_ui
node_dashboard -->|"visualizes packets"| node_animations
node_dashboard -->|"presents analysis"| node_visuals
node_dashboard -->|"opens forensics"| node_forensics
node_dashboard -->|"shows statistics"| node_metrics_ui
node_dashboard -->|"manages received files"| node_received_ui
node_session -.->|"may use simulator"| node_legacy_sim

click node_dashboard "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/app.js"
click node_visuals "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/graphs.js"
click node_forensics "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/forensics.js"
click node_animations "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/animation.js"
click node_received_ui "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/received-files.js"
click node_simulator_ui "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/simulator.js"
click node_metrics_ui "https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/metrics.js"
click node_bridge "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/web_bridge.py"
click node_session "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/session.py"
click node_sender "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/sender/sender.py"
click node_gateway "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/gateway.py"
click node_impairment "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/conditions.py"
click node_legacy_sim "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/simulator.py"
click node_receiver "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/receiver/receiver.py"
click node_reliability "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/session.py"
click node_congestion "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/congestion.py"
click node_packet "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/packet.py"
click node_crc "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/checksum.py"
click node_splitter "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/file_splitter.py"
click node_reassembler "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/file_reassembler.py"
click node_sha "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/file_checksum.py"
click node_output "https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/output_paths.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_animations,node_received_ui,node_simulator_ui toneBlue
class node_bridge,node_session toneAmber
class node_sender,node_gateway,node_impairment,node_legacy_sim,node_receiver,node_reliability,node_congestion toneMint
class node_packet,node_crc,node_splitter,node_reassembler,node_sha,node_output toneRose
class node_visuals,node_forensics,node_metrics_ui,node_user toneIndigo
```

## Components

### Browser experience

- [Dashboard](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Packet animation](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/animation.js): `frontend/js/animation.js`
- [Received files UI](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/received-files.js): `frontend/js/received-files.js`
- [Network controls](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/simulator.js): `frontend/js/simulator.js`

### Transfer service

- [HTTP and SSE bridge](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/web_bridge.py): `backend/web_bridge.py`
- [Transfer session](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/session.py): `backend/transfer/session.py`

### Transport and reliability

- [UDP sender](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/sender/sender.py): `backend/sender/sender.py`
- [UDP gateway](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/gateway.py): `backend/network/gateway.py`
- [Network conditions](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/conditions.py): `backend/network/conditions.py`
- [Network simulator](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/network/simulator.py): `backend/network/simulator.py`
- [UDP receiver](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/receiver/receiver.py): `backend/receiver/receiver.py`
- [Reliability algorithms](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/session.py): `backend/transfer/session.py`
- [Congestion control](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/congestion.py): `backend/transfer/congestion.py`

### File integrity

- [Packet framing and CRC](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/packet.py): `backend/protocol/packet.py`
- [CRC-32 helper](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/checksum.py): `backend/protocol/checksum.py`
- [File packetization](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/file_splitter.py): `backend/transfer/file_splitter.py`
- [File reconstruction](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/file_reassembler.py): `backend/transfer/file_reassembler.py`
- [SHA-256 verification](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/protocol/file_checksum.py): `backend/protocol/file_checksum.py`
- [Output path handling](https://github.com/theerthananda/rudp-network-simulator/blob/main/backend/transfer/output_paths.py): `backend/transfer/output_paths.py`

### Experiment analysis

- [Graphs and metrics](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/graphs.js): `frontend/js/graphs.js`
- [Packet forensics](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/forensics.js): `frontend/js/forensics.js`
- [Metrics display](https://github.com/theerthananda/rudp-network-simulator/blob/main/frontend/js/metrics.js): `frontend/js/metrics.js`

### Other components

- **Experimenter**

## Connections

- Experimenter → Dashboard: configures and uploads (evidence: `README.md`)
- Dashboard → HTTP and SSE bridge: sends requests (evidence: `README.md`)
- HTTP and SSE bridge → Transfer session: starts transfer (evidence: `backend/web_bridge.py`)
- Transfer session → UDP sender: owns endpoint (evidence: `README.md`)
- UDP sender → UDP gateway: sends datagrams (evidence: `README.md`)
- UDP gateway → Network conditions: plans delivery (evidence: `backend/network/gateway.py`)
- UDP gateway → UDP receiver: delivers datagrams (evidence: `README.md`)
- Transfer session → Reliability algorithms: runs strategy (evidence: `backend/transfer/session.py`)
- Transfer session → Congestion control: updates window (evidence: `backend/transfer/session.py`)
- UDP sender → File packetization: packetizes file (evidence: `backend/sender/sender.py`)
- UDP sender → Packet framing and CRC: serializes packets (evidence: `backend/sender/sender.py`)
- UDP receiver → Packet framing and CRC: parses packets (evidence: `backend/receiver/receiver.py`)
- Packet framing and CRC → CRC-32 helper: calculates and verifies (evidence: `backend/protocol/packet.py`)
- UDP receiver → File reconstruction: stores chunks (evidence: `backend/receiver/receiver.py`)
- UDP receiver → SHA-256 verification: verifies reconstructed file (evidence: `backend/receiver/receiver.py`)
- Transfer session → Output path handling: chooses output paths (evidence: `backend/transfer/session.py`)
- Transfer session → HTTP and SSE bridge: emits transfer events (evidence: `README.md`)
- HTTP and SSE bridge → Dashboard: streams live events (evidence: `README.md`)
- Dashboard → Network controls: configures conditions (evidence: `README.md`)
- Dashboard → Packet animation: visualizes packets (evidence: `README.md`)
- Dashboard → Graphs and metrics: presents analysis (evidence: `README.md`)
- Dashboard → Packet forensics: opens forensics (evidence: `README.md`)
- Dashboard → Metrics display: shows statistics (evidence: `README.md`)
- Dashboard → Received files UI: manages received files (evidence: `README.md`)
- Transfer session → Network simulator: may use simulator
