# A Complete Key Management Scheme for LoRaWAN v1.1 +
## 3 LoRaWAN v1.1 Structure Analysis  
In general, the LoRaWAN network is comprised of the following elements: end devices (typically a constrained devices), gateways (purely relay messages, or calls base stations), network servers, application servers, and join-servers. A LoRaWAN network has a star of stars topology. The gateways relay the data between end-devices and a network server, a network server directs the data between end devices and the paired application server. A join server comes to play at the initial stage when the device joins/rejoins the network. The join server generates and distributes the pairs of session keys from their devices' root keys to each player in the network (i.e., the corresponding network server and the application server). The device would successfully establish a secured radio channel using the Advanced Encryption Standard (AES 128) symmetric block cipher once it joins the network. Figure 1 illustrates the layout of the LoRaWAN structure. Furthermore, the end-devices collect service-oriented data from the environment and send it to the gateway via a single hop LoRa technology (an LPWA technology). Then the data is sent to the correct network server and vice versa. A mobile end device can receive data that traveled through one or many gateways before reaching the correct network server. Gateways are connected to the network server through a secured standard Internet Protocol (I.P.) connection. All communications are generally bi-directional, although the uplink communication from an end-device to the network server is expected to generate the majority of the network traffic. Communication between end devices and gateways are spread out across different frequency channels and data rates. It uses the LoRa, a radio modulation technology that is based on Chirp Spread Spectrum (CSS) running on Industrial, Scientific and Medical (ISM) unlicensed bands. The frequency bands differ from regions that apply EU868, EU433, US915 and AS430 standards [8]. To maximize both the battery life of the end-devices and the overall network capacity, the LoRa network infrastructure manages the data rate and radio-frequency output for each end-device individually via an Adaptive Data Rate (ADR) scheme. The network server is the center of the star of stars topology. This is where the Medium Access Control (MAC) payload is deciphered, and the cipher application message is transmitted to the application server. The application server processes the application-layer payloads. Depending on the end-devices' functionality, there are three different classes of LoRaWAN: Class A, Class B and Class C for the end-devices. Class A allows bi-directional communications with each end-devices with one uplink transmission that follows two short downlinks receive windows. Class A has the lowest power consumption, and all LoRaWAN devices must have the capability of implementing it. Class B allows for more receive windows at scheduled times. These times are synchronized with the gateway  
Figure 1: The layout of the LoRaWAN structure. beacon. Class C allows continuously opening the receiving windows unless transmitting. Hence, it has the highest power consumption and the lowest service latency. In the LoRaWAN Join Procedures, an end-device has two ways of joining the LoRaWAN network. (1) using the Over the Air Activation (OTAA) procedure. (2) using the Activation by Personalization (ABP) procedure. During the OTAA procedure, two messages are being exchanged (Join-Request and Join-Accept message) between the end device and network server, four session-keys (FNwkSIntKey, SNwkSIntKey, NwkSEncKey and AppSKey) are being generated after receiving the accept message. In the ABP procedure, on the other hand, the four session keys are pre-installed on the LoRa device, so that the device is ready to participate in a specific network at any time. Figure 2 illustrates the LoRaWAN v1.1 key distribution structure. Compared with the earlier LoRaWAN v1.0 released in January 2015 [16], the most significant change is the additional device root-key.