MQTT: Definition, How It Works and Its Role in Manufacturing

What is MQTT?

In short: MQTT is a lightweight, open messaging protocol for exchanging data between machines, sensors and applications. Devices publish their values under a topic to a central MQTT broker, and every application that has subscribed to that topic receives the update immediately. The MQTT protocol runs over TCP/IP, is standardized by OASIS and ISO and has become one of the most widely used ways to move industrial data from the shop floor to IT systems and the cloud.

Jump to: How it works · QoS · MQTT 5 · Sparkplug B · MQTT vs. OPC UA · Challenges · Examples · Security · Implementation · FAQ

From oil pipelines to the shop floor: where MQTT comes from

MQTT was developed in 1999 by Andy Stanford-Clark of IBM and Arlen Nipper of Arcom. Their task was to monitor oil pipelines over expensive and unreliable satellite links while using as little bandwidth and battery power as possible. These conditions shaped the design of the protocol: small packets, a connection that stays open and delivery guarantees that the sender can choose for each message.

IBM released version 3.1 royalty-free in 2010. In 2014, MQTT 3.1.1 became an OASIS standard, and in 2016 it was also adopted as the international standard ISO/IEC 20922. The current version is MQTT 5.0, published by OASIS in March 2019. The name originally stood for MQ Telemetry Transport, after IBM’s MQ product family. Today MQTT is simply the name of the protocol, even though many sources still spell it out as Message Queuing Telemetry Transport.

The properties that suit a satellite link also suit a factory with hundreds of controllers, mixed networks and many systems that need the same data. This is why MQTT has become a cornerstone of the Industrial IoT. In the 2025 IoT and Embedded Developer Survey of the Eclipse Foundation, published in March 2026, MQTT is the most frequently used communication protocol in IoT and edge deployments: 28% of respondents use MQTT 5 and 27% use MQTT 3, ahead of WebSockets (24%), HTTP/1.1 (17%) and OPC UA (10%). Respondents could select more than one protocol.

Every machine speaks its own language, and every application asks again

A typical plant runs controllers from several generations and vendors. Siemens controllers speak S7, older equipment Modbus, newer machines OPC UA, and many devices come with their own proprietary interface. Every application that wants machine data, whether MES, energy monitoring or a quality dashboard, has traditionally had to learn these languages and query each controller on its own. Over the years, this creates a growing number of polling connections that put load on the controllers, deliver data in different formats and have to be adapted whenever a machine or an application changes.

This is where many digitalization projects lose momentum. A use case runs on the pilot line because a team built the interfaces for exactly that line. Rolling it out to further lines and plants means building the same interfaces again. In the Eclipse Foundation survey mentioned above, data collection, analytics and decision-making at the edge was the most frequently named development challenge, cited by 35% of respondents.

MQTT solves the transport part of this problem. Each value is read from the machine once and published to a broker. From there, any number of applications can subscribe to it in the same format, without opening another connection to the controller. How the data gets from the controller into MQTT and how it is described so that every system understands it are separate questions, which are covered further down this page.

How MQTT works: publish, subscribe and a broker in between

MQTT follows the publish/subscribe pattern. Every participant is a client that keeps a permanent TCP connection to a central server, the MQTT broker. Clients that send data are called publishers, clients that receive data are called subscribers, and one client can be both. Publishers and subscribers do not need to know each other, because they only deal with the broker and with topics. How the broker itself is built and operated, from clustering to selection criteria, is explained on our page about the MQTT broker.

Connect: one open connection per client

A client opens a TCP connection to the broker, by default on port 1883, or on port 8883 when the connection is encrypted with TLS. With the CONNECT packet it identifies itself with a client ID, optionally with username and password or a certificate, and agrees on a keep-alive interval. The broker confirms with CONNACK. The connection then stays open, so data can flow in both directions without a new handshake for every message.

Topics: the address of every value

