# Towards Traffic-oriented Spreading Factor allocations in LoRaWAN systems

Francesca Cuomo, Julio César, Carrasquel Gámez, Antonio Maurizio, Laura Scipione, Manuel Campo, Alberto Caponi, Giuseppe Bianchi, Giampaolo Rossini, Patrizio Pisani

<figure><img src="image_1.png" /></figure>

## ► To cite this version:

Francesca Cuomo, Julio César, Carrasquel Gámez, Antonio Maurizio, Laura Scipione, et al. Towards Traffic-oriented Spreading Factor allocations in LoRaWAN systems. 17th Annual Mediterranean Ad Hoc Networking Workshop (Med-Hoc-Net 2018), Jun 2018, Capri Island, Italy. pp.55-63. hal-01832530

HAL Id: hal-01832530

https://inria.hal.science/hal-01832530

Submitted on 8 Jul 2018

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Towards Traffic-oriented Spreading Factor allocations in LoRaWAN systems

Francesca Cuomo*, Julio César Carrasquel Gámez*, Antonio Maurizio*, Laura Scipione*, Manuel Campo*,
Alberto Caponi†, Giuseppe Bianchi †, Giampaolo Rossini‡, Patrizio Pisani ‡

*CNIT/ University of Rome "La Sapienza", Italy †CNIT/ University of Rome "Tor Vergata", Italy

‡Unidata S.p.A, Italy

**Abstract**—To exploit the LoRaWAN (Long-Range Wide Area Network), it is essential to design suitable allocation schemes for the wireless resources. To this aim, strategies for a fair allocation of Spreading Factors (SF) among the network devices have been presented. These strategies greatly outperform the basic Adaptive Data Rate (ADR) scheme. Within these techniques, EXPLORa-AT yields so far the best results exploiting an “ordered water-filling” approach which aims to equalize the Air-Time channel usage for each group of devices using the same SF. This paper proposes two innovative schemes based on the former one, named EXPLORa-KM (K-means) and EXPLORa-TS (Time Symbol). Both schemes exploit the “ordered water-filling” approach, and apply further heuristics based on network traffic knowledge. EXPLORa-KM aims to relieve critical regions, characterized by a significant number of collisions, computing suitable adjustments on the SF allocation using K-means. Conversely, and with incremented complexity, EXPLORa-TS performs an equalization of the traffic load (measured in symbol times) among the SF channels. The latter takes into account the fact that each device, according to its application, transmits a variable amount of data at a different sending rate. Thus, different traffic types (more or less aggressive) can be recognized. Simulation results show how both heuristics give significant performance improvements when different traffic loads are generated around a LoRaWAN Gateway. Taking into account the traffic behavior, the techniques provided in this paper contribute as promising kick-off strategies for enhancing the network performance in order to come up with the ultimate goal of scalability on a LoRaWAN network for heterogeneous IoT scenarios.

**Index Terms**—Low power wide area networks; Internet of Things; LoRaWAN; Spreading Factors; Resource Allocation.

## I. INTRODUCTION

Within the captivating wave of The Internet of Things (IoT), the LoRaWAN (Long-Range Wide Area Network) has raised up as a prominent network infrastructure for long-range communication of ultra low-powered devices. Nonetheless, still some challenges regarding the network scalability need to be addressed. For serving an enormous amount of devices, and thereby for exploiting the LoRaWAN potential, it is essential to come up with a suitable allocation of the wireless resources. Different standards have arisen in this field, like it is surveyed in [1]. As for the wide-range technologies three main standards have been designed: i) Sigfox, which uses the industrial, scientific and medical (ISM) radio band to transmit data over a very narrow spectrum to and from connected

objects; ii) LoRaWAN, emerging as a power efficient wireless communication over very long distances; iii) Narrowband IoT, a new 3GPP cellular technology providing wide area coverage for the IoT. The first uses the ISM band efficiently (by occupying narrow chunks of spectrum), and it experiences low noise levels; the price is a maximum throughput of about only hundreds of bit/s. The LoRaWAN, designed by the LoRa Alliance [2], is operated in the ISM band using a proprietary spread spectrum technique developed and commercialized by Semtech Corporation [3][4]. It provides a bidirectional communication at data rates up to 50 kbit/s and is able to cover radio ranges of the order of kilometers [5]. Finally, the NB-IoT [6][7] is a new cellular system operating in a narrowband spectrum portion of the LTE (licensed). It is suitably designed for applications requiring low latency and having the need to communicate more frequently than the ones used in LoRaWAN. LoRaWAN indeed can be ideal for applications that have sporadic communication requirements (e.g. a couple of times per day) and need low energy consumption in order to increase battery lifetime. In this framework, several works have analyzed the potentialities of LoRaWAN systems in terms of scalability and performance [8][9].

