Spring 2023

ENSC 427: COMMUNICATION NETWORKS

Topic: ns-3 Simulation of Propagation Loss for Various LoRa Chirp Variations of RYLR896 Module

Miller Solis & Glorie Ramazani

Interim Report

ns-3 simulation of propagation loss for various LoRa chirp variations of RYLR896 module

Abstract

LoRaWAN (Long Range Wireless Area Network) is a wireless communication protocol that makes use of the unlicensed spectrum. It is optimized for low-power and long-range applications as its name suggest, implementing 2 different types of nodes, gateways and end devices which are capable of communicating using a signal that sweeps multiple frequencies as it travels in time, also known as chirp. A chirp is capable of encoding information while providing resiliency to interference and therefore a long range. This study leverages ns-3 to implement a mechanism to simulate scenarios where the chirp characteristics are not fixed, just like in real-life deployed gateways and end devices, where the chirp characteristics change on a regular basis. To achieve this, a LoRaWAN module (RYLR896: SX1276 chip with antenna) was selected to be modeled in the ns-3 simulation. As a result, the behavior of LoRa products that make use of that specific LoRa module can be more accurately simulated on ns-3.

Introduction

LoRa (Long Range) is a wireless communication technology designed for low-power, long-range transmissions between devices. It is a type of radio frequency (RF) modulation scheme that operates in the unlicensed Industrial, Scientific, and Medical (ISM) frequency bands, making it available for use by anyone without requiring a license. LoRa enables devices to communicate wirelessly over distances of several kilometers while using very little power. This makes it an ideal solution for applications that require long-range communication, such as IoT (Internet of Things) devices, smart cities, and environmental monitoring [13]. LoRa technology uses chirp spread spectrum (CSS) modulation, which enables a signal to be spread across a wide frequency range. This allows LoRa signals to be transmitted over long distances without requiring high power consumption. LoRaWAN (Long Range Wide Area Network) is a network protocol that operates on top of the LoRa technology. It provides a standard communication protocol for devices to connect to a LoRa network, enabling devices from different manufacturers to interoperate seamlessly.

Figure 1. Variations on LoRa chirp characteristics [6]


The LoRa chirps produce a frequency vs time graph such as the one in figure 1. The y-axis represents the frequencies and the x-axis represents the time. SF stands for “Spread Factor” which is seen on the graph as the x-axis range value for a single packet. SF values range from 7 to 12. A higher SF value results in a longer range transmission but a lower data rate. A lower SF results in a lower range transmission but higher data rate. LoRa transmits over license-free Megahertz radio frequency bands like 169 MHz, 433 MHz, 868MHz (Europe) and 915MHz (North America) [10]. We will be using the Europe frequency of 868MHz. The frequency 868 MHz will act as the central frequency. Our bandwidth will then be 125kHz according as a result - this is according to the LoRaWAN Regional Parameters document.

LoRa Transceiver Module

We are using the RYLR896 transceiver module which features the LoRa® long range modem. This enables the module to provide ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption. The RYLR896 transceiver has frequency range of 868-1020 MHz using the Semtech SX1276 chip [9]. Transmissions in rural areas can range more than 15 KM [10]. It can achieve baud rates of between 300 and 115200 bps, depending upon the spreading factor [9]. The RYLR896 features a fixed antenna, which is directly connected to the LoRa module, as apposed to a detachable antenna. This is especially beneficial as a detachable antenna may prove less effective to use as they will affect the transmission of the packet data being sent. For our purposes we will be using a typical transmission power of 14dB at the receiver end. Interacting with the LoRa module is done using the built-in STM microcontroller. The two components communicate with each other through a SPI (Serial Peripheral Interface) making sending commands to the LoRa module easier, abstracting away all the functionality of the SX1276 chip to AT COMMANDS, sent over UART (Universal asynchronous receiver-transmitter) protocol.

ns-3 LoRaWAN Module