Every message is published to a topic, a hierarchical string with levels separated by slashes, for example acme/hamburg/press-shop/press-04/temperature. Topics do not have to be created in advance. Subscribers can use two wildcards: + stands for exactly one level and # for all levels below. A subscription to acme/hamburg/+/+/temperature therefore delivers the temperatures of all machines in the Hamburg plant. When the topic levels follow the ISA-95 hierarchy of enterprise, site, area, line and machine, the topic tree becomes the backbone of a Unified Namespace.

Publish once, deliver to many

When a publisher sends a value, the broker forwards it to every client whose subscription matches the topic. Adding a new subscriber changes nothing for the publisher or for the machine behind it. MQTT can carry any payload, from JSON and plain values to binary formats such as Protocol Buffers. The fixed header of an MQTT packet is only two bytes long, so even frequent small values cause little network load.

Combined with report by exception, where a device only publishes when a value changes, this results in a lean event-driven architecture. Applications learn about a change the moment it happens and no longer need to ask every few seconds whether something is new.

Quality of Service: three delivery guarantees

For every message, the sender chooses one of three Quality of Service (QoS) levels. Each level balances reliability against network load and latency.

QoS levelGuaranteeTypical use in production
QoS 0: at most onceThe message is sent once without confirmation. If the connection drops at that moment, it is lost.High-frequency sensor values where the next reading follows shortly, for example vibration or temperature every second
QoS 1: at least onceThe receiver confirms with PUBACK, and the sender repeats the message until the confirmation arrives. Duplicates are possible.Most machine and process data, counters and states where a duplicate does no harm
QoS 2: exactly onceA four-step handshake makes sure that the message arrives exactly once.Events that must not be counted twice, for example order completions, quality results or quantities relevant for booking
MQTT QoS levels 0, 1 and 2 compared as message flows between publisher and broker

The QoS level applies to each leg separately, from publisher to broker and from broker to subscriber. If a subscriber requests a lower level than the publisher used, the broker delivers with the lower of the two.

Retained messages, Last Will and sessions

  • Retained messages: The broker keeps the last message on a topic that is flagged as retained and sends it immediately to every new subscriber. A dashboard that starts up sees the current state of a machine right away and does not have to wait for the next change.
  • Last Will and Testament: When connecting, a client can deposit a message that the broker publishes if the client disconnects unexpectedly. This makes it visible within seconds when a gateway or a machine goes offline.
  • Keep alive: When no other data flows, client and broker exchange small PINGREQ and PINGRESP packets. Both sides can thus detect dead connections, even in networks where firewalls silently drop idle connections.
  • Persistent sessions: The broker remembers the subscriptions of a client and buffers messages with QoS 1 and 2 while the client is offline. After reconnecting, the client receives what it missed.

MQTT 3.1.1 vs. MQTT 5: what the new version adds

MQTT 3.1.1 is still widespread, especially in devices and gateways that have been running for years. MQTT 5 keeps the basic principle and adds functions that matter most in large, long-running installations: better error reporting, controlled expiry of sessions and messages, and metadata for each message. Most brokers support both versions side by side, so devices can be switched over step by step.

FeatureMQTT 3.1.1MQTT 5.0
Error reportingFew return codes, and many errors only become visible when the connection is closedReason codes on almost every acknowledgment, so a client knows why a publish or a subscription was rejected
Session and message expiryPersistent sessions remain until they are deleted, and messages never expireSession expiry and message expiry intervals let outdated data and abandoned sessions run out automatically
Load distributionEvery subscriber receives every messageShared subscriptions distribute the messages of one topic across several instances of an application
MetadataTopic and payload onlyUser properties, content type and payload format indicator travel with each message
Request/responseOnly through self-defined topic conventionsResponse topic and correlation data are part of the standard
Flow controlNo limits agreed between client and brokerReceive maximum, maximum packet size and topic aliases reduce the load on constrained devices and networks
AuthenticationUsername and password, TLS certificatesAdditionally enhanced authentication, for example with challenge-response methods

For new installations, MQTT 5 is the natural choice as long as the devices and libraries in use support it. Existing 3.1.1 clients can keep running on the same broker.

