# Analysis of Bidirectional ADR-Enabled Class B LoRaWAN Networks in Industrial Scenarios
## 1 Introduction  
Any everyday object today has the ability to interact with other objects without human intervention if they are connected to a network. This interconnection between machines is known as machine-to-machine (M2M) communication and has evolved over the years to create the concept of the Internet of Things (IoT), as a greater variety of objects have enabled communication features and can exchange data through the internet. Cybernetic systems, the use of the Internet, and these types of networks are currently allowing an evolution in industry, giving way to Industry 4.0, which seeks the transformation towards an intelligent organization in order to achieve optimized results. Based on this definition, the \"Industrial Internet of Things\" (IIoT) concept has emerged, using IoT-based technologies with the aim of improving industrial processes. Some of the most promising communication solutions being adopted are low-power wide-area network (LPWAN) technologies since their characteristics fit some industrial application requirements [1]. LPWAN technologies make use of end devices, gateways, network servers, and application servers to enable the exchange of data in the range of kilometers at a very low energy cost. Within LPWAs there are several technologies such as Sigfox, LoRaWAN, NB-IoT, or Dash?. All LPWAN candidates enable long-range communication, use devices with a battery life that can last up to years (configured accordingly), and can integrate a large number of devices with small infrastructure, which entails a low cost. LoRaWAN (Long Range Wide Area Network) has been chosen for all the advantages it offers. The key advantage of selecting this technology over the other popular LPWAN solutions is that LoRaWAN can be deployed as a private network, avoiding the use of public infrastructure andallowing some degree of optimization and special configuration that can be of interest to better fit industrial applications, as it operates in unlicensed bands and the MAC layer protocol is open [2]. Nevertheless, there are still some aspects, issues, and barriers to overcome for this technology to be successfully adopted. One hurdle to face is battery lifetime. These devices must have a long useful life, but this is only possible with careful configurations and optimizations. Another big issue is the loss of packets in the network, which is influenced by the position of devices. This is a problem since the loss of information can have serious repercussions in the industrial process and data analytics. The use of a LoRaWAN network in industrial scenarios makes sense because of this network's ability to deploy a large number of connected devices. To improve the performance in such networks, the implementation of the Adaptive Data Rate (ADR) mechanism has been carried out following the description of the standard. This mechanism saves resources on the channel and saves battery by optimizing the transmission parameters. It also helps to adapt to channel conditions by changing the data rate transmission parameters of devices, which translates into a reduction in congestion in dense areas. In this way, the probability of success increases considerably. The main output of this work is therefore the implementation of the mechanism for adapting the data rate under a simulator--in this case, the widespread ns-3 simulator. This simulation tool allows operators to characterize the operation of the network and optimize parameters to reduce consumption and losses by configuring some parameters not strictly fixed by the standard. This implementation not only includes the mechanism for the uplink communication, which is the one selected by the standard, but also proposes using this mechanism for the downlink communication, from gateway to nodes, so it can help optimize new applications often overlooked until now, where the receivers of data are the end devices, such as actuators and sensor configurations.