A Comparison of IIoT Protocols: MQTT Sparkplug vs. OPC-UA

2023-07-15
关注

Illustration: © IoT For All

Industrial systems rely heavily on efficient and secure communication protocols to exchange data seamlessly. Two prominent contenders in this space are MQTT Sparkplug and OPC UA. We will comprehensively compare MQTT Sparkplug and OPC UA, and their successors, offering a clearer understanding of which protocol aligns best with your specific requirements.

“Industrial systems rely heavily on efficient and secure communication protocols to exchange data seamlessly.”

OPC Classic & OPC UA

The precursor of OPC UA is OPC Classic (also known as OPC DA or OPC Data Access), a set of industrial automation standards developed by the OPC Foundation. First published in 1996, the OPC Classic specification defines a standardized method for exchanging data between software applications and industrial hardware devices such as sensors, controllers, and programmable logic controllers (PLCs).

However, one of its major drawbacks is that OPC Classic is tightly integrated with the Microsoft Windows operating system and its proprietary DCOM technology. This type of dependency severely compromises the protocol’s usability, scalability, interoperability, security, and platform independence, which is a significant limitation for an open standard.

In response to these limitations, the OPC Foundation started work in 2006 on OPC Unified Architecture (UA) as a successor to the OPC Classic specification. Both specifications have a functionally equivalent protocol but use different underlying communication technologies. In addition, OPC Classic DA 3.0 was released the same year and is still in use today.

IoT-Ready Protocol: Evolution of MQTT

In the late 1990s, Andy Stanford-Clark and Arlen Nipper were working on a pipeline monitoring project that required a lightweight protocol for communicating with remote sensors and devices. The project required monitoring capabilities in a low-power, low-bandwidth environment. However, existing messaging protocols such as HTTP and SMTP were considered too heavy and inefficient for this specific use case.

To address these challenges, MQTT was developed as a publish/subscribe (Pub/Sub) messaging protocol. MQTT was designed with a small code footprint and minimal bandwidth requirements, making it suitable for deployment in low-power, low-bandwidth environments.

Its primary purpose is to facilitate large-scale, real-time data exchange between devices and systems, enabling standardized data communication even when different formats and structures are involved. This characteristic makes MQTT particularly suitable for IoT and M2M (machine-to-machine) applications.

In 2010, MQTT was released as an open standard by OASIS (Organization for the Advancement of Structured Information Standards), making it available to a wide range of organizations and industries.

Then, in 2014, MQTT 3.1.1 was introduced, including several new features such as improved error handling and support for Quality of Service (QoS) levels. Then, in 2019, MQTT 5.0 was released with significant enhancements such as support for custom properties, persistent sessions, and improved error reporting.

Combining the Advantages: OPC UA over MQTT

The MQTT publish/subscribe (pub/sub) model offers several advantages over the classic OPC UA client-server model, including:

  • Scalability: The pub/sub model can effectively handle a large number of devices and systems, making it well-suited for industrial automation and IoT applications.
  • Real-time data exchange: The pub/sub model is specifically designed to facilitate real-time data exchange, enabling devices and systems to promptly respond to environmental changes.
  • Reduced network traffic: The pub/sub model helps reduce network traffic by allowing devices and systems to receive only the data they are interested in, rather than receiving all data from all sources.

The OPC Foundation released the OPC UA Pub/Sub specification in 2018. This specification defines a publish-subscribe communication model for OPC UA, which can be implemented using the MQTT (Message Queuing Telemetry Transport) protocol as a transport mechanism. OPC UA’s Pub/Sub model is a powerful new feature that provides significant benefits for industrial automation and IoT applications.

Enhancing Industrial Connectivity: MQTT Sparkplug Specification

The MQTT protocol has achieved great success in IoT scenarios. However, its applicability to industrial automation systems is limited due to a lack of interoperability. To address this limitation, Cirrus Link Solutions introduced the Sparkplug specification in 2016, aiming to simplify the implementation of MQTT in industrial automation systems. This specification establishes a standardized format for MQTT messages, facilitating the exchange of data between different devices and applications.

One notable feature of Sparkplug is its support for bi-directional communication between devices. This capability enables devices to not only send commands but also receive responses from other devices within the network.

Check out these 5 key concepts that explain why a MQTT Broker is perfect for implementing Sparkplug design principles.

OSI Model Overview

MQTT and OPC UA are the two main popular protocols used in industrial automation and IoT applications, and they have different architectures and designs that reflect their different intended uses. Here is a comparison of MQTT, OPC UA, and their variants in terms of the OSI (Open Systems Interconnection) model:

OSI ModelMQTTOPC UAMQTT SparkplugOPC UA over MQTT
Application LayerPub/Sub mechanismOPC UA communication (60 data types)Sparkplug communication (18 data types)OPC UA pub/sub communication
Presentation Layernot definedUA-JSON
UA-XML
UA-Binary
ProtobufUA-JSON
UA-XML
UA-Binary
Session Layerno sessionClient-server session managementSparkplug session awarenessno session
Transport LayerTCP/IPTCP/IPMQTTMQTT

Transport Layer: Both MQTT and OPC UA utilize TCP/IP as the underlying protocol for communication. For MQTT Sparkplug and OPC UA over MQTT, the transport protocol uses MQTT as transport protocol, because these two protocols take advantage of the MQTT pub/sub model.

Session Layer: OPC UA incorporates a session layer responsible for managing the connection between clients and servers. It handles tasks such as session establishment, authentication, and encryption. In contrast, MQTT does not possess a session layer management feature. However, MQTT Sparkplug addresses this limitation by introducing Sparkplug session awareness at the session layer.

