# An Adaptive Data Rate Algorithm for Power-Constrained End Devices in Long Range Networks
## 5 Adaptive Data Rate Algorithm Design
### Adaptive Data Rate Control Algorithm Based on Network Performance Optimization
#### 5.2.2 Adaptive Data Rate Algorithm for Network Performance Optimization
\begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline Channel Frequency & 500 MHz \\ BW & 500 kHz \\ SF & 7 \\ Transmission Power & 22 dBm \\ Coding Rate & 4/5 \\ Transmission Interval & 20 s \\ Actual Data Rate & 21.88 kbps \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Initial communication parameter configuration of the ED. Figure 15: Schematic diagram of GW and ED distribution at different distances. In contrast, the proposed algorithm evaluates the link state from both stability and reliability perspectives, taking into account factors such as average SNR, average signal strength, PRR, SNR variance, and signal strength variance. This multidimensional assessment method provides a more accurate judgment of link conditions, allowing the algorithm to demonstrate significant advantages in long-distance communication. ### Multi-ED Network Performance Testing Scenario

The GW is deployed on the roof of a 20 m high building, with 50 EDs distributed around the GW in campus and urban environments. Table 11 shows the initial communication parameter configuration of the EDs in the network. Figure 18 illustrates the distribution of the GW and EDs in the LoRa network. This experimental scenario is used to test the proposed algorithm's optimization of network throughput, average energy consumption of EDs, and average latency of EDs in the LoRa network, and compares the network performance with the I-SFA scheme, LoRaWAN ADR, and ADR+ algorithms. Figure 19 shows the actual deployment environment of the EDs and the GW. The results show the number of EDs corresponding to different data rates, as calculated by the NS after the algorithm has been completed. According to the algorithm's results, EDs that are closer to the GW and have better link quality are preferentially assigned higher data rates, thereby minimizing the use of lower data rates while ensuring communication reachability. There are 17 end devices (EDs) operating with the combination of spreading factor (SF) 7 and bandwidth (BW) 500, while 4 EDs use SF 7 and BW 250. For the combination of SF 8 and BW 500, 10 EDs are in operation, and 4 EDs use SF 9 and BW 500. Additionally, 5 EDs operate with SF 10 and BW 250, and 3 EDs use SF 11 and BW 500. Finally, 5 EDs correspond to the combination of SF 12 and BW 500, and 2 EDs use SF 12 and BW 125. To optimize network performance and reduce ED power consumption, a larger number of EDs are assigned higher data rates, while fewer devices are assigned lower data rates. This reduces the probability of packet collisions during transmission. Figure 18: Deployment distribution of GW and ED in the LoRa network. At the beginning of network operation, all EDs work at the lowest data rate, generating a 20-byte data packet every 20 s. Figure 20 shows a comparison of the average power consumption of EDs under four different ADR algorithms. The results indicate that the proposed algorithm reduces the average power consumption of EDs by 15.9% compared to the I-SFA scheme; in contrast, the LoRaWAN ADR algorithm and the ADR+ algorithm reduce power consumption by 6.2% and 11.3%, respectively. This advantage arises from the comprehensive evaluation of the link state in the proposed algorithm, which determines the optimal data rate for each ED, thereby effectively reducing power consumption. The I-SFA scheme, on the other hand, assigns SFs based solely on RSSI without optimizing power consumption. The LoRaWAN ADR and ADR+ algorithms rely on partial statistical information, causing EDs to tend to use faster data rates, which increases the probability of packet collisions and, consequently, the average power consumption of the EDs. Figure 21 shows a comparison of network throughput and average latency of EDs for four different ADR algorithms. The results indicate that the proposed algorithm significantly increases the network throughput corresponding to the data rates of EDs, surpassing the I-SFA scheme and outperforming the LoRaWAN ADR algorithm and the ADR+ algorithm.