In our preliminary work [10] we defined the EXPLOra-Air Time (AT) solution playing with the LoRa modulation technique based on the Spreading Factors (SF) to improve the throughput and Data Extraction Rate (DER) performance compared with the Adaptive Data Rate (ADR) proposed in [3]. The main result of EXPLOra-AT is that there is the possibility, in the radio range of a LoRa Gateway (GW), to allocate different SFs to the transmitting End-Devices (ED), with the goal of ensuring a similar Time on Air period to all of them and inducing less collisions and ultimately an higher throughput. However, the EXPLOra-AT was designed under the assumption of having all end-devices transmitting with the same message rate and payload. In this work, we extend that approach to provide an EXPLOra solution tailored to the different applications and traffic loads that will be supported in LoRaWAN systems. The remainder of this paper is structured as follows. Sec. II presents the current literature related to our research topic. Sec. III briefly describes the considered LoRaWAN system. Sec. IV describes our proposed algorithms; Sec. V reports the simulation scenario and results. Finally conclusions are highlighted in Sec. VI.
## II. RELATED WORK

The LoRaWAN has attracted the IoT community as a promising platform for supporting smart city deployments. Thus, throughout the last years, different works have analyzed the technology limits and addressed open issues such as scalability. In this context, we can classify the related literature as follows:

(i) Works analyzing the current capabilities and limitations of LoRaWAN [11][5][12][8], and studying its performance under specific settings [13][14][15].

(ii) Papers proposing novel approaches and heuristics to optimize the network performance [4][16][17][18][10].

As for the first group, Adelantato et al. surveyed in [11] the limits of LoRaWAN. An issue concerns the maximum *duty cycle* (DC) allowed within the ISM band. For instance, the 1% for the UE 868 MHz band turns out into a maximum transmission time of 36 secs in an hour, for each device. This also limits the LoRa gateways in the down-link channel, which have to comply with the DC regulation. Another important analysis in [11] regards the use of ALOHA in a LoRaWAN deployment, which simplifies the network implementation, but at the expense of the throughput that is significantly limited by collisions. Petäjäjärvi et al. in [5] analyzed the capacity of a LoRaWAN cell. For applications requiring transmission of only a single packet per day, the cell may serve up to millions of devices. However, in case of applications reporting messages every minute, only few hundreds of devices may be hosted. Petäjäjärvi et al. in [5] also evaluated the performance of the LoRa communication under the presence of the doppler shift. The results concluded that with $SF = 12$ (which enables the longest range) the communication deteriorates when relative speed exceeds 40 km/h whereas with a lower mobility it can be assured a reliable communication; finally, it was also evaluated the coverage attained by a LoRa device transmitting with $SF = 12$ and a transmission power of 14 dBm; as a result, it was determined the feasibility of communicating within a distance of 2–5 km, and in a range of 15–30 km on the water.

Georgiou et al. in [12] showed how the coverage probability drops exponentially as the number of network devices grows due to the interfering signals using the same spreading factor, which is concluded to be perhaps the most significant limits towards scalability on LoRa. Scalability issues also have been addressed in by Bor et al. in [8] where it was identified a LoRa link model for the communication range and the collision behavior. They also provided the LoRa simulator (LoRaSim) implementing the link behavior model.

In addition, it has been of interest the evaluation the LoRaWAN performance in smart city scenarios. Magrin et al. in [13] implemented a model using the ns-3 simulator to study the performance in a typical urban environment. It was developed a path loss model where devices inside the buildings may be affected by building penetration losses. There were executed simulations with thousands of devices following a Pareto distribution. It was concluded that LoRaWAN with

the ADR scheme may scale well only if there are numerous gateways suitably deployed across the system. i.e., a packet success rate of 95% for 15000 devices is attained only if there are 75 gateways. Other works dealt with application-tailored deployments such as in [14] where it was studied the support of LoRa for health care monitoring, or in [15] for hosting smart metering devices.

For optimizing the performance of LoRa, many works have addressed the scalability issue. To this aim, several heuristics have been focused on how to efficiently allocate the wireless resources. Reynders et al. in [16] developed a scheme to efficiently assign the SF and the transmission power across the devices. On the other hand, Abdelfadeel et al. presented in [17] a fair adaptive data rate algorithm (FADR) which computes a data-rate and transmission power allocation in order to achieve fairness in data-rate and reduce collision among nodes.

Conversely, the EXPLoRa heuristic [10] aims to efficiently distribute the SFs among end-devices: the EXPLoRa-SF tries to equally distribute the SFs among the total number of nodes only constrained by the Receiver Signal Strength Indicator (RSSI) values. A more sophisticated approach, EXPLoRa-AT tries to equalize the Time-on-Air of the transmitted packets among the SF channels. The solutions presented in this paper are an upgrade of the latter approach by taking into account different traffic areas as well as variable payloads and message periods, thereby being able to precisely determine and equalize the traffic load for each SF channel, expressed in terms of symbol time.

Other efforts for optimizing the network have been done tackling other solutions such as the usage of new LoRa transceivers [4] or the development of multi-hop communication for choosing the minimal Time-on-Air path [18].

## III. LORAWAN

The LoRaWAN architecture has a star topology, where end-devices are connected to one or more gateways which, in turn, are connected to a common Network Server (NetServer). The communication between end-devices and gateways is spread out on different frequency channels and data rates. LoRaWAN uses up to 6 different programmable Spreading Factors (SF): 7, 8, 9, 10, 11, 12. Furthermore, also the adopted bandwidth can be configured: 125 kHz, 250 kHz and 500 kHz (typically 125 kHz for the 868 ISM band.) For a given SF, the narrower the bandwidth is, the higher the receiver sensitivity.

