Towards traffic-oriented spreading factor allocations in LoRaWAN systems

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.


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. (i) Works analyzing the current capabilities and limitations of LoRaWAN [11][5] [12][8], and studing 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 U E 868 M Hz 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 enddevices 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 125kHz 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 * 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 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]: where L pl (d 0 ) is the mean path loss at the reference distance d 0 , γ is the path loss exponent and χ σ ∼ N (0, σ 2 ) is the normal distribution with zero mean and σ 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.50dBm 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 T s • P L sym where T s is the symbol time of the message defined as T s = 2 SF BW whereas P L sym is referred as the payload size expressed in symbols.Clearly, the higher the spreading factor the higher the symbol time T s is.Thus, in case of high SFs (10)(11)(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 pseudoorthogonal) 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: 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  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 (P L) 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 N sym mess: In the considered model, the coding rate 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: 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 N sym messi ← P Lsym(P Li, SFi) Eq. 4 5: N sym usri ← N sym messi • N messi 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 , M P vec , P L 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 N mess i i.e., the number of messages to be sent by each ED considering their message periods within T .Then, it computes N sym mess i i.e. how many symbols characterize each single message in accordance with Eq. ( 4).Hence, it is possible to estimate N sym usr i , i.e. how many symbols are sent by each ED within the time T .Later, it is computed the vector N sym SF which aggregates the total amount of symbols transmitted for each SF channel.Hence, it is calculated the vector P ADR = N sym SF • 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 T S with a more balanced distribution of the symbol times between the channels.Figure 1 presents an insight of the procedure.The P T S 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 • w −1 containing the buckets sizes, i.e. how many symbols have be to 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 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 f ill 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 N mess i which have a size of N sym mess i symbols.Each time a message is allocated, the bucket capacity B pbucket is decremented by N sym mess 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 f ill 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 ≤ r ≤ 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 SimP y 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 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×10 2 , N = 500 and A = 240 × 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, 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 (P L) between 120 − 160 bytes and with a message period (M P ) 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 P L goes between 20 − 40 bytes, and with a M P 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 lighttraffic 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 Fig. 6.DER performance with respect to an increasing traffic in the area near the gateway.
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-agressive EDs, whereas in the outer area were placed the aggressive ones, using the same ranges of M P and P L 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 trafficbalanced 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 P L. Inevitably, EDs whose P L is longer may have a longer Timeon-Air, increasing their collision probability.However, the EXPLoRa-TS heuristic applies an allocation policy based on the P L, so EDs whose P L 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 P L 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 multigateway experiments, and energy-consumption evaluations.
ISBN 978-3-903176-05-8 c 2018 IFIPII.RELATED WORKThe 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:

Fig. 1 .
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.

Fig. 2 .
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).

Fig. 5 .
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.

TABLE II SIMULATION
PARAMETERS.