Lora and Lorawan
Lora and Lorawan
86
Table of Contents
List of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
List of tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1. What are LoRa® and LoRaWAN®? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Radio Modulation and LoRa. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1. Key LoRa Modulation Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2. LoRa Modulation Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3. Data Collisions and Spreading Factor Orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3. LoRaWAN Network Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1. LoRaWAN Network Elements: An Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1. LoRa-based End Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.2. LoRaWAN Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.3. Network Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.4. Application Servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.5. Join Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2. LoRaWAN Network Elements: Device Commissioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3. LoRaWAN Network Elements: Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3.1. The Join Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4. Device Classes: A, B and C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4.1. Class A Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4.2. Class B Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.4.3. Class C Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4. The LoRa Alliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
List of figures
Figure 1. IoT Technologies
Figure 2. Advantages of deploying a LoRaWAN network
Figure 3. OSI seven-layer network model
Figure 4. DSSS system carrier phase transmitter signal changes
Figure 5. LoRa Chirp Spread Spectrum illustration
Figure 6. LoRa Spreading Factors
Figure 7. LoRaWAN North America Channel Plan
Figure 8. LoRa modulation characteristics
Figure 9. LoRaWAN technology stack
Figure 10. Typical LoRaWAN network implementation
Figure 11. End devices in a typical LoRaWAN network deployment
Figure 12. Gateways in a typical LoRaWAN network deployment
Figure 13. Gateways receiving and transmitting messages from end devices
Figure 14. LoRaWAN Network Server in a typical LoRaWAN network deployment
Figure 15. LoRaWAN Application Server in a typical LoRaWAN network deployment
Figure 16. LoRaWAN Join Server in a typical LoRaWAN network deployment
Figure 17. Activation Types
Figure 18. Security keys generated during the Join procedure
Figure 19. Sending a join request message to the join server
Figure 20. Sending a join accept message to an end device
Figure 21. Session keys are shared with the network server and the application server
Figure 22. Secure transmission of data packets
Figure 23. Class A operation
Figure 24. Class A operation when nothing is received
Figure 25. Class A operation when a data packet is received in the first receive window
Figure 26. Class A operation when a data packet is received in the second receive window
Figure 27. Class B beaconing operations
Figure 28. Periodic Class B beaconing for device synchronization
Figure 29. Class B ping slots
Figure 30. Class C operation
List of tables
Consider the differences between LoRa and other network technologies that are typically used in IoT or traditional machine-to-machine (M2M)
connectivity solutions:
In Europe, mobile network operators have implemented a dual strategy to address packet size and latency issues. They often offer
both LoRaWAN and Cat-M1, which are complementary technologies. LoRaWAN accommodates the need for longer battery life, with
NOTE
a trade-off of longer latency and smaller packet sizes. In contrast Cat-M1 can be used for larger payloads with less latency than
LoRaWAN can accommodate.
With respect to range, a single LoRa-based gateway can receive and transmit signals over a distance of more than 10 miles (15 kilometers) in rural areas.
Even in dense urban environments, messages are able to travel up to three miles (five kilometers), depending on how deep indoors the end devices
(end nodes) are located.
As far as battery life goes, the energy required to transmit a data packet is quite minimal given that the data packets are very small and only transmitted
a few times a day. Furthermore, when the end devices are asleep, the power consumption is measured in milliwatts (mW), allowing a device’s battery to
last for many, many years.
When it comes to capacity, a LoRaWAN network can support millions of messages. However, the number of messages supported in any given
deployment depends upon the number of gateways that are installed. A single eight-channel gateway can support a few hundred thousand messages
over the course of a 24-hour period. If each end device sends 10 messages a day, such a gateway can support about 10,000 devices.[1] If the network
includes 10 such gateways, the network can support roughly 100,000 devices and one million messages. If more capacity is required, all that is needed
is to add additional gateways to the network.
And then, there is cost. Given the capabilities of LoRa-based end nodes and gateways, only a few gateways - configured in a star network - are required
to serve a multitude of end nodes. This means that capital and operational expenses can be kept relatively low. Also, when the cost-effective LoRa RF
modules that are embedded in inexpensive end nodes are used in conjunction with the open LoRaWAN standard, the return on investment can be
considerable.
[1] There is no one-to-one relationship between LoRa-based devices and gateways in a LoRaWAN network; messages sent to and from end devices
travel through all gateways within range. De-duplication is handled by the network server.
LoRa is purely a physical (PHY), or “bits” layer implementation, as defined by the OSI seven-layer Network Model, depicted in Figure 3. Instead of
cabling, the air is used as a medium for transporting LoRa radio waves from an RF transmitter in an IoT device to an RF receiver in a gateway, and vice
versa.
In a traditional or Direct Sequence Spread Spectrum (DSSS) system, the carrier phase of the transmitter signal changes according to a code sequence as
shown in Figure 4. When multiplying the data signal with a pre-defined bit pattern at a much higher rate, also known as a spreading code (or chip
sequence), a “faster” signal is created that has higher frequency components than the original data signal. This means that the signal bandwidth is
spread beyond the bandwidth of the original signal. In RF terminology, the bits of the code sequence are called chips (in order to distinguish between
the longer, un-coded, bits of the original data signal). When the transmitted signal arrives at the RF receiver, it is multiplied with an identical copy of the
spreading code used in the RF transmitter, resulting in a replica of the original data signal.
You might ask: Why go through all this trouble? Why not just transmit the original data signal instead of going through this code sequence
multiplication? The answer is simple: going through this code sequence multiplication buys you a higher RF link budget, so you can transmit over a
longer range.
The Log10 ratio of the code sequence’s chip rate and the data signal’s bit rate is called the processing gain (Gp). This gain is what allows the receiver to
recover the original data signal, even if the channel has a negative signal-to-noise ratio (SNR). LoRa has a superior Gp compared to frequency-shift
keying (FSK) modulation, allowing for a reduced transmitter output power level while maintaining the same signal data rate and a similar link budget.
One of the downsides of a DSSS system is the fact that it requires a highly-accurate (and expensive) reference clock. Semtech’s LoRa Chirp Spread
Spectrum (CSS) technology offers a low-cost and low-power, yet robust, DSSS alternative that does not require a highly-accurate reference clock. In LoRa
modulation, the spreading of the signal’s spectrum is achieved by generating a chirp signal that continuously varies in frequency, as is depicted in Figure
5.
An advantage of this method is that the timing and frequency offsets between transmitter and receiver are equivalent, greatly reducing the complexity
of the receiver design. The frequency bandwidth of this chirp is equivalent to the spectral bandwidth of the signal. The data signal that carries the data
from an end device to a gateway is chipped at a higher data rate and modulated onto the chirp carrier signal. LoRa modulation also includes a variable
error correction scheme that improves the robustness of the transmitted signal. For every four bits of information sent, a fifth bit of parity information
is sent.
In LoRa terms, the amount of spreading code applied to the original data signal is called the spreading factor (SF). LoRa modulation has a total of six
spreading factors (SF7 to SF12). The larger the spreading factor used, the farther the signal will be able to travel and still be received without errors by
the RF receiver.
Figure 6 shows the four different spreading factors [SF7…SF10] that can be used for uplink (UL) messages on a 125 KHz channel.[1] It shows the
equivalent bit rate as well as the estimated range (this depends on the terrain; longer distances will be achieved in a rural environment than in an urban
environment). It also shows the dwell time, or time on air (TOA), values for an 11-byte payload for each of the four spreading factors.
Importantly, the LoRa modulation spreading factors are inherently orthogonal. This means that signals modulated with different spreading factors and
transmitted on the same frequency channel at the same time do not interfere with each other. Instead, signals at different spreading factors simply
appear to be noise to each other.
LoRa signals are robust and very resistant to both in-band and out-of-band interference mechanisms. LoRa modulation also offers immunity to
multipath and fading, making it ideal for use in urban and suburban environments, where both mechanisms dominate. Additionally, Doppler shifts
cause a small frequency shift in the time axis of the baseband signal. This frequency offset tolerance mitigates the requirement for tight tolerance
reference clock sources and, therefore, makes LoRa ideal for data communications from devices that are mobile.
• The LoRa physical layer is intended for low throughput, low data rate, and high link budget (i.e., “long-range”) applications.
• For a fixed channel bandwidth, the higher the spreading factor, the higher the processing gain, resulting in an increase in sensitivity and, therefore,
an increase in link budget. Subsequently, however, the time on air will also increase.
• Orthogonality between spreading factors allows for the transmission of multiple LoRa signals that are both on the same channel frequency and in
the same time-slot.
• For a fixed SF, a narrower bandwidth will increase sensitivity as the bit rate is reduced.
• LoRaWAN in North America uses 125 kHz uplink channels and 500 kHz uplink and downlink channels
• The Code Rate is the degree of redundancy implemented by the forward error correction (FEC) used to detect errors and correct them. This rate is
fixed at 4/5 for the LoRaWAN protocol
As Stephan Hengstler asserts in his book, A Novel Chirp Modulation Spread Spectrum technique for Multiple Access, “LoRa is a constant envelope
modulation (very low cost, power efficient power amplifier implementation) … [it] is the most robust, ultra-low power and long range RF solution
available.”
The capacity of a LoRaWAN network is a function of its gateway density. To maximize the capacity of the network, using an adaptive data rate (ADR)
mechanism is essential. The main goal of ADR is to save the battery power of the LoRaWAN end-nodes. By having the end-nodes closest to a gateway
transmit using the lowest spreading factor, their time on air is minimized, thereby prolonging their battery life. More distant sensors transmit at a higher
LoRa® and LoRaWAN® Page 11
Version 1.0 semtech.com Semtech Corporation
AN1200.86 March 2024 Proprietary & Confidential
AN1200.86
spreading factor. A trade-off is made between battery power and distance given that a higher spreading factor allows for a gateway to connect to
devices that are farther away.
[1] Downlink messages broadcast over 500 KHz channels can use all six available spreading factors (SF7…SF12).
A LoRaWAN-enabled end device is a sensor or an actuator which is wirelessly connected to a LoRaWAN network through radio gateways using LoRa RF
Modulation.
In the majority of applications, an end device is an autonomous, often battery-operated sensor that digitizes physical conditions and environmental
events. Typical use cases for an actuator include: street lighting, wireless locks, water valve shut off, leak prevention, among others.
When they are being manufactured, LoRa-based devices are assigned several unique identifiers. These identifiers are used to securely activate and
administer the device, to ensure the safe transport of packets over a private or public network and to deliver encrypted data to the Cloud.
A LoRaWAN gateway receives LoRa modulated RF messages from any end device in hearing distance and forwards these data messages to the
LoRaWAN network server (LNS), which is connected through an IP backbone. There is no fixed association between an end device and a specific
gateway. Instead, the same sensor can be served by multiple gateways in the area. With LoRaWAN, each uplink packet sent by the end-device will be
received by all gateways within reach, as illustrated in Figure 12. This arrangement significantly reduces packet error rate (since the chances that at least
one gateway will receive the message are very high), significantly reduces battery overhead for mobile/nomadic sensors, and allows for low-cost
geolocation (assuming the gateways in question are geolocation-capable).
The IP traffic from a gateway to the network server can be backhauled via Wi-Fi, hardwired Ethernet or via a Cellular connection. LoRaWAN gateways
operate entirely at the physical layer and, in essence, are nothing but LoRa radio message forwarders. They only check the data integrity of each
incoming LoRa RF message. If the integrity is not intact, that is, if the CRC is incorrect, the message will be dropped. If correct the gateway will forward it
to the LNS, together with some metadata that includes the receive RSSI level of the message as well as an optional timestamp. For LoRaWAN downlinks,
a gateway executes transmission requests coming from the LNS without any interpretation of the payload. Since multiple gateways can receive the same
LoRa RF message from a single end device, the LNS performs data de-duplication and deletes all copies. Based on the RSSI levels of the identical
messages, the network server typically selects the gateway that received the message with the best RSSI when transmitting a downlink message
because that gateway is the one closest to the end device in question.
Figure 13. Gateways receiving and transmitting messages from end devices
Furthermore, LoRa allows for scalable, cost-optimized gateway implementation, depending on deployment objectives. For example, in North America,
8-, 16-, and 64-channel gateways are available.
The 8-channel gateways are the least expensive. The type of gateway needed will depend on the use case. Eight- and 16-channel gateways are available
for both indoor and outdoor use. Sixty-four channel gateways are only available in a carrier-grade variant. This type of gateway is intended for
deployment in such places as cell towers, the rooftops of very tall buildings, etc.
The LoRaWAN network server (LNS) manages the entire network, dynamically controls the network parameters to adapt the system to ever-changing
conditions, and establishes secure 128-bit AES connections for the transport of both the end to end data (from LoRaWAN end device to the end users
Application in the Cloud) as well as for the control of traffic that flows from the LoRaWAN end device to the LNS (and back). The network server ensures
the authenticity of every sensor on the network and the integrity of every message. At the same time, the network server cannot see or access the
application data.
• Queuing of downlink payloads coming from any Application Server to any device connected to the network
• Forwarding Join-request and Join-accept messages between the devices and the join server
The join server contains the information required to process uplink join-request frames and generate the downlink join-accept frames. It signals to the
network server which application server should be connected to the end-device, and performs the network and application session encryption key
derivations. It communicates the Network Session Key of the device to the network server, and the Application Session Key to the corresponding
application server
For that purpose, the join server must contain the following information for each end-device under its control:
The LoRaWAN specification allows for two types of activation: Over-the-Air Activation (OTAA) (preferred) and Activation by Personalization (ABP). Figure
17 shows the different characteristics of each of these types of activation.
With that foundation, we will take a look at the LoRaWAN security measures in more detail.
The end device sends a join request message to the join server, as illustrated in Figure 19.
After the join server authenticates the device requesting to join the network, it returns a join accept message to the device, as illustrated in Figure 20.
Next, the end device derives session keys locally, based on the DevEUI, Join EUI, DevNonce, root keys and fields in the join request and join accept
messages. On its end, the join server also derives session keys from the serial IDs, root keys and fields in join requests and join accept messages. Finally,
the join server shares session keys with network and application servers, as illustrated in Figure 21.
Figure 21. Session keys are shared with the network server and the application server
Figure 22 illustrates the security of data packet transmissions. The control traffic between the end device and the network server is secured with a 128-
bit AES Network Session Key (NwkSKey). The data traffic that travels between the end device and the application server, is secured with a 128-bit
Application Session Key (AppSKey). This method ensures that neither the gateway nor the network server can read the user data.
In this case, the end device spends most of its time in an idle state, (that is, in sleep mode). When there is a change in the environment related to
whatever the device is programmed to monitor, it wakes up and initiates an uplink, transmitting the data about the changed state back to the network
(Tx). The device then listens for a response from the network, typically for one second (although this duration is configurable). If it does not receive a
downlink during this receive window (Rx1), it briefly goes back to sleep, waking a moment later, again listening for a response (Rx2). If no response is
received during this second Rx window, the device goes back to sleep until the next time it has data to report. The delay between Rx1 and Rx2 is
configured in terms of a delay from the end of the uplink transmission.
There is no way the application of the end device can wake up a Class A device. Given this limitation, Class A devices are generally not
NOTE
suitable for actuators.
Figure 25. Class A operation when a data packet is received in the first receive window
Figure 26. Class A operation when a data packet is received in the second receive window
A device will not try to send another uplink message until either:
End devices in Class B mode provide for regularly-scheduled receive windows, in addition to those that open whenever a Class A-style uplink is sent to
the server.
Class B Beacons
For the Class B mode of communication to work, a process called beaconing is required. During the beaconing process, a time-synchronized beacon
must be broadcast periodically by the network via the gateways, as illustrated in Figure 27. The end device must periodically receive one of these
network beacons so that it can align its internal timing reference with the network.
Devices use beacons to derive and align their internal clocks with the network. Devices do not need to process every beacon if the device is already
aligned. In most cases, realigning several times a day is sufficient, with a minimal impact on battery life, as illustrated in Figure 28.
Based on the beacon’s timing reference, end devices can open receive windows (ping slots) periodically. Any of these ping slots may be used by the
network infrastructure to initiate a downlink communication, as shown in Figure 29. In order for a LoRaWAN network to support Class B devices, all the
LoRaWAN gateways in this network need to have a built-in GPS timing source, so they all can be synchronized to the exact beacon timing.
Class C end devices implement the same two receive windows as Class A devices, but they do not close the Rx2 window until they send the next
transmission back to the server. Therefore, they can receive a downlink in the Rx2 window at almost any time. A short window at the Rx2 frequency and
data rate is also opened between the end of the transmission and the beginning of the Rx1 receive window, as illustrated in Figure 30.
The LoRa Alliance also offers the LoRaWAN Certification Test Tool, to help manufacturers ensure that their devices are fully LoRaWAN-compatible prior
to sending those devices to an Authorized Test House for formal LoRaWAN Certification testing.
For more information on the LoRa Alliance, visit their website: https://lora-alliance.org.
Disclaimer
Information relating to this product and the application or design described herein is believed to be reliable, however such
information is provided as a guide only and Semtech assumes no liability for any errors in this document, or for the application
or design described herein.
Semtech reserves the right to make changes to the product or this document at any time without notice. Buyers should obtain
the latest relevant information before placing orders and should verify that such information is current and complete.
Semtech warrants performance of its products to the specifications applicable at the time of sale, and all sales are made in
accordance with Semtech’s standard terms and conditions of sale.
SEMTECH PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-
SUPPORT APPLICATIONS, DEVICES OR SYSTEMS, OR IN NUCLEAR APPLICATIONS IN WHICH THE FAILURE COULD BE
REASONABLY EXPECTED TO RESULT IN PERSONAL INJURY, LOSS OF LIFE OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE.
IMPORTANT
INCLUSION OF SEMTECH PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE UNDERTAKEN SOLELY AT THE
CUSTOMER’S OWN RISK. Should a customer purchase or use Semtech products for any such unauthorized application, the
customer shall indemnify and hold Semtech and its officers, employees, subsidiaries, affiliates, and distributors harmless
against all claims, costs damages and attorney fees which could arise.
The Semtech name and logo are registered trademarks of the Semtech Corporation. All other trademarks and trade names
mentioned may be marks and names of Semtech or their respective companies. Semtech reserves the right to make changes
to, or discontinue any products described in this document without further notice. Semtech makes no warranty,
representation or guarantee, express or implied, regarding the suitability of its products for any particular purpose. All rights
reserved.
© Semtech 2024