Sparkplug B: shared rules for industrial MQTT

MQTT deliberately leaves two things open: how topics are named and what a payload looks like. In a single project, this freedom is helpful. In a plant with dozens of suppliers and integrators, it leads to every team inventing its own conventions. Sparkplug closes this gap. The specification is maintained by the Eclipse Foundation and has been an international standard as ISO/IEC 20237 since 2023. Sparkplug B refers to the current version of its payload definition.

Sparkplug adds three things on top of MQTT:

  • Topic namespace: A fixed structure of the form spBv1.0/group/message type/edge node/device, so every Sparkplug-capable system finds data in the same place.
  • Payload: A compact binary format based on Google Protocol Buffers, with timestamp, data type and metric name for every value.
  • State management: Birth and death certificates announce when an edge node or a device comes online, which values it provides and when it goes offline. Applications therefore always know whether a value is current or stale.

Sparkplug is particularly useful where many devices from different vendors have to be connected to SCADA or MES applications with as little configuration effort as possible. Its fixed topic structure follows the technical view of edge nodes and devices, though. Many manufacturers therefore combine Sparkplug for device connectivity with a topic tree based on ISA-95 that reflects their plants, lines and machines. When Sparkplug B is the right choice and when a JSON-based Unified Namespace fits better is covered on our Sparkplug B page.

MQTT vs. OPC UA vs. HTTP: three protocols with three jobs

In discussions about industrial communication, MQTT and OPC UA are often presented as rivals. In practice, they solve different tasks and work well together. HTTP-based REST interfaces complete the picture, because many IT applications expect them.

MQTTOPC UAHTTP/REST
Communication patternPublish/subscribe via a brokerClient/server, with PubSub as an extensionRequest/response
Data modelNone, the payload can be defined freelyComprehensive information model with types, units and relationshipsNone, defined per API
Typical positionFrom the edge to the plant, the enterprise and the cloudDirectly at the machine and the controllerBetween IT applications and services
Data flowEvent-driven, changes are pushedPolling or subscriptions per client connectionThe client asks, the server answers
OverheadVery low, the fixed header is two bytesMedium to high, depending on the profileHigh per request because of text-based headers
Number of consumersAny number via the broker, without extra load on the sourceEach additional client loads the serverEach request loads the server
StrengthDistributing data to many systemsDescribing machine data with semanticsSimple integration with web and IT systems

A common architecture combines the protocols. OPC UA, S7 or Modbus read the values at the controller, an edge layer translates them into MQTT, and the broker distributes them to every application. OPC UA PubSub, specified in Part 14 of the standard, can also use MQTT as its transport. When a controller reaches its limits as an OPC UA server, for example with the node limit of the S7-1200, reading it through its native protocol and publishing to MQTT takes load off the controller.

MQTT architecture in manufacturing: controller protocols translated at the edge and distributed via an MQTT broker

And what about Kafka and AMQP?

Apache Kafka and AMQP also come up regularly in architecture discussions. Kafka is a platform that stores large data streams over long periods and makes them replayable for analytics. AMQP, the Advanced Message Queuing Protocol, comes from enterprise messaging and offers queues and flexible routing between business applications. Both are designed for data centers with stable networks. MQTT is designed for many devices with small, frequent messages and connections that can drop. In many architectures, MQTT therefore collects the data at the edge and in the plant, while Kafka or an AMQP-based system processes it further in the data center or the cloud.

The benefits show when a use case leaves the pilot line

The advantages of MQTT become visible when a use case is rolled out from the first line to further lines and plants. Every new application subscribes to topics that already exist, and every new machine publishes into the same structure. The effort for the second plant is therefore considerably lower than for the first.

  • Decoupling: Machines and applications can be changed independently, because both only know the broker and the topics.
  • Less load on controllers: Each value is read once, no matter how many systems need it.
  • Real-time data: Changes reach all subscribers as soon as they are published, without polling cycles.
  • Robust in unstable networks: QoS levels, persistent sessions and Last Will messages cover interruptions between production hall, plant and cloud.
  • Open and vendor-neutral: An OASIS and ISO standard with client libraries for practically every programming language and a broad choice of brokers, which avoids lock-in to a single vendor.
  • Bidirectional: The same connection can carry commands and setpoints back to the edge, provided the security concept allows it.

