Skip to Content
Future InternetFuture Internet
  • Article
  • Open Access

17 August 2023

An Efficient Adaptive Data-Link-Layer Architecture for LoRa Networks

,
and
1
Center of Physics, University of Minho, 4804-533 Guimarães, Portugal
2
CMEMS-UMinho/LABBELS, University of Minho, 4800-058 Guimarães, Portugal
3
Centro Algoritmi/LASI, University of Minho, 4804-533 Guimarães, Portugal
*
Authors to whom correspondence should be addressed.

Abstract

LoRa is one of the most popular low-power wireless network technologies for implementation of the Internet of Things, with the advantage of providing long-range communication, but lower data rates, when compared with technologies such as Zigbee or Bluetooth. LoRa is a single-channel physical layer technology on top of which LoRaWAN implements a more complex multi-channel network with enhanced functionalities, such as adaptive data rate. However, LoRaWAN relies on expensive hardware to support these functionalities. This paper proposes a LoRa data-link-layer architecture based on a multi-layer star network topology that adapts relevant LoRa parameters for each end node dynamically taking into account its link distance and quality in order to balance communication range and energy consumption. The developed solution is comprised of multiple components, including a LoRa parameter calculator to help the user to configure the network parameters, a contention-free MAC protocol to avoid collisions, and an adaptive spreading factor and transmission power mechanism. These components work together to ensure a more efficient use of the chosen ISM band and end node resources, but with low-cost implementation and operation requirements.

1. Introduction

Low-power wide-area networks (LPWANs) play a key role in the implementation of the IoT (Internet of Things) concept, and LoRa (which stands for “long range”) is among the most popular of these technologies [1]. LoRa defines a spread spectrum modulation technique based on the chirp spread spectrum (CSS) [2]. Covering the physical layer of the OSI (open systems interconnection) model, it makes use of the sub-gigahertz ISM (industrial, scientific, and medical) bands to enable low-power and long-range communication that can reach up to 10 km in rural areas.
The LoRaWAN open specification [3] is built over the LoRa physical layer, providing upper-layer protocols and the means to connect the LoRa devices (end nodes) to the Internet. It defines the device-to-infrastructure LoRa parameters and the LoRaWAN protocol, allowing for interoperability between devices. LoRaWAN has established itself as one of the main IoT communication stacks for low-power and lossy networks (LLNs).
The LoRaWAN network architecture consists of a star-of-stars topology (see Figure 8 in [2]), where gateways forward packets from end nodes (usually, data collected from sensors) to a network server and vice versa. The network server manages the network by performing functions such as deduplicating received packets and controlling the data rate. The data can then be accessed by the user through the Internet on application servers and cloud services.
While LoRa is a single-channel point-to-point (P2P) technology, LoRaWAN is a more complex multi-channel network where several low-cost end nodes may communicate simultaneously with high-cost LoRaWAN gateways using different channels and spreading factors (SFs). The LoRaWAN protocol controls the LoRa physical layer through the implementation of useful functionalities such as adaptive data rate (ADR), which manages the transmission power and spreading factor according to the received packet SNR (signal-to-noise ratio). However, it relies on expensive hardware to support these functionalities.
A functional LLN can be implemented on top of LoRa, instead of relying on LoRaWAN, and this may be a reasonable approach for simple network topologies (such as star) in low-power applications. By following this method, one can detach the network from a specific LoRaWAN infrastructure, which leads to lower costs. However, most works that pursue this approach do not consider adopting a mechanism similar to ADR from LoRaWAN, relying instead on a fixed physical layer parameter set. This leads to inefficient use of networks and end node resources, such as bandwidth and energy, which may be critical for the lifetime of end nodes, since they are typically battery-operated in many application scenarios.
Implementing an efficient LLN on top of LoRA requires a deep knowledge of the physical layer parameters and the development of a data-link-layer protocol. Transmission power (TxP), spreading factor (SF) and bandwidth (Bw) are three important and intrinsically related LoRa parameters because they have impact on range, data rate, and energy consumption. For example, a high TxP provides a long communication range but increases the energy consumption, and a higher SF increases the range but reduces the data rate (which can impact throughput), whereas increasing the used Bw increases the data rate but reduces range.
Our contribution in this paper is the proposal and evaluation of a LoRa data-link-layer architecture based on a multi-layer star network topology that dynamically adjusts the LoRa parameters of each end node taking into account the SNR in order to balance its communication range and energy consumption. The designed architecture takes into account that the end nodes usually are placed at different distances from the gateways and, therefore, require different parameter configurations to achieve a satisfactory link quality. The proposed architecture ensures efficient use of the chosen ISM band and low-cost implementation and operation, i.e., without requiring the use of third-party LoRaWAN services or infrastructure.
The rest of this paper is organized as follows: Section 2 identifies the related work, whereas Section 3 provides the background regarding the relevant LoRa parameters. Section 4 describes the proposed link layer architecture and each of its components, whereas Section 5 presents the results and discussion. Finally, Section 6 outlines the conclusions and suggestions of future developments.

3. LoRa Parameter Background

To develop an efficient LoRa data-link-layer protocol, it is necessary to control SF, Bw, and other main LoRa parameters. This is performed by LoRaWAN to implement useful functionalities, such as ADR, which manages the TxP and SF according to the received packet SNR.
LoRaWAN allows the selection of bandwidths in the range between 125 and 500 kHz for uplink packets. On the other hand, the range of available bandwidths for LoRa networks is larger, with values that can go as low as 7.8 kHz. The TxP impacts the link budget directly, and its value depends on the hardware implementation and the regional limitations, where its maximum value may range from 14 to 20 dBm. The spreading factor (SF), which can vary from 7 to 12, defines the number of chips per symbol, and each step up doubles the symbol period, as shown by Equation (1), where Bw is in Hz [19].
S y m b o l p e r i o d = 2 S F B w ( s )
For a LoRa node to receive a packet, it must perform CAD using the same SF and Bw of the sending node. This operation takes a time expressed in the transceiver datasheet [20] as a multiple of the LoRa symbol period.
These parameters have impact on communication throughput, range, and energy consumption. As shown by Equation (1), using a higher Bw decreases the symbol period (and, consequently, increases the data rate), which allows us to increase the network throughput. A higher data rate decreases the time on air (ToA) for the packets, which means that less energy is spent to transmit them. On the other hand, the communication range decreases when Bw increases.
A higher TxP provides a longer communication range but increases energy consumption. Therefore, this parameter should be controlled to adequately balance communication range and energy consumption.
Increasing the SF increases the symbol period (Equation (1)), so the data rate is reduced. Equation (2), derived from [19], shows that a higher SF increases the processing gain of the receiver, and thus communication range is also increased. However, as seen in Equation (3), each step up of SF divides the bit rate approximately by half and, consequently, the ToA of each packet is roughly doubled. This means that more energy is required to send packets with higher spreading factors. Therefore, the SF is another LoRa parameter that can be used to balance the range and the energy consumption.
P r o c e s s i n g g a i n = 10 × l o g 10 2 S F S F ( d B )
B i t R a t e = S F × B W 2 S F × C R ( b p s )
Other relevant LoRa parameters are the coding rate (CR) and header mode, which is largely application dependent. The CR improves communication robustness by performing forward error correction (FEC); its possible values in Equation (3) range from 4/8 (higher robustness) to 4/5 (lower robustness). The header mode can be implicit, implying a fixed payload length, or explicit, giving the freedom of arbitrary payload sizes.

5. Results and Discussion

