# LaRaWAN Metering Infrastructure Planning in Smart Cities
## 3 Materials and Methods
### LoRaWAN Technology Overview  
LoRaWAN, a network standard introduced by the LoRa Alliance [27], utilizes the proprietary LoRa modulation technology, which is based on the Chirp Spread Spectrum modulation technique developed and owned by Semtech Company [14]. It operates in one of the unlicensed ISM radio bands, which is geographically dependent. In Europe, the _LoRa Alliance_ established two specific frequency bands for the implementation of LoRa technology. These bands are EU433, ranging from 433.05 to 434.79 MHz, and EU863, spanning from 863 to 870 MHz. The primary modulation parameter in LoRa technology is the _spreading factor_ (SF), which impacts both the data rate and the range of radio transmission. The spreading factor can range from 7 to 12. Signals modulated with different spreading factors are orthogonal, enabling simultaneous transmission and decoding at the same time and frequency. Additionally, signals with the same spreading factor can be decoded even if there is a power level difference of 6 dB between them (Table 1). The LoRaWAN architecture defines an open protocol standardized by LoRa Alliance at the MAC (Medium Access Control) network layer. A LoRaWAN network follows a star topology, where end nodes such as sensors and physical parameter measurement systems exclusively communicate with LoRaWAN gateways within a specific area. In this network structure, end nodes do not communicate directly with each other. This configuration is depicted in Figure 1. As a result, gateways play the role of packet relays within the network by encapsulating raw data into IP packets using TCP or UDP protocols. Additionally, the network server facilitates the transmission of downlink packets to the end nodes. The specifics of this transmission process depend on the class of the end device. The LoRaWAN standard outlines three classes of end devices: A, B, and C.  
In _Class A_ devices, the majority of the time is spent in sleep mode. These devices activate two receive (RX) windows, one and two seconds after completing packet transmission from the end device to the gateway. This mechanism allows the end devices to send acknowledgment packets, indicating successful receipt of the message by the network server. The first window utilizes the same frequency channel for transmission. In the second window, transmission occurs on a channel with a frequency of 869.525 MHz, \begin{table}
\begin{tabular}{c c c c c c c} \hline \(\mathbf{SF_{ref}}\) & \(\mathbf{SF7}\) & \(\mathbf{SF8}\) & \(\mathbf{SF9}\) & \(\mathbf{SF10}\) & \(\mathbf{SF11}\) & \(\mathbf{SF12}\) \\ \hline
7 & 6 & \(-16\) & \(-18\) & \(-19\) & \(-19\) & \(-20\) \\
8 & \(-24\) & 6 & \(-20\) & \(-22\) & \(-22\) & \(-22\) \\
9 & \(-27\) & \(-27\) & 6 & \(-23\) & \(-25\) & \(-25\) \\
10 & \(-30\) & \(-30\) & \(-30\) & 6 & \(-26\) & \(-28\) \\
11 & \(-33\) & \(-33\) & \(-33\) & \(-33\) & 6 & \(-29\) \\
12 & \(-36\) & \(-36\) & \(-36\) & \(-36\) & \(-36\) & \(6\) \\ \hline \end{tabular}
\end{table} 
Table 1: Interference thresholds for different SF (SINR) [dBm]. employing a spreading factor of SF 12 and an increased transmission power of 24 dBm. This mode is designed for low power consumption. In order to enhance the transmission capabilities towards end nodes, devices operating in _Class B_ mode introduce reception windows at predetermined intervals. The gateway sends downlink beacons to _Class B_ end devices, synchronizing them and notifying the network server about the specific times when an end device will be listening for downlink traffic. On the other hand, _Class C_ devices keep their windows continuously open, remaining available at all times for downlink traffic, except during their own transmission periods. The LoRaWAN protocol incorporates mechanisms to ensure reliable and secure communications. One such mechanism is the Adaptive Data Rate (ADR), which enables the dynamic management of link parameters to enhance packet delivery rates. The management of transmission parameters is possible on both the end device and network server sides.