What are LoRa and LoRaWAN and Why is LoRaWAN so awesome
What are LoRa and LoRaWAN?
Welcome to The Things Fundamentals on LoRaWAN. In this article, you’ll learn why LoRaWAN is so awesome, hear about some great LoRaWAN use cases and learn the difference between LoRa and LoRaWAN.
LoRa
LoRa is a wireless modulation technique derived from Chirp Spread Spectrum (CSS) technology. It encodes information on radio waves using chirp pulses - similar to the way dolphins and bats communicate! LoRa modulated transmission is robust against disturbances and can be received across great distances.

Don’t be alarmed about the complex terms; LoRa modulation and Chirp Spread Spectrum technology are simple to understand in practice. In case you are curious, in this video, Richard Wenner explains how Chirp Spread Spectrum technology works:
LoRa is ideal for applications that transmit small chunks of data with low bit rates. Data can be transmitted at a longer range compared to technologies like WiFi, Bluetooth or ZigBee. These features make LoRa well suited for sensors and actuators that operate in low power mode.

LoRa can be operated on the license free sub-gigahertz bands, for example, 915 MHz, 868 MHz, and 433 MHz. It also can be operated on 2.4 GHz to achieve higher data rates compared to sub-gigahertz bands, at the cost of range. These frequencies fall into ISM bands that are reserved internationally for industrial, scientific, and medical purposes.
What Is The LoRa Radio?

LoRa uses radio frequency (RF) signals to communicate and operate in the unlicensed ISM spectrum. This means that anyone can openly use this band without paying or getting a license so long as regulations are followed as determined by the FCC in the US. Although LoRa operates in the ISM (Industrial, Science, Medical) band, the ranges within ISM fields vary greatly depending on geographical region.


LoRa provides the necessary ranges and data rate within the following geographical frequencies for specified wireless sensors: Europe: 868Mhz and 433 Mhz, US: 915Mhz and AUS: 915-928 Mhz. These differences prevent US devices and gateways from being compatible with European or Australian devices. There are several techniques LoRa uses to improve data reliability, however, the two most important ones are Spread Spectrum and Adaptive Data Rate (ADR).


Spread Spectrum: 
Originally developed for military applications increasing resistance to interference from noise and jamming. It does this by taking raw information and is spread across a larger frequency.


ADR: 
This allows augmentation of the data rate and transmit power to adjust the functioning of signal quality and distance to the gateway. A slow transmission will have a higher spreading factor that achieves longer and more reliable ranges.

LoRaWAN
LoRaWAN is a Media Access Control (MAC) layer protocol built on top of LoRa modulation. It is a software layer which defines how devices use the LoRa hardware, for example when they transmit, and the format of messages.

The LoRaWAN protocol is developed and maintained by the LoRa Alliance. The first LoRaWAN specification was released in January 2015. The table below shows the version history of the LoRaWAN specifications. At the time of this writing the latest specifications are 1.0.4 (in 1.0 series) and 1.1 (1.1 series).

Version | Release date
1.0 | January 2015
1.0.1 | February 2016
1.0.2 | July 2016
1.1 | October 2017
1.0.3 | July 2018
1.0.4 | October 2020
Bandwidth vs. Range
LoRaWAN is suitable for transmitting small size payloads (like sensor data) over long distances. LoRa modulation provides a significantly greater communication range with low bandwidths than other competing wireless data transmission technologies. The following figure shows some access technologies that can be used for wireless data transmission and their expected transmission ranges vs. bandwidth.


Why is LoRaWAN so awesome?
  • Ultra low power - LoRaWAN end devices are optimized to operate in low power mode and can last up to 10 years on a single coin cell battery.
  • Long range - LoRaWAN gateways can transmit and receive signals over a distance of over 10 kilometers in rural areas and up to 3 kilometers in dense urban areas.
  • Deep indoor penetration - LoRaWAN networks can provide deep indoor coverage, and easily cover multi floor buildings.
  • License free spectrum - You don’t have to pay expensive frequency spectrum license fees to deploy a LoRaWAN network.
  • Geolocation- A LoRaWAN network can determine the location of end devices using triangulation without the need for GPS. A LoRa end device can be located if at least three gateways pick up its signal.
  • High capacity - LoRaWAN Network Servers handle millions of messages from thousands of gateways.
  • Public and private deployments - It is easy to deploy public and private LoRaWAN networks using the same hardware (gateways, end devices, antennas) and software (UDP packet forwarders, Basic Station software, LoRaWAN stacks for end devices).
  • End-to-end security- LoRaWAN ensures secure communication between the end device and the application server using AES-128 encryption.
  • Firmware updates over the air - You can remotely update firmware (applications and the LoRaWAN stack) for a single end device or group of end devices.
  • Roaming- LoRaWAN end devices can perform seamless handovers from one network to another.
  • Low cost - Minimal infrastructure, low-cost end nodes and open source software.
  • Certification program- The LoRa Alliance certification program certifies end devices and provides end-users with confidence that the devices are reliable and compliant with the LoRaWAN specification.
  • Ecosystem- LoRaWAN has a very large ecosystem of device makers, gateway makers, antenna makers, network service providers, and application developers.