The selection of the data rate is a trade-off between communication range and message duration, given that communications at different SFs do not interfere with each other. LoRaWAN data rates range from 0.3 kbps to 50 kbps. To maximize both battery lifetime of the end-devices and overall network capacity, the LoRaWAN network infrastructure can manage the data rate and Radio Frequency output for each end-device individually by means of the ADR scheme. The relation between nominal bit rate and SF is given as: $R = SF * \frac{CR}{2^{SF}/BW}$, where BW is used bandwidth and CR the adopted Code Rate.

In the following we propose two schemes that can be easily
<table><caption>TABLE I
SENSITIVITY/DISTANCE THRESHOLDS FOR SPREADING FACTORS (SF)
OPERATING AT A FREQUENCY BAND OF 125kHz</caption><thead><tr><td>SF</td><td>RSSI [dBm]</td><td>Distance [m]</td></tr></thead><tbody><tr><td>7</td><td>-126.50</td><td>74</td></tr><tr><td>8</td><td>-127.25</td><td>78</td></tr><tr><td>9</td><td>-131.25</td><td>94</td></tr><tr><td>10</td><td>-132.75</td><td>101</td></tr><tr><td>11</td><td>-134.50</td><td>110</td></tr><tr><td>12</td><td>-133.25</td><td>104</td></tr></tbody></table>

applied at the NetServer in order to allocate to the EDs the SFs to transmit their data to a GW.

## IV. TRAFFIC-ORIENTED EXPLORA HEURISTICS

EXPLoRa aimed at allocating in a suitable way the SFs to network devices in order to improve the Data Extraction Rate (DER) and the network throughput. Similarly to [8] we define the DER as the ratio of messages correctly received by the GWs to the transmitted messages either from all network devices (overall DER) or from just a single ED, computed in a given time period.

The selection of a specific SF value firstly depends on the average RSSI with which messages arrive to the gateways. The RSSI value depends on the distance between the ED and the gateway according to the $L_{pl}(d)$ path loss model [8]:

$$L_{pl}(d) = \overline{L_{pl}}(d_0) + 10\gamma \log\left(\frac{d}{d_0}\right) + \chi_{\sigma} \quad [dB] \quad (1)$$

where $\overline{L_{pl}}(d_0)$ is the mean path loss at the reference distance $d_0$, $\gamma$ is the path loss exponent and $\chi_{\sigma} \sim N(0, \sigma^2)$ is the normal distribution with zero mean and $\sigma^2$ variance to account for shadowing. For each SF, Table I presents the sensitivity and distance thresholds for EDs operating at 125 kHz, based on the LoRaWAN specification and the described path loss model. For instance, a device within a maximum distance of 74 meters from the gateway needs to have a RSSI value greater than -126.50 dBm to be successfully decoded at the GW; to this aim a SF = 7 must be assigned.

In the LoRaWAN, the allocation of SF to an ED is important for different reasons: a high spreading factor value corresponds to a high coverage distance within which the ED messages can be correctly received, but it implies a low bit rate and a consequent high Time-on-Air (ToA). The Time-on-Air for an ED message is defined as $Ts \cdot PL_{sym}$ where $Ts$ is the symbol time of the message defined as $Ts = \frac{2^{SF}}{BW}$ whereas $PL_{sym}$ is referred as the payload size expressed in symbols. Clearly, the higher the spreading factor the higher the symbol time $Ts$ is. Thus, in case of high SFs (10-12), the communication channel will be occupied for a long time, increasing the possibility of collisions between packets concurrently transmitted. However, since different SFs are mutually orthogonal (or pseudo-orthogonal) this enables to have more communications in the same channel without collisions. The idea of EXPLoRa [10] was to play with this tradeoff, so we planned to use all available SF values (7, 8, ..., 12) for all EDs covered by a GW

with the objective of improving the DER (by reducing the collision rate) and the throughput.

### A. EXPLoRa - K-means

A first evolution of EXPLoRa is the K-means based one (named EXPLoRa-KM) which aims to improve the behavior of EXPLoRa-AT when in the considered scenario there exist some critical areas, i.e. crowded regions with a significant concentration of nodes with a high probability of collisions. In particular, it employs the K-means technique described in [19] to identify in the considered scenario these critical areas. The K-means is simply used to derive centroids of the EDs covered by a GW in order to identify critical areas. Notice that a GW collects and transmits to the NetServer all the RSSI values and positions of the EDs in its area. It is assumed that the majority of nodes belonging to a critical area will have the same SF since those nodes are particularly close to each other and, according to the allocation of SFs based on ADR (like EXPLoRa-AT), nodes with the same geographical position have the same RSSI and are likely to have allocated the same SF. EXPLoRa-KM works as follows: first, it determines the Voronoi diagram for a given scenario, in which the EDs and the GW are represented in Cartesian coordinates, whereby it is applied the K-means algorithm. As stated before, the centroid of each cluster represents the center of a critical area. Then, the collisions that happen in such regions are monitored (e.g. by measuring for a period of time the resulting DER), and depending on the number of collisions for a certain node in that area, its SF is increased. In particular, the SF is increased if the number of collisions is greater than the number of messages that the ED transmits in the monitored period. Another important aspect to consider is the choice of the number of clusters for a given scenario. In particular, if this number is too big, then there might be the risk of performing clustering on regions that are not indeed critical areas. On the other hand, if a really small amount of clusters is chosen, the opposite issue is encountered: the application of K-means will not be able to identify all the critical areas. Therefore, in order to maintain a suitable balance regarding the number of clusters, the following rule is imposed:

