1. Introduction
With the rapid development of the Internet of Things (IoT), Massive Machine-Type Communication (MMTC) [
1] plays a crucial role in connecting a vast number of devices and enabling intelligent services. The emergence of MMTC is driven by the explosive growth of IoT devices and the increasing demand for low-power and long-distance transmission. According to predictions, the number of MMTC terminals connected via wireless communication will exceed 30 billion by 2025 [
2], which demonstrates the immense potential and wide-ranging applications of the MMTC in the future development of the IoT [
3]. Compared to traditional Internet connectivity, the MMTC generally focuses on connecting a large number of machines and IoT devices, spanning various industries and domains such as smart cities, intelligent transportation, industrial automation, and agricultural monitoring. However, the conventional IoT connectivity technologies based on cellular systems usually struggle to meet the requirements of the MMTC applications for low power consumption and independent networking, which has led to the rise of low-power wide-area networks (LPWAN) technologies, bridging the technological gap between short-distance communication and cellular technologies [
4]. The LPWAN technologies offer characteristics such as low power consumption, long-distance transmission, and wide coverage, providing an ideal communication solution for the MMTC [
5]. Through LPWAN technologies, it helps to realize the intelligent interconnection of massive devices, efficient data transmission, and low-power operation of terminals [
6].
In particular, among the existing LPWAN, the Long Range Wide Area Network (LoRaWAN) stands out with significant advantages in large-scale IoT applications [
7]. The optimization of the LoRaWAN protocol aims to improve data transmission performance and provide a favorable user experience. It can be achieved by adjusting the transmission parameters of LoRa terminals, using adaptive data rate mechanisms, implementing collision detection and conflict management strategies, and defining different QoS requirements for different types of data traffic. The LPWAN radio access technologies aim to provide cost-efficient and energy-efficient communication across massive deployments of autonomous transducers and have lately experienced tremendous growth [
8]. It can connect thousands of devices and provide long-range, low-power communication capabilities.
The Long Range Radio (LoRa) is a typical LPWAN technology that works in the frequency band below 1 GHz. It can be independently networked in the license-free frequency band, and provide low power consumption and long-range communication through unique Chirp spread spectrum modulation [
9]. The frequency range of LoRa technology is 486.3∼487.7 MHz. LoRa has strong flexibility in radio parameter configuration, which can reduce network energy consumption, improve radio coverage, and reduce radio interference and error rate by adjusting parameters such as spreading factor, etc. [
10].
LoRaWAN is an open standard promoted by the LoRa Alliance, which defines the medium access control and network management protocol of the LoRa network. LoRaWAN provides three different terminal classes: Type A terminals transmit according to the Aloha protocol, with the lowest power consumption; Type B terminals periodically listen to beacons from the gateway; Type C terminals continuously listen to downlink incoming frames, and consume the highest power consumption [
11]. LoRa networks usually adopt a star topology, as shown in
Figure 1. The LoRa network architecture is divided into several parts: terminal, gateway, and network server. Generally, data transmission can be carried out between LoRa terminals and gateways through LoRa wireless technology, whereas communication protocols such as TCP/IP or UDP/IP can be used between gateways and network servers to connect through the internet. The network server can manage multiple LoRa gateways and act as a gateway for LoRa terminals to connect to the IoT cloud platform. The radio signal transmitted by the terminal is received by the gateway, which then forwards the data packet to a web server for further processing [
10]. In the uplink, the terminal initiates a communication request, and after each uplink transmission, the terminal can receive the data packet and confirmation information sent by the network server.
1.1. Related Works
Many existing works generally focused on the performance of LoRa networks, and analyzed from the perspective of communication link, such as scalability [
12], performance limitation [
13], etc. However, the performance of LoRa terminals depends not only on the communication link, but also on how each gateway manages resources. In the actual LoRa networks, resource allocation is crucial due to a range of issues, including limited network capacity, unfair resource utilization, data conflicts and collisions, energy consumption, and the lifespan of terminals.
Especially, the spreading factor and transmission power are important metrics for adjusting data transmission parameters in the resource allocation of LoRa networks. The spreading factor determines the bandwidth and transmission rate of data, whereas the transmission power determines the transmission distance and reliability of data packets. Although a high spreading factor may reduce bandwidth and data transfer rates, longer communication distances can still be achieved. The spreading factor refers to the expansion of the original signal into a wider frequency band when sending data, and a higher spreading factor means a wider frequency band, so that the interference signal is dispersed, which helps to reduce the interference of data in the transmission process and makes the data packet transmitted over a long distance. At the same time, the high spreading factor allows the network to operate under a relatively low signal-to-noise ratio, and in the process of long-distance transmission, the signal may become very weak due to path loss, but the high spreading factor still allows the receiver to correctly decode and identify these weak signals. The higher transmission power can increase the propagation range of the signal, improve the successful transmission rate of the data packet over a long distance, and improve the reliability of the packet to a certain extent when the signal is weakened. However, excessive transmission power will increase the energy consumption of the terminal and introduce interference, thereby reducing the reliability of the packet. Therefore, the requirements of data transmission rate, distance, and reliability can be effectively balanced by selecting the appropriate spreading factor and transmission power. As a special case, using a higher spreading factor in LoRa networks helps to provide a longer transmission distance but with a lower transmission rate, whereas using a higher transmission power helps to increase the transmission distance and signal penetration but at the cost of higher energy consumption. In addition, the automatic data rate (ADR) technology of LoRa networks helps to optimize the transmission parameters of the terminal devices, including spreading factor and transmission power, based on factors such as data packet quality and network congestion.
On the contrary, the use of unreasonable spreading factors and transmission power in LoRa networks, as well as the lack of ADR technology, may lead to increased unfair resource utilization, data conflicts and collisions, increased energy consumption, and shortened lifespan of terminals. Therefore, in the case of limited resources, it is necessary to select an appropriate spreading factor and transmit power, and utilize the ADR technology to ensure the stability, fairness, and efficiency of LoRa networks, so as to improve the utilization of network capacity.
Moreover, some other existing works have analyzed the effect of LoRa transmission parameters on network performance, such as spreading factor, bandwidth, coding rate, and transmission power, etc., improved LoRa performance through single resource optimization [
14]. Moreover, there are adaptive mechanisms considering the configuration of LoRa network communication parameters in dense IoT scenarios, and some parameter assignment algorithms have been proposed. For example, a LoRa terminal can configure its parameters according to the link budget, energy efficiency, network load, etc. [
15]. Generally, most of the existing works focused on optimizing a single radio parameter in LoRa to improve network performance. The representative work was as follows.
1.1.1. Spreading Factor (SF)
In recent years, the SF has become a popular parameter for LoRa resource allocation optimization. We take the EXPLoRa-SF algorithm [
16] as an example, which determined the percentage of terminals operating for each SF based on the Received Signal Strength Indicator (RSSI), used an ordered water injection method to allocate SFs and balanced the airtime of the data package transmitted by terminals in each SF group. In addition to RSSI, the path loss was also used as a measure to optimize the allocation of SF. The terminals were ordered by the estimated path loss distance to the gateway, and the terminals closest to the gateway were assigned the lowest SF. By optimizing the SF distribution, the average packet error rate of users far from the gateway was reduced [
17]. Moreover, the multi-gateway configuration has also become a consideration for allocating SF, and a distributed SF allocation algorithm was proposed based on several criteria facing multi-gateway deployments that effectively allocated SF to progressively joining terminals [
18]. Particularly, linear programming has become an important tool for optimizing SF allocation, for example, some works optimized SF allocation by using an integer linear programming model to maximize the number of serving terminals [
19]. Moreover, some works adopted an intelligent assignment strategy in SF assignment based on machine learning, which was optimized by using support vector machine and decision tree classifier machine learning. This mechanism usually started from learning the transmission behavior of terminals, and the network server assigned SFs according to its prediction of collisions [
20]. In general, the adaptive SF allocation algorithm often had great flexibility, which took the initial SF allocation and the interference-based adaptive SF allocation in the deployment phase [
21].
1.1.2. Transmission Power (TP)
The TP is also one of the optimization parameters in LoRa networks. The iterative approach has been usually used to allocate the minimum power until the minimum power index is reached, then the iterative allocation of the maximum power until the maximum power index is reached, iterating between the two to allocate the remaining TP [
22]. By monitoring the channel status and link quality of the network, the dynamic optimization of transmission power was achieved based on feedback mechanisms, maximizing the efficiency of data packet transmission [
23]. The mathematical model was established for LoRa networks, which considered factors such as energy efficiency, signal quality, and network capacity. The numerical methods were employed to implement an optimal transmission power control algorithm [
24]. To achieve a fair data rate independent of the gateway distance, it is necessary to avoid excessive TP to reduce energy consumption.
1.1.3. Adaptive Data Rate
To optimize the adaptive data rate, some works proposed a greedy algorithm, which designed an enhanced greedy adaptive data rate algorithm with coding rate adaptation to optimize the trade-off between delivery ratio and energy consumption [
25]. Moreover, some guarantee parameters were dynamically selected to compensate for the error of the adaptive data rate channel condition estimation to meet the reference data extraction rate [
26]. In adaptive data rate technology, the gradient projection method was considered for addressing contention issues caused by data rate [
27]. Based on the link, the binary search algorithm was used to configure the transmission parameters of terminal nodes, achieving lower complexity [
28]. The terminal node status was determined, and a Kalman filter was applied to estimate the signal-to-noise ratio for mobile terminals, thus determining the terminal transmission parameters [
29].
1.1.4. Packet Distribution Ratio
Some other works adopted reinforcement learning methods in the packet distribution ratio allocation strategy, and the resource allocation problem was modeled as a Multi-Armed Bandit (MAB). Through a two-phase algorithm named MIX-MAB algorithm, the terminal can determine its transmission parameters in a distributed mode [
30]. Based on collected data from an actual network, including link quality and environmental conditions, the packet distribution ratio model was developed to calculate the successful transmission rate of data packets in LoRa networks [
31].
1.2. Motivation and Contributions
The problem of near-far effect is one of the causes of unfairness in the LoRa network. In wireless communication, the received power varies between different locations due to the influence of path loss, fading, and other effects during data transmission. For the general case, we assume that the receive power at the receiving end close to the transmitter source may be higher than the distant receiving end, but it is not necessarily the maximum. This situation can affect the capture effect of the LoRa network. Therefore, the received power of all terminals needs to be balanced to achieve a fair data rate, regardless of their distance from the gateway [
22]. However, the optimization of resource allocation in the LoRa network focused on a single parameter such as the spreading factor, and the optimization goal is limited to a single goal such as optimizing the terminal adaptive data rate. There is still a great lack of tools, methods, and models for multi-radio parameter, multi-objective optimization. In general, traditional dynamic programming and Lagrangian relaxation methods often face the curse of dimensionality when solving problems. With the development and application of commercial solution software, Mixed Integer Linear Programming (MILP) has gradually shown its good advantages [
32]. In the MILP model, optimization problems can usually be modeled as seeking solutions that satisfy certain optimal properties under certain conditions [
33]. These problems can be expressed by a set of decision variables, a set of constraints, and a set of objective functions. The main advantage is that it can utilize mature computing tools, and the solution methods are diverse, with controllable solution accuracy and calculation time [
34].
In this paper, we use Mixed Integer Linear Programming (MILP) to optimize LoRa radio parameter configuration to improve LoRa network performance. Starting from the management of wireless resources by the gateway, we propose an optimal framework for the joint allocation of SF and TP. To maximize the data extraction rate in the LoRa network and ensure the lowest energy consumption, we develop and optimize a solution in terms of mixed integer linear programming formulations to solve problems.
Our contribution is to solve the resource allocation optimization problem in the LoRa network uplink transmission system. By establishing a multi-objective function with the lowest packet collision probability and the lowest network energy consumption, we propose an optimal joint allocation of SF and TP. In this scheme, the radio parameter assignment problem is constructed as a MILP model and solved with the aid of the optimization solver Gurobi [
35]. Finally, we perform a simulation analysis of the network performance based on the obtained optimal solution.
The main contributions of this paper are summarized as follows:
According to the Aloha protocol mechanism adopted in the LoRa network, we classify data packets collision into three theorems, namely, no conflict, conflict avoidance, and conflict occurrence. The above theorems can provide a basis for analyzing the collision effect and capturing the effect of packets in the LoRa network.
Against the singleness of parameter allocation of the existing LoRa network, we propose the improvement idea of multi-parameter and multi-objective optimization, and transform the problem into a Mixed Integer Linear Programming (MILP) model. The proposal of this model fundamentally eliminates the defect of single parameter optimization in the LoRa network.
Since the MILP model is a non-convex optimization problem, which is difficult to solve in terms of time and efficiency, we propose the heuristic fusion algorithm, which uses the combination of Gurobi mathematical solver and the heuristic genetic algorithm. We input the better solution obtained by the heuristic genetic algorithm into the solver as the initial solution of Gurobi, and get the final results through Gurobi.
Numerical results demonstrate that the proposed algorithm can significantly reduce the number of data packet collisions and effectively reduce network energy consumption, with good fairness among terminals. Compared with the dynamic radio parameter allocation strategy, including Genetic Algorithm (GA) and Approximate Average Packet Airtime Algorithm (AAPA) [
36], the average increase in data extraction rate is 5.2%, and the energy consumption is reduced by an average of 41.5%. Compared to traditional allocation strategies, including minimum airtime allocation, equal distribution allocation, and random allocation, the data extraction rate increases by an average of 14.3%, and energy consumption decreases by an average of 23.7%.
1.3. Organization
The rest of this paper is organized as follows. The LoRa network collision effect is analyzed in
Section 2, including the transmission model and collision analysis. The LoRa network resource allocation optimization is introduced in
Section 3, including the problem formulation and the MILP solution algorithm.
Section 4 provides the simulation results. The conclusions are finally summarized in
Section 5.
4. Simulation Results
To show the performance of different parameter selection strategies, we choose the LoRaSim simulation platform for performance verification [
43]. With this tool, we deploy terminals as well as a gateway in a two-dimensional area, assuming that a single gateway can decode concurrent signals on all SFs. The parameters set in the simulation are shown in
Table 1.
We use three types of indicators to evaluate the performance of the LoRa network, namely data extraction rate (DER), the number of collisions, and network energy consumption, in addition to evaluating the effectiveness of the model.
It can be found from the analysis that our proposed MILP model is a non-convex optimization problem. Therefore, when using the mathematical solver, we first set a fixed solution time of 3600 s to obtain as good a solution accuracy as possible within this time. For the proposed MILP model, we combined the Gurobi mathematical solver and heuristic genetic algorithm to solve the problem. The parameter allocation strategies we selected include minimum airtime allocation, equal distribution allocation, random allocation, Genetic Algorithm (GA), and Approximate Average Packet Airtime Algorithm (AAPA) [
36].
(1) Data extraction rate: We evaluate the data extraction rate of the LoRa network within the value range between 0∼1. The closer the DER is to 1, the more effective the LoRa deployment will be. The following is the calculation formula of DER:
where
represents the number of received packets,
C represents the number of conflicting packets, and
represents the number of sent packets. As shown in
Figure 3, compared with the genetic algorithm, AAPA algorithm, minimum airtime allocation, random and equal distribution allocation, the DER optimal solution obtained by using the Gurobi tool increased by 2.7%, 7.6%, 10.7%, 14.8%, and 17.3%. It can be found that the genetic algorithm has a poor search ability and low search efficiency in the face of high-dimensional and complex problems, and it is prone to premature convergence problems and falls into local optimal solutions. In addition, random allocation and equal distribution allocation are suitable for the situation with few LoRa network terminals. The disadvantage is that random allocation may have terminals close to the gateway using high SF, thereby increasing the airtime of data packets and increasing the probability of collision, whereas equal distribution allocation only distributes the number of terminals evenly among
, without considering the different applicable distances of SF. The model proposed in this paper is a global optimization that considers all terminals in the entire network, providing the optimal spreading factor and precise transmission power values for each terminal. Accurate parameter allocation helps to reduce packet collisions and interference, thereby improving the data extraction rate of the network.
(2) Number of collisions: When there are two or more terminals in the LoRa network sending data at the same time, if a collision occurs, the transmitted data may be lost. When two LoRa transmissions occur at the same time, by analyzing the SF, TP, energy, and time conditions, it is determined that the receiving end can simultaneously decode the received packets. From
Figure 4 and
Figure 5, it can be found that the number of data packet collisions and the collision rate are under different parameter allocation strategies. It shows that the number of data packet collisions caused by the Gurobi optimization strategy is the lowest, which is far lower than other parameter allocation strategies. After optimization, the network strives to ensure that each terminal has an equal transmission opportunity by maximizing the fairness among terminals, thereby balancing the utilization of resources among different terminals. When resource allocation is more balanced, the transmission timings of different terminals are less likely to overlap, thereby reducing packet collisions.
(3) Network energy consumption: The NEC is defined as the energy consumed by the network to successfully extract information. Generally, the energy consumption of the LoRa terminal depends mostly on the energy consumption of the transceiver. Since terminals are mostly battery-powered, the energy consumption of the transmission must be kept to a minimum.
Figure 6 shows the trend of NEC changing with the number of terminals. For every increase in SF of 1, the transmission rate is halved, the transmission duration is doubled, and the final energy consumption is doubled [
42]. It can be seen from the results that using Gurobi to solve the MILP model can not only maximize the DER of the network, but also effectively ensure the lowest level of energy consumption. The reason is that packet collisions may cause data transmission failures and retransmissions, but this not only consumes network bandwidth and resources, but also consumes additional energy, affecting the overall efficiency of the network. By selecting the appropriate spreading factor and transmission power, packet collisions and packet retransmissions can be reduced, enabling the network to more effectively utilize limited resources and improve terminal energy efficiency. The energy consumption caused by random allocation, equal distribution allocation, genetic algorithm, AAPA algorithm, and minimum airtime allocation is 8.3 times, 6.4 times, 6.5 times, 1.9 times, and 1.8 times the Gurobi optimization strategy, respectively.
(4) Throughput: Due to the low power consumption characteristics of LoRa, high throughput can be achieved through appropriate parameter selection, as selecting a lower SF can improve the transmission rate, whereas selecting the appropriate transmission power can balance packet quality and energy consumption. The model proposed in this paper can improve the data extraction rate while minimizing energy consumption. As shown in
Figure 7, the model proposed in this paper also has good performance in throughput. This model enables terminals in the network to achieve the optimal balance between data transmission rate and energy consumption, and can accurately determine the optimal SF and transmission power of each terminal. The parameters of terminals can be dynamically adjusted based on network status and requirements for global optimization, which helps to maximize the performance of the entire network and maintain high throughput. In the minimum airtime allocation, all terminals use the minimum spreading factor, which means that the signal bandwidth is narrow and more data can be transmitted, resulting in high network throughput. Random allocation, equal distribution allocation, and genetic algorithm have certain uncertainties in parameter selection, and cannot achieve global optimization results.
(5) Effectiveness of the MILP model: We compare the performance of the MILP model under different channel qualities, and the model shows good applicability. From
Figure 8 and
Figure 9, it can be found that changing
in the path loss model will hardly affect the DER and energy consumption of the Gurobi optimization parameter allocation strategy, whereas the random allocation and equal distribution allocation strategies are greatly affected by channel interference. This model has dynamic adaptability, allowing terminal parameters to be optimized based on network status and requirements to adapt to worse channel conditions. In addition, based on mathematical programming methods, this model can obtain reliable parameter decisions and maintain stable performance.
Furthermore, we take 500 terminals as an example,
Figure 10 shows the selection result of SF in the case of a single gateway and multiple terminals. The Gurobi allocation strategy is to select the SF that satisfies the constraints as small as possible, which means that it can achieve lower data packet transmission time, reduce the possibility of collision, and at the same time, it can also achieve network energy consumption under the premise of without reducing the data extraction rate. According to the data packet transmission time formula, the transmission time is the smallest when the BW and CR are fixed and SF equals seven. Therefore, when the terminal transmission time is all concentrated in SF7 in the minimum airtime allocation scheme, the probability of data packet collision is also greatly increased.
To evaluate the fairness level of different algorithms, the Jain’s fairness index is introduced as follows [
44]:
where
N is the number of terminals in the LoRa network, and
is the data extraction rate of terminal
i. The range of the fairness index is 0∼1, and the higher the value, the fairer the terminals are. Under the assumption that SF is completely orthogonal and the capture effect is considered, the results for different numbers of terminals are shown in
Figure 11. It can be seen that regardless of the number of terminals, the fairness index of the proposed model is close to 1, showing good fairness among most terminals in the LoRa network. This model has the characteristic of global optimization, which means that it can simultaneously consider the mutual influence between multiple terminals, which helps to avoid excessive concentration of resources on certain terminals. In Equation (
15), the optimization objective is transformed into minimizing the difference in the utility function of nodes, thereby improving overall fairness. However, in the comparison scheme, as the number of terminals increases and the conflicts increase sharply, the fairness index will decrease obviously, which reflects the effectiveness of the MILP model.
In Equations (
16) and (
17), the data packet generation probability
is fixed. Further, in order to analyze the effect of changes in
on the algorithms, we assume that the time interval between LoRa terminal data packet transmissions follows a Poisson distribution, and the results shown in
Figure 12 are obtained. It can be found that when the packet generation intervals in the network obey the Poisson distribution, the data packet extraction rate decreases synchronously. In this scenario, the proposed algorithm still outperforms the AAPA algorithm. The randomness of the Poisson distribution provides a more realistic simulation of packet generation, but may also increase the probability of data packet collisions and collisions, which demonstrates the excellent performance of the proposed MILP model in LoRa networks.
Moreover, when using the Gurobi tool to solve the MILP problem, to further improve the solution accuracy and take into account the solution efficiency factor, the optimal solution of the model obtained by the heuristic algorithm is used as the initial calculation solution of Gurobi.
Figure 13 is a comparison of DER under the fusion algorithm, Gurobi without an initial solution, and the heuristic algorithm. It can be found that using the hybrid solution combining the heuristic algorithm and Gurobi, the quality of the obtained solution is higher, and the data extraction rate is further improved. The computational complexity of the model is
, where
K is the number of decision variables,
B is the number of binary decision variables, and
M is the number of constraints. In large-scale terminal and massive machine communication scenarios, it usually requires a lot of computing power for the resource allocation in LoRa networks to be modeled as MILP. This may lead to delayed responses, adversely affecting time-sensitive service operations. In addition, as the network size increases, the scalability of the model may be limited.