Skip to content

RhynoW/Leo_Flood_Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛰️ LEO Constellation Network Routing Simulator

LEO 星際網絡路由模擬器

Live Demo

👉 https://leo-flood-demo.streamlit.app/

An interactive, bilingual (English / Traditional Chinese) Streamlit web application for teaching and exploring routing algorithms in Low Earth Orbit satellite constellations.

Built as an open educational tool — students can tune weights, watch the cost curve explode, and see routing paths move across a 3-D globe, all without leaving the browser.


✨ Features

Feature Description
3 Constellation Presets Starlink-like (dense), Kuiper-like (gateway-aware), Sparse / TinyLEO-like
4 Routing Algorithms Static Dijkstra, Load-aware Dijkstra, Multi-constraint Dijkstra, Directed Flood
Monte Carlo CDF Randomised traffic trials → latency distribution charts for all 4 algorithms
Interactive 3-D Globe Orthographic Scattergeo globe with routing paths, satellite topology overlay, and orbital ground tracks
Cost Analyzer Live M/M/1 queueing cost calculator — watch the queue term blow up as ρ → 1
Bilingual UI Full English / 繁體中文 toggle in the sidebar
Teacher Resources Curated academic papers, open-source labs, and teaching videos

🖥️ Screenshots

Run the app locally and explore the five tabs: Global Routing Map · Constellation Info · Tutorial & Guide · Cost Analyzer · Teacher Resources


🚀 Quick Start

Prerequisites

Python >= 3.9

Installation

# 1. Clone the repository
git clone https://github.com/<your-username>/Leo_Flood_Demo.git
cd Leo_Flood_Demo

# 2. Install dependencies
pip install streamlit numpy pandas plotly

# 3. Launch the app
streamlit run app.py

The app will open at http://localhost:8501 in your browser.


📁 Project Structure

Leo_Flood_Demo/
├── app.py                  # Streamlit front-end (bilingual UI, all tabs)
├── leo_flood_demo_v3i.py   # Simulation engine (constellation, routing, Monte Carlo)
└── README.md

Key modules in leo_flood_demo_v3i.py

Symbol Role
WalkerConstellation Walker-like LEO constellation model (ECI coordinates, ISL graph)
RoutingConfig Dataclass holding all weights and normalisation factors
dijkstra_static Classic propagation-delay Dijkstra
dijkstra_load_aware Usage-weighted Dijkstra (λ × usage_count penalty)
dijkstra_multi Multi-constraint Dijkstra with M/M/1 queueing proxy
monte_carlo Monte Carlo engine — samples random util_map, runs all 4 algorithms per trial
build_sparse_active_set Removes even-index satellites to create TinyLEO-like sparse topology

🧭 Routing Algorithms

1. Static Dijkstra

Edge weight = propagation delay (distance ÷ speed of light) + fixed processing delay (1.5 ms/hop). Fast and stable; ignores real-time link load.

2. Load-aware Dijkstra

Edge weight = static delay + λ × usage_count. Avoids historically heavy links; cannot respond to sudden traffic bursts.

3. Multi-constraint Dijkstra

Five-term normalised cost function (identical to multi_constraint_cost() in the engine):

cost = w_delay   × (base_delay   / 10.0)
     + w_queue   × (ρ / (1−ρ)   / 5.0)   ← M/M/1 queueing, service_rate = 1
     + w_usage   × (usage_count  / 10.0)
     + w_contact × (ISL_dist     / 10000.0)
     + w_gateway × (dist_to_GW   / 10000.0)  ← Kuiper only

Weights are tunable in real time via the sidebar sliders.

4. Directed Flood

Flood routing from Source toward Destination pruned by a direction-cosine threshold. Uses the actual per-trial util_map — finds the current-optimal path each trial. May fail (∞) under strict thresholds or sparse topologies.


🛰️ Constellation Presets

Preset Planes (M) Sats/plane (N) Altitude Inclination Cross-seam ISL
Starlink-like 24 22 550 km 53.0°
Kuiper-like 6 11 630 km 51.9°
Sparse (TinyLEO-like) 24 22 (even-index active) 550 km 53.0°

🎮 Usage Guide

  1. Select a constellation preset from the sidebar.
  2. Adjust traffic & hotspot settings — or click 🔥 Max Congestion Mode for an extreme scenario.
  3. Tune routing weights (w_delay, w_queue, w_usage, w_contact).
  4. Select source / destination satellites by plane index and satellite index.
  5. Click "▶ Run Simulation" to execute Monte Carlo and view the latency CDF.
  6. Switch to the Globe tab — enable "Satellite Topology" or "Orbital Planes", then rotate the globe to trace routing paths.
  7. Open the Cost Analyzer tab to interactively explore the M/M/1 cost formula.

📚 Related Resources

Resource Link
ETH Zurich Hypatia simulator github.com/snkas/hypatia
SatCom-TELMA MA-DRL Routing github.com/SatCom-TELMA/MA-DRL_Routing_Simulator
Starlink Performance (Purdue 2024) stygianet.cs.purdue.edu
Mark Handley — LEO Routing talk (UCL) youtube.com/watch?v=m05abdGSOxY
Real Engineering — How Starlink Works youtube.com/watch?v=giQ8xEWjnLs

🗺️ Pedagogical Sequence (for teachers)

  1. Theory — Watch Mark Handley's UCL talk to understand why LEO routing is a "moving maze".
  2. Exploration — Open the Cost Analyzer tab; raise w_queue and observe the exponential blow-up.
  3. Experiment — Run Monte Carlo in Max Congestion mode; compare Static vs Multi-constraint CDFs.
  4. Challenge — Reference the Purdue/STyGIANet white-paper data and try to reproduce Starlink's ~15-second periodic handover latency spikes.
  5. Extension — Explore SatCom-TELMA MA-DRL to see how deep RL can replace hand-tuned weight sliders.

📄 License

MIT License — free to use, modify, and distribute with attribution.


Built with Streamlit · Plotly · NumPy

About

Interactive bilingual (EN/繁體中文) Streamlit simulator for LEO satellite network routing algorithms — Dijkstra, Multi-constraint, Directed Flood, Monte Carlo CDF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages