An Analytical Model for Multihop LoRaWAN Networks

LoRaWAN is one of the most popular LPWAN technology due to the facility to implement applications that require a low cost, low energy consumption, low data rate, and large coverage area. A LoRaWAN network is composed of end-devices that transmit data to gateways, forming a single-hop star topology. Multihop networks are receiving the attention of the LoRaWAN community since it allows to extend the coverage area and improve the energy eﬃciency, thus prolonging the network lifetime. In this paper, we propose an analytical model for multihop LoRaWAN networks. We investigate the energy consumption, throughput, delay, and packet delivery ratio of single-hop and multihop relay networks. The results showed that the network performance could be improved with relay nodes, giving insights to new multihop proposals for LoRaWAN.


I. INTRODUCTION
Low Power Wide Area Networks (LPWANs) are being used in many Internet of Things (IoT) applications.The Long Range Wide Area Network (LoRaWAN) is a well-known LPWAN protocol developed to achieve the IoT aims in terms of longrange coverage area with low power energy consumption and low data rate [1]- [3].A LoRaWAN network has a star topology, where end-devices transmit data to gateways.Many works have shown that LoRaWAN may achieve several kilometers in some scenarios, such as open areas and rural environments.However, in areas with obstacles, buildings, or mountains, the performance will decrease.Dense networks with many devices also lead to poor performance due to interference and packet collisions.Thus, the network will consume more energy and present less reliability.
The LoRaWAN specification defines only one hop between the end-devices and the gateway [4], [5], although many studies have proposed multihop strategies for network expansion or improvements [6]- [11], where some devices act as relays or routers.Multihop communication is typically used to extend coverage and to improve the energy efficiency of the wireless networks, extending battery life and network lifetime.Multihop strategies may also improve scalability, network capacity, and reliability, which are relevant issues in LoRaWAN networks [6].Most of the related works in multihop LoRaWAN focus on practical implementations or network simulations with relay nodes or even router nodes [6].In this work, we present an analytical model for multihop LoRaWAN networks.The proposed model includes energy consumption, throughput, Packet Delivery Ratio (PDR), and delay.We used the proposed model to provide an analytical comparison between the regular star topology with a linear multihop network.The comparison considers a multihop J. R. Cotrim and J. H. Kleinschmidt are with Center of Engineer, Modeling and Applied Social Sciences, Federal University of ABC, Santo Andr é, Brasil (email:jeferson.cotrim@ufabc.edu.brscenario composed of relay devices and shows the network improvement with the approach.The results obtained may give new insights into multihop proposals for LoRaWAN.
The remainder of this paper is organized as follows: Section II presents the LoRaWAN protocol in detail and includes the related work.Section III describes the proposed model.Section IV shows the scenario that will be used for the analytical comparison and the results.Section V makes the final considerations and presents the future work.

II. THE LORAWAN PROTOCOL
LoRaWAN is a data link layer protocol developed by LoRa Alliance to provide long-range connectivity with low power consumption [4].The protocol uses the Long Range (LoRa) physical layer developed by Semtech and is based on the Chirp Spread Spectrum (CSS) modulation technique [12].The CSS spread the data along the frequency using different Spreading Factor (SF), from 7 to 12.The SFs are orthogonal, guaranteeing no interference between different SFs using the same transmission frequency.The data spreading along the frequency provides a large coverage area.However, the total time to transmit a packet increases with a higher SF.The side effect is sending fewer data in each packet to avoid collisions in the air interface.
The default LoRaWAN network topology is a stars-of-stars with all devices sending their data to a gateway.The network is composed of end-devices, gateways, and a LoRaWAN Network Server.The end-device is responsible for data collection and actuation.The gateway receives all end-devices packets and forwards them to the Network Server.The LoRaWAN Network Server comprises three main elements: the network server, the application server, and the join server.The network server is responsible for the LoRaWAN network management, including end-devices address check, acknowledgment, frame count, etc.The application server is responsible for connecting the arrival packets from end-devices to the related application.The Join Server manages the end-devices authentication process.Figure 1 presents the default LoRaWAN architecture [13].

LoRaWAN Network Server
Network S.
App S.
Join S.

Fig. 1: LoRaWAN network
There are, by standardization, three modes of operation in LoRaWAN called classes.Class A is the primary mode where an end-device could transmit at any time, and after every transmission, it must open two reception windows to receive possible downlink packets.The first window always opens.However, the second window opens only if the first window does not receive any packet.Class B introduces more reception windows, with a mechanism of synchronization based on beacons, for applications that need more actuation.Class C keeps the reception radio on all the time except when the end-device is transmitting.It is highly recommended that only non-energy-constrained devices use the Class C mode.All data messages could be confirmed or unconfirmed.Confirmed messages must be acknowledged by the receiver, while unconfirmed messages do not require any acknowledgment.
Although the LoRaWAN standard defines only single-hop communication of the end-device to the gateway, many researchers studied the limitations of the protocol [14] and proposed different solutions for multihop LoRaWAN.These approaches include using intermediate devices such as relays or routers between the transmitter end-device and the receiver gateway.Some works presented solutions applying usual routing protocols or adapted versions of common routing protocols as [7] and [8].The work presented in [9] summarizes and analyzes the routing proposals for LoRaWAN.Some other works present a multihop solution using relay nodes as [10] and [11].In [6], the authors review the related work in routing and relay solutions for LoRaWAN networks.The authors also present a classification of the devices and possible topologies for multihop networks.
In terms of energy consumption, few works presented an analytical model for the LoRaWAN.However, they focused on a model of the end-node energy consumption such as [15].In [16], the authors evaluate the LoRa energy performance, not considering the LoRaWAN specification.In [17], the authors presented a model for energy performance considering only the regular star-of-star topology.

III. THE MULTIHOP LORAWAN MODEL
In this section, we present the proposed model to describe the behavior of multihop LoRaWAN networks.First of all, we introduce the channel model adopted and the losses probability.Then it is described the energy consumption of the end-devices, the intermediate devices (relay and router), and the network.The model also describes the network throughput, Packet Delivery Ratio (PDR) and packet delay.We adopted the nomenclature proposed in [6], where the devices are classified according to their functions and hardware used.A device (enddevice, relay-device, or router-device) is hardware and energyconstrained, and it has one radio available.A gateway is a multi-radio and non-constrained device, although it needs a reliable power source.The gateway connected to the network server is the main-gateway, and the intermediate gateways are called relay-gateway (relay-gtw) or router-gateway (routergtw).

A. Channel Model
A basic transmission system is composed of a transmitter, a receiver, and channel characteristics.The system is modeled by equation P Rx = P T x + G − P Loss , where P Rx is the reception power, P T X is the transmission power, G is the sum of the antennas gains and P Loss refers to path loss.Some related works presented channel models for LoRaWAN, although they describe a specific scenario unsuitable for general modeling.The authors of [18] presented one of the first propagation models for LoRa based on measurements in Oulu city, Finland.The works presented in [19]- [22] used measurements in urban and indoor scenarios to compare the results with the well-known propagation models like Okumura-Hata.The comparison gives a relevant guide to understanding the LoRa propagation behavior, although it is limited for specific scenarios.Because of the absence of a general channel model to describe LoRaWAN, the presented work adopted the channel model described for the IEEE 802.11ah standard also called WiFi HaLow [23].The model defines the path loss for outdoor and indoor scenarios.The 802.11ah channel model was already used in other LoRaWAN works, such as [24], and is suitable to LPWANs in the sub-GHz band with 900 MHz central frequency [25].The outdoor model is subdivided into three possibilities of path loss: Macro, Pico, and Device-to-Device.The Macro model considers an antenna deployment of 15 meters above the rooftop, and the path loss is given by The Pico model assumes the antenna height at the rooftop level, and the path loss is defined as The Device-to-Device model considers all devices at the same level and the antennas at 1.5m above the floor.The Device-to-Device path loss is calculated by the equation The channel model includes the indoor equations, although it will not be presented since the model evaluation only considers the outdoor scenarios.We consider the end-devices and gateways are capable of identifying and solving the problems caused by a noisy channel, multipath, fading, etc.The main objective of this approach is to focus on the problems associated with the data link layer and the LoRaWAN protocol.

B. Probability of Success
The probability of a packet to be successfully delivered on a LoRaWAN network is directly associated with the ALOHA protocol performance [26].The ALOHA efficiency is defined as where λ is the data rate of the network and the 2 * T oA refers to the vulnerable time of a packet to be transmitted.The vulnerable time is the slot of time the transmitted packet could collide with another packet into the air interface.The Time on Air (ToA) values, adopted in this work, follows the definitions at the Semtech documentation available at [12].Another factor that impacts the success of a message to reach the destination is the capabilities of the receiver to receive the packet.In general, LoRaWAN gateways work with multi-channel devices that mean they could receive messages at different frequencies.However, for relays or routers, there is a possibility the receiver has only one radio to be shared between transmission and reception.In this case, the intermediate device could drop packets during the transmission period, decreasing the packet delivery probability of success.We assume a single radio intermediate device uses a Markovian queue scheme with one server.The probability of a device is free to receive a packet is defined by P f ree = 1 − ρ, where ρ is the server utilization defined as the relation of arrival rate (Λ) per service rate (µ), ρ = Λ µ .The service rate is equal to µ = 1 T oA , and the arrival rate is defined as where P ckt T x is the number of transmitted packets, P Success is the probability of a packet successfully arriving on the receptor, and T T otal is the total time of analysis.
Based on the probability of success and the probability of the server being available, it is possible to define the number of collided packets as P ckt collide = P ckt T x * (1−P Success ), and the number of packet lost by congestion as P ckt congestion = P ckt T x * P Success * (1 − P f ree ).The sum of packets lost by collision and congestion is equal to the total number of packets lost P ckt lost , that will be the same number of retransmitted packets P ckt Re T x , then P ckt Re T x = P ckt lost = P ckt collide + P ckt congestion (6) The total number of packets sent by an end-device, including the possible retransmitted ones when they are sent in confirmed mode is defined by P ckt All T x = P ckt T x + P ckt Re T x .If the device is sending unconfirmed messages, there will be no retransmissions, then P ckt Re T x = 0.
We can also define the number of packets successfully delivered as P ckt Delivered = P ckt T x * P success * P f ree + P ckt Re T x * P success * P f ree ∴ P ckt Delivered = (P success * P f ree )(P ckt T x + P ckt Re T x )

C. Energy Consumption
The energy spent in a single transmission E T x is the ToA multiplied by the transmission power P T x , so E T x = T oA * P T x The transmission power P T x is upper limited by LoRa regional parameters and inferior limited by the radio specifications.The ToA is the period of time each transmission uses the air interface and its changes according to the SF, bandwidth, and payload size.
The energy spent in reception E rx is equal to the time spent listening for incoming packets T Rx multiplied by the radio power spent for this activity P Rx , then E rx = P Rx * T Rx .T Rx depends on the technique the end-device or the intermediate device uses to open the reception window.For the default class A LoRaWAN the end-device open one or two reception window after every transmission and the size of each window is, at least, the sufficient time to receive a packet.It means the total energy spent in reception depends on the total number and size of opened windows.The intermediate nodes need to keep the reception window open to listen for every packet arrival that must be forwarded.In the simplest case, the intermediate device will keep the radio listening for an incoming packet all the time except when it is transmitting.On the other hand, in the best-case scenario, the intermediate device and end-nodes are synchronized.However, a mechanism to synchronize the devices could be very complex and energy inefficient.
The most common operation mode in LoRaWAN is the Class A method, which defines that after every transmission, the end-device opens one or two reception windows.The enddevice must open the first reception window, although the second one is opened only if the end-device do not receive any message on the first window.The end-device energy consumption is defined by where P ckt All T x refers to the sum of all messages sent by the end-device, including possible retransmission and acknowledgments.The E Rx1 is the energy spent to receive packets in the first reception window, and the number of opened windows n W 1 is equal to the total packets sent P ckt All T x .The E Rx2 is the energy spent in the second reception window, and the number of opened windows n W 2 is equal to or less than the number of first reception window n W 1 opened.The T Rx for the first and second windows are equal to the ToA of the received message.
The relay function energy consumption is composed of the energy spent forwarding packets (uplink, downlink, and acknowledgment messages), listening to the incoming messages, and the energy spent to process all the messages.Equation 9defines the energy consumption of the relay where P ckt All T x is the number of forwarded messages and is defined by The P ckt All T x includes all original uplink and downlink forwarded messages, the possible retransmission, and all acknowledgments.The energy spent processing the messages (E P ) depends on the device, and its value needs to be checked at the respective datasheet.
The energy spent for reception E Rx relay is calculated according to the implemented listening mechanism of the relay.In the present work, we consider the relay and enddevices are synchronized.Then the reception energy could be defined as The router function energy consumption is very similar to the energy consumption of the relay function.The difference is about the energy spent to create and update the routes.The router-device energy consumption is defined as (11) where E f ormation and E update are dependent on the routing protocol used.The reception energy consumption, as well as for relay, depends on the mechanism adopted by the device.
LoRaWAN network uses a star topology which means the energy consumption of the entire network using class A end-devices is the sum of all individual end-devices energy consumption.Considering a network that includes relays and routers, the energy consumption of these new devices must be added to the network energy consumption.The network energy consumption is defined as the sum of the energy spent by end-devices, relays, and routers.
where n ED , n Relay and, n Router refer to the total number of end-devices, relays, and routers on the network.Equation 12generalizes the network energy consumption, although it is necessary to consider the special case when the relay-gtw or router-gtw are used.Due to using a fixed power supply to these devices, their energy consumption must be disregarded.
The last equations presents the devices and network energy consumption providing information about the behavior of the device.However, it is also relevant to analyze the energy cost to transmit a packet through the network, defined as the sum of energy spent by end-device and intermediate devices to transmit, and the energy spent by the intermediate devices to receive the packet to be forwarded.
We adopt the packet cost as the sum of all transmissions, counting the end-device that originates the packet and all the intermediate devices that will forward the message; and all the energy spent by the intermediate devices to receiving.We also consider the sum of the energy spent to process the packet in every intermediate device.If a packet is transmitted directly to the gateway, the energy cost to receive and process the packet is equal to zero because no relay is used in the transmission path.

D. PDR, Throughput, and Delay
The PDR definition is the ratio between the delivered packets and the packets sent by the transmitter.The number of packets that arrived at the destination is the ones that do not collide with any other packet on the air interface and, after that, encounter the receiver free to receive packets.Considering the multihop scenario, the network PDR is directly related to the number of hops a packet pass until being delivered to the main gateway.Equation 14 defines the PDR for the multihop scenario considering the sum of all delivered packets per hop.The P ckt F wd refers to the number of packets forwarded by the intermediate devices, where the maximum number of forwarded messages is equal to the number of messages the device received that is equal to the definition of P ckt Delivered .
With the already defined number of successfully delivered packets, we can define Equation 15 to calculate the network throughput for a determined time T T otal .
The packet delay is the sum of the time a packet spent on the air interface and the processing on every hop where T p is the time spent to process the packet by the intermediate device.

IV. EVALUATION
This section provides an analytical evaluation of the model proposed in section III.The evaluation compares the multihop solution using relays with regular LoRaWAN networks.The evaluation does not include the router model, because it is dependent on the adopted routing protocol.The simplest scenario for a relay analysis, and comprehension of the relay solution performance, is composed of one end-device, one relay, and one gateway.The relay scenario is compared with the default P ckt All T x (j) + P ckt F wd (i − 1) * P success (i) * P f ree (i) LoRaWAN with a single end-device sending messages directly through the gateway.Table I presents the values of delay and energy packet cost, for a single 50 Byte packet transmission for all the SFs.The P rx refers to the sensitivity of the receiver specified on the datasheet of the radio.The end-device is configured to use 14 dBm transmission power.We consider the relay-device could have one or two radios (single or dual radio) to comprehend the possible congestion effect caused by the impossibility of one relay receiving a packet due to the transmission activity.For comparison purposes, we consider the relay is capable of receiving all the incoming packets in a synchronized way.It means the time spent in listening mode is the incoming packet ToA.The delay is the total ToA to deliver a packet, disregarding the time spent in the relay to process the messages.The results, as expected, show the delay increases when the relay solution is adopted compared with the direct transmissions using the SF.The packet cost follows the behavior of the delay and increases for the relay solution.The maximum number of devices for unconfirmed and unconfirmed messages is calculated according to the maximum throughput of the network.The relay network using unconfirmed messages could have more devices than the regular network.On the other hand, the regular LoRaWAN using confirmed messages presents more devices than the relay solution.The maximum number of devices is limited by the ALOHA protocol, which means it is directly related to the number of lost packets.The usage of confirmed messages increases the total amount of messages sent by the end-devices due to the retransmissions.The increase of devices on the network will increase the number of new and retransmitted messages, and the consequence is the decreasing of the throughput.When we analyze the distances given in Table I, we notice the relay solution increases the coverage area.For example, a relay network using SF7 can cover almost the same area as direct communication using SF12.The single packet energy cost significantly decreases when the relay solution using SF7 is compared to direct transmission using higher SF.For example, the packet cost of the relay solution using SF7 is 5.66 mJ, and the direct solution using SF12 costs 66.05 mJ.The relay solution using SF7 also reduces the overall delay compared to the direct transmission using SF12.The results show the relay solution using SF7, for example, presents better results compared to the direct transmission using higher SFs.
The linear topology is characterized by the relays receiving messages from end-devices and receiving forwarded messages from only one relay.The analysis considers two linear scenarios represented by Figures 2(a) and 2(b), where the relays receive data from end-devices or another relay.The scenarios consider the main-gtw also receives data from end-devices.In both scenarios, end-devices and relays use SF7 to transmit.The analysis considers the maximum of three hops to a packet achieves the main-gtw based on Table I, where it is noticed that two relays cover almost the same area that a direct transmission using SF12.The comparisons are made with the direct communication where all end-devices transmit their packets using the same SF from 7 to 12.

SF7 SF7
End Figures 3 present the network energy consumption results.The dotted lines present the network results without relay and using a single SF, for comparison purposes.
The relay-devices consume more energy than direct transmission using SF7 but less than the others SFs.The relaygtw solution requires a fixed and reliable power source for a proper deployment.The effect of this approach is the network only considers the energy consumption of the end-devices, and because of the small SF, the energy consumption decreases compared to the other relay solutions and also the direct transmission.Because the network with relay-gtws considers just the energy spent from the end-devices, the number of relays does not change the network energy consumption.The network energy consumption is affected by the increase of relays but not by the number of radios per relay.The graphs overlaid the results for single or dual radio relaydevices.When we insert more relay-devices on the network,  the energy consumed by these devices affects the network energy consumption.With more relays, more end-devices could be used too, increasing the energy spent for listening and forwarding messages.However, it is relevant to notice that the higher number of end-device increases the packet collision and, consequently, decreases the number of incoming messages on the relays, decreasing its energy consumption.
The number of radios per relay becomes irrelevant because the increase of collisions decreases the number of incoming messages.It means the relay will be available for more time, even with one radio.The throughput decreases when relay-devices uses single radio hardware because the messages are dropped when the relay is forwarding another packet.When the relay is dual radio, the maximum throughput achieves the same value as the direct transmission using SF7 but with more devices on the network due to the separation of the total number of devices in two or three subnetworks.The relay-gtw behavior presents a better throughput compared to the other solutions especially using confirmed messages.The relay-gtw set different frequencies for each traffic type, one frequency to end-devices incoming packets and another frequency to packets from other relays.The solution using two relay-gtws splits the network into three subnetworks, each with one-third of the associated devices.This approach decreases the packet collision and, by consequence, increases the network throughput.
Figures 5 present the PDR analysis for the linear scenarios.The relay solutions present reliable results with similar values to the direct transmission with SF7.The relay-Gtw solution presents a better PDR because of the usage of separated frequencies to receive packets from end-devices and other relays.It means the relay-Gtw forwarded packets always arrive at the destination.A relevant analysis is the effect of the hop number on the PDR of remote devices.The evaluated scenario is the same shown in Fig. 2(b), with the difference that we increase the number of relays (and hops by consequence) for each test.All relays and the main-gtw receive packets from end-devices.For each hop test, we consider there are 100 end-devices associated with each relay and the main-gtw, sending 1 to 6 packets.Figure 6 shows the hop impact over the PDR of the enddevices located on the border of the network.
The PDR presented refers to the packets sent by the end- devices associated with the farther relay from the main-gtw.
Results show that the number of delivered packets decreases with the hop increasing and packets sent by the end-devices.In the worst-case scenario (100 end-devices sending 6 confirmed packets and 8 hops), the PDR of the remote end-devices is lower than 10%.In practice, it is possible to admit that, for some end-devices, their packet never achieves the destination.The previous linear comparisons consider all end-devices transmitting directly to the main-gateway are using the same SF.However, in practice, the end-devices SFs will be distributed following the Adaptive Data Rate (ADR) mechanism or set by the network administrator.For our comparison, we consider the SFs are distributed equally over the total number of end-devices.It means the networks always use the same number of end-devices per SF, for example, for a network with 600 end-devices each SF will have 100 end-devices.The scenarios used for comparison are the same presented in Figure 2.
Figure 7 presents the energy consumption for unconfirmed messages.The LoRaWAN presents a higher energy consumption than the relay solutions, because of the amount of energy spent by the end-devices that use higher SFs.The LoRaWAN network presents a better throughput than the relay-devices solution, but it is worse when compared with the relay-gtw.The end-devices distribution over the SFs guarantees the orthogonality usage between signals, decreasing the collision probability due to the decrease of the number of end-devices per SF and better throughput performance.The relay-gtw presents a better performance, because it uses a different frequency to forward the packets from the frequency used by the end-devices to transmit their packets.The PDR results confirm the better performance of the LoRaWAN network over the relay-device solution.However, it is relevant to notice that the relay solution produces good results for a lower number of end-devices.The relay-gtw presents a better performance because it allows different frequencies usage, one to forward packets from end-devices and another to forward packets from other relays.The PDR results are shown in Figure 9.

V. CONCLUSIONS
The present work proposed a mathematical model to generalize the behavior of multihop LoRaWAN.The model presented the packet delivery probability used to describe the energy consumption of the end-devices, relays, and routers.The model includes the network energy consumption and the packet cost.The network throughput, PDR, and packet delay are also part of the proposed model.
The analytical model validation for the proposed relay solution includes scenarios analysis based on the described topologies.The results showed the relay solution decreases the network energy consumption, improves the PDR and the throughput.The performance of these metrics proves the relay is suitable for LoRaWAN networks.The Relay-Device solution is beneficial for some scenarios, although it is necessary to consider the limitations associated with the device.If the scenario demands higher traffic, the relay could deplete the battery faster, and the immediate consequence is the partial isolation of the network.The energy constraints also impose limitations for smart features, some of them fundamental to better performance, such as the synchronization mechanism.Better results are achievable using Relay-Gtw, although it is relevant to notice that the solution requires a fixed and reliable power source.The usage of a Relay-Gtw opens the possibility to introduce a micro-server into the network that is helpful to decrease the control messages traffic and to improve the security for multihop networks.
The analytical results indicate the Relay-Gtw solution is a valuable option to increase the LoRaWAN coverage area and network capacity in terms of connected devices and packets delivered, with the advantage of reduced energy consumption.

P
ckt All T x (j) + P ckt F wd (i − 1) * P success (i) * P f ree (i)

Fig. 6 :
Fig.6: Hop effect on PDR on a Linear scenario.

TABLE I :
Summarized data for a single packet transmission.