LoRaWAN Introduction – LoRa practitioners read this is enough
This article is a introduction to LoRaWAN’s popular science. You have seen countless LoRaWAN articles in the circle of friends. It is time to come to a real technical dry goods. This article first introduces the behind-the-scenes and network deployment of LoRaWAN, and then explains the network architecture and specific protocol content in a vertical direction, helping LoRa practitioners to systematically understand the LoRaWAN protocol.
1 What is LoRaWAN?
According to the LoRa Alliance official white paper “what is LoRaWAN”, LoRaWAN is a communication protocol and system architecture designed for LoRa long-distance communication networks.
LoRaWAN? defines the communication protocol and system architecture for the network while the LoRa? physical layer enables the long-range communication link.
In addition, the official provides a hierarchical map of this slightly biased technology, you can see the general experience.
LoRaWAN considers several factors such as node power consumption, network capacity, QoS, security and network application diversity in the design of protocol and network architecture. After the following content, you will have a deeper understanding of the introduction.
2 Behind the interest group – LoRa Alliance
The NB-IoT that loves LoRa is from the global standardization organization 3GPP, by the famous ETSI (European Telecommunications Standardization Committee), Japan ARIB (Wireless Industry Enterprise Association) and TTC (Telecommunications Technical Committee), CCSA (China Communications Standards Association) South Korea TTA (Telecom Technology Association) and North American ATIS (World Wireless Communication Solutions Alliance) and so on.
Compared to the 3GPP’s roots, the LoRa Alliance behind LoRaWAN is weaker. From the cover of the agreement you can see that the author is from three board member companies: N. Sornin (Semtech), M. Luis (Semtech), T. Eirich (IBM), T. Kramp (IBM), O.Hersent (Actility ).
We know that the promotion of each technology is accompanied by the promotion of interests. Although organizations and alliances are non-profit organizations, their corporate members are not dedicated to public welfare. From a business perspective, spending 5W to do things is destined to do with the expectation of inciting at least 50W dollars.
The LoRa Alliance was founded in the first half of 2015 by Cisco, IBM and Semtech. Up to now (2017.04) there are 400+ members, and there are many large companies in the board of directors. In order to divide the cake of the future low-power WAN, we will work hard. This is a form I made, collecting 19 board members who are willing to pay 5W US dollar membership fees at this stage. You can see the wishes of these companies.
3 LoRaWAN network deployment
After binding several first-tier telecom operators, the network deployment situation is quite impressive. According to the official current (2017.04) statement, the network deployment situation is like this:
34 publicly announced networks deployed, at least 150 pilot cities in progress
4 LoRaWAN network architecture
After learning that LoRaWAN is very hot in the previous section, we will do some specific technical understanding. The following is a diagram of the network architecture in the official white paper of the LoRa Alliance.
It can be seen that a LoRaWAN network architecture includes four parts: a terminal, a base station, an NS (network server), and an application server. A star network topology is used between the base station and the terminal. Due to the long-distance nature of LoRa, single-hop transmission is used between them. There are six typical applications listed in the terminal section. With a detail, you will find that the endpoints can be sent to multiple base stations at the same time. The base station performs forwarding processing on the LoRaWAN protocol data between the NS and the terminal, and carries the LoRaWAN data on the LoRa radio transmission and Tcp/IP respectively.
Let’s take a look at this network architecture in conjunction with the industry ecology. You can have a deeper understanding. The picture is from ST’s LoRa white paper “IoT connectivity made easier STM32 MCUs & LoRa”.
5 Protocol Overview
5.1 Classification of terminal nodes
In the introduction at the beginning, we can see that there are three types of terminal devices specified in the agreement, Class A/B/C. These three types of devices basically cover all application scenarios of the Internet of Things.
5.2 Uplink and downlink transmission of the terminal node
Let’s take a look at the timing diagram to let everyone have a deeper feeling.
This is the timing diagram of Class A uplink and downlink. Currently, the receiving window RX1 generally starts 1 second after the uplink, and the receiving window RX2 starts 2 seconds after the uplink.
Class C and A are basically the same, except that during the sleep of Class A, it opens the receive window RX2.
The time slot of Class B is more complicated. It has a synchronous time slot beacon and a fixed-cycle receive window ping time slot. As in this example, the beacon period is 128 seconds and the ping period is 32 seconds.
5.3 Screening of terminal nodes
Once you understand the basic concepts, you can understand how the nodes work. Before the data is officially sent and received, the terminal must first be screened.
There are two types of screening: Over-the-Air Activation (OTAA), Activation by Personalization (ABP).
Commercial LoRaWAN networks generally follow the OTAA activation process so that security is guaranteed. In this way, you need to prepare three parameters: DevEUI, AppEUI, and AppKey.
DevEUI is a globally unique ID similar to IEEE EUI64 that identifies a unique terminal device. Equivalent to the MAC address of the device.
AppEUI is a globally unique ID like IEEE EUI64 that identifies a unique application provider. For example, each garbage bin monitoring application, smoke alarm application, etc., has its own unique ID.
The AppKey is assigned to the terminal by the application owner.
After initiating the join process, the terminal sends a screening command. After the NS (network server) confirms the error, it will reply to the terminal and assign the network address DevAddr (32-bit ID). The two parties use the relevant information in the screening reply. The AppKey generates session keys NwkSKey and AppSKey for encrypting and verifying data.
If the second screening method is adopted, that is, the ABP is activated, it is relatively simple and rude. The parameters of the three LoRaWAN final communication, such as DevAddr, NwkSKey and AppSKey, are directly configured, and the join process is no longer needed. In this case, the device can directly send application data.
5.4 Data Transceiver
After the screening, the application data is encrypted.
LoRaWAN specifies that the data frame type is either Confirmed or Unconfirmed, that is, the type of response and no response are required. Vendors can choose the right type for their application needs.
In addition, as you can see from the introduction, a major consideration at the beginning of LoRaWAN design is to support application diversity. In addition to using AppEUI to partition applications, the FPort application port can also be used to process data separately during transmission. The value range of FPort is (1~223), which is specified by the application layer.
5.5 ADR mechanism
We know that there is a concept of spreading factor in LoRa modulation. Different spreading factors have different transmission distances and transmission rates, and have no effect on data transmission.
In order to expand the LoRaWAN network capacity, a LoRa Rate Adaptive (ADR) mechanism is designed on the protocol. Devices with different transmission distances use the fastest data rate according to the transmission conditions. This also makes the overall data transmission more efficient.
5.6 MAC Command
For network management needs, a series of MAC commands are designed on the protocol to modify network related parameters. Such as the delay of the receiving window, the device rate and so on. In the actual application process, it is rarely involved, and it is temporarily ignored.
6 regional parameters
In addition to the agreement, the LoRa Alliance officially released a supplementary supplementary document, LoRaWAN Regional Parameters, which describes LoRaWAN specific parameters in different regions of the world. In order to avoid the change of the document caused by the addition of new areas, the regional parameter chapter is stripped from the protocol specification.
This document mainly talks about the specific physical layer parameters of LoRaWAN in various regions of the world. It is not only the difference of frequency bands, but also the channel division, even the data rate, transmission power, maximum data length and so on.