OPC UA Protocol: Features, Information Models & MQTT Synergy
EMQ Technologies Inc.EMQ Technologies Inc.
OPC UA (OPC Unified Architecture) is a platform-independent, service-oriented, open, and secure communication architecture. It enables interoperability of industrial automation devices, systems, and software applications from different vendors. The OPC UA information model defines the codes and formats for exchanging data using various transport protocols.
The same foundation developed OPC UA and its predecessor, Open Platform Communications (OPC), but they are significantly different. The foundation continues to develop OPC UA to create an architecture that is more desirable than the original OPC communications and more in line with the needs of evolving industrial automation.
The OPC Foundation released the first version of the OPC UA specification in 2006, and as of today, OPC UA is at version 1.05. In addition to the Client-Server (Subscriptions) model, OPC UA includes a Pub-Sub mechanism, which allows pushing JSON specifications (also using the standard-defined binary specification - UADP) over the UDP protocol, MQTT protocol, or AMQP protocol.
Through the fast, secure, and reliable transport channel provided by the MQTT protocol, OPC UA can directly use the internet for data transfer while retaining the key benefits of OPC UA's end-to-end security and standardized data modeling.
Functionality | Descriptions |
---|---|
Discovery | Find available OPC servers on your local PC and/or network |
Address space | All data is represented hierarchically (e.g. files and folders), allowing OPC clients to discover and utilize simple and complex data structures |
On-demand | Read and write data/information based on access rights |
Subscription | Monitor data/information and report exceptions when values change beyond the client's settings |
Event | Client-based settings notify important information |
Method | Clients can execute programs based on methods defined on the server, etc. |
Functionality | Descriptions |
---|---|
Transport | A number of protocols are defined, providing options such as ultra-fast OPC binary transfers or the more general SOAP-HTTPS |
Session encryption | Information is transmitted securely with 128-bit or 256-bit encryption levels |
Message Signature | The signature must be identical when the message is received as when it is sent. |
Sequencing Data Packages | Identified message replay attacks eliminated through sequencing |
Authenticate | Each UA client and server is identified by an OpenSSL certificate, which provides control over how applications and systems connect to each other. |
User control | Applications can require user authentication (login credentials, certificates, etc.) and can further restrict or enhance user access to permissions and address space "views". |
Audits | Logging of user and/or system activity to provide an access audit trail |
The OPC UA information model, the address space, is a network of nodes and references forming a structured graph.
Objects in a standard form are represented in the address space, where model elements are called nodes. The address space represents objects and their components as a collection of nodes, described by attributes and connected by references. OPC UA modeling is all about creating nodes and references between nodes.
OPC UA uses objects as the basis for representing data and activities in the processing system. Variables, events, and methods are interconnected by reference within objects.
The source node is the node containing the reference, and the target node is the referenced node. The referenced target node can be in the same address space as the source node, or in the address space of another OPC server, or even the target node can be non-existent.
The most important node categories in OPC UA are objects, variables, and methods.
MQTT is a lightweight, efficient, and reliable messaging protocol for IoT, using a publish-and-subscribe model to support real-time communication. MQTT is well-suited for resource-constrained environments, especially scenarios requiring efficient power and bandwidth use.
Built on MQTT 3.1.1, SparkplugB ensures flexible, efficient basic data modeling for industrial IoT through an industry-established specification. SparkPlugB achieves strong interoperability and network state awareness, thanks to MQTT's excellent design.
OPC UA and MQTT have a certain degree of functionality overlap, but their use of scenarios is very different:
In industrial scenarios, MQTT excels at messaging in distributed systems, while OPC UA focuses on providing interoperability. OPC UA abstracts and aggregates business data, and MQTT facilitates seamless, distributed data exchange with its strong connectivity capabilities.
The Pub-Sub model proposed by the OPC Foundation in the latest specification of OPC UA allows data changes to be pushed to subscribers using the MQTT Broker.
Pub-Sub security is a bit more complex than that in client/server, and the specification is not as detailed. In an MQTT network, security is based on SSL/TLS, and the broker can define application-level authentication in addition to enabling SSL/TLS for transport.
In principle, these security models are either all or nothing for every subscriber and publisher that can join the network. The ongoing standardization of OPC UA is still a work in progress, and it remains unclear how to best map the rich OPC UA information model to MQTT.
The Most Comprehensive IoT Newsletter for Enterprises
Showcasing the highest-quality content, resources, news, and insights from the world of the Internet of Things. Subscribe to remain informed and up-to-date.
New Podcast Episode
Related Articles