$$K = \lceil C \cdot N/A \rceil \quad (2)$$

where $N$ is the number of EDs, $A$ is the area covered by the GW, and $C$ is a proportional parameter which contains the prior knowledge of the density of a scenario. The term $N/A$ represents the density of EDs in the scenario; the higher the density, the bigger the number of clusters will be. If the density is particularly low, no clustering is performed: the allocation of SFs performed by EXPLoRa-AT is sufficient and our algorithm is not applied. Finally, we remark that in the considered scheme, the region of influence of a critical area cannot include a number of EDs greater than the 5% of the total.

### B. EXPLoRa - Time Symbol

While EXPLoRa-KM works only on the basis of the topological setting of the LoRaWAN, EXPLoRa-TS takes into
<figure><img src="image_3.png" /><figcaption>Fig. 1. Example of performing the EXP\_water\_filling [10] in order to balance the traffic load measured in symbol times among the SF channels.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig. 2. Heuristic for allocating EDs messages within the buckets (representing the different SF channels). The EDs messages are allocated according to their payload size (longer payloads are served first). Such allocation is illustrated by the solid arrows; if for an specific message there is no space left in a bucket, then it is placed in the next bucket (as shown by the dashed arrows).</figcaption></figure>

account also the traffic load. It operates in conjunction with the EXPLoRa “ordered water-filling” approach proposed in [10], hereinafter referred by EXP\_water\_filling in order to balance the traffic load (measured in symbol times) among the SF channels as Figure 1 presents. Channels are modeled as a set of buckets (see Figure 2) where symbols that are associated to the different EDs transmissions are suitably inserted.

According to the ED message payload (PL) size (in bytes) and the SF value, EXPLoRa-TS uses the following equations, given by the LoRa specifications, in order to compute the payload size in symbols, that is $Nsym\_mess$:

$$8 + \max\{\lceil \frac{8PL - 4SF + 28 + 16CR - 20H}{4(SF - 2DE)} \rceil \cdot (CR + 4), 0\} \quad (3)$$

In the considered model, the coding rate $\frac{4}{4+CR}$ has been set to $CR = 1$, implicit header is disabled, $H = 0$, and data-rate optimization option is not enabled, $DE = 0$. Hence, Eq. (3) is simplified into Eq. (4) only as a function of PL (in bytes), and SF:

$$8 + \max\{\lceil \frac{2PL - SF + 11}{SF} \rceil \cdot 5, 0\} \quad (4)$$

EXPLoRa-TS aims to allocate in a suitable way the SFs to EDs in order to balance the occupation time, measured in time symbols, in the different SF channels. Each SF channel

## Algorithm 1 EXPLoRa-TS

1: **function** EXPLORA-TS($PL_{vec}$, $MP_{vec}$, $SF_{vec}$, $T$)
2: &nbsp;&nbsp;&nbsp;&nbsp;$w \leftarrow \{1, 2, 4, 8, 16, 32\}$ ▷ Symbol times [in ms] per SF
3: &nbsp;&nbsp;&nbsp;&nbsp;$Nmess_i \leftarrow T/MP_i \forall i \in [1 \cdots N]$ ▷ Eq. 4
4: &nbsp;&nbsp;&nbsp;&nbsp;$Nsym\_mess_i \leftarrow PL_{sym}(PL_i, SF_i)$ ▷ Eq. 4
5: &nbsp;&nbsp;&nbsp;&nbsp;$Nsym\_usr_i \leftarrow Nsym\_mess_i \cdot Nmess_i$
6: &nbsp;&nbsp;&nbsp;&nbsp;$Nsym\_SF_k \leftarrow \text{number of sym per } SF_k \forall k \in [7 \cdots 12]$ ▷ Eq. 4
7: &nbsp;&nbsp;&nbsp;&nbsp;$P_{ADR} \leftarrow Nsym\_SF \cdot w$
8: &nbsp;&nbsp;&nbsp;&nbsp;$P_{TS} \leftarrow \text{EXP\_water\_filling}(P_{ADR}, w)$ ▷ Buckets capacities
9: &nbsp;&nbsp;&nbsp;&nbsp;$B \leftarrow P \cdot w^{-1}$ ▷ Buckets capacities
10: &nbsp;&nbsp;&nbsp;&nbsp;$S \leftarrow \text{fill\_buckets}(B)$ ▷ SF allocation on EDs
11: &nbsp;&nbsp;&nbsp;&nbsp;$\text{return } S$
12: **end function**

is modeled as a bucket. Thus, we define six buckets (one for each SF) such that the capacity of bucket $k$ is equal to $B_k$ symbols. The buckets are filled with the EDs messages and figuratively transport these messages to the sink (modeling the GW). The task is to efficiently allocate all EDs messages (with their symbols) within these buckets.