For evaluation of the proposed solution in a real-world scenario, the end node functionalities were implemented in a printed circuit board (PCB) based on the STM32L0 microcontroller, with an RFM95W LoRa module and a soil moisture sensor connected to it, while the packet forwarder used the same LoRa module but was connected to a Raspberry Pi Zero W and resorted to Wi-Fi to send the received packets to the web server using the CoAP (constrained application protocol) application layer protocol. Figure 9 shows the hardware implemented for these two LoRa devices.
Figure 9. Hardware of the end node (on the left) and the packet forwarder (on the right).
The Raspberry Pi Zero W module is compatible with the IEEE 802.11 b/g/n wireless LAN standards. The maximum bit rate supported by the IEEE 802.11g standard is 54 Mbps, and the IEEE 802.11n allows even higher bit rates. According to Equation (3), the maximum LoRa bit rate is less than 22 kbps. That means that the Wi-Fi bit rate is several orders of magnitude higher than the necessary to forward the packets to the Web server. This is expected, since Wi-Fi is a wireless network optimized for performance, whereas LoRa is optimized for low resource requirements (such as energy consumption, since the LoRa-based end nodes are normally designed to operate with batteries). On the other hand, the packet forwarders are designed to be connected to the power grid, so they do not have the same restrictions.
Regarding the implementation of the MAC protocol, it supports up to 65,535 packet forwarders, where each network was configured to support up to 254 end nodes. Notice that this limitation is due to the use of a 8-bit short end node address and the reservation of two addresses. In terms of network scalability, the number of supported end nodes may be higher, as explained in the next paragraph. The data consists of a fixed 4-byte payload (implicit header mode) that contains soil moisture information, and the superframe period and data packet interval were set to the same value (1 h). Table 1 shows an example of the values of relevant fields of the packets presented in Figure 7 for this application scenario.
Table 1. Protocol applied to a real-world scenario.
The maximum number of end nodes supported by a network in the proposed solution is application-dependent. It will depend on several parameters configured by the network administrators with the help of the LoRa parameter calculator. Each end node reserves a superframe slot in the proposed MAC protocol. According to Equation (7), the number of slots generated by the MAC protocol increases in powers of two (2, 4, 8, and so on). Therefore, as an example, with a maximum ToA of 4000 ms (4 s) and the MAC superframe period (and data packet interval) of 1 h (3600 s), which is the value adopted in the implemented prototype, the maximum number of end nodes supported by the network would be 512 (the highest power of two below 900).
The network parameters were obtained by feeding the LoRa parameter calculator the maximum ToA of 1000 and 4000 ms, packet size of 8 bytes, coding rate of 4/5, and processing time needed to perform an iteration of the ASFS algorithm by the gateway of 10 µs. During each iteration, the algorithm finds the available options and selects those that fit the criteria, providing them to the user in a CSV file. The user may then decide if they want a lower link budget that provides a faster and more energy efficient option, allowing also more messages to be sent per superframe, or the opposite option, which maximizes the range at the cost of lower data rate and energy efficiency. These two options can be observed in Table 2.
Table 2. Results obtained with the LoRa parameter calculator.
By observing Table 2, we can also note how the proposed ADL mechanism is able to provide a more efficient use of the medium and a smaller end node’s energy expense, in comparison to approaches that do not adjust the SF dynamically and, especially those that used the same fixed SF value for all the end nodes. In many cases, the end nodes are located in close enough proximity to the gateway, enabling them to communicate with a smaller SF while sustaining a reliable link to the gateway. By comparing the ToA of the lowest SF to the highest, we can see that an adaptive approach may decrease the ToA up to around nine times, resulting in much smaller energy consumption and use of the ISM band. On the other hand, if a fixed small SF value is used, we are not taking advantage of a larger link budget to support longer communication ranges when necessary or to overcome link quality fluctuations.
In Figure 10 and Figure 11, we can observe the relation between the sensitivity (where a lower value means more sensitive) and ToA for different spreading factors and CR fixed at 4/5. The four points of each curve/SF correspond to bandwidths of 125, 62.5, 41.7, and 31.25 kHz, respectively, from the top left to the bottom right of the graphs. The graphs clearly show that both sensitivity and ToA increase as SF also increases, with the former increasing 2 to 3 dBm for each SF step up, while the latter increases very strongly as SF increases. Consequently, having smaller spreading factors when possible can heavily decrease ToA and, consequently, energy consumption. In case smaller values of CR are used (4/6 through 4/8), ToA increases (as is shown in Figure 12 and Figure 13), but the sensitivity is not affected.
Figure 10. Relation between sensitivity and ToA for SFs 7 through 9, with CR = 4/5 and Bw ∈ {125, 62.5, 41.7 and 31.25} kHz.
Figure 11. Relation between sensitivity and ToA for SFs 10 through 12, with CR = 4/5 and Bw ∈ {125, 62.5, 41.7 and 31.25} kHz.
Figure 12. Relation between coding rate and ToA for SFs 7 through 9 (with Bw = 125 kHz).
Figure 13. Relation between coding rate and ToA for SFs 10 through 12 (with Bw = 125 kHz).
Figure 12 and Figure 13 show the relation between the coding rate and ToA for different spreading factors, where Bw is fixed at 125 kHz, where we can conclude the ToA increases proportionally with each increase in CR and that the extra error correction provided by the coding rate might be worth the extra ToA and power consumption.