Where MQTT alone is not enough

MQTT is a transport protocol. It moves data reliably and leaves several questions open that decide whether an installation still works after a few years with many lines and plants. Anyone planning a production rollout should answer them from the start.

ChallengeWhy it mattersSolution
Machines do not speak MQTTMost installed controllers offer S7, Modbus, OPC UA or proprietary interfaces, and older ones have no MQTT client at all.A connectivity layer at the edge reads the controllers in their native protocol and publishes to MQTT. The PLC control logic stays as it is.
Payloads without meaningA value such as 73.4 is useless without unit, timestamp and asset.A binding payload format, for example JSON with metadata or Sparkplug B, defined before the first machine publishes.
Inconsistent topicsWithout rules, every integrator names topics differently, and the topic tree becomes impossible to navigate.Naming conventions based on ISA-95 and central governance of the topic structure.
Wrong QoS choiceQoS 0 for quantities relevant for booking loses data, and QoS 2 for every sensor value creates unnecessary load.A defined QoS level per data class, for example for sensor values, states and events.
Outdated retained messagesA retained value from a machine that was shut down weeks ago still looks current.Message expiry in MQTT 5, Last Will messages for the online state and a timestamp in every payload.
Security not active by defaultWithout configuration, MQTT transmits data unencrypted and without authentication.TLS, client certificates and access rights per topic as a mandatory part of every installation.

MQTT in practice: typical use cases in manufacturing

OEE across lines and plants

Machine states, quantities and scrap are published per line in the same topic structure. A central application calculates OEE from them and compares lines and plants on a common basis.

Energy data per machine

Meters and controllers publish consumption values, and energy management, controlling and sustainability reporting subscribe to the same topics. A global tool manufacturer reduced its energy consumption with real-time energy data provided by Cybus.

MES and ERP integration

Order start, order completion and quantities are published as events with QoS 2. The MES subscribes to them and passes confirmations on to the ERP, without polling the controllers. Learn more about MES integration.

Condition monitoring and predictive maintenance

Vibration, temperature and current values flow at high frequency with QoS 0 to an analytics platform. Models for predictive maintenance detect deviations and publish their warnings back as MQTT messages, which maintenance can subscribe to.

Event-driven smart factory

The agricultural machinery manufacturer KRONE built its new smart factory from the ground up on an event-driven architecture, together with Cybus, NTT DATA and FIR at RWTH Aachen University. Read how the architecture came about.

You can find more scenarios in our use cases.

MQTT security: encryption, authentication and access rights

The MQTT protocol provides the mechanisms for security, and the configuration of the broker decides whether they are actually used. In production networks, where MQTT connects OT and IT, the following measures belong in every installation:

  • Encryption: TLS on port 8883 for all connections, including those inside the plant network.
  • Authentication: Client certificates with mutual TLS, or at least individual credentials per device and application, never shared accounts.
  • Authorization: Access rights per topic, so a dashboard can read without writing and a gateway only publishes to its own branch of the topic tree.
  • Network segmentation: Brokers in a defined zone between OT and IT, in line with the zones and conduits model of IEC 62443.
  • Traceability: Logging of connections and rejected access attempts, ideally connected to existing monitoring.

Governance belongs alongside security. Who may create new topics, who decides on the payload format and who approves access for a new application? Clear responsibilities keep the topic tree from growing out of control.

Introducing MQTT in production in five steps

  1. Choose a use case with a clear benefit: Start with a question that matters to production, for example the causes of downtime on one line, and identify the data it requires.
  2. Define topic structure and payload format: Set naming conventions based on ISA-95, the payload format and the QoS level per data class before the first machine publishes.
  3. Connect the machines: Read the controllers in their native protocol at the edge and publish the values to MQTT. PLC programs remain unchanged.
  4. Set up broker and security: Run the broker on premises or at the edge with TLS, certificates and access rights per topic, and connect it to your monitoring.
  5. Scale with templates: Describe connections and mappings as code (Infrastructure as Code), roll them out to further lines and plants and expand the structure into a Unified Namespace.

