# IoT Protocols Compared: LoRaWAN, NB-IoT, Modbus and MQTT

> LoRa vs LoRaWAN, NB-IoT, Modbus RTU/TCP and MQTT compared by range, power and data rate, with protocol choices for energy monitoring, greenhouses and livestock.

LoRa is a long-range, low-power radio modulation, and LoRaWAN is the network and security protocol that runs on top of it. NB-IoT uses a mobile operator's licensed cellular network, Modbus is the industrial standard for reading meters, analysers and PLCs in the field, and MQTT is a lightweight messaging protocol that carries data to the cloud. They are rarely alternatives to one another, and most real IoT systems use several of them at different layers.

## Which layer does each protocol cover?

| Layer | Examples | Job |
|---|---|---|
| Field / device connection | Modbus RTU (RS-485), Modbus TCP | Read registers from meters, analysers, PLCs and inverters |
| Wireless access | LoRa, LoRaWAN, NB-IoT (also LTE-M, Wi-Fi) | Carry sensor data to a gateway or network |
| Messaging | MQTT (also CoAP, HTTP) | Move data to the platform reliably and efficiently |
| Platform | Database, dashboards, alerting | Store, visualise and raise alerts |

Some typical setups:

```text
Energy analyser --Modbus RTU (RS-485)--> Gateway --MQTT/TLS (fiber or LTE)--> Broker --> Platform
Soil moisture sensor --LoRaWAN--> Gateway --> Network server --MQTT integration--> Platform
Water tank level sensor --NB-IoT (UDP/CoAP or MQTT)--> Operator network --> Platform
```

## LoRa vs LoRaWAN

**LoRa** is a physical-layer modulation developed by Semtech, based on chirp spread spectrum (CSS). It runs in licence-exempt sub-GHz bands. Europe and Türkiye commonly use the EU868 (863–870 MHz) band plan. Higher spreading factors (SF7–SF12) extend range at the cost of data rate. LoRa can be used point-to-point on its own, but then the developer has to handle addressing, security and retransmission.

**LoRaWAN** is the network protocol published by the LoRa Alliance, also standardised as ITU-T Y.4480:

- **Topology:** end devices reach gateways, and gateways forward to a network server (star-of-stars). Gateways relay packets transparently. The network server handles de-duplication, adaptive data rate (ADR) and MAC commands.
- **Security:** AES-128 with separate session keys for the network and application layers. Over-the-air activation (OTAA) is considered safer than activation by personalisation (ABP), which uses static keys.
- **Device classes:** Class A uses the least energy and listens only briefly after its own uplink. Class B opens scheduled receive windows. Class C listens continuously and suits mains-powered devices.
- **Constraints:** most EU868 sub-bands impose a 1% duty cycle, which is about 36 seconds of airtime per hour. Data rates run from about 250 bit/s (SF12) to 5.5 kbit/s (SF7, 125 kHz). Application payload is limited to roughly 51–222 bytes, depending on data rate. LoRaWAN is designed for small, infrequent messages. It is not suitable for images or continuous streams.

## NB-IoT

NB-IoT is an LTE-based cellular IoT technology defined in 3GPP Release 13. It uses licensed spectrum with a narrow 180 kHz carrier.

- **Data rate:** Cat-NB1 peaks at roughly 26 kbit/s downlink and 66 kbit/s uplink. Cat-NB2 (Release 14) raises this to about 127/159 kbit/s.
- **Coverage:** designed for a 164 dB maximum coupling loss (MCL), so it reaches basements, meter rooms and manholes.
- **Power:** with power saving mode (PSM) and eDRX, battery devices can run for years if the reporting interval is suitable.
- **Constraints:** it depends on operator coverage and a SIM subscription. Latency is in the order of seconds, and mobility support is limited. Because of TCP overhead, UDP/CoAP or MQTT-SN is often preferred. For higher throughput or mobility, look at LTE-M.

## Modbus RTU and Modbus TCP

Modbus is a simple, open client/server (master/slave) protocol that Modicon created in 1979. It is still one of the most common field protocols for energy analysers, PLCs, inverters and drives.

- **Modbus RTU:** binary framing over RS-485, with one master polling devices in turn. Up to 247 device addresses are available. A single segment typically supports 32 unit loads without repeaters, and cable runs can reach 1200 m at lower baud rates. Common speeds are 9600–115200 bit/s.
- **Modbus TCP:** runs over Ethernet/IP on TCP port 502 and allows multiple clients. The protocol has no authentication or encryption, so keep devices on an isolated VLAN or behind a VPN. A TLS-based Modbus/TCP Security extension also exists.
- **Data model:** coils, discrete inputs, input registers and holding registers, with a register map specific to each device. The most frequent source of integration bugs is 32-bit floating-point values split across two 16-bit registers, because the word order varies by vendor.

## MQTT

MQTT is a lightweight publish/subscribe messaging protocol built around a broker. MQTT 3.1.1 is an OASIS standard, also published as ISO/IEC 20922. MQTT 5.0 adds reason codes, message expiry and shared subscriptions.

- **Topics:** hierarchical, for example `site/gebze/panel1/active_power`. The `+` and `#` wildcards allow group subscriptions.
- **QoS levels:** 0 (at most once), 1 (at least once), 2 (exactly once).
- **Useful features:** retained messages keep the last known value, and a Last Will message tells the platform when a device drops off unexpectedly.
- **Security:** the standard ports are 1883 (unencrypted) and 8883 (TLS). In production, use TLS, per-device credentials or certificates, and per-topic access control lists (ACLs).

