LoRaSim is a discrete-event simulator based on SimPy for simulating collisions in LoRa networks and to analyse scalability.
Do LoRa Low-Power Wide-Area Networks Scale?, Martin Bor, Utz Roedig, Thiemo Voigt, and Juan Alonso, MSWiM 2016.
Mitigating Inter-Network Interference in LoRa Networks, Thiemo Voigt, Martin Bor, Utz Roedig, and Juan Alonso, EWSN 2017.
Download LoRaSim (110 kB, last updated 10 July 2017)
LoRaSim consist of four Python scripts: loraDir.py
, loraDirMulBs.py
, directionalLoraIntf.py
, and oneDirectionalLoraIntf.py
. loraDir.py
simulates a single base station, loraDirMulBs.py
simulates more than one base station (up to 24), directionalLoraIntf
simulates nodes with directional antennae and multiple networks, oneDirectionalLoraIntf.py
simulates base stations with directional antennae and mulitple networks. All require the following packages: matplotlib, simpy and numpy.
It is recommend to use virtualenv to keep your Python environment isolated, together with virtualenvwrapper to make working with virtual environments much more pleasant, e.g.:
$ pip install virtualenvwrapper
...
$ export WORKON_HOME=~/.virtualenvs
$ mkdir -p $WORKON_HOME
$ source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv -p python2 lorasim
You can install the required packages using the provided requirements.txt
file:
(lorasim)$ pip install -r requirements.txt
All simulators operate mostly in the same way, and take the same parameters. The main difference is that loraDirMulBS.py
simulates up to 24 basestations, and xx takes.
./loraDir.py
<NODES> <AVGSEND> <EXPERIMENT> <SIMTIME> [COLLISION]
./loraDirMulBS.py
<NODES> <AVGSEND> <EXPERIMENT> <SIMTIME> <BASESTATIONS> [COLLISION]
directionalLoraIntf.py
<NODES> <AVGSEND> <EXPERIMENT> <SIMTIME> <BASESTATIONS> <COLLISION> <DIRECTIONALITY> <NETWORKS> <BASEDIST>
oneDirectionalLoraIntf.py
<NODES> <AVGSEND> <EXPERIMENT> <SIMTIME> <BASESTATIONS> <COLLISION> <DIRECTIONALITY> <NETWORKS> <BASEDIST>
experiment is an integer that determines with what radio settings the simulation is run. All nodes are configured with a fixed transmit power and a single transmit frequency, unless stated otherwise.
The result of every simulation run will be appended to a file named expX.dat, whereby X is the experiment number. The file contains a space separated table of values for nodes, collisions, transmissions and total energy spent. The data file can be easily plotted using e.g. gnuplot.
Initial release.
LoRaSim - Copyright (c) 2016-2017 Thiemo Voigt and Martin Bor. This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
Thiemo Voigt thiemo@sics.se
Martin Bor m.bor@lancaster.ac.uk