LoRaWAN use cases
Here are a few great LoRaWAN use cases provided by IoTNVR to give you some insight into how LoRaWAN can be applied:
  • Vaccine cold chain monitoring - LoRaWAN sensors are used to ensure vaccines are kept at appropriate temperatures in transit.
  • Animal conservation - Tracking sensors manage endangered species such as Black Rhinos and Amur Leopards.
  • Dementia patients - Wristband sensors provide fall detection and medication tracking.
  • Smart farms- Real time insights into crop soil moisture and optimized irrigation schedule reduce water use up to 30%.
  • Water conservation- Identification and faster repair of leaks in a city’s water network.
  • Food safety- Temperature monitoring ensures food quality maintenance.
  • Smart waste bins - Waste bin level alerts sent to staff optimize the pickup schedule.
  • Smart bikes- Bike trackers track bikes in remote areas and dense buildings.
  • Airport tracking - GPS-free tracking monitors vehicles, personnel, and luggage.
  • Efficient workspaces - Room occupancy, temperature, energy usage and parking availability monitoring.
  • Cattle health - Sensors monitor cattle health, detect diseases and forecast calves delivery time.
  • LoRa in space - Satellites to provide LoRaWAN-based coverage worldwide.
How Does LoRaWAN Work?
For sake of simplicity LoRaWAN networks can be primarily illustrated by the following diagram:

Devices<–>LoRa radio <–>Gateway<–>Network Server <–>End Application

Looks linear, simple, and yet confusing and mysterious. How does this work and what does it mean? Upstream messages (data sent from the device) are encrypted and sent over LoRa radio through transmissions. The message is received by one or more gateways who then transfer the encrypted data over a network (typically IP cellular/Ethernet) to a network server. The network server is the software that authenticates the device and decrypts the LoRaWAN payload. The server then delivers the data packet to the appropriate end application.

This process can also happen in the inverse, better explained, messages can be sent downstream which allows the application to reconfigure the end devices. With this being said, LoRa was designed to use low energy, which means some devices are limited when listening for incoming data transmission. This factor is device dependent as described in the next section.
What Are LoRaWAN Wireless Sensor Devices?
A LoRaWAN sensor device is anything that sends or receives informational data and is commonly carried out by devices like wireless sensors, detectors, and actuators. These devices come in 3 classes and are essentially a step up from the previous class.

For instance, a Class A device is only able to receive a message during a small window after it has sent an uplink message and then returns to a low power sleep state where it cannot receive new messages.

Class B is similar to A, but instead is able to listen for incoming messages following predetermined intervals.

Unlike Classes A and B, Class C is able to continuously listen for new incoming messages without entering sleep mode, however, this feature comes at the expense of higher energy usage and for that reason, many Class C devices are not battery operated.

The LoRaWAN standard uses two different message types: MAC messaging and data messaging. MAC messages are used as commands to control the radio and networking message. Data messages are the actual payload that is sent/received and is application or device specific. Since these sensors have limited messaging capabilities, MAC commands/messages are able to ride alongside data messages similar to piggybacking and numerous MAC messages can be released at one time.
What Is A LoRa Gateway?
A gateway can be thought of as an access point or modem. It’s receiving all LoRa radio messages sent by devices within range. If the gateway has a network server built in it will process the data payload locally, and if the network server is located in the cloud the gateway will simply relay the encrypted packet to the server.
What Does The Network Server Do?
Once a LoRa gateway has received a transmitted data packet (message), it will then continue upstream to a network server, considered the most intelligent or sophisticated area of the LoRaWAN network. Network servers are responsible for carrying out a list of various tasks that include:
  • Decrypt LoRa payload data
  • Provision devices to speak to the network
  • Grouping incoming messages from all LoRaWAN gateways within its network and sensor range.
  • Direct/advance incoming data to the appropriate end application.
  • Regulate LoRa radio settings to the gateways.
  • When there are multiple gateways, the best gateway within range is selected for downlink messages for that particular device.
  • Data buffering: stores downlink data (messages) until a class A or B LoRa device is able to receive messages specified during configuration.
  • Filter/Eliminate duplicate messages/data sent from a single device appearing across multiple gateways where devices are unknown by receiving gateways. Since there is no distinction, multiple gateways can receive the same data.
  • Assess/monitor gateways and devices.
The network server in most instances will direct messages from a particular ID and port to a specified or predefined application. This typically happens by sending it to a web service (HTTP(S)) or by placing it in an MQTT queue to be sent to the right place at a determined interval.
What Does End Application Mean?
The final step of data transmission in a LoRa network is the data sent to the actual end application. This is where manufacturers and developers will create code to parse messages received by devices relevant to the application being used. This is where the raw data is assembled into digestible information for the end user’s interpretation.


We’ve simplified the flow diagram so you can visually compare how these areas work with each other.
Lastly, security comes to mind. Since networks themselves do not need to be able to interpret the data received unless it pertains to network infrastructure or is relevant to the network itself. A network session key (NwkSKey) encrypts the messages and payloads in the event a MAC command is sent. This key signs the message allowing networks to verify the sender’s identity.

A second key is known as the application session key (AppSKey) and is responsible for encrypting the payload (actual data) and does not need to be recognized or known by the network server in order to forward the message where it needs to be. The application server will then decrypt the message to extract the information by using the same key.

There are two secure ways to join a LoRa network. They are referred to as Activation by Personalization (ABP) and Over the Air Activation (OTAA). This determines how LoRaWAN devices connect to networks, but does not involve upstream-downstream communication flow as we’ve detailed above.