# Analysis of Bidirectional ADR-Enabled Class B LoRaWAN Networks in Industrial Scenarios
## 2 LoRaWAN
### LoRaWAN  
LoRaWAN [5] oversees the definition of the MAC protocol and the architecture of the network system. LoRaWAN is an OSI layer 2 and 3 network protocol (see Figure 1) that works with LoRa technology and is supported by a central network server that orchestrates all the devices (end nodes and gateways) of the network (for instance, selecting the best gateway for a node).  
After these layers, the LoRaWAN architecture relies on application servers to connect with different application protocols, as shown in Figure 2.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Geographical Area** & **Working Frequencies** \\ \hline Europe & 863–870 MHz \\ America & 902–928 MHz \\ Asia & 470–510 and 779–787 MHz \\ Australia & 915–928 MHz \\ \hline \hline \end{tabular}
\end{table}
Table 1: Long Range (LoRa) frequencies for different geographical areas.  
Figure 1: LoRaWAN stack.  
Figure 2: LoRaWAN architecture.  
LoRaWAN offers three different classes or modes of operation for end devices (EDs), as seen in Figure 3. Class A is the most basic mode of communication. Communication is bidirectional, with the limitation that nodes can only receive a download packet if they have previously sent an upload message, which is a great limitation for some applications. However, the battery saving in this class is greater than in the other classes.  
Class B is also bidirectional, but in this case, nodes can also receive in scheduled time slots. When operating in class B, nodes send upload messages following the class A mechanism, which means they can send data at any time (always respecting the duty cycle), but they do not need to enable the RX windows, as the gateway will establish a schedule reserving slots for all class B nodes in the network. Other temporal parameters can be seen in Figure 4.  
For this mechanism to work, it requires every node to be synchronized with the gateway. This is achieved by using periodic beacons broadcasted by the gateway every 128 s. The time window between beacons is then divided into slots that can be assigned to nodes to enable downlink messages without the need for previous upload packets. Finally, class C allows bidirectional communication while respecting the duty cycle, at the cost of consuming more energy because it is always active.  
Figure 4: Class B beacon window temporal parameters.  
Figure 3: Operation of LoRaWAN classes.  
Regarding architecture, LoRaWAN networks have a star topology which makes more sense when trying to preserve battery life by obtaining greater connectivity at long range. However, for a long-range star network to be possible, the gateway must have the ability to connect a large number of nodes.  
The nodes are asynchronous and communicate with gateways when they have any data to send, either on a scheduled basis or by events. This type of protocol is similar to the Aloha method. Depending on the class used, the battery consumption can be affected since the nodes have to wake up to synchronize, and this synchronization is the main cause of the decrease in battery life.  
LoRaWAN guarantees a data rate from 0.3 kbps up to 50 kbps, acceptable for sending data in real time on IoT and machine-to-machine (M2M) applications.  
On the other hand, at low speed, lower battery consumption is guaranteed, which allows the device batteries to last longer.  
Another matter to keep in mind when sending and receiving messages is the duty cycle, which is the percentage of time a device uses or occupies the channel. Depending on the application and the frequency, it is limited between 0.1% and 10%, as can be seen in Table 2. In this case, it is 1% as it is in the 868 MHz band [6], corresponding to band G1. This choice allows end devices to use eight different channels to improve resiliency to noise.