Presentation Layer: OPC UA incorporates a well-defined information model that defines the structure and semantics of exchanged data between clients and servers, such as UA-JSON and UA-binary. On the other hand, MQTT lacks a formal information model but relies on topic-based messaging for data communication between clients and servers. However, MQTT Sparkplug addresses this gap by specifying Google Protobuf as the message format to enhance MQTT’s capabilities.

Application Layer: MQTT and OPC UA diverge significantly in their application layer protocols. MQTT follows a publish/subscribe model that organizes messages using topics, while OPC UA adopts a client/server model and utilizes a hierarchical object model to organize data. The OPC UA pub/sub specification serves as a solution for the OPC UA client/server model.

Comparing MQTT Sparkplug and OPC UA

Both MQTT Sparkplug and OPC UA are popular protocols for Industrial IoT, and they have different strengths and weaknesses that may make one more suitable than the other depending on the specific use case. Here are some key differences between the two protocols and their variants:

CriteriaMQTTMQTT SparkplugOPC UAOPC UA over MQTT
Messaging Modelpub/subpub/subclient-serverpub/sub
Bandwidth Usageminimal overhead
low bandwidth and low power
minimal overhead
low bandwidth and low power
large code
footprint
high bandwidth
large code
footprint
high bandwidth
Message Payloadnot definedlightweight messaging that is typically smaller than OPC UAmore complex data types and its messages can be much larger than MQTT Sparkplug.more complex data types and its messages can be much larger than MQTT Sparkplug.
Interoperabilityno interoperableinteroperable (18 data types)highly interoperable (60 data types)highly interoperable (60 data types)
ScalabilityHigh scalabilityhigh scalability with the ability to handle millions of messages per second.scalable but requires more complex architecture to handle large amounts of databetter scalability than OPC UA client/server model
Ease of Integrationsimple to use and requires minimal configurationsimple to use and requires minimal configurationrequires more setup and configurationrequires more setup and configuration
Quality of ServicesQoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once)QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once)provides a reliable transport layer that ensures messages are delivered in order and without lossprovides a reliable transport layer that ensures messages are delivered in order and without loss
State AwarenessNoYesYesYes
Auto DiscoveryNoNoYesYes
ApplicationIoT, home automation and M2M applicationsIIoT and M2M applicationsindustrial automationindustrial automation
Real-TimeYesYesYesYes
Securitysecurity features are considered less secure than OPC-UAsecurity features are considered less secure than OPC-UAdigital certificates, digital signatures, data encryption, and secure authenticationdigital certificates, digital signatures, data encryption, and secure authentication
Information Modeldoes not have built-in support for information modelingsupport sophisticated information modeling but not as many as OPC UA.support sophisticated information modeling systems that allow for the creation of complex data structures and modelssupport sophisticated information modeling systems that allow for the creation of complex data structures and models

In short, OPC UA is an open standard that incorporates a well-defined set of data type specifications. On the other hand, MQTT Sparkplug is also an open standard but has fewer efforts in standardizing data types compared to OPC UA. Consequently, MQTT Sparkplug has less protocol overhead during data transmission.

OPC vs. UA

MQTT Sparkplug utilizes a lightweight messaging protocol, making it well-suited for low-bandwidth or unreliable networks. On the other hand, OPC UA employs a more robust messaging protocol capable of handling larger data volumes, which is better suited for high-speed and secure networks.

The competition between OPC UA and MQTT continues to this day.

Tweet

Share

Share

Email

  • Connectivity
  • Industrial Automation
  • Network and Protocols

  • Connectivity
  • Industrial Automation
  • Network and Protocols

  • en
您觉得本篇内容如何
评分

相关产品

EN 650 & EN 650.3 观察窗

EN 650.3 version is for use with fluids containing alcohol.

Acromag 966EN 温度信号调节器

这些模块为多达6个输入通道提供了一个独立的以太网接口。多量程输入接收来自各种传感器和设备的信号。高分辨率,低噪音,A/D转换器提供高精度和可靠性。三路隔离进一步提高了系统性能。,两种以太网协议可用。选择Ethernet Modbus TCP\/IP或Ethernet\/IP。,i2o功能仅在6通道以太网Modbus TCP\/IP模块上可用。,功能

雷克兰 EN15F 其他

品牌;雷克兰 型号; EN15F 功能;防化学 名称;防化手套

Honeywell USA CSLA2EN 电流传感器

CSLA系列感应模拟电流传感器集成了SS490系列线性霍尔效应传感器集成电路。该传感元件组装在印刷电路板安装外壳中。这种住房有四种配置。正常安装是用0.375英寸4-40螺钉和方螺母(没有提供)插入外壳或6-20自攻螺钉。所述传感器、磁通收集器和壳体的组合包括所述支架组件。这些传感器是比例测量的。

TMP Pro Distribution C012EN RF 音频麦克风

C012E射频从上到下由实心黄铜制成,非常适合于要求音质的极端环境,具有非常坚固的外壳。内置的幻像电源模块具有完全的射频保护,以防止在800 Mhz-1.2 Ghz频段工作的GSM设备的干扰。极性模式:心形频率响应:50赫兹-18千赫灵敏度:-47dB+\/-3dB@1千赫

ValueTronics DLRO200-EN 毫欧表

"The DLRO200-EN ducter ohmmeter is a dlro from Megger."

评论

您需要登录才可以回复|注册

提交评论

广告

iotforall

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

Retail IoT Helps Businesses Benefit in 4 Unique Ways

提取码
复制提取码
点击跳转至百度网盘