## 2 Materials and Methods
### Background
#### 2.1.2 Data Rate Allocation Issues Related to Range and Power Consumption  
The ADR mechanism, as mentioned before, is based on two concurrent algorithms. The one on the network side is optional but highly recommended [14] and not explicitly defined in the LoRaWAN protocol specification. Frequently, variants of this mechanism, which is not unified between deployments, are based on implementation of a simple distance-based approach in which the minimum possible transmission power and the maximum data rate that enable ED and GW communication are assigned to it. Most of the schemes that are currently available rely on EDs with static proximity (fixed locations) and on environmentsin which the channel attenuation is stable [7]. Semtech does provide a recommended algorithm which is quite popular for deployment and has been adopted by a lot of open source projects, such as the things network. More specifically, in Semtech's scenario for the EU868 band, the ED decides if a default or a self-assigned data rate and transmit power should be used, or if the network server should adjust the data rate. On the side of the ED, the algorithm is based on the idea of reacting to the lack of requested downlink feedback by decreasing the data rate which results in increasing the communication range. On the network server side, if ADR is activated, it optimizes the data rate to achieve transmissions with the minimum time on air with the least possible transmission power. This data rate is calculated according to the highest SNR of the last 20 received messages. ADR is working in such a way that only the network server can increase and only the ED can decrease the data rate [10]. If the ED is not already using the highest data rate and the lowest transmission power, it calculates the most suitable data rate for this situation. Any new transmission power and data rate is communicated through the LinkADRreq MAC command within a downlink frame, and this is acknowledged with the piggybacking of a LinkADRns MAC command in the ED's next uplink frame [14]. If the connection is lost, the ED reduces the data rate until the message reaches the server [10]. Unfortunately, evaluations on ADR algorithms showed a failure in converge synchronization and inconsistent behavior between different implementations of the network server. The ADR algorithm on the ED is slower to converge as it has been designed to minimize the amount and maximize the flexibility of the control of plane downlink traffic, which is greatly limited by the duty-cycle regulations. The network server-side algorithm in most cases converges EDs to a data rate that can achieve greater range but is less energy -efficient. On the other hand, the ED side algorithm, which does the opposite, can potentially converge to a lossy link. The authors of [14] have found that the network convergence time is greatly increased when scaled. They proved that the Semtech ADR algorithm is effective only in stable channel conditions but not in variable conditions. In addition, they observed that the algorithm performance cannot scale due to spectrum duty-cycle regulations and that in a lossy channel the ED side algorithm convergence time is increased. Additionally, the total convergence time to reach a steady data rate for all EDs is relative to both starting data rate and also to the number of EDs within the network. Thus, the starting data rate of an ED has a huge effect on the convergence time. In contrast, network server algorithms converge to the ideal data rate much quicker than the ED side, which only changes the data rate of an ED one step at a time. The network server ADR changes begin to occur after some amount of uplink frames are received. The choice of a particular number of uplinks received to trigger changes is quite arbitrary, and it may become clear quickly that the data rate of an ED should be increased. For example, if an ED first joins the network with any data rate, this join procedure data rate becomes the first set data rate of the upcoming uplinks.