Modbus, OPC UA (Open Platform Communications Unified Architecture) and MQTT (Message Queuing Telemetry Transport) are not competitors at the same layer. In a typical factory IoT gateway, Modbus and OPC UA are southbound protocols used to read machines, meters and PLCs (Programmable Logic Controllers), while MQTT is the northbound transport that publishes normalized data to a broker, historian or cloud platform. The real design question is which southbound protocol each asset supports and how the gateway maps that data into one consistent model.
What does each protocol actually do?
Modbus is a simple request and response protocol published in 1979 and still present in most energy meters, VFDs (Variable Frequency Drives), temperature controllers and older PLCs. Modbus RTU (Remote Terminal Unit) runs over RS485 serial lines, typically at 9,600 to 115,200 baud, and Modbus TCP runs over Ethernet on TCP port 502. Data is exposed as 16 bit registers and single bit coils with no built in names, units or types, so every integration starts from a register map supplied by the device vendor.
OPC UA, standardized as IEC 62541, is a service oriented framework rather than a register protocol. A server exposes an address space of typed nodes with names, engineering units, timestamps and quality codes, and clients can browse it, subscribe to changes and call methods. Security is part of the specification: application instance certificates based on X.509, message signing and encryption, and user authentication. Many modern PLCs, CNC (Computer Numerical Control) controllers and SCADA (Supervisory Control and Data Acquisition) servers ship with an OPC UA server, and companion specifications define standard models for machine types.
MQTT is a lightweight publish and subscribe protocol standardized by OASIS (MQTT 3.1.1 is also ISO/IEC 20922, and MQTT 5.0 is the current version). Devices and gateways publish to topics on a central broker, and any number of consumers subscribe. MQTT defines transport, not meaning, so industrial users often add the Eclipse Sparkplug specification, which fixes the topic namespace, payload encoding and device state handling so that consumers can discover data without custom agreements.
How do Modbus, OPC UA and MQTT compare side by side?
The table summarizes the differences that matter when you design a factory gateway.
| Criterion | Modbus RTU and Modbus TCP | OPC UA (IEC 62541) | MQTT (with optional Sparkplug) |
|---|---|---|---|
| Typical role in a gateway | Southbound: meters, drives, older PLCs | Southbound: modern PLCs, CNC, SCADA servers | Northbound: gateway to broker, historian or cloud |
| Communication pattern | Client polls server (request and response) | Client and server with subscriptions; PubSub also defined | Publish and subscribe through a broker |
| Data model | Raw 16 bit registers and coils, no metadata | Typed, browsable nodes with units, timestamps and quality | Topic plus payload; Sparkplug adds a defined model |
| Built in security | None in classic Modbus; Modbus TCP Security adds TLS (Transport Layer Security) | Certificates, signing, encryption, user authentication | TLS and client authentication provided by the broker |
| Physical layer | RS485 serial or Ethernet | Ethernet (TCP port 4840 by convention) | Any TCP/IP link: Ethernet, WiFi, cellular |
| Change detection | Gateway must poll and compare values | Server side monitored items report changes | Publisher decides when to send |
| Integration effort per asset | Low protocol effort, high mapping effort | Moderate: certificates, browsing, namespace design | Low on device side; topic and payload design matter |
| Typical weakness | Register maps differ per vendor and firmware | Heavier stack, server licensing on some PLCs | No semantics without a convention such as Sparkplug |
Which industrial protocols can be integrated into a factory IoT gateway?
A factory IoT gateway can integrate almost any industrial protocol for which a stable driver exists, but the practical list on a typical shop floor is short. The protocols below are common on brownfield plant equipment. Vendor specific protocols usually need either a licensed driver or the controller's own OPC UA server, which is often the cleaner option.
Protocols commonly integrated on the southbound side of a factory gateway:
- Modbus RTU over RS485 and Modbus TCP over Ethernet for meters, drives, chillers and simple controllers.
- OPC UA for modern PLCs, CNC controllers, robots and SCADA servers; OPC Classic DA (Data Access) through a wrapper on legacy Windows systems.
- EtherNet/IP (Common Industrial Protocol, CIP) for Rockwell and compatible controllers, and PROFINET or Siemens S7 communication, often read through the PLC's OPC UA server.
- Vendor serial or Ethernet protocols such as Mitsubishi SLMP and MC protocol, Omron FINS and Fanuc FOCAS for CNC data, where licensed drivers are available.
- CAN (Controller Area Network) and SAE J1939 for mobile machinery, gensets and battery systems; IO Link through an IO Link master for smart sensors.
- BACnet and Modbus for utilities, HVAC (Heating, Ventilation and Air Conditioning) and building systems connected to the plant.
- Northbound: MQTT (optionally Sparkplug), HTTPS (Hypertext Transfer Protocol Secure) REST (Representational State Transfer) APIs, OPC UA server exposure to MES (Manufacturing Execution System), and store and forward buffering for network outages.
How do you choose the right protocol for each machine?
A repeatable selection procedure for a gateway project:
- Step 1: Build an asset inventory listing every controller, meter and drive with its make, model, firmware version and available ports.
- Step 2: For each asset, prefer an existing OPC UA server if one is licensed and enabled, because it brings names, units and quality codes.
- Step 3: Where only Modbus is available, obtain the vendor register map, confirm byte and word order, scaling factors and polling limits.
- Step 4: Define one plant data model (asset, tag name, unit, sampling interval) that all southbound sources are mapped into inside the gateway.
- Step 5: Publish northbound over MQTT with TLS, using Sparkplug or a documented topic convention, so that consumers do not depend on southbound details.
- Step 6: Size polling: total tags multiplied by polling rate must stay within what each RS485 segment or controller CPU can serve without affecting control.
As a rough sizing rule for illustration, a single RS485 segment at 19,200 baud carries roughly 1,750 bytes per second (11 bits per character); reading 10 registers costs about 33 bytes of request and response, about 19 ms on the wire, plus silent intervals and the device response delay, often tens of milliseconds in total, so a segment with 20 meters polled every second can already approach its practical limit. Measure on site before committing to sampling rates.
When does this comparison not apply?
This comparison assumes monitoring and data acquisition, not control. Writing setpoints or commands from a cloud platform into a PLC is a separate safety and cybersecurity decision that requires the plant controls owner's approval, interlocks and an OT (Operational Technology) security review under the IEC 62443 series. It also does not cover hard real time motion or safety networks such as PROFIsafe or CIP Safety, which must stay inside the control layer. Finally, if every machine already writes to a SCADA historian, reading the historian may be simpler than adding new connections to each PLC.
How should you decide?
Use OPC UA wherever the controller supports it, Modbus where it is the only option, and MQTT for everything leaving the gateway. Keep the mapping logic in one place in the gateway so that adding a machine means adding configuration, not new code. If you are unsure which assets expose what, a short readiness assessment that inventories controllers and tests one connection per protocol is cheaper than discovering gaps during rollout.
Sources and standards
Specifications referenced in this article:
- Modbus Application Protocol Specification V1.1b3 and Modbus over Serial Line Specification (Modbus Organization)
- IEC 62541 (OPC UA)
- OASIS MQTT Version 5.0 and ISO/IEC 20922 (MQTT 3.1.1)
- Eclipse Sparkplug Specification
- IEC 62443 series (industrial automation and control systems security)


