In industrial IoT, OPC UA and MQTT solve different layers of plant communication rather than competing as direct substitutes. OPC UA (IEC 62541) defines a self-describing information model, 25 built-in data types, and integrated X.509 security for structured machine integration, whereas MQTT (ISO/IEC 20922 and OASIS 5.0) delivers lightweight, payload-agnostic publish-subscribe messages through a central broker.
Separating semantic data modeling from message transport prevents the two most common integration mistakes on factory networks: pushing unstructured plain MQTT payloads that downstream software cannot parse consistently, or forcing heavy request-response polling over constrained wide-area links. Before choosing either protocol for a production line, engineers should also confirm where monitoring ends and local actuator control stays, a boundary detailed in industrial IoT versus industrial automation.
| Dimension | OPC UA (IEC 62541) | Plain MQTT (ISO/IEC 20922 / OASIS 5.0) |
|---|---|---|
| Primary standard role | Semantic information model, services, and transport mappings | Lightweight publish-subscribe messaging transport |
| Release milestones | Released 2008; version 1.05.06 released 22 October 2025 | Authored 1999; v3.1.1 in October 2014; v5.0 on 7 March 2019 |
| Communication pattern | Client-Server plus Part 14 PubSub (IEC 62541-14) | Broker-mediated publish-subscribe (one-to-many and many-to-one) |
| Data typing and schema | 25 built-in data types, DataValue, and over 60 to 150+ Companion Specifications | Payload-agnostic; carries arbitrary bytes with no built-in schema |
| Packet and string bounds | Chunking of large datagrams; embedded servers down to 15 kB RAM | 2-byte minimum control packet; up to 268,435,455 bytes remaining length |
| Default transport and ports | TCP/IP, UDP/IP, WebSockets, AMQP, MQTT, Layer 2 Ethernet 0xB62C | Ordered lossless TCP/IP on port 1883 (plain) or port 8883 (TLS) |
| Discovery and history | Native server discovery, hierarchical browsing, Part 11 Historical Access | No native topic discovery; 1 retained message per topic, no history query |
| Security model | Built-in X.509 certificates, signing, encryption, replay sequencing, auditing | Plain-text credentials by default; relies on TLS and broker configuration |
What is OPC UA mainly used for on the factory floor?
On the factory floor, OPC UA is used to expose structured machine data, callable services, alarms, and historical records across multi-vendor controllers and plant software under a single open standard. Released in 2008 as a platform-independent, service-oriented architecture under IEC 62541, OPC UA replaced Windows-only COM and DCOM interfaces across discrete manufacturing, process manufacturing, and energy operations.
Hierarchical address space, built-in types, and Companion Specifications
Unlike flat tag lists, the OPC UA information model organizes machine data as an object-oriented mesh of nodes inside a hierarchical address space. A client can locate OPC UA servers on a local network through built-in discovery services and browse that hierarchy dynamically to see which variables, events, and methods a machine exposes.
The OPC UA specification defines 25 built-in data types to standardize how applications interpret industrial values. A composite DataValue carries the measured value alongside timestamps and a status code, while the DateTime type records 64-bit integer counts of 100-nanosecond intervals since 1 January 1601 UTC. Beyond those core primitives, the OPC Foundation publishes standardized Companion Specifications covering over 60 types of industrial equipment—and lists over 150 market-specific Companion Specifications on its portal—so software built for one conforming machine encounters the same node structure on another.
Subscriptions, methods, historical access, and built-in security
OPC UA supports several plant-floor interaction patterns within one framework. Clients read and write current values on demand, monitor changes through report-by-exception subscriptions based on client criteria, receive structured event notifications, invoke server-defined methods, and query time-series archives through IEC 62541-11 Historical Access. To protect against transient network interruptions, OPC UA uses bidirectional connection heartbeats so both server and client detect dropped links, along with data buffering and acknowledgements so lost datagrams can be refetched.
Security is built into the core protocol specification rather than left as an optional deployment layer. Each OPC UA client and server identifies itself with X.509 certificates, negotiates session encryption and message signing to verify origin and integrity, uses sequenced packets to eliminate replay attacks, enforces user authentication with access rights and address-space views, and records an activity audit trail. Although full OPC UA stacks require more resources than minimal telemetry clients, embedded implementations have scaled down to 64 kB of RAM on a single-chip ARM microcontroller (Embedded Labs Ltd) and 15 kB of RAM with 10 kB of ROM in an October 2012 demonstration by Fraunhofer IOSB-INA and inIT.
What are the disadvantages of plain MQTT without an information model?
Plain MQTT moves small messages efficiently over constrained links, yet provides no native data types, schema enforcement, topic discovery, historical queries, or mandatory encryption. Because OASIS MQTT 5.0 is explicitly a payload-agnostic messaging transport, teams deploying raw MQTT must build topic conventions, payload parsing, broker security, and state tracking outside the base protocol.
Minimal framing efficiency versus missing semantics
Andy Stanford-Clark and Arlen Nipper authored MQTT in 1999 to monitor oil pipelines in SCADA systems over expensive satellite links, and OASIS later standardized version 3.1.1 (29 October 2014, adopted as ISO/IEC 20922) and version 5.0 (7 March 2019). A minimal MQTT control message requires as little as two bytes, while a 4-byte Variable Byte Integer allows a remaining length up to 268,435,455 bytes (nearly 256 megabytes) and UTF-8 encoded strings such as topic names range from 0 to 65,535 bytes. Publishers and subscribers stay decoupled through a broker over ordered, lossless TCP/IP links, selecting among three Quality of Service levels: QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once).
That transport minimalism becomes a liability when multiple teams publish plant metrics without a shared data model. Because the broker routes UTF-8 topic strings without validating payload contents, downstream consumers cannot automatically discover what a numeric payload means, what engineering unit it carries, or which topics exist until publishers transmit them. An MQTT broker stores at most one retained message per topic so new subscribers receive only the most recent value, with no built-in historical query interface equivalent to OPC UA Part 11.
Security, ordering, clustering, and MQTT 5.0 mitigations
Plain MQTT transmits connection credentials in plain text on default TCP port 1883 unless operators configure TLS encryption (default port 8883), certificates, and broker access rules. In MQTT 3.1.1, the specification also requires the broker to apply a timeout of one-and-a-half times the client keepalive value, a mechanism exploited in the 2020 SlowITe denial-of-service attack to exhaust broker connections.
Distributed state introduces two further operational boundaries:
- Cross-client message ordering: The OASIS MQTT specification guarantees ordering only within a single client session on a single topic. Messages published across separate client sessions can arrive out of sequence, which can invert connect and disconnect lifecycle alerts if downstream monitors rely on last-write-wins rules.
- Unstandardized broker clustering: The MQTT standard defines client-to-broker communication only and does not specify broker-to-broker bridging or clustering, so high-availability multi-node broker deployments depend on vendor-specific broker implementations.
Persistent sessions (which retain client subscriptions and undelivered QoS 1 or QoS 2 messages offline) and Will Messages (published automatically by the broker upon abnormal disconnection) help recover from WAN drops. MQTT 5.0 also narrows several operational gaps by adding shared subscriptions to balance load across consumers, message expiry intervals to drop stale queued messages, and topic aliases that replace repeated topic strings with a single number.
How does MQTT Sparkplug compare with OPC UA?
Eclipse Sparkplug adds a standardized topic namespace, structured Payload B format, and session state management to MQTT for real-time SCADA and HMI systems on ordinary brokers. Even with Sparkplug 3.0, however, MQTT remains a brokered transport rather than an object-oriented service framework with browsable server methods and over 60 Companion Specifications for industrial equipment like OPC UA.
The Sparkplug Working Group at the Eclipse Foundation added Payload B in revision 2.1 (10 December 2016) and published Sparkplug 3.0 on 21 October 2022 with explicit normative statements. Because a single MQTT broker can serve standard MQTT and Sparkplug traffic concurrently under the same TLS and authentication settings, plants can standardize industrial payloads without replacing existing MQTT infrastructure.
| Capability | Plain MQTT (OASIS 5.0) | MQTT with Eclipse Sparkplug 3.0 | OPC UA (IEC 62541) |
|---|---|---|---|
| Topic or address structure | User-defined UTF-8 strings (0 to 65,535 bytes) | Standardized MQTT Topic Namespace | Hierarchical node-based Address Space |
| Payload and data typing | Payload-agnostic; no built-in types | Structured Payload B definition | 25 built-in types plus composite DataValue |
| Connection state awareness | Persistent sessions and Will Messages | Defined session state management for SCADA/HMI | Bidirectional heartbeats, buffering, and refetching |
| Equipment domain models | None built into standard | Generic IIoT and SCADA/HMI structure | Over 60 freely available (150+ listed) Companion Specifications |
| Callable services and history | None built into standard | Brokered messaging; external historian needed | Server Methods and Part 11 Historical Access |
| Security enforcement | Optional TLS (port 8883) and broker ACLs | Inherits underlying MQTT broker TLS and auth | Integrated X.509 certificates, signing, encryption, and auditing |
When a project connects distributed field stations or edge nodes into central SCADA, HMI, or MES platforms over wide-area networks, Sparkplug closes plain MQTT’s biggest gap—unstructured topic sprawl and ambiguous offline state—while keeping MQTT’s broker decoupling. When machines on the shop floor need rich object hierarchies, standardized vendor Companion Specifications, or direct server-side method calls, OPC UA remains the more expressive model.
How do OPC UA, MQTT, and Modbus fit into the same plant network?
In most factories, Modbus, OPC UA, and MQTT operate at consecutive network tiers rather than replacing one another. Legacy drives and PLCs speak Modbus RTU or TCP on local buses, OPC UA models machine data over plant Ethernet, and MQTT with Sparkplug distributes telemetry from industrial edge gateways to enterprise historians and cloud tools.
Why Modbus persists at the field layer and cannot scale to enterprise IoT
Published by Modicon in 1979 and maintained by the Modbus Organization since 2004, Modbus remains entrenched in industrial hardware because it is open, royalty-free, and simple to implement. It exposes four primary tables of up to 65,536 addressable items each: 1-bit discrete inputs (read-only), 1-bit coils (read/write), 16-bit input registers (read-only), and 16-bit holding registers storing unsigned 16-bit words from 0 to 65,535 (read/write).
Its framing and communication limits explain why engineers keep Modbus localized near the machine:
- Small frame ceiling and serial cap: A Modbus Protocol Data Unit is limited to 253 bytes, yielding a maximum Application Data Unit of 256 bytes on RS-232/RS-485 serial buses and 260 bytes on Modbus TCP (port 502). A single Modbus serial line supports one master and at most 247 server addresses (1 to 247).
- Polling-only traffic: Because standard Modbus operates strictly on client-server polling, field devices cannot report changes by exception; the client must repeatedly poll each device, which wastes bandwidth on slower links.
- No self-description or native security: Modbus has no standard mechanism for a node to discover what a register represents—such as learning that a register holds a temperature between 30 and 175 degrees—and the protocol provides zero native security against unauthorized commands or data interception.
Comparing Modbus, OPC UA, and MQTT across one plant stack
Keeping Modbus polling inside a local PLC or edge collector isolates unencrypted port 502 and RS-485 traffic from wider enterprise networks. From there, mapping raw 16-bit register offsets into an OPC UA address space attaches data types, timestamps, and status codes before data reaches MES or maintenance software—a transition closely linked to industrial IoT sensors for factory retrofits and how plant measurements become actionable production records in digital manufacturing on the factory floor.
| Protocol layer | Framing and addressing limit | Reporting mechanism | Metadata and security posture |
|---|---|---|---|
| Modbus RTU / TCP | 253-byte PDU; 256-byte serial / 260-byte TCP ADU; 247 serial slaves; port 502 | Continuous client polling only | Flat 1-bit and 16-bit tables; no self-description; no native security |
| OPC UA (IEC 62541) | Hierarchical NodeId address space; datagram chunking; down to 15 kB RAM | On-demand read/write, report-by-exception subscriptions, events, methods, PubSub | 25 built-in types, Companion Specs, X.509 certificates, signing, encryption, audit |
| MQTT / Sparkplug | 2-byte minimum packet up to 268,435,455 bytes; ports 1883 / 8883 | Brokered publish-subscribe with QoS 0, 1, 2, persistent sessions, and Will | Plain MQTT is payload-agnostic; Sparkplug 3.0 adds Payload B and namespace; TLS required |
When should you run OPC UA over MQTT or bridge them with a gateway?
Choose native OPC UA Part 14 PubSub over MQTT when modern controllers natively implement IEC 62541-14 and subscribers need decoupled many-to-many middleware delivery without an intermediate translator. Choose a plant-floor edge gateway bridging OPC UA and Modbus into MQTT or Sparkplug when integrating brownfield PLCs that only support OPC UA Client-Server or Modbus and require an explicit OT security boundary.
Native OPC UA Part 14 PubSub transport mappings
Standardized in IEC 62541-14 (2020), OPC UA PubSub removes direct client-server request-response coupling for data and event notifications. Publishers send structured address-space updates to message-oriented middleware without knowing which subscribers exist, while subscribers express interest in specific data sets without tracking publisher locations.
Because OPC UA is transport-independent, Part 14 specifies mappings across multiple network layers: MQTT and AMQP at OSI Layer 7, OPC UA UDP at Layer 4 (supporting multicast, broadcast, unicast, and DTLS), and direct Layer 2 OPC UA Ethernet using EtherType 0xB62C for UADP messages. Where controllers already implement Part 14, publishing OPC UA payloads over an MQTT broker preserves standardized data types while leveraging MQTT broker fan-out.
Edge gateway translation and NIST SP 800-82 Rev. 3 security boundaries
Most operating factories run mixed fleets of Modbus serial devices, Modbus TCP drives, and OPC UA Client-Server PLCs that do not implement Part 14 PubSub. Placing a hardened edge gateway on the plant Ethernet segment keeps Modbus polling local, subscribes to OPC UA servers via authenticated X.509 sessions, normalizes register addresses into Sparkplug 3.0 payloads, and initiates outbound TLS connections on port 8883 to an upstream MQTT broker.
This segmented topology aligns with NIST SP 800-82 Rev. 3 (published September 2023), which provides guidance on securing operational technology systems while preserving their performance, reliability, and safety requirements. Separating local polling and machine-level OPC UA sessions from enterprise MQTT brokers prevents remote analytics clients from polling controllers directly and lets OT teams audit every boundary crossing.
| Architecture scenario | Recommended protocol pattern | Key engineering checks before deployment |
|---|---|---|
| Local machine-to-MES coordination on plant Ethernet | OPC UA Client-Server (IEC 62541) | Verify Companion Spec coverage, X.509 certificate lifecycle, user views, and heartbeat buffering |
| Remote or WAN sensor fleet over constrained links | MQTT 5.0 over TLS (port 8883) | Enforce TLS and client authentication, set QoS 0, 1, or 2 per signal, configure message expiry and topic aliases |
| Distributed SCADA and HMI across multiple sites | MQTT with Eclipse Sparkplug 3.0 | Standardize Payload B metric definitions, monitor session state, and account for single-client ordering scope |
| Modern PubSub-capable PLCs fanning out to middleware | OPC UA Part 14 PubSub over MQTT (or UDP/Ethernet 0xB62C) | Confirm controller IEC 62541-14 firmware support and middleware broker clustering architecture |
| Brownfield line mixing Modbus RTU/TCP and OPC UA PLCs | Plant-floor edge gateway bridging to MQTT / Sparkplug | Keep unencrypted Modbus port 502 and serial buses isolated; enforce outbound TLS 8883 and NIST SP 800-82 Rev. 3 controls |
For related explainers on factory networking, sensors, and automation boundaries, browse the Technology section.



