Figure 3.
Lora Network (extracted from [
7]).
3.1. LoRa Basics
The LoRa network uses Chirp Spread Spectrum (CSS) Modulation, which is a spectral spreading technique. Spread spectrum techniques use a greater communication bandwidth than the original signal band to combat fading and shadowing problems. Fading can be originated in reasons like, signal strength variations (due to obstacles), reflections or interference and shadowing can be originated walls, hills or other objects blocking the signal and causing attenuation.
By spreading the signal, the impact of fading and shadowing will be minimized. Even if part of the spectrum is affected, other parts remain usable. Analyzing more in detail:
Spread Spectrum: Spread spectrum techniques distribute the signal energy over a wider frequency band.
-
Types:
- ▪
Frequency Hopping Spread Spectrum (FHSS): Rapidly changes the carrier frequency according to a predefined pattern.
- ▪
Direct-Sequence Spread Spectrum (DSSS): Spreads the signal using a pseudorandom code sequence.
- ▪
Chirp Spread Spectrum (CSS): Utilizes linear frequency-modulated chirp pulses.
-
Advantages:
- ▪
Robustness: They enhance resistance to interference, noise, and multipath fading.
- ▪
Security: Spread spectrum signals are harder to intercept or jam.
- ▪
Low Power: They allow low-power communication.
Chirp Spread Spectrum (CSS) modulation prioritizes stability over data rate, making it suitable for extremely long-range communication. Additionally, to address scalability issues, Semtech introduced LR-FHSS (Long Range-Frequency Hopping Spread Spectrum) for satellite connectivity [
8,
9], which enhances network capacity and robustness through intra-packet frequency hopping without sacrificing communication range or power efficiency. It also introduced
Direct Sequence Spread Spectrum (DSSS) modulation as an alternative to the original
Chirp Spread Spectrum (CSS) modulation used in LoRa. While CSS provides long-range communication with ultra-low power requirements, DSSS offers some distinct advantages like:
- ▪
Robustness: DSSS is less sensitive to interference and noise, making it suitable for challenging environments.
- ▪
Clock Independence: Unlike CSS, DSSS does not require a highly accurate reference clock, simplifying implementation.
- ▪
Spectral Spreading: In DSSS, the signal’s spectrum spreads by directly encoding data bits across a wider bandwidth, enhancing robustness.
Overall, DSSS complements CSS, providing more flexibility and robustness in LoRa-based solutions [
10] making the logical choice to use CSS for long-range, low-power applications, and DSSS for robustness in challenging environments or when moderate data rates are acceptable. In addition, CSS LoRa modulation has the following advantages [
11]:
- ▪
It is easily scalable in both frequency and bandwidth.
- ▪
Resistant to multipath, fading, and Doppler phenomena.
- ▪
Allows communication via multiple signals due to orthogonality between different Spreading Factor (SF).
As written before the LoRa modulation technique (CSS) essentially consists of varying the frequency of a given wave. In chirp modulation, the frequency of the transmitted signal changes linearly over time. This allows LoRa signals to be robust against interference and noise. Frequency will increase linearly in the case of an up-Chirp and decreases in the case of a down-Chirp.
Figure 4 and
Figure 5 shows a graphical representation of this variation.
Figure 6 below shows the representation of an up-chirp for its frequency as a function of time.
By observing
Figure 6 we can draw some conclusions about a chirp. There is an increasing, linear variation in frequency over time. Also, an interesting thing about chirps is that the maintenance of a constant bandwidth over their duration means that even as the frequency changes, the overall width of the frequency band that the chirp occupies remains the same. This property is quite important for the operation of a LoRa network and is one of the reasons why it’s able to provide long-range communication with low power consumption.
When growth reaches the upper end of the frequency band (fmax), there is a “jump” to the minimum frequency end (fmin). The slope of these chirps (rate at which the frequency changes) is determined by the Spreading Factor (SF). A higher SF results in chirps with a slower slope, while a lower SF results in chirps with a steeper slope.
Looking at
Figure 6, we can obtain the expression (6) for the bandwidth of this symbol,
Equation (7) below, shows that the symbol time depends not only on the bandwidth but also on the spreading factor (
Figure 7).
In the modulated signal of
Figure 7 we could also see 4 symbols represented, having each one a time duration that we can further represent by
Ts, and
Ts can be expressed by [
6]:
This formula tells us that if the band is fixed the higher the SF the higher the symbol time. For example, if BW=125 kHz and SF=7 (7 bits in a symbol), Ts will be:
, or 1.024 To the same BW if the SF=9 the Ts will be:
, or 4.096 (4 times higher than the previous example)
Increasing
Ts means the message transmission time (
Time on Air-ToA) will also increase (and this way, bigger distances will be achieved). Furthermore, the number of chips per chirp is given by
[
6]. The chip count is given by the development seen in [
6]:
The symbol rate can be given by:
And
representing the number of chips per chirp [
6].
As an example, being BW=125 kHz and SF=7,
Rs will be:
So if, as the example before, SF increases from 7 to 9, and the symbol time (Ts) increase by 4 times, it means the symbol rate Rs (being the inverse of Ts) will be reduced 4 times.
The Bandwidth equals the Chip Rate, just changing the units (Hz per Chips/s) and the Formula (8) could also be written in the form of:
To note that the Chip Rate (Rc) is always higher than the Symbol Rate (Rs) because multiple chips can form one symbol.
Also, a very common term, is the Chirp Rate. The chirp rate (and like the chip rate) is also equal to the bandwidth, being measured in chirps per second (chirps/s). The difference it’s not in the numbers but in the definition: while the chip rate can be defined by the number of chips transmitted per time unit, the chirp rate will be defined by the rate of change of the frequency of a signal. This means that the chirp rate measures how quickly the frequency of the signal is changing at any given point in time. In
Figure 7, and as an (illustrative) example, the slope of the spectrogram of each symbol can gives us the chirp rate (rate of change of frequency).
One of the most important expressions in characterising a LoRa signal is expression (11) [
6], which correlates some of the most important factor’s characteristic of signals from this technology.
Where:
- ▪
, bit rate (or data rate) [bit/s]
- ▪
, Bandwidth [Hz]
- ▪
, Code rate (varies between 1 and 4)
- ▪
, Spreading factor
This expression defines the nominal binary rate of a LoRa signal according to its code rate, spreading factor and bandwidth.
3.1.1. Spreading factor
The Spreading Factor is a parameter in the LoRa modulation scheme that affects the data rate, range, and processing time. A higher SF means a longer range and a lower data rate, while a lower SF means a shorter range and a higher data rate. The SF is one of LoRa’s most important parameters and essentially represents the speed at which a chirp changes frequency. For higher SFs we have a slower frequency change, which means that each chirp will also have a longer symbol time than signals with lower SFs.
Table 1 tells us that higher SF results in a higher number of chips per chirp (or a higher symbol count), and a lower SF results in a lower number of chips per chirp (or a lower symbol count). This implication takes to the conclusion that a higher symbol count (means a longer transmission time for each symbol) results in a lower data rate (Rs). On the other hand, a lower symbol count leaves to a higher data rate.
Another important factor to consider is the importance of SF for the binary throughput data rate of a LoRa signal. In expression (10) we can see the direct implication this has on this output. Using MATLAB to produce the function steps, for a bandwidth of 125 kHz and Code Rate = 4/5, we obtained
Figure 8. This figure shows the influence of SF on data rate. This graph reinforces the proposition set out in the previous paragraphs: for higher SFs, lower binary data rate.
A key characteristic in LoRa is orthogonality. Orthogonality allows different Spreading Factors (SFs) to coexist in the same channel without interfering with each other. This is because different SFs result in different data rates, which in turn produce signals with different slopes (rate of change of frequency versus time) when viewed in the frequency-time plane. However, this orthogonality is not perfect. When the bandwidth is fixed, different SFs can cause packet loss if the interference power received is strong enough. This imperfect orthogonality can significantly deteriorate the performance, especially on the higher SFs. Moreover, there can be combinations of SF and bandwidth which would have the same slope as other combinations, and thus not be as fully orthogonal from them. This could potentially lead to more problems, especially when SFs are close to each other.
3.1.2. Code Rate
The Coding Rate refers to the ratio associated with error detection and correction for the Hamming code used by LoRa. The CR can take 4 different values: 4/5, 4/6, 4/7 and 4/8, and these ratios being equivalent to the H(5,4)...H(8,4) codes [
6]. For the values 4/5 and 4/6 only error detection is possible, while for 4/7 and 4/8 its possible error detection and correction [
12]. These ratios correspond to the number of data bits and the number of redundant bits for error detection, e.g., for a 4/5 CR, there are 4 data bits and 1 bit for error detection. For CRs with more redundant bits (i.e., decreasing of the coding rate), the bit rate will decrease in practical terms, since for the same binary output we can have a variable number of redundant bits and, consequently, a variable number of data bits [
6].
Figure 9 shows that for CRs with a higher number of redundancy bits, the bit rate will decrease, as would be expected.
Another parameter that was studied in the previous section is the SF, and again in this situation there are implications in terms of bit rate for higher SFs. A higher SF increases the signal’s ability to resist interference (effectively increasing the range), but it also reduces the data rate. In this case we can once again see a much lower bit rate for a high SF, but it should be kept in mind that a CR of 4/8 when compared to one of 4/5 will also cause a considerable decrease in bit rate. A higher CR (more redundant bits) provides better error correction at the expense of data rate.
So, in a scenario where long range and robust error correction are needed, we might opt for a higher SF and CR, even though this would result in a lower data rate. On the other hand, if high data rate is the priority and the devices are close to each other, a lower SF and CR might be more suitable.
The choice of SF and CR will therefore depend on specific network communication needs.
3.1.3. Bandwidth
The bandwidth used in LoRa can be 125 kHz, 250 kHz and 500 kHz (the latter not used in Europe).
Producing the graphical progression again based on the previous expressions,
Figure 10 shows the graphical result of this expression for two different SFs.
Looking at the graph in
Figure 10, it’s clear from the outset that when the bandwidth increases, the data rate of the link also increases. This means that a given amount of data can be transmitted in a shorter amount of time, reducing the Time-on-Air (ToA). A shorter ToA has several advantages. For one, it reduces the likelihood of the signal suffering from interference, as the signal is “on air” for less time and thus has less opportunity to collide with other signals. Additionally, effects such as fading or noise have less time to impact the signal, potentially improving the quality of the received signal. However, it’s important to note that increasing the bandwidth also increases the potential for interference with other signals, as it requires a larger portion of the frequency spectrum. Once again, the correlation and impact that SF, CR and BW have on data rate becomes increasingly clear, as does the influence of each parameter on reducing the likelihood of the signal being affected by interference. If, on the one hand, an SF12 is used for communication over long distances, a high CR must be used so that the signal is more robust, the tradeoff being the fact that we have a lower binary data rate (which can be manipulated through the bandwidth used). Therefore, when choosing signal specifications for the communication the balancing of these three parameters is crucial.
3.1.4. Frame Format and Duty Cycle
LoRa uses a specific packet format (
Figure 11 and
Figure 12) for data transmission. There are two types of packet formats in LoRa: explicit and implicit [
14].
In explicit mode, a LoRa packet can be described as following:
- ▪
Preamble: Used to synchronize the receiver with the transmitter. It consists of 8 symbols for all regions, but the radio transmitter adds another 4.25 symbols, resulting in a final preamble length of 12.25 symbols.
- ▪
PHDR (Physical Header): An (optional) field that contains information about payload size and CRC (Cyclic Redundancy Check). It’s only present in explicit mode.
- ▪
PHDR_CRC (Header CRC): An (optional) field that contains an error detecting code for correcting errors in the header.
- ▪
PHYPayload: Contains the complete frame generated by the MAC layer. The maximum payload size varies by Data Rate (DR) and is region-specific.
- ▪
CRC: An (optional) field that contains an error detecting code for correcting errors in the payload of uplink messages.
The PHDR and PHDR_CRC are encoded with the Coding Rate of 4/8, while the PHYPayload and CRC are encoded with one of the Coding Rates: 4/5, 4/6, 4/7, or 4/8. The complete frame is then sent using one of the Spreading Factors (SF = 7 to 12).
In implicit mode, the header is removed from the packet where the payload size and Coding Rate are fixed or known in advance. Beacons use LoRa radio packet implicit mode for sending time synchronizing information from gateways to the end devices.
Duty cycle is the fraction of time a device is busy transmitting data. A higher duty cycle means the signal is “on” for a larger portion of the total period which can result in longer frames. Longer frames takes more time to transmmit which impacts Time on Air (ToA). The time a packet takes to be transmitted at a given data rate and this will be impacted by the size of the frames the devices send.
So, the impact of ToA [
15] can be seen the following way:
- ▪
Data Rate: The data rate in LoRa is determined by the bandwidth, coding rate, and spreading factor. A lower spreading factor provides a higher bit rate for a fixed bandwidth and coding rate. Therefore, for a fixed amount of data (payload), a higher spreading factor (lower data rate) needs a longer ToA.
- ▪
Payload Size: The payload size directly affects the ToA. Sending a larger amount of data with a fixed bandwidth and spreading factor requires a longer ToA. This is because the data rate is fixed for a given bandwidth and spreading factor.
- ▪
Network Traffic: In a network with high traffic, a longer ToA could increase the risk of packet collisions, leading to packet loss.
- ▪
Interference: A longer ToA means the packet is in the air for a longer time, increasing the chance of interference from other signals.
The battery life of an end device is also affected by the ToA. Higher spreading factors result in longer active times for the radio transceivers, which means a longer ToA and consequently, a shorter battery life.
In Wireless Sensor Networks (WSNs), one of the major problems that can arise when using signals that are susceptible to interference is interference between them. This is because, depending on the duty cycle and ToA of each signal, there may be a temporal overlap. This overlap, for two signals susceptible to co-channel interference for example, could have catastrophic consequences for the quality of signal.
As seen for SF, the ToA of signals with high SFs is longer than for low SFs, meaning that it is potentially more susceptible to interference. In addition to the time-on-air, signals with higher SFs also have a longer time per symbol, which means that even with low duty cycles, the communication time for signals with high SFs will also be high. Bandwidth also affects time-on-air, which decreases with increasing bandwidth. In (12) we see the waiting time of a node, and how this is influenced by the duty cycle,
δ.
In addition to the influence on energy efficiency, which is largely affected by the time a node is transmitting, there is also the problem of signal collision. Signal collision can occur at an elementary level for two reasons: temporal or frequency collisions. As you might expect, two (or more) signals being received at the same time (overlap) may lead to collisions and packet loss. However, thanks to the capture effect found in LoRa modulation, a packet received with a higher power level (at least 6 dB stronger) [
15], can still be decoded during collision. This means that even if two packets (with the same SF) arrive at the same time, if one has a significantly stronger signal, it can still be successfully received due to this “capture effect”, which allows the receiver to “capture” and successfully demodulate the stronger signal, while ignoring the weaker one.
3.2. RSSI-Received Signal Strength Indicator and SIR-Signal-to-Interference Ratio
The channel model of one of our experiments (Line of Sight-LOS) from the end device node to the receiver can be based on the Friis formula (free space path loss-FSPL). Admitting ideal conditions (no obstacles), and with the antenna of the transmitter and receiver having directivity equal to 1 (isotropic antenna), we can say that:
Where
d is the distance (meters)
f is the frequency (Hz) and
c is the speed of light (a constant). Converting this formula to dB:
A more precise expression can be found considering the gain of the antennas (transmission and reception) by saying that:
Being
the gain of the transmitting antenna and
the gain of the receiving antenna. If the transmitter is emitting with a power of
Ptx (expressed in mW), the RSSI will be:
Which, converted to dBm will result in:
More accurately models like the Rice fading can be seen applied in works like [
16,
17].
For non-line of sight (NLOS) we need to include the expected vegetation (can cause path loss due to absorption, reflection, and scattering) and wall loss (create shadowing effects and can significantly reduce signal strength) and this type of scenarios could be seen explored in [
17]. Models like Nakagami-m fading [
16] or Log-normal shadowing are usually applied and, in our experiment, looking for the short distances used at our study (20 to 60m) a Nakagami-m fading model would be more realistic. Yet, the application of this model was not the focus of our work.
Another very important variable to understand the reliability of our link and the influence of interference it’s the Signal-to-Interference Ratio (SIR) and it can be expressed by the following formula:
Where
I is the aggregate interference (random variable) of the SFs that are interfering over the packets. As was study by Goursaud and Gorce [
18] a packet that arrives with higher signal strength than the lowest limit of the receiver sensibility can still be lost due to interference of other packets either from other end devices or either from the same end device (if packets were sent in the same channel with different SFs and different payload sizes). The tolerance to this interference will depend on the SFs chosen between packets, being one (or more) be considered the interfering packet. The SIR table (figure) presented can be used to understand if the packet was successfully received or not:
The values of the
Table 2 can be read this way: Imagining that two packets (packet 1 and packet 2) with the same SF arrive at the same time at the receiver. The receiver will still be able to be demodulated if one (e.g., packet 1) is 6 dB higher than the other. For example:
Packet 1: RSSI= -100 dBm,
Then for the packet 1 can be demodulated the RSSI of the “interfering packet” (packet 2) must not exceed:
-100-6=-106 dBm
For the cases that different SFs were transmitted (our scenario) and imagining a package transmitted with SF=12 (at a longer distance) and received with RSSI=-100 dBm an interfering packet with SF=9 (at a shorter distance and received at the same time) cannot exceed:
-100-(-25) =-75 dBm, for the package with SF=12 be corrected received and demodulated.
This way the implementation of higher SFs for more distant end devices, concerning the noise sensitivity (and RSSI) will allow to overcome the impact of closer devices that are more susceptible of receiving signals with higher signal strength. Yet, the study of [
18] are not much clear about in what conditions these values were achieved, and works like of [
2], have reduced these values in a very significant terms, leading this quasi-orthogonality to be even more imperfect.
A more precise representation of the channel conditions can be achieved by using the SINR, because SINR will add the noise floor of the channel to the aggregate interference used by SIR. In our case and considering the channel conditions, we will consider SIR≈SINR, considering this way that the noise power is much lower than the signal power and the interference is significantly stronger than the background noise.