There are multiple ns-3 modules that enable simulation of LoRaWAN networks. Some of them include a great deal of finer simulation details, but lack documentation and examples. The ns-3 module for LoRaWAN developed by a team of master students at the University of Padova, which would be later further developed by the Signet lab from the same university. The ns-3 module is well documented, using the same documentation framework as the original ns-3 documentation in Doxygen. In addition, the module includes multiple examples and was used to perform simulations for multiple papers on LoRaWAN networks, providing extra support and further explanation on how the model works. This ns-3 module implementation has embedded a considerable amount of parameters that are trying to mimic the behaviour of Semtech SX1301, which means that it would be fairly easy to modify them and make the simulations have a higher degree of accuracy for a different Semtech chip, such as SX1276 and modules that make use of them such as RYLR896. Parameters such as transmission power, SF tuning, receiving sensitivity, frequency and bandwidth are all modelled in the ns-3 module from Signet lab. The module's architecture includes a PHY (physical) layer model, which is connected to the channel that is used to send and receive packets at the lowest level, and applies interference models as well as propagation loss models and assigns a receive power as well as if the packet was destroyed by interference or not. For a packet to be received from the channel, the receiver must be listening on the correct frequency with the correct SF. The module's architecture includes a Gateway model which implements Gateways and End Devices according to a typical LoRaWAN network architecture. Furthermore, the module also implements a MAC layer model that deals with the contents of the packet itself. Although this ns-3 module is a powerful tool for LoRaWAN simulations, it has multiple limitations. This is mainly thanks to the LoRa specifications for different regions, which change multiple parameters such as frequency, bandwidth and behavior of gateways and end devices. Many of the previously mentioned parameters are hard coded for the EU (Europe) region in the Signet lab module since it was first developed at an Italian university. Even though modifying the code to change the previously mentioned parameters is possible, it would require a huge development effort and expertise on the inner workings of the module and the LoRa protocol on different regions. Hence, this study will build on top of the readily available features and configurations of the module and will use EU as the region for the simulations.

Figure 2. ns-3 module class structure [12]

As mentioned earlier, the LoRa channel is one of the most important abstractions that this module uses. It is the point of interest when talking about range, propagation and interference loss in the simulations. For this study, there is a strong focus on the propagation loss related to the SF and the distance between the nodes, given that the bandwidth is set to 125kHz and the frequency is set to 868MHz as per EU region spec. The channel is able to utilize propagation loss models and interference loss models from ns-3. It is important to make the distinction from propagation loss and interference models on this module. These two models abstract a completely different source of loss for packets in the LoRa channel and hence they do not interfere with each other, instead, their behavior is aggregated by the channel to simulate the behavior of networks. This distinction means that in order to develop a model that mimics the propagation loss depending on SF and distance of nodes, we do not have to consider the interference of other devices or from the environment obstacles, since this behavior of the channel is abstracted away independently by the interference helper.

Data Acquisition

In order to acquire data to develop a propagation loss model that mimics the real life capabilities of the RYLR896 module, it is necessary to collect data from nodes that make use of this module and collect data of interest for different SF. Data as receiving power, packet loss rate at a distance, SNR (signal to noise ratio) will need to be collected for each SF and at different distances to characterize the RYLR896 module’s characteristics and to integrate them into the ns-3 LoRaWAN module to perform more accurate simulations for nodes that make use of the RYLR896. Data will be obtained from nodes that will represent a Gateway and an End Device, which will periodically send a packet one-way to obtain data. These nodes will have the following hardware architecture.

Figure 3. Node hardware architecture

Data collection will be conducted as follows: our Receiver and Sender RYLR896 modules will start off at a distance of about 4 KM. The objective of the initial phase is to be far enough that no packets are received by the Receiver module. The distance between the Receiver and Sender will be reduced by about 500m by bringing the modules closer to each other. At each distance we will be setting the SF to 7,8,9,10,11, and 12 while collecting at every SF the power at the receiver end, number of packets received at the receiver end and the distance between the Sender and Receiver. With the number of packets received we will be able to calculate the percentage of packets lost.

