## 3 Long-Range, Low-Power IoT Communication Protocols and Their Security
### LoRaWAN  
A long-range wide-area network (LoRaWAN) provides security at the network and application layers. The link layer protocol authenticates LoRaWAN sensor nodes, or _motes_, and provides integrity to the data frame. The application layer protocol provides confidentiality to the message end-to-end, by transferring encrypted data from the more to the application server. To explain the context of this network and its security, we next describe some fundamentals of LoRa networks. Figure 5: IoT communication architectures classified by distance and data rate in bits/sec. **Architecture. ** LoRaWAN is a proprietary protocol devised by the LoRa Alliance [47] that uses a free spectrum within the Industrial Scientific and Medical (ISM) band. LoRa has two parts [48]: the LoRa physical layer standard, and the LoRaWAN network protocol. * Within the LoRa physical layer specification, LoRaWAN uses different ISM bands depending on the geographic region. In North America, LoRa uses 72 uplink channels and eight downlink channels in the 902-928 MHz ISM band [25]. The channels are modulated using Chirp-Spread Spectrum (CSS) with multiple Spreading Factors (SF). SFs are chosen depending on the application since different SFs provide different transmission rates, which can vary from 300 bps to 50 kbps [49]. Higher SFs are associated with lower data rates. The advantage of a spread spectrum is that multiple nodes can transmit at the same time within the same physical channel. LoRaWAN nodes can initiate transmission at any time using a random-access mode similar to unslotted ALOHA networks [50]. * LoRa network topology has in the uplink the gateways or base stations (BS), which relay data packets from motes to a network server at the core IP network [51]. The server performs security functions, such as authentication, checking the packets' integrity, and removing duplicate packets. For the downlink, i.e., from the application server to the mote, the network server usually stores data from the user application to send to end devices. * The downlink and uplink transmissions depend on the type of LoRaWAN motes [47]:
* Class A devices are battery-powered devices that \"wake up\" to send data. All transmissions are initiated by the device in the uplink. These devices conserve energy; however, they experience the longest downlink latency because they can only receive downlink data after an uplink transmission. * Class B devices are battery-powered actuators that have scheduled receive windows. They listen for commands to perform an action. Because of the receive windows, these devices have low downlink latency while still being energy-efficient. * Class C devices in Class C are actuators that are not restricted by battery life and require the fastest response time. The receive window is always open, except when there is an uplink transmission. **Security. ** LoRaWAN uses the EtM approach, i.e., Encrypt-then-MAC. Based on IEEE 802.15.4 data link layer security, LoRa encrypts the application data using AES Cipher block chaining message authentication code (AES-CCM) mode, which is a combination of the AES Counter (AES-CTR) mode for confidentiality, and the cipher block chaining (AES-CBC) mode to generate a message authentication code (MAC) for integrity and authentication. The network server can verify the CMAC of the LoRA frame. However, only the application server can decrypt the frame's payload. A typical LoRa frame includes the frame header, a device identifier called _DevAddr_, a frame counter \(C\), the encrypted data payload \(EP\), and the MAC or MIC at the end. The frame header has fields such as frame type, protocol version, acknowledgments, mode of operation, commands, and adaptive data rate signaling, and it is used only between the device and the network server [52]. To provide confidentiality, the payload is encrypted with AES-CTR mode using the Application Session Key (AppSKey). As in Equation (4), the frame counter \(C\) and device identifier _DevAddr_ are also taken as inputs to the AES-CTR mode.