# An Efficient Adaptive Data-Link-Layer Architecture for LoRa Networks
## 1 Introduction  
Low-power wide-area networks (LPWANs) play a key role in the implementation of the IoT (Internet of Things) concept, and LoRa (which stands for \"long range\") is among the most popular of these technologies [1]. LoRa defines a spread spectrum modulation technique based on the chirp spread spectrum (CSS) [2]. Covering the physical layer of the OSI (open systems interconnection) model, it makes use of the sub-gigahertz ISM (industrial, scientific, and medical) bands to enable low-power and long-range communication that can reach up to 10 km in rural areas. The LoRaWAN open specification [3] is built over the LoRa physical layer, providing upper-layer protocols and the means to connect the LoRa devices (end nodes) to the Internet. It defines the device-to-infrastructure LoRa parameters and the LoRaWAN protocol, allowing for interoperability between devices. LoRaWAN has established itself as one of the main IoT communication stacks for low-power and lossy networks (LLNs). The LoRaWAN network architecture consists of a star-of-stars topology (see Figure 8 in [2]), where gateways forward packets from end nodes (usually, data collected from sensors) to a network server and vice versa. The network server manages the network by performing functions such as deduplicating received packets and controlling the data rate. The data can then be accessed by the user through the Internet on application servers and cloud services. While LoRa is a single-channel point-to-point (P2P) technology, LoRaWAN is a more complex multi-channel network where several low-cost ensimultaneously with high-cost LoRaWAN gateways using different channels and spreading factors (SFs). The LoRaWAN protocol controls the LoRa physical layer through the implementation of useful functionalities such as adaptive data rate (ADR), which manages the transmission power and spreading factor according to the received packet SNR (signal-to-noise ratio). However, it relies on expensive hardware to support these functionalities. A functional LLN can be implemented on top of LoRa, instead of relying on LoRaWAN, and this may be a reasonable approach for simple network topologies (such as star) in low-power applications. By following this method, one can detach the network from a specific LoRaWAN infrastructure, which leads to lower costs. However, most works that pursue this approach do not consider adopting a mechanism similar to ADR from LoRaWAN, relying instead on a fixed physical layer parameter set. This leads to inefficient use of networks and end node resources, such as bandwidth and energy, which may be critical for the lifetime of end nodes, since they are typically battery-operated in many application scenarios. Implementing an efficient LLN on top of LoRA requires a deep knowledge of the physical layer parameters and the development of a data-link-layer protocol. Transmission power (TxP), spreading factor (SF) and bandwidth (Bw) are three important and intrinsically related LoRa parameters because they have impact on range, data rate, and energy consumption. For example, a high TxP provides a long communication range but increases the energy consumption, and a higher SF increases the range but reduces the data rate (which can impact throughput), whereas increasing the used Bw increases the data rate but reduces range. Our contribution in this paper is the proposal and evaluation of a LoRa data-link-layer architecture based on a multi-layer star network topology that dynamically adjusts the LoRa parameters of each end node taking into account the SNR in order to balance its communication range and energy consumption. The designed architecture takes into account that the end nodes usually are placed at different distances from the gateways and, therefore, require different parameter configurations to achieve a satisfactory link quality. The proposed architecture ensures efficient use of the chosen ISM band and low-cost implementation and operation, i.e., without requiring the use of third-party LoRaWAN services or infrastructure.