LoRa Propagation Loss Model Development

Since a LoRa channel from the ns-3 module is able to utilize a propagation loss model native from ns-3, it is natural to think about extending the functionality of native propagation loss models to take into account distance and SF of sending and receiving nodes, or gateway and end device. To achieve this, a class that inherits from the native ns-3 module was developed to include a SF variable that needs to be updated with the specific SF that the channel is using, and will return the theoretical receiving power according to the propagation loss that the packet would suffer based on the datasets described in the previous section. By using inheritance from the native ns-3 propagation loss model, we are able to use the LoRa Propagation Loss model (child class) interchangeably with the other non-LoRa native ns-3 propagation loss models without the need to make further changes for compatibility to the LoRaWAN module’s source code.

References

  • [1] U. Raza, P. Kulkarni and M. Sooriyabandara, "Low power wide area networks: An overview", IEEE Commun. Surveys Tuts., vol. 19, no. 2, pp. 855-873, 2017.
  • [2] D. Magrin, M. Centenaro and L. Vangelista, "Performance evaluation of LoRa networks in a smart city scenario," 2017 IEEE International Conference on Communications (ICC), Paris, France, 2017, pp. 1-7, doi: 10.1109/ICC.2017.7996384.
  • [3] F. Van den Abeele, J. Haxhibeqiri, I. Moerman and J. Hoebeke, "Scalability Analysis of Large-Scale LoRaWAN Networks in ns-3," IEEE Internet of Things Journal, vol. 4, no. 6, pp. 2186-2198, Dec. 2017, doi: 10.1109/JIOT.2017.2768498.
  • [4] Semtech, “SX1276 Product Details”. [Online]. Available: https://www.semtech.com/products/wireless-rf/lora-connect/sx1276/
  • [5] Reyax Technology, “RYLR896 Specification”. [Online]. Available: https://reyax.com/products/rylr896/
  • [6] A. Gutiérrez-Gómez et al., “A Propagation Study of LoRa P2P Links for IoT Applications: The Case of Near-Surface Measurements over Semitropical Rivers,” Sensors, vol. 21, no. 20, p. 6872, Oct. 2021, doi: 10.3390/s21206872. [Online]. Available: http://dx.doi.org/10.3390/s21206872
  • [7] G. Codeluppi, A. Cilfone, L. Davoli, and G. Ferrari. “LoRaFarM: A LoRaWAN-Based Smart Farming Modular IoT Architecture,” Sensors, vol. 20, no. 7, p. 2028, Apr. 2020, doi: 10.3390/s20072028. [Online]. Available: http://dx.doi.org/10.3390/s20072028
  • [8] V. Talla, M. Hessar,B. Kellogg, A. Najafi, J. Smith and S. Gollakota. “LoRa Backscatter: Enabling The Vision of Ubiquitous Connectivity”. Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies. May 2017, doi: 10.1145/3130970. [Online]. Available: https://doi.org/10.1145/3130970
  • [9] Rylr896|Reyax Technology (no date) RYLR896|REYAX TECHNOLOGY. Available at: https://reyax.com/products/rylr896/" (Accessed: March 12, 2023).
  • [10] Meaney, D. (2023) Lora and Lorawan timing, ECS Inc. [Online]. Available: https://ecsxtal.com/lora-lorawan-timing/" (Accessed: March 12, 2023).
  • [11] Ns-3 LoRaWAN Module Documentation. Signet Lab. [Online]. Available: https://signetlabdei.github.io/lorawan-docs/models/build/html/lorawan.html
  • [12] D. Magrin. “LoRaWAN Simulations Using ns-3”, Department of Information Engineering, University of Padova, Italy. [Online]. Available: https://www.nsnam.org/tutorials/consortium19/wns3-lorawan.pdf
  • [13] What is Lora®? (no date) Semtech. Available at: https://www.semtech.com/lora/what-is-lora (Accessed: March 12, 2023).