As illustrated in Alg. 1 the procedure takes as input three vectors $SF_{vec}$, $MP_{vec}$, $PL_{vec}$ collecting respectively the SFs, message periods, and payload sizes for all the $N$ EDs. It is also considered a vector $w$ collecting the symbol time weights for each SF (in accordance with the values in LoRa [2]). Finally, a time window $T$ is used to estimate the channels usage within a given time period. Algorithm 1 starts by evaluating $Nmess_i$ i.e., the number of messages to be sent by each ED considering their message periods within $T$. Then, it computes $Nsym\_mess_i$ i.e. how many symbols characterize each single message in accordance with Eq. (4). Hence, it is possible to estimate $Nsym\_usr_i$, i.e. how many symbols are sent by each ED within the time $T$. Later, it is computed the vector $Nsym\_SF$ which aggregates the total amount of symbols transmitted for each SF channel. Hence, it is calculated the vector $P_{ADR} = Nsym\_SF \cdot w$ which for each channel expresses the traffic load measured in symbol time.

We proceed to balance the weighted vector $P_{ADR}$ in order to have an equalized traffic load among the SF channels; for the latter, it is used the EXP\_water\_filling [10]. This procedure will result into a new vector $P_{TS}$ with a more balanced distribution of the symbol times between the channels. Figure 1 presents an insight of the procedure. The $P_{TS}$ is the maximum permitted symbol time consumption that each SF channel $k$ is allowed to use in the network in order to assure channel occupancy fairness. Finally, it is computed the vector $B = P \cdot w^{-1}$ containing the buckets sizes, i.e. how many symbols have to be allocated within each SF channel.

The second part of the solution addresses the allocation of messages in the buckets. This challenge resembles classical optimization problems such as bin-packing or knapsack. However, in our case, there are two specific constraints: (i) The message size, expressed in symbols, changes according to the chosen bucket (since it depends on the used SF). (ii) An ED who has allocated by the ADR a $SF = k$ is not able to put its messages in a bucket $k-1$ since, given the RSSI, the ED signal cannot be decoded by the GW at $SF = k-1$. To solve
<table><caption>TABLE II
SIMULATION PARAMETERS.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td>Carrier Frequency (MHz)</td><td>860</td></tr><tr><td>Bandwidth (kHz)</td><td>125</td></tr><tr><td>Code Rate (CR)</td><td>4/5</td></tr><tr><td>Transmission Power (TP)</td><td>14 dBm</td></tr><tr><td>Path loss values (Eq. (1))</td><td>d<sub>0</sub> = 40 m, γ = 2.08, σ<sup>2</sup> = 0<br>L<sub>pt</sub>(d<sub>0</sub>) = 127.41 dB</td></tr></tbody></table>

this problem we defined an heuristic where EDs having longer payloads are served first. Allocating messages of EDs whose payload size is longer will significantly increase probabilities of having space left in the buckets for allocating shorter messages, thereby respecting the buckets capacities that were previously derived from the EXP\_water\_filling. The heuristic, invoked as fill\_buckets(B) in Algorithm 1, performs the following steps:

1) It selects the first bucket, representing the channel with SF = 7 as the current bucket pbucket.

2) It serves EDs having SF $k = 7$ which are sorted in a list L according to their PL size: EDs whose PL size is bigger are served first.

3) For each ED i in L, the procedure allocates into the current bucket pbucket the ED messages $Nmess_i$ which have a size of $Nsym\_mess_i$ symbols. Each time a message is allocated, the bucket capacity $B_{pbucket}$ is decremented by $Nmess_i$ symbols. This to represent that such message are transmitted with SF = pbucket.

4) If through Step 3, the current bucket end the space for allocating further messages, then the subsequent messages are be allocated in the next bucket pbucket + 1. Since the SF is changed to pbucket + 1, the size of the ED messages in symbols is calculated again using Eq. (4) in order to place its messages in the new bucket.

5) After all messages of all EDs in L are allocated in the buckets, then the next devices with SF $k = 8, 9, ... 12$ are served using the same procedure starting from Step 2.

6) When all EDs belonging to the different SFs were served, the fill\_buckets(B) returns an output vector indicating with which SF value the EDs are going to transmit their messages (according to the operations done in Step 3).

If the described approach is not be able to allocate all messages with the given buckets capacities, for the subsequent messages, it is chosen a bucket r that has the largest available space. In particular, for an ED transmitting with SF = k, it is chosen a bucket in the range $SF_k \le r \le 12$ in such a way to satisfy the initial problem constraints.

Figure 2 provides an insightful representation of the explained procedure. As seen, the implementation allows an ED to transmit its messages with more than one SF value. However, as the number of EDs grows on the network, the number of devices using multiple SFs is negligible. This because the size of the buckets will be enlarged notably.

V. SIMULATION MODELS AND PERFORMANCE RESULTS

The performance assessments for both strategies, EXPLORa-KM and EXPLORa-TS, have been done by extending the SimPy simulator LoRaSim [8]. In both cases, there were considered single-gateway scenarios with $N = 500$ fixed EDs generated around the gateway. The settings for the radio parameters for the EDs, and the values for the adopted path loss model are listed in Table II.

