LoRa and LoRaWAN

LoRaWAN logo

LoRa ≠ LoRaWAN

LoRaWAN stands for LoRa Wide Area Network. It is very recent: Used since 2015, only in 2021 did it become an International Telecommunications Union standard ITU-T Y.4480. See the LoRa alliance website and wikipedia LoRa page for more information.

Let’s get some notions straight right away: LoRa is a proprietary modulation technique, whereas LoRaWAN is a network communications’ protocol and system architecture. The latter is a ‘protocol’ in the same sense as, for example, the Internet Protocol (IP) or Bluetooth are other well known communications’ protocols. Not yet a household name as its more famous peers, we are excited about LoRaWAN, because it is quite unique at what it does.

What low power? What long range?

The acronym LoRa stands for `Long Range’. Together with LoRaWAN they define what is known as LPWAN or Low Power Wide Area Network. But how can LoRaWAN be both ’long range’ and ’low power’ at the same time, since we normally perceive that to transmit over greater distances, more power is required? To answer that question requires involving another aspect of communications: the bandwidth which is the difference between the maximum and minimum frequency used for transmission.

Here is a general result known as Shannon-Hartley theorem: the maximum rate of information transmission (measured in bits per second) over a fixed-bandwidth communications channel, in the presence of noise, is given by the formula:

$$C = \text{BW} \cdot \log_2\Big(1 + \frac{S}{N} \Big).$$

In this formula, “C” denotes the maximum data transmission rate in bits per second, “BW” is the bandwidth measured in hertz, “S” is power of the signal and, finally, “N” is power of the noise. We see that the transmission rate is proportional to the bandwidth and it can be amplified or attenuated by a term that depends on the signal-to-noise ratio S/N. This formula implies that the same amount of information per unit time can be sent using a small bandwidth and a high S/N, but also with a high bandwidth and a small S/N. LoRaWAN achieves long range with low transmission power (thereby saving in power consumption) by increasing the transmission bandwidth, in what is known as spread spectrum transmission, the same technique that is used in WiFi. LoRa transmission rate can be up to 5.5 kbps, but most use cases make do with transmission of a few bits per second. But hey, that can be good enough for environmental sensors, that need to transmit a small payload (10 bytes, say) every 10 minutes or so. It’s all about finding the right tool for the right purpose. LoRaWAN can be a great solution for remotely connecting IoT weather stations, but forget about streaming audio or video over LoRaWAN.

The modulation technique employed is adaptive, meaning that the same information can be sent in a short time to nearby nodes, while a longer transmission time needs to be allocated to reach far away nodes, or traverse heavily wooded areas that will absorb part of the signal.

The main difference with Cellular technologies is the usage of unlicensed frequencies, meaning that it can be deployed without a specific permit (avoiding the associated costs), providing that certain rules regarding the maximum transmitting power and maximum transmission time are followed.

In Africa and Europe the maximum transmission time at a given frequency is 1%. This means that if the transmission lasts, for instance, 1 second, the device must not transmit again in the following 99 seconds (1.65 minutes). Since there are 8 carrier frequencies available in the 868 MHz band usable in Africa and Europe, the device could nevertheless switch to a different frequency to start the timer from scratch.

A LoRaWAN network consists of end nodes (normally fitted with some kind of sensors) that communicate with one or more gateways. The gateways are controlled by a Network Server, which directs the traffic to the specific Application Server. Since the traffic is encrypted from the end node to the Application Server, only the authorized user of a given application will be able to access the respective data by means of a web browser.

The generic layout of a LoRaWAN network is the following:

The connection between the Gateways and the Network Server can be by means of an Ethernet Cable, Cellular service (2 G, 3G or 4G), WiFi or even by means of a Satellite link, usually employing the Internet Protocol (IP). The Network and Application servers can be located anywhere as long as there is connection among them and the Gateway. They can even be implemented in the same box together with the Gateway.

As an example, the end node is a Meteorological station installed at the ICTP in Italy. In this case, 3 different gateways were able to receive the same transmitted data, with the following parameters:

“frequency”: 867.9, (megahertz)

“Air time 41 ms”, actual time the packet spent on transmission of 24 data bytes, so the real throughput is 4.683 kbit/s

“modulation”: “LORA”,

“data_rate”: “SF7BW125”,(spreading factor 7, bandwidth 125 kHz, the raw data rate is 125/7 = 17.8 kHz)

“coding_rate”: “4/5”, (This means that an extra redundant bit is transmitted every 4 data bits to combat interference)

“gateways” that received the transmission:

“gtw_id”: “eui-b827ebfffebfbee2”, This gateway is located close to the end node, so the received signal is strong and the S/N is 9.8

“gtw_id”: “eui-58a0cbfffe801146”, This gateway is located In the basement of the building, the signal must traverse several floors, S/N = 1.8

“gtw_id”: “eui-ac1f09fffe0148c0”, This gateway is located 2 kilometers away, without any obstacle in the trajectory, S/N = -3.2

So the S/N ratio is dependent not only on the distance but also on the possible obstacles in the trajectory.

Each of these gateways was connected to the Internet by means of an Ethernet cable. They sent the same message to ttn-router-eu, the TTN Network server for Europe encapsulated in an Internet Protocol message.

The network server reads the embedded application identifier and forwards the payload (meteo data) as another IP (Internet Protocol) message to the Barani Meteorological application server where the payload is decoded. The data is also sent to the Allmeteo server which makes it available as a web page to any authorized user as seen in the following image:

Note that the TTN network server in Europe is handling traffic from a great number of gateways, but it cannot read the payload that it is forwarding, it only reads the application identifiers and forwards the traffic to the respective application server.

In summary, the meteorological data captured by the sensors are sent as the payload of a LoRaWAN packet to the gateway, which reads only the application identifier, strips the LoRaWAN protocol and builds an IP packet containing the payload and the address of the application server. The application server decrypts the data with the application key supplied by the owner of the data and presents them accordingly.