---
title: "MQTT Protocol: How It Works, Advantages and Industrial Uses"
description: "A complete guide to MQTT: publish/subscribe, topics, QoS levels, MQTT 5, security, MQTT vs OPC UA and HTTP, and how to use MQTT in industrial IoT."
image: https://blog.alleantia.com/hubfs/mqtt-protocol-guide-publish-subscribe-broker-2000x876.jpg
---

[![Alleantia Logo](https://www.alleantia.com/wp-content/uploads/2023/11/Alleantia_logo.png)](https://blog.alleantia.com/)

- [Home](https://blog.alleantia.com/)
- [About](https://alleantia.com/)
- [Support](https://kb.alleantia.com/)

[EN](https://blog.alleantia.com/) | [IT](https://blog.alleantia.com/it)

[Contact Us](https://www.alleantia.com/ask-our-experts/)

[Skip to content](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#main-content)

![aMQTT publish/subscribe architecture: edge gateways, PLCs, energy meters, LoRaWAN sensors, robots and vision systems publish to an MQTT broker, which delivers data to MES, ERP, analytics and AI](https://blog.alleantia.com/hs-fs/hubfs/mqtt-protocol-guide-publish-subscribe-broker-2000x876.jpg?width=2000&height=876&name=mqtt-protocol-guide-publish-subscribe-broker-2000x876.jpg)

Industry 4.0

# MQTT Protocol: How It Works, Advantages and Industrial Uses

![Mattia Bigongiali](https://blog.alleantia.com/hs-fs/hubfs/Imported%20images/mattia_square-570x570.jpg?width=48&height=48&name=mattia_square-570x570.jpg)

 Mattia Bigongiali

December 1, 2026

A practical guide to the publish/subscribe protocol behind industrial IoT: architecture, QoS levels, security, MQTT 5 and how it compares with OPC UA and HTTP

**MQTT** is a lightweight, open publish/subscribe messaging protocol that lets machines, sensors and applications exchange data through a central server called a broker. Devices publish messages to named topics, and the broker delivers each message to every client subscribed to that topic. Its tiny packet overhead, event-driven model and built-in delivery guarantees have made it one of the most widely used protocols in IoT and industrial IoT. MQTT is an OASIS standard (versions 3.1.1 and 5.0) and an international standard, ISO/IEC 20922.

This guide explains how MQTT works, its components and Quality of Service levels, what changed with MQTT 5, how to secure it, how it compares with OPC UA, HTTP and AMQP, and how to use it to move machine data from the shop floor to MES, ERP, analytics and AI.

#### Key takeaways

- MQTT uses a publish/subscribe model: clients never talk to each other directly, a broker routes every message by topic.
- Three QoS levels (0, 1 and 2) let you choose, message by message, between speed and delivery guarantees.
- Retained messages, Last Will and persistent sessions keep data flowing reliably on unstable networks.
- MQTT defines how data travels. Payload format, topic names and data model are left to you, or to specifications such as Sparkplug.
- Most PLCs, CNCs and legacy machines do not speak MQTT natively: an edge layer reads them in their own protocols and publishes clean, structured data.

#### In this guide

- [What is MQTT?](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#what-is-mqtt)
- [How MQTT works: the publish/subscribe model](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#how-mqtt-works)
- [MQTT components: clients, broker, topics and messages](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#mqtt-components)
- [MQTT QoS levels explained](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#mqtt-qos)
- [Retained messages, Last Will and persistent sessions](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#reliability-features)
- [Advantages and limitations of MQTT](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#advantages)
- [MQTT 5 vs MQTT 3.1.1](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#mqtt-5)
- [MQTT security](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#mqtt-security)
- [MQTT vs OPC UA, HTTP and AMQP](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#mqtt-vs-protocols)
- [MQTT use cases in manufacturing](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#use-cases)
- [MQTT, Sparkplug and the Unified Namespace](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#sparkplug-uns)
- [How to implement MQTT in a plant](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#implementation)
- [How Alleantia Core works with MQTT](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#alleantia-core-mqtt)
- [FAQ about MQTT](https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol#faq)

## What is MQTT?

MQTT is a client/server messaging transport protocol based on the publish/subscribe pattern. The OASIS specification describes it as light weight, open, simple and easy to implement, which makes it a good fit for machine-to-machine communication and IoT, where devices have limited resources and networks have limited bandwidth.

The protocol was created in 1999 by Andy Stanford-Clark of IBM and Arlen Nipper of Arcom Control Systems (now part of Eurotech) to monitor oil pipelines through SCADA systems connected over expensive and unreliable satellite links. That origin explains its design goals: minimal bandwidth, resilience to dropped connections and simple clients. IBM submitted MQTT to OASIS in 2013, OASIS published version 3.1.1 in October 2014, ISO/IEC adopted it as ISO/IEC 20922 in 2016 and OASIS approved MQTT 5.0 on 7 March 2019.

The name is often expanded as *Message Queuing Telemetry Transport*, but it originally referred to IBM's MQ product family, and MQTT does not use message queues in the traditional sense. Today OASIS uses "MQTT" as a name in its own right.

| Feature | MQTT at a glance |
| --- | --- |
| Communication model | Publish/subscribe through a broker |
| Transport | TCP/IP, or WebSockets for browser clients; MQTT-SN is a variant for non-TCP networks such as Zigbee or UDP |
| Standard ports | 1883 (unencrypted), 8883 (MQTT over TLS), 443 commonly used for MQTT over secure WebSockets |
| Minimum overhead | 2-byte fixed header per packet |
| Delivery guarantees | QoS 0 (at most once), QoS 1 (at least once), QoS 2 (exactly once) |
| Payload | Any binary data up to about 256 MB per message; JSON is the most common format in IIoT |
| Current versions | MQTT 3.1.1 (OASIS 2014, ISO/IEC 20922:2016) and MQTT 5.0 (OASIS 2019) |

## How MQTT works: the publish/subscribe model

In a request/response protocol such as HTTP, a client asks a server for data and waits for the answer, then asks again to see whether something changed. In MQTT the senders (publishers) and receivers (subscribers) never communicate directly. Every client keeps an open connection to a broker; publishers send messages to a topic, and the broker forwards each message to all the clients subscribed to that topic, as soon as it arrives.

1. **Connect**: the client opens a TCP connection to the broker and sends a CONNECT packet with its client ID, credentials, keep alive interval and session options. The broker answers with CONNACK.
2. **Subscribe**: a client tells the broker which topics it is interested in (SUBSCRIBE and SUBACK), using wildcards to cover groups of topics.
3. **Publish**: a client sends a PUBLISH packet containing a topic name, a QoS level, a retain flag and the payload.
4. **Route**: the broker matches the topic against all active subscriptions and forwards the message to every matching subscriber.
5. **Stay connected**: the connection remains open. When there is no traffic, tiny PINGREQ and PINGRESP packets keep it alive and let the broker detect clients that disappear.

This model decouples producers and consumers of data in three ways. In **space**, because a publisher does not need to know who the subscribers are or how many there are. In **time**, because with persistent sessions and retained messages they do not need to be online at the same moment. In **synchronization**, because publishing never blocks the publisher while it waits for receivers. In practice, adding a new consumer such as a dashboard, a MES or an AI model requires no change on the machine side.

## MQTT components: clients, broker, topics and messages

- **MQTT client**Any device or application running an MQTT library: a sensor, a PLC, an edge gateway, a MES or an analytics service. The same client can publish, subscribe, or both.
- **MQTT broker**The server that receives every message, filters it by topic and delivers it to subscribers. It also handles authentication, authorization, sessions and retained messages. Examples include Eclipse Mosquitto, EMQX, HiveMQ and VerneMQ, and managed services such as AWS IoT Core and the Azure Event Grid MQTT broker.
- **Topic**A UTF-8 string organized in levels separated by slashes, for example `acme/pisa/line2/press4/temperature`. Topics do not need to be created in advance: the broker handles them dynamically.
- **Message**A topic, a payload, a QoS level and a retain flag, plus optional properties in MQTT 5. For the broker the payload is just bytes, so the format (JSON, Protobuf, plain text) is agreed between publishers and subscribers.

### Topics and wildcards

Subscribers can use two wildcards to receive data from many topics with a single subscription. Wildcards are only allowed in subscriptions, never when publishing.

| Pattern | What it matches | Example |
| --- | --- | --- |
| `+` single level | Exactly one topic level | `acme/pisa/+/press4/temperature` receives the temperature of press 4 on every line |
| `#` multi-level | All remaining levels; it must be the last character | `acme/pisa/line2/#` receives everything published by line 2 |
| `$` prefix | Topics reserved for the broker, not matched by wildcards at the first level | `$SYS/broker/clients/connected` on many brokers |

A good topic design follows the structure of the company, often the ISA-95 hierarchy (enterprise, site, area, line, cell, asset), uses consistent lowercase names without spaces, avoids a leading slash and keeps different kinds of data on separate branches, for example telemetry, alarms, events and commands.

## MQTT QoS levels explained

Quality of Service (QoS) defines the delivery guarantee for each message. The publisher chooses the QoS of each message, the subscriber chooses the maximum QoS of each subscription, and the broker delivers at the lower of the two.

![MQTT QoS levels diagram: QoS 0 at most once with a single PUBLISH packet for high-frequency telemetry, QoS 1 at least once with PUBLISH and PUBACK for counters, alarms and events, QoS 2 exactly once with PUBLISH, PUBREC, PUBREL and PUBCOMP for commands and setpoints](https://blog.alleantia.com/hs-fs/hubfs/mqtt-qos-levels-0-1-2-explained.png?width=1125&height=712&name=mqtt-qos-levels-0-1-2-explained.png)

| QoS | Guarantee | Packets exchanged | Typical use in a factory |
| --- | --- | --- | --- |
| 0 | At most once: the message may be lost, never duplicated | PUBLISH | High-frequency telemetry where the next value replaces a lost one |
| 1 | At least once: the message always arrives, possibly more than once | PUBLISH, PUBACK | Production counts, alarms and events, with consumers that ignore duplicates |
| 2 | Exactly once: the message arrives a single time | PUBLISH, PUBREC, PUBREL, PUBCOMP | Commands, setpoints, recipes and totals where a duplicate would change the result |

Two details are often overlooked. QoS applies to each hop separately (publisher to broker, then broker to subscriber), so an end-to-end guarantee depends on both. And a higher QoS means more packets and more latency, so QoS 2 should be reserved for the data that really needs it.

## Retained messages, Last Will and persistent sessions

- **Retained messages**The broker keeps the last message published with the retain flag on a topic and sends it immediately to every new subscriber. Ideal for state information such as machine status or configuration.
- **Last Will and Testament**A message the client registers when it connects. If the client disconnects unexpectedly, the broker publishes it for the client, which is the standard way to signal that a machine or gateway went offline.
- **Keep alive**The client declares a maximum silence interval. If the broker receives nothing for one and a half times that interval, it closes the connection and publishes the Last Will.
- **Persistent sessions**With a persistent session the broker stores the client's subscriptions and queues QoS 1 and 2 messages while it is offline, then delivers them when it reconnects. In MQTT 5 the session expiry interval controls how long this lasts.

## Advantages and limitations of MQTT

These are the main advantages of the MQTT protocol, and the reasons it has become a de facto standard for IoT and IIoT data:

- **Lightweight**: a 2-byte minimum header and small client libraries let MQTT run on microcontrollers and on low-bandwidth links such as cellular or satellite.
- **Event-driven, no polling**: data is sent when it changes or at a defined interval, which reduces network traffic and latency compared with repeated polling.
- **Decoupled architecture**: one data stream can feed many applications, and new consumers can be added without touching the data sources.
- **Reliable on unstable networks**: QoS levels, persistent sessions and Last Will handle disconnections without losing critical data.
- **Scalable**: a single broker or a cluster can handle from a few devices to millions of connections.
- **Bidirectional and firewall-friendly**: devices open an outbound connection to the broker and use it both to send data and to receive commands, without exposing inbound ports.
- **Open and interoperable**: an OASIS and ISO/IEC standard with open-source clients for almost every programming language and support from all major IoT and IT platforms.

### Limitations to consider

- **No standard data model**MQTT carries bytes. Topic names, payload format, units and meaning must be agreed by every system, which is the problem Sparkplug and a Unified Namespace address.
- **The broker is a central component**It needs high availability (clustering or bridging), capacity planning and monitoring, like any critical infrastructure.
- **Security is configuration**Port 1883 is unencrypted and some brokers allow anonymous access by default. TLS, authentication and access control must be set up explicitly.
- **Machines rarely speak MQTT**Most PLCs, CNCs and legacy machines use their own protocols, so a plant-wide MQTT architecture needs an edge layer that translates them.

## MQTT 5 vs MQTT 3.1.1: what changed

MQTT 5.0 keeps the same core model as 3.1.1 and adds features that matter in industrial deployments:

| MQTT 5 feature | What it does | Why it matters in industry |
| --- | --- | --- |
| Reason codes | Every acknowledgement can carry a reason code | Faster troubleshooting of refused connections or subscriptions |
| Session and message expiry | Sessions and single messages can expire after a set time | Prevents stale commands or old data from being delivered hours later |
| Shared subscriptions | Messages on `$share/group/topic` are load-balanced across a group of subscribers | Scales data ingestion with several parallel consumers |
| User properties | Custom key/value metadata in the message header | Adds context such as unit, source or schema version without changing the payload |
| Topic alias | Replaces a long topic name with a short number | Saves bandwidth with deep ISA-95 topic hierarchies |
| Request/response | Response topic and correlation data | Commands that need an explicit confirmation |
| Flow control and maximum packet size | Limits on in-flight messages and packet size | Protects constrained devices and the broker from overload |
| Payload format and content type | Declares whether the payload is UTF-8 text and its MIME type | Helps consumers parse data correctly |
| Enhanced authentication | Challenge/response authentication through the AUTH packet | Stronger authentication methods than username and password |

Most modern brokers support both versions at the same time, so devices with MQTT 3.1.1 clients, still very common, can coexist with newer MQTT 5 applications.

## MQTT security: how to protect MQTT communication

The MQTT protocol carries only a username and password in the CONNECT packet. Confidentiality comes from TLS at the transport level, while authentication and authorization are functions of the broker. Plain MQTT on port 1883 travels in clear text, so in a factory it should be limited to isolated test networks. OASIS has also published a companion document, [MQTT and the NIST Cybersecurity Framework](http://docs.oasis-open.org/mqtt/mqtt-nist-cybersecurity/v1.0/mqtt-nist-cybersecurity-v1.0.html), with guidance on securing MQTT deployments.

1. **Encrypt every connection** with TLS, on port 8883 or over secure WebSockets.
2. **Authenticate every client**, preferably with X.509 client certificates or at least unique credentials per device, and disable anonymous access.
3. **Authorize by topic** with access control lists: each machine publishes only on its own topics and reads only its own command topic.
4. **Segment the network**: keep the plant broker inside the OT network or in a DMZ, use outbound connections only and bridge data to IT systems, in line with IEC 62443 zones and conduits.
5. **Limit and validate** payload size, message rates and content, using MQTT 5 options such as maximum packet size and receive maximum.
6. **Monitor and update** the broker: connection logs, metrics and regular security patches.

## MQTT vs OPC UA, HTTP and AMQP

MQTT is often compared with other protocols used to move industrial data. Each one is designed for a different job:

|  | MQTT | OPC UA | HTTP / REST | AMQP |
| --- | --- | --- | --- | --- |
| Model | Publish/subscribe through a broker | Client/server, plus PubSub (Part 14) | Request/response | Message queues and exchanges |
| Data model | None, the payload is opaque | Rich information model and companion specifications | Defined by each API | None |
| Overhead | Very low | Medium to high | High, headers on every request | Medium |
| Best for | Streaming telemetry to many consumers, UNS | Structured access to machines and PLCs | Web and business applications, occasional requests | Enterprise messaging and transactional queues |
| Typical role in a plant | Data distribution layer | Machine and controller interface | APIs toward business systems | IT backend integration |

> **MQTT or OPC UA?** In most plants the answer is both. OPC UA describes machine data in a structured information model, MQTT distributes data efficiently to many consumers. OPC UA PubSub can even use MQTT as its transport. An edge layer can read machines over OPC UA and native protocols and publish the result over MQTT.

## MQTT use cases in manufacturing

- **Machine monitoring and OEE**Machine states, piece counts and stops published in real time to measure availability, performance and quality. [See performance monitoring](https://www.alleantia.com/smart-manufacturing-oee/).
- **Energy monitoring**Consumption from meters and machines published per line and per product for cost control and sustainability reporting. [See energy monitoring](https://www.alleantia.com/energy-monitoring/).
- **Predictive maintenance**Vibration, temperature, current and alarm streams feeding anomaly detection models. [See predictive maintenance](https://www.alleantia.com/predictive-maintenance/).
- **Remote service for machine builders**Machines installed at customer sites publish data and receive commands through a single outbound connection. [See servitization](https://www.alleantia.com/servitization/).
- **Wireless and LoRaWAN sensors**Gateways publish sensor readings as JSON to a broker, from where they join the rest of the plant data. [See a LoRaWAN example](https://kb.alleantia.com/how-to-connect-milesight-uc300-iot-trough-ug30-lorawan-gateway).
- **Integration with IT platforms**The same data stream reaches MES, ERP, databases and platforms such as AWS or Azure, without point-to-point connections.

## MQTT, Sparkplug and the Unified Namespace

Because MQTT does not prescribe topic names or payload formats, two approaches have emerged to give industrial MQTT data a shared structure.

**Sparkplug** is an open specification managed by the Eclipse Foundation that defines a topic namespace, a payload encoding based on Protocol Buffers and state management through birth and death certificates, built on MQTT's Last Will. Sparkplug 3.0 was published as the international standard ISO/IEC 20237:2023.

A **Unified Namespace (UNS)** is an architecture in which an MQTT broker becomes the central hub of the company's data: every system publishes its current state into a shared hierarchy, often modelled on ISA-95, and consumes the data it needs from the same place. Its effectiveness depends on semantics, meaning a clear and shared model behind every topic and payload.

To go deeper into the semantic layer of a UNS, read [ISA-95 and UNS: the semantic model for OT/IT integration](https://blog.alleantia.com/isa-95-and-uns-the-semantic-model-for-ot-it-integration) and [ISA-95, the semantic layer that makes UNS truly effective](https://blog.alleantia.com/isa-95-the-semantic-layer-that-makes-uns-truly-effective).

## How to implement MQTT in a plant

1. **Start from the use cases**: define which applications need which data, and how fast.
2. **Map machines and protocols**: list controllers, protocols and variables, and identify which machines will need an edge layer to publish over MQTT.
3. **Design the topic namespace**: choose a hierarchy (for example ISA-95), naming rules and separate branches for telemetry, alarms, events and commands.
4. **Define the payload**: a JSON structure with value, timestamp, quality and unit, or a specification such as Sparkplug.
5. **Choose QoS and retain per data type**: QoS 0 for fast telemetry, QoS 1 for events and alarms, retained messages for states.
6. **Choose and size the broker**: inside the plant, in a central data center or as a managed service, with clustering or bridging for high availability.
7. **Secure it from day one**: TLS, client certificates and topic-level access control.
8. **Test and monitor**: use MQTT client tools to inspect topics, measure end-to-end latency and watch broker metrics.

For a broader view of the whole data flow, from acquisition to distribution, see [Industrial and IoT data integration: benefits and use cases](https://blog.alleantia.com/the-benefits-of-data-integration) and [IoT data interoperability for machine data](https://blog.alleantia.com/iot-data-interoperability-machine-data).

## How Alleantia Core works with MQTT

[Alleantia Core](https://www.alleantia.com/alleantia-core/) is the edge software that connects PLCs, CNCs, robots, sensors and legacy machines of any brand to the applications that use their data, without writing code. It runs inside your infrastructure and works with MQTT in both directions.

![Alleantia Core and MQTT diagram: PLCs, CNCs, robots, energy meters, LoRaWAN sensors and legacy machines connect to Alleantia Core inside the plant, which acquires and normalizes data, publishes telemetry, alarms and events to the customer's MQTT broker and listens for commands on a dedicated topic](https://blog.alleantia.com/hs-fs/hubfs/alleantia-core-mqtt-publish-subscribe-commands.png?width=1125&height=712&name=alleantia-core-mqtt-publish-subscribe-commands.png)

- **Every machine can publish over MQTT**: the [Machine Drivers Library](https://www.alleantia.com/machine-drivers-library/) provides 5,000+ ready-to-use drivers and 70+ industrial protocols, so machines that only speak Siemens S7, Fanuc FOCAS, Heidenhain, Modbus or OPC UA can still feed an MQTT architecture.
- **Telemetry, alarms and events on your broker**: data is published as JSON on dedicated topics for telemetry, alarms and events. Telemetry is sent at a configurable sampling interval, in complete, compact or time-series formats.
- **Commands from the broker**: Core can listen on a commands topic to write values to machine variables enabled for writing and to manage part programs, replying on the telemetry topic.
- **Data from MQTT devices**: an MQTT subscriber driver reads JSON messages from a broker, for example LoRaWAN sensors connected through a gateway, and brings them into the same data model as every other machine.
- **Tunable performance**: each MQTT connector has its own sampling interval, and several connectors can run on the same gateway. In Alleantia tests with four parallel MQTT connectors, device-to-broker latency was 6 to 8 ms.
- **Many destinations at once**: MQTT runs alongside the other Connectors for AWS, Microsoft Azure, SQL databases and REST APIs, and applications can also read data from Core as an OPC UA or Modbus server.
- **Runs where you need it**: Windows, Linux, Raspberry Pi, Docker, Cisco IOx and Azure IoT Edge, with data that stays in your infrastructure.

The same structured data feeds **Alleantia Insights** for KPIs and production analytics, and **Alleantia Agents**, which builds a knowledge graph of the factory that AI agents can query.

Technical resources from the Alleantia knowledge base:

- [How to use the MQTT service with Alleantia (user guide)](https://kb.alleantia.com/how-can-i-use-the-mqtt-service-with-alleantia)
- [Troubleshooting MQTT commands with Alleantia](https://kb.alleantia.com/trouble-in-testing-mqtt-communication-with-alleantia)
- [Optimizing machine data acquisition and distribution throughput](https://kb.alleantia.com/optimizing-machine-data-acquisition-and-distribution-throughput)
- [Connecting LoRaWAN sensors to Alleantia Core over MQTT](https://kb.alleantia.com/how-to-connect-milesight-uc300-iot-trough-ug30-lorawan-gateway)
- [Supported industrial protocols](https://kb.alleantia.com/supported-industrial-protocols)
- [Industrial connectivity in 5 minutes with Alleantia](https://kb.alleantia.com/industrial-connectivity-configuration-steps)

## FAQ about MQTT

### What does MQTT stand for?

MQTT originally stood for MQ Telemetry Transport, from IBM's MQ product family, and is often expanded as Message Queuing Telemetry Transport. Since its standardization at OASIS, MQTT is used as a name in its own right and is not considered an acronym.

### Does MQTT use TCP or UDP?

MQTT runs over TCP/IP, which provides ordered and lossless connections, or over WebSockets. For networks without TCP/IP, such as Zigbee or UDP-based sensor networks, there is a variant called MQTT-SN.

### What port does MQTT use?

Port 1883 for unencrypted MQTT and port 8883 for MQTT over TLS, both registered with IANA. MQTT over secure WebSockets commonly uses port 443.

### What is an MQTT broker?

An MQTT broker is the server that receives all messages from publishing clients, filters them by topic and delivers them to subscribed clients. It also manages authentication, authorization, sessions and retained messages.

### What is the difference between MQTT and HTTP?

HTTP is a request/response protocol: a client must ask a server for data each time. MQTT is publish/subscribe: clients keep an open connection to a broker and receive data as soon as it is published. MQTT has much lower overhead per message and suits continuous data streams, while HTTP suits occasional requests and web APIs.

### Is MQTT better than OPC UA?

They solve different problems and are often used together. OPC UA offers structured, secure access to machines through a rich information model; MQTT efficiently distributes data to many consumers. A common architecture reads machines over OPC UA and native protocols at the edge and publishes the data over MQTT.

### Is MQTT secure?

MQTT can be secure when it is configured correctly: TLS encryption on port 8883, client certificates or unique credentials, topic-level access control and network segmentation. Plain MQTT on port 1883 is unencrypted and should not be used on production networks.

### Which MQTT QoS level should I use?

Use QoS 0 for high-frequency telemetry where losing a single value is acceptable, QoS 1 for events, alarms and counts with consumers that ignore duplicates, and QoS 2 for commands or totals where a duplicate would cause an error.

### What is MQTT Sparkplug?

Sparkplug is an open specification from the Eclipse Foundation that defines a topic namespace, a payload format and state management for industrial MQTT data. Sparkplug 3.0 is published as the international standard ISO/IEC 20237:2023.

### Can PLCs and CNC machines send data over MQTT?

Some recent PLCs include an MQTT client, but most PLCs, CNCs and legacy machines do not support MQTT natively. An edge software such as Alleantia Core reads them in their own protocols and publishes their data to an MQTT broker.

Ready to stream your machine data over MQTT?

[Discover Alleantia Core](https://www.alleantia.com/alleantia-core/)[Book a demo](https://www.alleantia.com/book-a-demo/)

Sources: [MQTT Version 5.0, OASIS Standard](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html); [MQTT Version 3.1.1, OASIS Standard](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html); [ISO/IEC 20922:2016](https://www.iso.org/standard/69466.html); [ISO/IEC 20237:2023, Sparkplug 3.0](https://www.iso.org/standard/86204.html); Alleantia MQTT user guide.

## Share this post

<https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fblog.alleantia.com%2Fget-to-know-the-advantages-of-mqtt-protocol>

## Keep reading

### [![data\_integration\_the common format](https://blog.alleantia.com/hs-fs/hubfs/data-integration-alleantia-core-en-2000x876.jpg?width=2000&height=876&name=data-integration-alleantia-core-en-2000x876.jpg) Industry 4.0 Industrial & IoT Data Integration: Benefits and 6 Use Cases](https://blog.alleantia.com/the-benefits-of-data-integration)

### [![data interoperability-standardize](https://blog.alleantia.com/hs-fs/hubfs/machine-data-interoperability-three-layers-alleantia.png?width=2400&height=1520&name=machine-data-interoperability-three-layers-alleantia.png) Industry 4.0 Edge Computing IoT Data Interoperability for Machine Data | Alleantia](https://blog.alleantia.com/iot-data-interoperability-machine-data)

### Alleantia NewsRoom

Stay updated with the latest insights, case studies, and trends on Industry 4.0, IoT, and AI.

- [alleantia.com](https://www.alleantia.com/)

[![LinkedIn](https://www.alleantia.com/wp-content/uploads/2025/04/linkedin-icon.png)](https://it.linkedin.com/company/alleantia-s-r-l-)

### Contact Us

Name: Email: Message:

 Send Message

---

[Privacy Policy](https://www.alleantia.com/privacy-policy/) · Legal · © 2025. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Mattia Bigongiali",
    "url" : "https://blog.alleantia.com/author/mattia-bigongiali"
  },
  "dateModified" : "2026-12-01T16:40:07.953Z",
  "datePublished" : "2026-12-01T15:45:00.000Z",
  "headline" : "MQTT Protocol: How It Works, Advantages and Industrial Uses",
  "image" : [ "https://blog.alleantia.com/hubfs/mqtt-protocol-guide-publish-subscribe-broker-2000x876.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.alleantia.com/get-to-know-the-advantages-of-mqtt-protocol",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.alleantia.com/hubfs/Alleantia_ATJ_transpbg_HD.jpg"
    },
    "name" : "ALLEANTIA SRL"
  }
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "FAQPage",
  "inLanguage" : "en",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "MQTT originally stood for MQ Telemetry Transport, from IBM's MQ product family, and is often expanded as Message Queuing Telemetry Transport. Since its standardization at OASIS, MQTT is used as a name in its own right and is not considered an acronym."
    },
    "name" : "What does MQTT stand for?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "MQTT runs over TCP/IP, which provides ordered and lossless connections, or over WebSockets. For networks without TCP/IP, such as Zigbee or UDP-based sensor networks, there is a variant called MQTT-SN."
    },
    "name" : "Does MQTT use TCP or UDP?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Port 1883 for unencrypted MQTT and port 8883 for MQTT over TLS, both registered with IANA. MQTT over secure WebSockets commonly uses port 443."
    },
    "name" : "What port does MQTT use?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "An MQTT broker is the server that receives all messages from publishing clients, filters them by topic and delivers them to subscribed clients. It also manages authentication, authorization, sessions and retained messages."
    },
    "name" : "What is an MQTT broker?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "HTTP is a request/response protocol: a client must ask a server for data each time. MQTT is publish/subscribe: clients keep an open connection to a broker and receive data as soon as it is published. MQTT has much lower overhead per message and suits continuous data streams, while HTTP suits occasional requests and web APIs."
    },
    "name" : "What is the difference between MQTT and HTTP?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "They solve different problems and are often used together. OPC UA offers structured, secure access to machines through a rich information model; MQTT efficiently distributes data to many consumers. A common architecture reads machines over OPC UA and native protocols at the edge and publishes the data over MQTT."
    },
    "name" : "Is MQTT better than OPC UA?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "MQTT can be secure when it is configured correctly: TLS encryption on port 8883, client certificates or unique credentials, topic-level access control and network segmentation. Plain MQTT on port 1883 is unencrypted and should not be used on production networks."
    },
    "name" : "Is MQTT secure?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Use QoS 0 for high-frequency telemetry where losing a single value is acceptable, QoS 1 for events, alarms and counts with consumers that ignore duplicates, and QoS 2 for commands or totals where a duplicate would cause an error."
    },
    "name" : "Which MQTT QoS level should I use?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Sparkplug is an open specification from the Eclipse Foundation that defines a topic namespace, a payload format and state management for industrial MQTT data. Sparkplug 3.0 is published as the international standard ISO/IEC 20237:2023."
    },
    "name" : "What is MQTT Sparkplug?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Some recent PLCs include an MQTT client, but most PLCs, CNCs and legacy machines do not support MQTT natively. An edge software such as Alleantia Core reads them in their own protocols and publishes their data to an MQTT broker."
    },
    "name" : "Can PLCs and CNC machines send data over MQTT?"
  } ]
}
```