# Analysis of Bidirectional ADR-Enabled Class B LoRaWAN Networks in Industrial Scenarios
## 5 Scenario  
An objective of this work was to analyze the performance of LoRaWAN class B nodes in industrial scenarios. As such, simulations were carried out simulating the characteristics of an industrial plant. The dimensions of 2000 m \(\times\) 500 m were chosen for the industrial plant. The height of the chosen plant was 10 m. This scenario was based on an automotive production plant that is used in related projects. The definition of the scenario important for obtaining useful results. Therefore, this work aimed to select a realistic industrial scenario and application and simulate it in order to characterize the network before any real deployment is done. Figure 7 shows the test site plan with the industrial plant divided into four large, connected warehouses, with each of the 200 nodes located at a unique grid intersection and the gateway in the bottom-left corner. This configuration allows simulation of indoor behavior, with internal and external walls, in a realistic scenario. Figure 6: State machine for implemented adaptive data rate (ADR) in end device (ED) uplink (left) and gateway downlink (right). It was decided to distribute the 200 nodes throughout the plant uniformly in 100 m \(\times\) 54 m squares, as seen in the grid. On the other hand, it was decided to place the gateway at the end (0,0), thus achieving a greater distance from the farthest node to obtain worse channel performance and observe the ADR mechanism impact in the change of SF. The technology simulated was LoRaWAN, class B in particular. This class is the one that enables download traffic, without end devices starting the communication, and without the excess energy consumption which occurs in class C, but always respecting the duty cycle. Regarding the chosen payload, the size was 21 bytes (13 bytes of LoRaWAN protocol + 8 bytes of data); in this way, a higher rate of successful reception of packets was made possible. The preamble length was 8 symbols by default as indicated in the standard. Depending on the SF, the final number of symbols varied. Once the sizes of the packages were chosen, with the Equations (3)-(7), as defined in the LoRa modem design guides from Semtech [14], the calculation of LoRaWAN message airtime proceeded as follows:  
\[T_{\text{preamble}}=\left(n_{\text{preamble}}+4.25\right)\times\ T_{\text{sym}} \tag{3}\]  
\[payloadSymbolNb=8+\text{max}(\ ceil\left(\frac{8 PL-4 SF+28+16-20H}{4(SF-2 DE)} \right)(CR+4),\ 0) \tag{4}\]  
\[T_{\text{payload}}\ =payloadSymbolNb\times T_{\text{sym}} \tag{5}\]  
\[T_{\text{sym}}\ =\ \frac{2^{SF}}{BW} \tag{6}\]  
\[Air\ Time=\ T_{\text{preamble}}\ +\ T_{\text{payload}} \tag{7}\]  
where SF is spreading factor, PL is number of bytes of the payload, H is insertion of the optional header in the frame, DE is use of the optimized rate, and CR is code rate. Firstly, to determine the time on air, it is necessary to define the symbol time (6). This is the time it takes to send chirps at the chirp rate. On the other hand, another time to consider is the preamble time (3), where n\({}_{\text{preamble}}\) is the number of symbols in the preamble. It is also necessary to consider the number of symbols that make up the header and the payload of the package, which is calculated with Equation (4). Once the payload time (5) has been defined, the calculation can be made for the time on air (7), which is the sum of times of the payload and preamble. With this, in the best case with an SF = 7, the airtime is 56.58 ms and the duty cycle allows sending a message every 6 s. In the worst case, with an SF = 12, the airtime is 1482.75 ms and the duty cycle allows sending a message every 2 min 28 s. Therefore, any message rate above that value, such as  
Figure 7: Distribution of nodes within the scenario. the selected rate of one message each 300 s, is ensured to comply with the duty cycle regulations.