A. Managing an overcrowded area with EXPLORa-KM

In this case, it is considered a scenario with 90% of EDs placed around the GW within a radius of 50 meters. Each ED tries to transmit 15 messages in a simulation time period of 30 minutes, and a rate of a message every 50 seconds. First, EXPLORa-AT is applied in order to allocate the SFs on the nodes; the resulting allocation is illustrated in Figure 3(a). The number of clusters K that was used, having $C = 5 \times 10^2$, $N = 500$ and $A = 240 \times 240$, is $K = 4$. The resulted clustering procedure, and the relative centroids are shown in Figure 3(b).

By applying EXPLORa-KM, the SFs are modified, as illustrated in Figure 3(c). It is clearly visible that, around the centroids of the pink, red, and blue clusters, a significant number of EDs have increased their SFs, while around the centroid of the light blue cluster, there is almost no reaction. Indeed, this is mainly due to the fact that this critical area is not as dense as the others.

In the considered scenario, the use of EXPLORa-KM is compared to ADR and to EXPLORa-AT. In addition, their performance with and without retransmissions were evaluated simulating the presence of the retransmissions mechanism as described in [20]. In the LoRaWAN, the retransmission mechanism aims to retransmit a message when an ED does not receive an acknowledgment (ACK). The retransmission is computed in a randomly chosen channel if ACK-TIMEOUT seconds have passed from the first transmission, and if no acknowledgment has been received. The recommended behavior is to set up ACK-TIMEOUT between 1 – 3 seconds [20].

In Figure 4, it can be observed how ADR, by using the retransmission mechanism, results in a poor DER performance with respect to the case without retransmissions. This is, however, plausible; as a matter of fact, in this scenario most of nodes have SF = 7 with ADR. Thus, by retransmitting messages, the collisions keep happening. On the other hand, EXPLORa-AT distributes the SFs more fairly, so it leads to an increment of the DER of 10% with respect to the case without retransmissions. Finally, EXPLORa-KM shows a significant improvement of the DER of 21% with respect to the case without retransmission and most importantly, of 11% with respect to EXPLORa-AT.

As far as the fairness is concerned, an algorithm is fair if all the nodes are treated equally, in our case if it achieves a fair DER among all nodes. Since EXPLORa-KM performs a discrimination, namely it selects only a subset of nodes for the re-allocation of the SFs, then it is necessary to check if fairness is kept. This is obtained by measuring the DER values in each cluster. They are similar: 90% for the blue and red clusters,
<figure><img src="image_5.png" /><figcaption>Fig. 3. SF allocation with EXPLOra-AT (a) Calculation of clusters and centroids (b) and SF allocation with EXPLOra-KM (c)</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 4. DER distribution with and without retransmission for ADR, EXPLOra-AT and EXPLOra-KM</figcaption></figure>

<caption>Fig. 5. Distinct traffic zones: An overloaded inner area where EDs make incessant use of the network and a light-traffic outer zone where EDs may sporadic use of the channel.</caption>

91% for the *pink* cluster and 89% for the *light blue* cluster, thereby evidencing fairness among the EDs when applying EXPLOra-KM.

Performance results using EXPLOra-AT [10] came up with a *DER* equal to 80% with retransmissions (70% without retransmissions). In the considered scenario, EXPLOra-KM provides a *DER* equal to 90%, which demonstrates the usefulness of applying this technique on top of EXPLOra-AT.

## B. Addressing distinct traffic zones with EXPLOra-TS

In this case we defined two traffic zones as in Figure 5: there is an inner area covering a radius of 50 meters around the GW. EDs placed on this area are considered *aggressive* and transmit messages with payload size (*PL*) between 120–160 bytes and with a message period (*MP*) ranging from 30–60 seconds. Then, there is an outer area settled within an interval range of 50–130 meters with respect to the GW. EDs placed in this outer zone load less traffic on the network, transmitting a message whose *PL* goes between 20–40 bytes, and with a *MP* in the range of 10–30 minutes. These two categories can represent two main applications planned within an IoT city deployment. We carried out different simulations where both zones enlarge or shrink based on the number of EDs placed in each of the two areas. To determine the number of EDs placed in each area we used a parameter *p* = 0.1, 0.2, ..., 1, such that *p* \* 100% of *N* EDs are placed within the inner area, and they are generated as *aggressive* EDs whereas the other (*1* − *p*) \* 100% generated in the outer zone are *non-aggressive*. For instance, with *p* = 0.4, 40% of EDs belong to the highly

congested inner area whereas 60% are placed at the light-traffic outer area. For each value of *p*, there were executed 100 simulation runs. The performance results represent the mean values within a confidence interval of 95%.

