Comparing OPC UA and MQTT Sparkplug and BLIIoT Industrial 4g Edge Gateway BL110
BLIIoT Applications
Share the applications of BLIIOT products from BLIIOT Clients and Agents, Including lots of IoT and IIoT Soultions.
Industrial systems rely heavily on efficient and secure communication protocols to seamlessly exchange data. Two prominent contenders in this space are MQTT Sparkplug and OPC UA. We will make a comprehensive comparison between MQTT Sparkplug and OPC UA and its successors to give you a clearer idea of which protocol is best for your specific requirements.
What is 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.
What is MQTT Protocol?
In 1999, Dr. Andy Stanford-Clark of IBM and Dr. Arlen Nipper of Arcom invented the MQTT (Message Queuing Telemetry Transport) technology.
MQTT features
The MQTT protocol is a protocol designed for the communication of remote sensors and control devices with limited computing power and working in low-bandwidth, unreliable networks. It has the following main characteristics:
1. Use the publish/subscribe message mode to provide one-to-many message publishing and decouple application programs;
2. Message transmission for payload content shielding;
3. Use TCP/IP to provide network connection;
4. There are three types of message publishing service quality:
"At most once", message publishing is entirely dependent on the underlying TCP/IP network. Message loss or duplication can occur. This level can be used in the following situations, environmental sensor data, it does not matter if a read record is lost, because there will be a second send in the near future.
"at least once", ensures that the message arrives, but message duplication may occur.
"only once", ensures that the message arrives once. This level can be used in cases where duplicate or missing messages can lead to incorrect results in billing systems.
5. Small transmission with very little overhead (fixed-length header is 2 bytes), and protocol exchange is minimized to reduce network traffic;
6. Use the Last Will and Testament features to notify relevant parties of the mechanism of abnormal client interruption;
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:
领英推荐
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
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:
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.
BLIIoT Industrial 4g Edge Gateway BL110
BLIIoT Industrial 4g Edge Gateway BL110 used to convert?Modbus, Modbus TCP, DLT645, PLC, BACnet MS/TP, BACnet/IP and other industrial protocols to?MQTT, OPC UA, BACnet/IP, Modbus TCP and other protocols.Support BLRMS (also known as BLIIOT RMS) and can facilitate remote upgrades of software versions as well as device management. BLIIoT Industrial 4g Edge Gateway BL110?has built-in multiple mainstream cloud engines, including AWS IoT, Thingsboard, SparkplugB, Aliyun, Huawei IoT,?BLIIOT?, etc., which can quickly access multiple cloud platforms at the same time.
More information about the BLIIoT Industrial 4g Edge Gateway BL110: https://www.bliiot.com/industrial-iot-edge-gateway-p00272p1.html