# A LoRaWAN Network Architecture with MQTT2 MULTICAST
## 3 Technical Overview of LoRaWAN  
LoRaWAN is an open standard which specifies the network architecture and the communication protocol to connect between each entity of the network. The design of the network architecture and the relates protocols are determined by the network capacity, the battery lifetime of the nodes, the security, and the applications that can run over the network [11]. To illustrate a typical LoRaWAN network, Figure 1 shows a star-of-stars topology where one or more gateways (concentrators) relay download and upload traffic among end-nodes (mobile or fixed in a location) and a central network server respectively. The network server steers the traffic between each end-device and the associated application server. The communications are bi-directional. Communications between gateways and end-devices are a single-hop LoRa (the physical layer of a LoRaWAN network) or FSK (Frequency Shift Keying) connections. Communcations between gateways and the network servers use standard IP. LoRa is a chirp spread spectrum based modulation developed by Cycleo in 2009 and acquired by Semtech in 2012. LoRa modulation complexity is low thanks to the equivalent offsets in timing and frequency between the transmitter and the receiver. The data signal is modulated onto a chirp signal that changes its frequency with time. The chirp rate defines the spectral bandwidth (BW) of a LoRa signal. For instance, a spectral BW of 125 kHz corresponds to a chip rate of 125,000 chips/sec. The data rate can change depending on the employed spreading factor (SF), if we assume a fixed BW. The number of raw bits carried per symbol is expressed as \(SF\), and varies between 7 and 12. LoRa modulation includes a FEC (Forward Error Correction) scheme which adds redundancy in the code to find and correct erroneous bits. This improves the robustness of the transmitted signal [12]. \(CR\) is the Code Rate and its values can vary between 1 and 4. The data rate \(R_{b}\) is calculated as follows:  
\[R_{b}=SF\times\left(\frac{BW}{2^{SF}}\right)\times\left(\frac{4}{4+CR}\right) \tag{1}\]  
where \(SF\) is the spreading factor, the second term corresponds to \(R_{s}\) or symbol rate (symbols/sec) and the third term depends on the coding rate (\(CR\)). Thus, assuming fixed BW and coding rate, the data rate decreases as the \(SF\) increases. Table 1 presents a data rate (DR) configuration assuming a 125 kHz bandwidth and the default LoRaWAN Code Rate (4/5). The bit rate increases and the ToA (Time on Air) decreases as the SF is decremented. Figure 1: LoRaWAN network architecture. The communication between end-nodes and gateways uses different spreading factors and channels. In every transmission, the end-device selects the transmission channel in a pseudo-random way. The SF (or DR) is selected considering the message duration and communication range by using an Adaptive Data Rate (ADR) scheme [1]. In each transmission, the DR is selected considering the link budget (the higher the link budget, the faster DR or SF selected). Parallel transmissions in the same channel but in different SFs will not collide due to the orthogonality of the SFs. This can be used to improve the network capacity. Three classes of LoRaWAN end-devices are considered in the LoRaWAN standard (classes A, B and C), depicted in Figure 2. Class A is mandatory and the most employed, typical for battery-operated sensors. In Class A devices, two receiving windows are opened after an uplink transmission in order to receive a downlink transmission. Class B devices are typically battery-operated actuators. These devices behave similar, but use extra receive windows scheduled by beacon frames. Class C devices are typically mains powered. They are continuously listening except when transmitting.