Figure 6 presents the measured network *DER* and throughput values when the traffic load increases by incrementing the *p* parameter. For all possible *p* values, EXPLOra-TS outperforms the ADR and EXPLOra-AT since it is able to calculate the traffic load, measured in symbol times, of each SF channel into the network. For example, Figure 7 presents how the SF values have been distributed when 30% of EDs belongs to the congested internal area: ADR allocates SF values to EDs taking into account just the RSSI, so it naively assigns *SF* = 7 to the majority of the EDs. EXPLOra-AT goes one step further by balancing the Time-on-Air, but assuming that the same traffic load is put in network. EXPLOra-TS, through the symbol time balancing procedure among the SF channels, correctly considers how should be the distribution of the SFs across the SF channels/traffic zones. The high-level channel usage of the EDs in the heavy-traffic inner area, representing a 30% of the total of EDs, is proportional to the low channel usage of the other 70% of EDs that belong to the outer area. This reasoning, as Figure 7 (c) presents, is translated into a convenient SF allocation: the *SF* = 7, 8, 9 values are mostly assigned within the inner zone whereas a lot of devices in the
<figure><img src="image_7.png" /><figcaption>Fig. 6. DER performance with respect to an increasing traffic in the area near the gateway.</figcaption></figure>

outer zone result with $SF = 10, 11, 12$. Hence, for the case $p = 0.3$, the overall DER from a value of 0.21 in case of ADR increases to 0.44 with EXPLORa-TS. Similarly, the network throughput improves from 0.35 kbps to 1.06 kbps. In addition, Figure 8 provides a heatmap for the $p = 0.3\%$ case which let us to understand how the EXPLORa-TS improves the single DER for each ED. As seen in Figure 6 this performance improvement on the overall network is equivalent for other possible distributions of the EDs within the traffic zones (i.e. for other values of $p$).

In addition, it was simulated an opposite case where in the inner zone were placed the *non-aggressive* EDs, whereas in the outer area were placed the *aggressive* ones, using the same ranges of *MP* and *PL* for each class of ED; as a result, Figure 9 illustrates how, as $p$ increases, the traffic load decreases since all EDs transmit at a reduced rate in the inner area. The latter is a non-stressed case ideally for the ADR, but that EXPLORa-AT was not able to cope with. Thus, it is shown how EXPLORa-TS outstrips EXPLORa-AT, and it is able to maintain the same performance level of the ADR. It is important to remark that in both situations, either *aggressives* EDs near to the gateway or far from it, when $p = 1$ it means that 100% of the EDs belong to just one class, so it means a traffic-balanced case (i.e. all SF channels/traffic zones using the channel at the same rate). From Figures 6 and 9 it can be observed EXPLORa-TS maintains the same DER performance levels previously obtained from ADR and EXPLORa-AT.

As a second benefit from EXPLORa-TS, either in traffic-balanced scenarios or not, is that the fact of allocating first ED messages whose payload size is longer yields a convenient channel usage fairness among EDs regardless of their *PL*. Inevitably, EDs whose *PL* is longer may have a longer Time-on-Air, increasing their collision probability. However, the EXPLORa-TS heuristic applies an allocation policy based on the *PL*, so EDs whose *PL* size is longer will be benefited being sent in a minor symbol time. For the previous simulations, there was performed an alternative case where the devices *PL* were in the range of 20–250 bytes, regardless of their class;

as a result, Figure 10 shows how EXPLORa-TS achieves better DER of the single ED than EXPLORa-AT and ADR.

## VI. CONCLUSIONS

In the framework of the IoT, the Low Power, Long Range technologies are emerging. These have many potentials that can be exploited once there is the possibility to support different applications and traffic types in network scenarios composed by hundreds of devices. In an incremental order of complexity we presented two approaches. First, it was introduced EXPLORa-KM, for the reallocation of the SFs of LoRaWAN devices, which are located in overcrowded areas, thereby reducing gradually the amount of collisions, and increasing the Data Extraction Rate. EXPLORa-KM also provides a good fairness among the EDs. Afterwards, we presented EXPLORa-TS, an enhanced version of EXPLORa-AT that takes into account different traffic configurations, payload sizes and message periods. We defined an allocation scheme for transmissions at different SFs by nodes placed around a gateway, and we showed via simulations that, by suitably balancing the SF channels occupation time (e.g. measured in terms of symbol time), the EXPLORa-TS presents very good performance in terms of DER. Both approaches may be combined in order to provide an overall framework for realistic scenarios. i.e. applying EXPLORa-TS taking into account different message rates and payload sizes of each ED, and then executing EXPLORa-KM in order to assist critical regions with a high probability of collisions. Future research will address such work including as well multi-gateway experiments, and energy-consumption evaluations.

## ACKNOWLEDGEMENTS

This research was supported by the EU Commission within the Horizon 2020 symbIoTe project (Grant no. 688156).

## REFERENCES

[1] U. Raza, P. Kulkarni, and M. Sooriyabandara, "Low power wide area networks: An overview," *IEEE Communications Surveys Tutorials*, vol. 19, no. 2, pp. 855-873, Secondquarter 2017.

[2] N. Sornin, M. Luis, T. Eirich, T. Kramp, and O. Hersent, "LoRaWAN Specification," https://www.lora-alliance.org/, 2015.

[3] Semtech, "LoRa," http://www.semtech.com/, 2015.

[4] M. Bor, J. Vidler, and U. Roedig, "LoRa for the Internet of Things," in *Proceedings of the 2016 International Conference on Embedded Wireless Systems and Networks*, ser. EWSN '16, 2016, pp. 361-366.