6. Conclusions

In this work, the design and implementation of a data-link-layer architecture based on the LoRa physical layer was presented. The proposed solution is able to manage the spreading factor and transmission power dynamically according to the measured link quality, ensuring efficient utilization of the device and ISM band resources. Along with it, a LoRa parameter calculator was developed to aid the user to configure the physical layer parameters in accordance with the necessities of the target application.
The developed architecture poses itself as a viable and low-cost alternative to the LoRaWAN stack, where some of its important features are replicated, such as the ability to efficiently manage the network and end node resources. It also upgrades the P2P LoRa link by controlling the end nodes’ link budget dynamically and individually, enhancing network robustness by adding downlink ACK packets and allocating resources for contention-free data transmission, so that network performance is not degraded with an increasing number of nodes while complying with the ISM band restrictions.
Even though the developed work is promising, some improvements can be made, such as the adaptation of the proposed architecture to a mesh network topology for increased network coverage and robustness. The integration of the packet forwarder into the LoRaWAN stack may also provide some advantages, such as easing the interoperability with already-developed applications that use this stack and extending the network coverage. The integration of security mechanisms in the data link protocol should also be a relevant step to improve its usefulness.

Author Contributions

Conceptualization, M.C., S.F.L. and J.A.A.; methodology, M.C. and S.F.L.; software, M.C.; validation, M.C.; investigation, M.C. and S.F.L.; resources, S.F.L.; writing—original draft preparation, M.C., S.F.L. and J.A.A.; writing—review and editing, M.C., S.F.L. and J.A.A.; supervision, S.F.L.; funding acquisition, S.F.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by FEDER through COMPETE2020—Programa Operacional Competitividade e Internacionalização (POCI) grant number POCI-01-0145-FEDER-028247 and by FCT—Fundação para a Ciência e Tecnologia within the R&D Units Project Scope: UIDB/00319/2020.

Data Availability Statement

