A Python-based simulator for LoRaWAN networks that models the effects of Spreading Factor (SF) on packet success rate, signal strength, battery life, and packet collisions.
- Packet Success Rate — how reliably packets reach the gateway at each SF
- Collision Rate — packets lost due to simultaneous transmissions on the same SF
- RSSI vs Sensitivity — signal strength compared to minimum decode threshold
- Time on Air — how long each transmission takes (affects battery)
- Battery Life Estimate — estimated days on a 2000 mAh battery
git clone https://github.com/Aarushhiii/lorawan-network-simulator.git
cd lorawan-network-simulator
pip install -r requirements.txtDefault simulation (20 nodes, 50 packets, 5km radius):
python lorawan_simulator.pyInteractive What-If mode — customize nodes, packets, and radius:
Run What-If mode? (y/n): y
Number of sensor nodes [default 20]: 50
Packets per node [default 50]: 100
Network radius (m) [default 5000]: 3000
| SF | Range | Battery Life | Time on Air | Best For |
|---|---|---|---|---|
| SF7 | Short | Longest | 56.6 ms | Dense urban areas |
| SF8 | Medium | Long | 103.4 ms | Suburban |
| SF9 | Medium | Moderate | 185.3 ms | Mixed areas |
| SF10 | Long | Moderate | 370.7 ms | Rural |
| SF11 | Longer | Short | 741.4 ms | Remote areas |
| SF12 | Longest | Shortest | 1482.8 ms | Max range needed |
lorawan-network-simulator/
│
├── lorawan_simulator.py # Main simulation script
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
└── assets/
└── lorawan_simulation_results.png # Output chart
-
Add multi-gateway support
-
Simulate ADR (Adaptive Data Rate) (https://learn.semtech.com/mod/book/view.php?id=174)
-
Add real-world dataset comparison (https://zenodo.org/records/4121430#.YjMRoX_MJhE)
-
Export results to CSV : Done ✅
-
GitHub README Integration Tips • Render formulae with GitHub-supported LaTeX fencing: wrap equations in $$ ... $$ blocks in README.md • Embed lorawan_simulation_results.png at the top of the README so reviewers see results without running code • Use a Mermaid.js block to render the network topology diagram inline in the browser Add a Results section with a table linking each plot to its interpretation — reviewers rarely run notebooks
Aarushi Jain LinkedIn · GitHub
MIT License — see LICENSE for details.