MQTT is not a radio technology. It runs over any IP connection, including Ethernet, Wi-Fi, LTE and NB-IoT.

## Range, data rate and power compared

| Technology | Typical range | Data rate | Power | Infrastructure | Best at |
|---|---|---|---|---|---|
| LoRa (P2P) | 2–5 km urban, 10 km+ in open terrain (typical) | ~0.3–11 kbit/s (EU868) | Very low | Licence-exempt sub-GHz, custom protocol | Simple remote telemetry |
| LoRaWAN | Similar to LoRa, depends on gateway density | ~0.25–5.5 kbit/s (125 kHz) | Very low (Class A) | Licence-exempt, private or public network server | Battery sensors, wide areas, your own network |
| NB-IoT | Depends on operator coverage, strong indoor penetration | ~26–127 kbit/s downlink (NB1/NB2) | Low (PSM/eDRX) | Licensed cellular, SIM | Scattered meters, single remote points |
| Modbus RTU | RS-485 runs up to ~1200 m | 9.6–115.2 kbit/s (typical) | Wired, powered device | RS-485 cabling | Meters, analysers, PLCs |
| Modbus TCP | Local network reach | Ethernet speeds | Wired | LAN / VPN | Industrial devices on site |
| MQTT | Depends on the underlying IP network | Depends on the underlying network | Lightweight protocol | Any IP network | Device-to-cloud messaging |

## Examples: energy monitoring, greenhouses and livestock

### Energy monitoring (factories, shopping centres, solar plants)

- Panel analysers and meters connect to a gateway over Modbus RTU. The gateway polls registers at a fixed interval, for example every 15 seconds to 1 minute, and publishes to the platform over MQTT/TLS.
- The gateway should buffer locally (store-and-forward) so readings are not lost during an outage.
- Track active and reactive energy, power factor, harmonic distortion (THD), phase imbalance and demand. Raise alerts as reactive energy limits or demand peaks approach.
- Solar inverters usually expose Modbus TCP with SunSpec data models. For remote metering points without a local network, NB-IoT is a practical option.

### Greenhouses

- Measure air temperature and humidity, soil moisture and temperature, EC, CO2 and light (PAR). Vapour pressure deficit (VPD), derived from temperature and humidity, is a useful indicator of plant stress.
- LoRaWAN suits battery-powered sensors spread over several greenhouses. One gateway on a mast can cover a large area.
- Keep control of fans, vents, irrigation valves and heaters on a local controller, for example a PLC over Modbus. The platform raises alerts and recommendations, but critical control loops should not depend on an internet connection. Downlink commands to LoRaWAN Class A devices also arrive with a delay.

### Livestock

- In barns, the temperature-humidity index (THI) indicates heat stress. Ammonia (NH3) and CO2 readings inform ventilation decisions.
- Milk cooling tank temperature should be monitored continuously for food safety. A sudden change in water consumption can be an early warning of a plumbing fault or a herd health issue.
- On pasture, LoRaWAN fits GPS trackers and remote water troughs. NB-IoT suits generator or solar-powered sites with no local network. Activity and rumination collars are usually vendor-specific systems integrated via API.

## Questions to ask before choosing

1. Is the device mains-powered or battery-powered?
2. How often, and how much, data will it send?
3. Is the site a defined area you control (plant, greenhouse, farm) or spread across a city or region?
4. Do you need two-way control and low latency?
5. What interface do existing devices offer (RS-485 Modbus, Ethernet, analogue or pulse output)?
6. Which operating model fits better: a monthly fee per SIM or an up-front gateway investment?
7. How will you handle TLS, key management and network segmentation?

We are developing [Metrik](/en/solutions/metrik) (coming soon), a metrics platform that is planned to collect data arriving over NB-IoT, Modbus, MQTT, LoRaWAN and LoRa for energy, greenhouse and livestock use cases. Networking and field hardware is available through [wi.com.tr](/en/solutions/wi-com-tr).

## Frequently asked questions

### Are LoRa and LoRaWAN the same thing?

No. LoRa is the radio modulation at the physical layer. LoRaWAN is the protocol on top of it that defines network architecture, addressing, security and device classes. Every LoRaWAN device uses LoRa, but not every LoRa application is LoRaWAN.

### Should I choose NB-IoT or LoRaWAN?

If your devices are scattered over a wide area with good operator coverage, NB-IoT gets you started without building infrastructure. If you have many sensors in a defined area such as a greenhouse, farm or plant, a private LoRaWAN network with no per-SIM fees is usually more flexible and economical.

### Is MQTT an alternative to LoRaWAN?

No, they work at different layers. LoRaWAN carries data wirelessly from the sensor to the network server. MQTT typically moves data from the network server or gateway to the platform, and many LoRaWAN network servers provide a ready-made MQTT integration.

### Can I expose Modbus TCP devices directly to the internet?

You should not. Modbus TCP has no authentication or encryption, so an exposed device is open to unauthorised reads and writes. Keep devices on a separate VLAN and send data out over an outbound MQTT/TLS connection or a VPN.

### How many years will a battery-powered IoT sensor last?

There is no single answer. Battery life depends on reporting frequency, radio conditions (spreading factor for LoRaWAN, coverage level for NB-IoT), the sensor's own consumption, battery capacity and ambient temperature. Check vendor estimates against your actual reporting profile.

---
Canonical: https://internetten.com.tr/en/knowledge-base/iot-protocols-lorawan-nb-iot-modbus-mqtt
