The framework consists of three main components, i.e., nodes, an air interface and a gateway. The nodes send messages to the gateway via the air interface. Collisions and weak messages are detected in the air interface component. The uncollided and strong packets are delivered to the gateway, whereafter a downlink message will be scheduled if requested by the node.
@INPROCEEDINGS{8885739,
author={G. {Callebaut} and G. {Ottoy} and L. {van der Perre}},
booktitle={2019 IEEE Wireless Communications and Networking Conference (WCNC)},
title={Cross-Layer Framework and Optimization for Efficient Use of the Energy Budget of IoT Nodes},
year={2019},
volume={},
number={},
pages={1-6},
}
Other publications:
G. Callebaut, G. Ottoy and L. V. d. Perre, "Optimizing Transmission of IoT Nodes in Dynamic Environments,"
2020 International Conference on Omni-layer Intelligent Systems (COINS), 2020, pp. 1-5, doi: 10.1109/COINS49042.2020.9191674.
The source of the framework is located in the Framework
folder.
The Simulations
folder contains some examples.
In order to compare different settings/configurations
, it is imperative that the locations of the nodes are the same for all simulations.
Therefore, a file generate_locations.py
is included in the examples.
Workflow:
Simulation.py
file as detailed here.Configurable parameters:
For each simulation, a random set of locations inside the area is generated and is stored in the location_file
which is a parameter defined in the GlobalConfig.py
file.
In the simulation file, you will use the building blocks in the framework to simulate a specific environment and
acquire results such as the consumed energy, and the number of collided messages. See section Framework
(below) for configurable parameters and output.
Please see the comments in the Example>simulation.py
on how to write a simulation file.
In simulation.py
you load the locations, specify the object to hold the results and specify what you want to simulate.
In SimulationProcess
, the simulation itself is run. The gateway is created, the nodes are generated with their lora parameters and energy profile.
Afterwhich the simulation is run. After completion of one simulation the results are extracted from the objects and returned, to be used in the simulation.py
file.
The project can now be run by first running generate_locations.py
and then simulation.py
.
Please read first the paper to have a more detailed understanding of the framework with respect to LoRaWAN operation and limitations.
The propagation model determines how the messages are impacted by the environment.
It predicts the path loss, i.e., how much the signal is attenuated between the transmitter and receiver, for a given environment.
The PropagationModel.py
contains (currently) two implementations:
This model transforms the received signal strength (RSS) to a signal-to-noise ratio (SNR) by the method rss_to_snr
.
At this moment the noise is only affected by the thermal noise.
This results in (dB):
SNR = RSS - (-174 + 10 * log10(125e3))
All parameters specific to the lora protocol (lorawan) and measured energy consumption related to these parameters are here included.
LoRaPackets are send over the air interface from the nodes to the gateway.
LoRaPacket
contains a uplink and downlink message class, including relevant metadata and information concerning the state of the message, e.g., received, collided,...
The energy profile class contains the sleep, processing, transmitting and received power of a node.
This can be different for each node and can be defined in the simulation.py
file.
The Node class contains all information regarding the power consumption, number of messages send, payload send, retransmissions, ...
Nodes act as real IoT nodes, joining the network, waiting, sleeping, transmittion and receiving. Their behaviour is determined in the main simulation.py
file.
After running the simulation, you can extract the following iniformation:
energy_per_bit
. This is the amount of energy consumed to send one bit of datatransmit_related_energy_per_bit
. This only contains the energy spend in transmit mode.transmit_related_energy_per_unique_bit
. This only contains the energy spend in transmit mode and tx'ed retransmissions are not count against the transmitted bitstotal_energy_consumed
get_simulation_data
:series = {
'WaitTimeDC': self.total_wait_time_because_dc / 1000, # [s] instead of [ms]
'NoDLReceived': self.num_no_downlink,
'UniquePackets': self.num_unique_packets_sent,
'TotalPackets': self.packets_sent,
'CollidedPackets': self.num_collided,
'RetransmittedPackets': self.num_retransmission,
'TotalBytes': self.bytes_sent,
'TotalEnergy': self.total_energy_consumed(),
'TxRxEnergy': self.transmit_related_energy_consumed(),
'EnergyValuePackets': self.energy_value
}
The air interface detects collisions and alters the LoRaPacket object so the node and gateway know what happened during the transmission of the message. It employs the used propagation model and snr model to determine if the transfer was successful or not.
At the gateway, the received SNR is checked and messages below the required threshold are marked as weak and is not rx'ed. The gateway also handles DL messages if requested by the node.
Q: Can't find Globaconfig, Locations, .... A: Ensure that the folders Framework and Simulations are marked as Source Root. For Pycharm right click on the folder > Mark directory as > Source Root
Q: no output in IPython/Spyder A: The code is run in parralel by default and the std output is not handled well in that case. You can run the code sequently, see the comments in Example/simulation.py regarding the pool.map function at the bottom.
Cited in.
Simulator used in: