A New Annulus-based Distribution Algorithm for Scalable IoT-driven LoRa Networks

Long-Range (LoRa) has been a major avenue for deploying the Internet of Things (IoT) in large scale environments due to its long-scale connection, energy efficiency, and cost-effectiveness. LoRa networks provide multiple configurable transmission parameters that greatly affect the performance of the overall network. To the best of our knowledge, the optimal combination of these parameters that can allow orthogonal simultaneous transmissions to be successfully decoded by the gateway has not been reported in the literature. Exploiting all the transmission parameters in the physical layer to find optimal combinations between them will inevitably increase the throughput of LoRa without affecting the energy consumption. In this paper, authors propose annulus-based distribution algorithm of LoRa transmission parameters to mitigate well-known and challenging issues, namely the capture effect and the limited scalability. The performance of the proposed algorithm has been compared with the Adaptive Data Rate(ADR) algorithm of LoRaWAN and the simulation results show that the proposed algorithm significantly outperforms the ADR especially in large-scale dense networks. Specifically, the proposed algorithm has improved the network throughput by an average of 59% compared to the legacy LoRaWAN.


I. INTRODUCTION
Low Power Wide Area Network (LPWAN) can be defined as a collection of technologies that facilitates long-range communications with a lower level of costs and energy consumption [1]. These features make the LPWAN an appealing technology for most of Internet of Things (IoT) applications. Currently, there are many initiatives worldwide to deploy the LPWA as a backbone for the smart city vision. These applications include smart farming, healthcare, oil and gas pipeline monitoring, smart grid, and industrial monitoring and management. However, LPWA provides long area coverage and low energy consumption at the cost of low data rates (in order of tens of kilobytes) [2]. Accordingly, LPWA technologies are perfectly fitted for delay-tolerant applications that typically transmit short packets for long-range and require low power consumption and low cost. LoRa has the lowest deployment cost compared to other LPWA technologies since This research work was funded by Institutional Fund Projects under grant no (IFPRC-065-612-2020). Therefore, authors gratefully acknowledge technical and financial support from the Ministry of Education and King Abdulaziz University, Jeddah, Saudi Arabia. it uses the unlicensed ISM spectrum. Furthermore, LoRa has good resistance to interference thanks to the physical layer characteristics that allow relatively far nodes to communicate efficiently with base stations [3] [4].

A. Overview of Long-Range (LoRa) networks
LoRa is the physical layer of LoRa technology that uses Chirp Spread Spectrum (CSS) modulation, which provides the long-range communication link. Note that, the main attractive feature of LoRa is the long-range capability, where a single base station can cover hundreds of square kilometers. Consequently, LoRa networks use simple star network architecture instead of mesh network architecture, which reduces the complexity and node's energy consumption associated with mesh network architectures. LoRa radio has five configurable parameters: the carrier frequency (CF), the spreading factor (SF), the transmission power (TX), the bandwidth (BW), and the coding rate (CR). In fact, the number of supported channels, transmission power levels, and bandwidths are greatly affected by the region. As for the SFs, LoRa uses six different SFs, ranging from SF7 to SF12, which will affect the data rate. In other words, the use of small spreading factors results in high data rates and vice versa. Furthermore, the transmissions with different spreading factors are considered orthogonal to each other [5].
In fact, these varieties of transmission parameters greatly affect the performance of the overall network in terms of throughput and energy consumption. For instance, configuring neighbor nodes to choose different channels and different spreading factors reduces the probability of collisions and hence the network throughput is increased. In other words, having an optimal combination between these transmission parameters is crucial for LoRa network performance.

B. Motivation and related work
There are various transmission parameters distribution algorithms that have been proposed in the literature [6] [7] [8] [9] [10]. In fact, the majority of these algorithms propose methods to distribute spreading factors (SFs) among LoRa nodes and ignore other transmission parameters. For instance, in [6], they propose two algorithms, namely, EXPLoRa-SF and EXPLoRa-AT that distribute SFs among the nodes in two different ways while they use a single channel and a fixed transmission power. In [10], authors propose an algorithm to determine the optimal range for each spreading factor that maximize the packet success probability. Similar to [6], they also only focus on SFs distribution without exploiting other advantages provided by the physical layer such as the multi-channel communication and multiple transmission power levels. The algorithms that are proposed in [7], [8], and [9] try to distribute both the spreading factors and the transmission powers, but they assume only the use of LoRa default channels. Hence, they are missing the advantages of using multi-channel communication to enhance the network throughput.
As known, the main attractive feature of LoRa networks that makes them appealing for IoT applications is the longrange coverage, where one gateway can cover up to 14 Km in sub-urban areas. That being said, one of the main shortages in the literature review of LoRa based MAC protocols is that the majority of the proposed algorithms deal with short-distances (around 1 km from the gateway), although LoRa networks are designed to be large-scale networks with up to 14 km range coverage. Consequently, since most of the proposed algorithms are evaluated on a very small area, the actual performance of these protocols remain unclear for larger-scale LoRa networks.

C. Contributions
The main contribution of this research is exploiting most of the transmission parameters provided by LoRa physical layer to enhance the network performance. To the best of our knowledge, there is no research that considers all these parameters to find the optimal configuration of LoRa sensors. Specifically, there is no work considering the multi-channel support of LoRa physical layer in their proposed algorithms. By exploiting all these parameters, we propose a distribution algorithm of transmission parameters that enhance the scalability of LoRa networks. Furthermore, the proposed solution could make the LoRa networks applicable for mission critical IoT networks.
The second important contribution of this research is the evaluation of the proposed algorithm on large-scale dense networks. As declared in section IV, we evaluate the proposed algorithm with a maximum distance from the gateway that could reach 14 km.
The rest of this paper is structured as follows: in section II , the problem statement is defined. Section III describes the proposed annulus based distribution of LoRa transmission parameters. Finally, simulation results are provided in section IV.

II. PROBLEM STATEMENT
Although LoRa networks are considered as one of the technologies that efficiently enable the IoT due to their longrange coverage, cost-effectiveness, and robustness against interference, they have challenges that may limit their broadness. The main issue that has been investigated in the literature review is the scalability of LoRa networks [11] [12] [13]. Scalability means both i) how many nodes can be supported by a single gateway and ii) how far a node can be from the gateway. First, regarding the number of nodes that can be connected to a gateway, it is worth pointing out that it is mainly limited by the duty cycle regulations that are imposed by the regulatory organization of a particular region for both the uplink and downlink communication. Since LoRa networks use the unlicensed ISM band, nodes as well as the gateway should comply with the duty cycle restrictions of the ISM band. For example, if the duty cycle for a channel is 1% and the Time on Air (ToA) is 2s; then, the transmitted node should wait at least 198s before it can transmit again on the same channel. Consequently, if downlink communication is needed to update the different nodes with their SFs and the used transmission power, which is the case of Adaptive Data Rate (ADR) algorithm of LoRaWAN MAC protocol, the duty cycle constraint will restrict the total duration of time on air and consequently the total number of nodes that could be supported by the gateway will be reduced. Obviously, the ToA has a direct impact on the duty cycle. Moreover, the ToA is affected by three main transmission parameters, besides the payload size, which are the bandwidth (BW), the coding rate (CR), and the spreading factor (SF) [11] . For example, the time on air for 15 bytes payload can vary between 23ms and 1.45s depending on the used transmission parameters. Consequently, the duty cycle restriction is considered as one of the main challenges of LoRa networks that further limits the network throughput [14].
Second, regarding the coverage range of the gateway, note that it can be controlled from either the gateway side (the receiver) or the node side (the transmitter). From the gateway side, we can increase the range of the received signals by increasing the receiver sensitivity, which is controlled by the used SF and the bandwidth BW. From the node side, the only parameter that could control the transmission range is the transmission power. Indeed, neither the SF, the BW nor the CR have impact on the radiated power from the nodes [11].

III. ANNULUS-BASED DISTRIBUTION OF LORA TRANSMISSION PARAMETERS
In this section, an optimal distribution of all transmission parameters that affect the scalability of the network is described and outlined in Algorithm 1.The algorithm is executed during the initialization phase of the newly joined node. The algorithm takes the distance between the node and the gateway d N G as an input and returns the cell identifier cell, the selected channel frequency CF node , the chosen transmission power level T X node , and the selected spreading factor SF node as outputs. It also defines three different vectors (line 3-5). The SFs vector holds all supported spreading factors, which are six, the CFs vector stores six different channel frequencies, and the TXs vector that holds six different power transmission levels. The values of both SFs and TXs vectors are listed in ascending order. According to LoRa networks, the network topology is one-hop star topology. We assume that each node knows its coordinates and the gateway's coordinates. As mentioned before, LoRa physical layer supports multiple transmission parameters that greatly affect the transmission quality. Among them, the Spreading Factor (SF) and the transmission power (Tx) are the most influencing transmission parameters that directly affect the transmission range and the bite rate. In addition, efficient utilization of the multi-channel communication that is provided by the physical layer will greatly enhance the throughput and the scalability of the network. In order to efficiently distribute these transmission parameters among the nodes, we partition our network into six equal sized annulus cells as shown in fig. 1 such that for a given cell i , the radius is ir, where r is the field radius, R, divided by six (line 7). Note that our network partitioning into six cells is closely related to the total number of available SFs, which is six, as it will be explained later. The following equation defines the annulus width according to the field radius R.
According to our proposed algorithm, each cell is assigned one unique channel with a specific transmission power (line [10][11][12]. By doing that, we split the nodes located far from the gateway and the node close to the gateway into different channels. Furthermore, all nodes that use the same channel will be relatively close to each other and hence they may use the same transmission power. By doing that, we will mitigate collisions resulting from the capture effect [15], which is considered as one of the main concerns of LoRa networks. Regarding the distribution of SFs, each cell is assigned a set of eligible SFs. The eligible SFs of a node is a set of SFs that can be used by a node in a transmission such that it can be successfully received and decoded by the gateway. As mentioned earlier, LoRa networks support six different SFs from SF7 to SF12. Smaller SFs have smaller transmission ranges, so it can be only used with close nodes to the gateway. In other words, the number of eligible SFs per cell depends on how close the cell is to the gateway. For example, cell 1 , the closest cell, supports all SFs while cell 6 , the farthest cell, supports only SF12, as the transmissions of nodes on cell 6 will not be successfully received if they use smaller SFs because it will be received below the sensitivity threshold of the gateway. Table I shows the list of eligible SFs for every cell. In order for a node to specify its cell and since we assume that each node knows its coordinates and the gateway's ones, each node first calculates the euclidean distance between the node and the gateway . Once done, it will calculate the radius of each cell i according to the annulus width r as follows: where i refers to the number of cells.
After defining the boundaries of each cell according to the field radius R, each node iteratively calculates its cell identifier (line [8][9]. In other words, a node will be considered on cell 1 if its distance to the gateway is less than the radius of cell 1 . In general, a node will be considered on cell i if the following condition is satisfied where d N G refers to the distance between the node and the gateway and r is the cell width. Once a node determines its cell, it will be assigned the unique channel and the transmission power level that is defined for that cell (line [10][11][12]. Regarding the distribution of SFs among the cells, each cell is assigned a set of SFs and in order to distribute the set of eligible SFs among the nodes on that cell, we implement two different approaches. The first approach consists of distributing the set of eligible SFs uniformly among all the nodes on each cell. This approach is called Random-cell distribution. In the second approach, we further divide each cell into a number of sub-cells ns that is equal to the number of eligible SFs on each cell, as shown in fig. 1. For example, cell 1 supports all six SFs, so it will be divided into six equal-width sub-cells and each sub-cell is assigned one SF. On the other hand, cell 2 supports only five SFs (from SF8 to SF12), so it will be divided into five sub-cells by assigning one SF for each sub-cell. In other words, closer cells to the gateway will have smaller cell identifier, and hence it will have larger number of eligible SFs as explained in Algorithm 1 line (13). This approach is called the Cell-based distribution. In order for a node to determine its sub-cell and hence its SF, it will first iteratively determine the boundaries of sub-cell of the cell that is located on (line  [15][16][17]. Once done, based on its distance to the gateway it will determine its sub-cell and hence its spreading factor (line 18-20).
According to LoRa specification, spreading factors are orthogonals. Indeed, if two nodes n 1 and n 2 as shown in Fig.  1 on the same cell, cell 2 , but on different sub-cells, which means on the same channel but using different SFs, transmit simultaneously, there will be no collisions at the receiver due to the orthogonality of the SFs. By splitting the area around the gateway into multiple cells and sub-cells with different transmission parameters, we mitigate collisions resulting from the use of the same transmission parameters and hence the scalability will be improved. Fig. 2 shows the difference between the SF distribution of our proposed protocol and the Adaptive Data Rate (ADR) algorithm of LoRaWAN. As shown in the figure, 4000 nodes are distributed in a radio range of 14 km around a single gateway. In the ADR algorithm, the majority of nodes have the same SF, which is SF12 in this example. This is mainly because of the large number of nodes that is supported by the gateway. According to ADR algorithm, the gateway transmits periodic downlink messages to nodes to update their SF and transmission power but due to the duty cycle restrictions of the ISM band, the gateway cannot transmit these packets to all the nodes in the network. Consequently, nodes that are not receiving these downlink packets from the gateway in a specific period of time will suppose that their transmissions were not successfully received by the gateway and hence they end up increasing their SF. Consequently, majority of nodes will end up using SF12 as shown in Fig2.c. This will increase the probability of collisions as well as decreasing the network throughput as explained in sectionIV. However, in our proposed algorithm, we maintain the diversity of SFs among the nodes even with challenging large-scale dense deployment area thanks to the autonomy of the proposed algorithm, where nodes specify their transmission parameters without any required intervention from the server.

IV. PERFORMANCE EVALUATION
To validate the proposed algorithm, we implement it on OMNET++ simulator [16] under FloRa framework [17]. We compared the performance of the proposed algorithm with the legacy LoRaWAN. Particularly, we developed two different Algorithm 1 Annulus-based distribution algorithm 1: Input: Distance between node and gateway D N G 2: Output: cell, CF node , T X node , and SF node 3: SF s ← [7,8,9,10,11,12] 4: CF s ← [cf 1 , cf 2 , .., cf 6 ] 5: T Xs ← [T x 1 , T x 2 , .., T x 6 ] 6: # r is the annulus width, R is the field radius 7: r ← R/6 8: for i ← 1 to 6 do 9: sr ← r/ns 15: for k ← 1 to ns do 16: min ← ((k − 1) · sr) + ((cell − 1) · r) versions of our algorithm that mainly differ in the distribution of SFs namely; the Random-cell distribution and the Cellbased distribution. Since our proposed protocol targeted largescale dense networks, we simulate a large number of nodes, ranging from 1000 to 4000 nodes, which they are randomly distributed on a land with an area of 20 km 2 . Furthermore, we consider a LoRa network with a single gateway located at the center of the area. Regarding the packet size, each node generate a packet of 20 bytes with an inter-arrival time between packets following the exponential distribution with 1000s mean. Similar to [17], we used the European regional parameters for the LoRa physical layer with 1% duty cycle for both the LoRa nodes and the gateway. Table II summarizes the used simulation parameters. We analyze and compare the performance of our protocol with the ADR algorithm of LoRaWAN based on the probability of collision, the end-to-  A. The probability of collision Fig. 3 shows the probability of collision as function of the number of nodes. First, the probability of collision of all protocols is increasing with the increase of the number of nodes as the traffic rate is getting higher. Most importantly, note that both versions of our protocol are achieving lower probability of collision than the ADR-LoRaWAN thanks to the efficient distribution of transmission parameters among the nodes. Indeed, ADR-LoRaWAN tends to assign SF12 for the majority of nodes in large-scale dense deployment as shown in Fig.2.c. Furthermore, LoRaWAN use only the default channels without exploiting the multi-channel feature of LoRa physical layer and thus all the nodes tend to communicate on the same channel which will further increase the number of collisions. Regarding our proposed protocol, the Cell-based scenario achieves lower probability of collisions than the random one thanks to the sub-cell distribution mechanism that assures an even distribution of SFs among the nodes as clearly shown in Fig.2.a and Fig.2.b. B. The end-to-end delay Fig. 4 shows the end-to-end delay as function of the number of nodes. The end-to-end delay is greatly affected by the used SF. Indeed, the usage of smaller SFs results in lower end-toend delay as the packets that are transmitted by small SFs will have less Time on Air (ToA). This explains why the Randomcell approach of the proposed algorithm has lower end-toend delay than the cell-based distribution as demonstrated in  Fig.2.b. However, this is not the case of ADR-LoRaWAN where it has the lowest end-to-end delay due to the high Packet Error Rate (PER) (Fig.6 as the delay is only considered for the successfully received packets by the gateway which are mainly the closest nodes that use SF7.

C. The throughput
The throughput is mainly affected by the end-to-end delay and the probability of collisions. Fig. 5 reports the network throughput as function of the number of nodes. First, it is worth pointing out that both versions of our protocol are achieving higher throughput than LoRaWAN. Indeed, despite the fact that LoRaWAN is achieving lower end-to-end delay than our protocol (Fig. 4), it ends up with lower throughput as the impact of collision is much important (Fig. 3). Moreover, note that the throughput of LoRaWAN tends to stabilize when the number of nodes reach 2000 nodes. In other words, the LoRaWAN throughput is saturated at this point. On the other hand, the throughput of our proposed protocol depicts a clear increase with the increase of the number of nodes. Thus, our protocol is more scalable than LoRaWAN. For example, when N = 4000 nodes, the throughput of the cell-based version of our proposed protocol is double the one using LoRaWAN.

D. The Packet Error Rate (PER)
The PER is the ratio of the total number of packets that are received under the gateway sensitivity. As shown in Fig. 6, the PER of the Cell-based scenario of the proposed protocol is much better than the PER of LoRaWAN. Specifically, the PER of the Cell-based scenario is four times less than the PER of LoRaWAN when the number of nodes is 4000 nodes. Indeed, according to the Cell-based scenario, we assign smaller SFs to the nodes that are close to the gateway to avoid such problem. On the other hand, the Random-cell scenario randomly assigns a SF from the set of eligible SFs on a given cell. Consequently, nodes on the edge of the cell may be assigned small SFs which may cause their transmissions to be received below the sensitivity at the gateway, and hence the PER will increase. Regarding LoRaWAN, the network server of LoRaWAN updates the SFs and the power used by the nodes according to some statistics collected from previously received packets, which results in slower and not completely accurate updates and hence higher PERs are noted.

V. CONCLUSION
This paper proposed an algorithm to exploit and orchestrate all LoRa physical layer transmission parameters that would increase the scalability of the network. Specifically, this research takes advantage of the multi-channel feature that could increase the throughput by allowing simultaneous transmissions on different channels to be successfully received by the gateway. Furthermore, the proposed algorithm assigns specific power for each channel to avoid collisions due to the capture effect. Moreover, the algorithm defines a set of eligible SFs for each specific cell to mitigate the PER and to further reduce the probability of collision. Our main goal is to increase the throughput of large-scale dense networks. Simulation results demonstrated that the probability of collisions was decreased by an average of 26% compared to LoRaWAN. Furthermore, an average throughput improvement of 59% was observed by using our proposed algorithm compared to LoRaWAN.