The data presented in this study are available within this article.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Mekki, K.; Bajic, E.; Chaxel, F.; Meyer, F. A comparative study of LPWAN technologies for large-scale IoT deployment. ICT Express 2019, 5, 1–7. [Google Scholar] [CrossRef]
  2. Semtech. LoRa and LoRaWAN: A Technical Overview. Available online: https://lora-developers.semtech.com/documentation/tech-papers-and-guides/lora-and-lorawan/ (accessed on 5 December 2022).
  3. LoRa Alliance. LoRaWAN 1.0.4 Specification Package. Available online: https://lora-alliance.org/resource_hub/lorawan-104-specification-package/ (accessed on 5 December 2022).
  4. Kenyeres, M.; Kenyeres, J. Average Consensus over Mobile Wireless Sensor Networks: Weight Matrix Guaranteeing Convergence without Reconfiguration of Edge Weights. Sensors 2020, 20, 3677. [Google Scholar] [CrossRef] [PubMed]
  5. Adefemi Alimi, K.O.; Ouahada, K.; Abu-Mahfouz, A.M.; Rimer, S. A Survey on the Security of Low Power Wide Area Networks: Threats, Challenges, and Potential Solutions. Sensors 2020, 20, 5800. [Google Scholar] [CrossRef] [PubMed]
  6. Ali, T.A.A.; Choksi, V.; Potdar, M.B. Precision Agriculture Monitoring System using Green Internet of Things (IoT). Int. J. Res. Appl. Sci. Eng. Technol. 2018, 6, 2961–2970. [Google Scholar] [CrossRef]
  7. Co, J.; Tiausas, F.J.; Domer, P.A.; Guico, M.L.; Monje, J.C.; Oppus, C. Design of a Long-Short Range Soil Monitoring Wireless Sensor Network for Medium-Scale Deployment. In Proceedings of the TENCON 2018—IEEE Region 10 Annual International Conference, Jeju, Republic of Korea, 28–31 October 2018; pp. 1371–1376. [Google Scholar]
  8. Nico, N.G. Development of Low-cost LoRaWAN Gateway for Private Deployments. Master’s Thesis, Instituto Superior Técnico, Lisbon, Portugal, November 2017. [Google Scholar]
  9. Xia, X.; Hou, N.; Zheng, Y.; Gu, T. PCube: Scaling LoRa Concurrent Transmissions with Reception Diversities. ACM Trans. Sens. Netw. 2022, 18, 66. [Google Scholar] [CrossRef]
  10. Wang, Y.; Zhang, F.; Zheng, X.; Liu, L.; Ma, H. Decoding LoRa Collisions via Parallel Alignment. ACM Trans. Sens. Netw. 2023, 19, 62. [Google Scholar] [CrossRef]
  11. Loubany, A.; Lahoud, S.; Chall, R. Adaptive algorithm for spreading factor selection in LoRaWAN networks with multiple gateways. Comput. Netw. 2020, 182, 107491. [Google Scholar] [CrossRef]
  12. Finnegan, J.; Farrell, R.; Brown, S. Analysis and Enhancement of the LoRaWAN Adaptive Data Rate Scheme. IEEE Internet Things 2020, 7, 7171–7180. [Google Scholar] [CrossRef]
  13. Islam, A.; Akter, K.; Nipu, N.J.; Das, A.; Rahman, M.M.; Rahman, M. IoT Based Power Efficient Agro Field Monitoring and Irrigation Control System: An Empirical Implementation in Precision Agriculture. In Proceedings of the 2018 International Conference on Innovations in Science, Engineering and Technology (ICISET), Chittagong, Bangladesh, 27–28 October 2018; pp. 372–377. [Google Scholar]
  14. Gloria, A.; Dionisio, C.; Simoes, G.; Sebastiao, P.; Souto, N. WSN Application for Sustainable Water Management in Irrigation Systems. In Proceedings of the IEEE 5th World Forum on Internet of Things (WF-IoT’19), Limerick, Ireland, 15–18 April 2019. [Google Scholar]
  15. Kim, S.; Lee, H.; Jeon, S. An Adaptive Spreading Factor Selection Scheme for a Single Channel LoRa Modem. Sensors 2020, 20, 1008. [Google Scholar] [CrossRef] [PubMed]
  16. Rahman, M.; Saifullah, A. Boosting Reliability and Energy-Efficiency in Indoor LoRa. In Proceedings of the 8th ACM/IEEE Conference on Internet of Things Design and Implementation (IoTDI ’23), San Antonio, TX, USA, 9–12 May 2023; pp. 396–409. [Google Scholar]
  17. Marjasz, R.; Połys, K.; Strzoda, A.; Grochla, K. Improving Delivery Ratio in LoRa Network. In Proceedings of the 19th ACM International Symposium on Mobility Management and Wireless Access (MobiWac ’21), Alicante, Spain, 22–26 November 2021; pp. 141–146. [Google Scholar]
  18. Gamage, A.; Liando, J.; Gu, C.; Tan, R.; Li, M.; Seller, O. LMAC: Efficient Carrier-Sense Multiple Access for LoRa. ACM Trans. Sens. Netw. 2023, 19, 44. [Google Scholar] [CrossRef]
  19. Semtech. LoRa Modulation Basics, AN1200.22. Available online: https://web.archive.org/web/20190718200516/https://www.semtech.com/uploads/documents/an1200.22.pdf (accessed on 10 March 2020).
  20. Semtech. Reading Channel RSSI during a CAD, AN1200.21. Available online: https://studylib.net/doc/18373650/an1200.21-reading-channel-rssi-during-a-cad (accessed on 24 February 2020).
  21. GitHub Repository. LoRa Air-Time Calculator. Available online: https://github.com/ifTNT/lora-air-time (accessed on 1 June 2020).
  22. Karl, H.; Willig, A. Protocols and Architectures for Wireless Sensor Networks; John Wiley & Sons: Hoboken, NJ, USA, 2007. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.