Our article Why the Unified Namespace Is Essential for Scale explains how this structure grows across plants.

MQTT with Cybus Connectware

In Cybus Connectware, MQTT is the central data interface. Cybus Connectware reads machines and systems in their native protocols, translates the values into a defined topic structure and makes them available to every application through its built-in MQTT broker. It carries production data at manufacturers such as Liebherr and Krone.

  • Connect existing machines: Protocol adapters from the Connectivity Portfolio read S7, Modbus, OPC UA and many other protocols and publish the values to MQTT. The control logic of existing PLCs stays unchanged.
  • Complete MQTT support: The built-in broker supports MQTT 3.1.1 and 5.0 with all QoS levels, retained messages, persistent sessions and shared subscriptions.
  • Existing brokers stay in use: Cybus Connectware can also subscribe and publish to external MQTT brokers, so infrastructure that is already in place keeps its role.
  • Configuration as code: Connections, mappings and permissions are described in YAML files that can be versioned and rolled out to further plants.
  • Secure by design: TLS and mTLS, certificate-based authentication and built-in certificate management.

The built-in broker is called CybusMQ and comes as part of Cybus Connectware. You can find all features and how to get started on the product page.

FAQ: frequently asked questions about MQTT

What does MQTT stand for?

Originally MQ Telemetry Transport, named after IBM’s MQ product family. Today MQTT is the official name of the protocol and no longer an abbreviation. The spelled-out form Message Queuing Telemetry Transport is common, although MQTT is not a classic message queue.

Which port does MQTT use?

Port 1883 for unencrypted connections and port 8883 for connections secured with TLS. Both are registered with IANA. MQTT over WebSockets uses a port that is defined in the broker configuration.

Is MQTT based on TCP or UDP?

MQTT runs over TCP/IP, which guarantees complete delivery in the right order. For very constrained sensor networks, there is the variant MQTT-SN, which can also run over UDP.

What is the difference between MQTT and HTTP?

HTTP works with request and response: a client asks, the server answers, and every request carries its own headers. MQTT keeps a connection open and pushes changes as soon as they occur, with much less overhead per message. For continuous machine data, MQTT is usually the more efficient choice, while HTTP suits occasional queries between IT systems.

Is MQTT secure?

The protocol supports TLS encryption and authentication, and together with the broker access rights per topic. Whether an installation is secure depends on these functions being configured. Without configuration, MQTT transmits data unencrypted.

What is the difference between MQTT and Kafka?

MQTT is designed for many devices with small, frequent messages and unstable connections. Apache Kafka stores large data streams over long periods and makes them replayable for analytics. In many architectures, MQTT collects the data at the edge and Kafka processes it in the data center or the cloud.

What is the difference between MQTT and AMQP?

AMQP comes from enterprise messaging and offers queues and flexible routing between business applications. MQTT is leaner and built for devices, constrained networks and many subscribers per value. In industrial architectures, MQTT is usually used close to the machines.

What is Sparkplug B?

A specification on top of MQTT that standardizes topic structure, payload format and device state for industrial applications. Sparkplug has been an international standard as ISO/IEC 20237 since 2023, and B designates the current version of its payload definition.

Is MQTT 5 backward compatible with MQTT 3.1.1?

The protocol version is agreed for each connection. Most brokers accept 3.1.1 and 5.0 clients at the same time, so devices can be migrated step by step. New functions such as reason codes or user properties are only available on MQTT 5 connections.

Does MQTT need an internet connection?

No. MQTT works in any IP network, including a closed plant network. An internet connection is only needed when clients or brokers outside the plant have to be reached.

Bringing your machine data to MQTT?

Talk to our experts about your data architecture.