[5] J. Petäjäjärvi, K. Mikhaylov, M. Pettissalo, J. Janhunen, and J. Iinatti, "Performance of a low-power wide-area network based on LoRa technology: Doppler robustness, scalability, and coverage," *Int. Journal of Distributed Sensor Networks*, vol. 13, no. 3, pp. 1-16, 2017.

[6] J. Gozalvez, "New 3GPP Standard for IoT [Mobile Radio]," *IEEE Vehicular Technology Magazine*, vol. 11, no. 1, pp. 14-20, March 2016.

[7] Y. P. E. Wang, X. Lin, A. Adhikary, A. Grovlen, Y. Sui, Y. Blankenship, J. Bergman, and H. S. Razaghi, "A Primer on 3GPP Narrowband Internet of Things," *IEEE Communications Magazine*, vol. 55, no. 3, pp. 117-123, March 2017.

[8] M. C. Bor, U. Roedig, T. Voigt, and J. M. Alonso, "Do LoRa Low-Power Wide-Area Networks Scale?" in *19th ACM Int. Conf. on Modeling, Analysis and Simulation of Wireless and Mobile Systems*, ser. MSWiM '16, 2016, pp. 59-67.

[9] T. Voigt, M. Bor, U. Roedig, and J. Alonso, "Mitigating inter-network interference in lora networks," in *Proceedings of the 2017 Int. Conf. on Embedded Wireless Systems and Networks*, ser. EWSN &#8217;17, 2017, pp. 323-328.
<figure><img src="image_8.png" /><figcaption>Fig. 7. SF allocation when 30% of nodes belong to the congested inner zone: (a) ADR, (b) EXPLORa-AT and (c) EXPLORa-TS</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 8. Heat-map showing the DER by node when 30% of EDs belong to the congested inner zone: (a) ADR, (b) EXPLORa-AT and (c) EXPLORa-TS</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Fig. 10. DER performance by node as a function of its payload size.</figcaption></figure>

<caption>Fig. 9. DER performance when the traffic load is reduced in the area near the gateway, and increased in the outer zone.</caption>

<footnote>[10] F. Cuomo, M. Campo, A. Caponi, G. Bianchi, G. Rossini, and P. Pisani, "EXPLORa: Extending the performance of LoRa by suitable spreading factor allocations," in *IEEE 13th Int. Conf. on Wireless and Mobile Computing, Networking and Communications (WiMob)*, 2017, pp. 1-8.</footnote>

<footnote>[11] F. Adelantado, X. Vilajosana, P. Tuset-Peiro, B. Martinez, J. Melia-Segui, and T. Watteyne, "Understanding the limits of lorawan," *IEEE Communications Magazine*, vol. 55, no. 9, pp. 34-40, 2017.</footnote>

<footnote>[12] O. Georgiou and U. Raza, "Low Power Wide Area Network Analysis: Can LoRa Scale?" *IEEE Wireless Communications Letters*, 2017.</footnote>

<footnote>[13] D. Magrin, M. Centenaro, and L. Vangelista, "Performance Evaluation of LoRa Networks in a Smart City Scenario," in *IEEE ICC 2017 SAC Symposium Internet of Things Track (ICC'17)*, 2017, pp. 1-5.</footnote>

<footnote>[14] J. Petäjäjärvi, K. Mikhaylov, M. Hämäläinen, and J. Inatti, "Evaluation of LoRa LPWAN technology for remote health and wellbeing monitoring," in *10th Int. Symposium on Medical Information and Communication Technology (ISMICT)*, March 2016, pp. 1-5.</footnote>

<footnote>[15] N. Varsier and J. Schwoerer, "Capacity limits of LoRaWAN technology for smart metering applications," in *2017 IEEE International Conference on Communications (ICC)*, May 2017, pp. 1-6.</footnote>

<footnote>[16] B. Reynders, W. Meert, and S. Pollin, "Power and spreading factor control in low power wide area networks," in *IEEE ICC 2017 SAC Symposium Internet of Things Track (ICC'17)*, 2017, pp. 1-5.</footnote>

<footnote>[17] K. Q. Abdelfadeel, V. Cionca, and D. Pesch, "Fair Adaptive Data Rate Allocation and Power Control in LoRaWAN," *2018 International Conference on Embedded Wireless Systems and Networks*, Feb 2018.</footnote>

<footnote>[18] B. Sartori, S. Thielemans, M. Bezunartea, A. Braeken, and K. Steenhaut, "Enabling RPL multihop communications based on LoRa," in *IEEE 13th Int. Conf. on Wireless and Mobile Computing, Networking and Communications (WiMob)*, Oct 2017, pp. 1-8.</footnote>

<footnote>[19] C. M. Bishop, *Pattern Recognition and Machine Learning (Information Science and Statistics)*. Springer-Verlag New York, Inc., 2006.</footnote>

<footnote>[20] D. Bankov, E. Khorov, and A. Lyakhov, "On the Limits of LoRaWAN Channel Access," in *2016 International Conference on Engineering and Telecommunication (EnT)*, Nov 2016, pp. 10-14.</footnote>