MQTT Vs Opc Ua: Simon Detollenaere
MQTT Vs Opc Ua: Simon Detollenaere
MQTT Vs Opc Ua: Simon Detollenaere
Simon Detollenaere
Technical Services Team Leader
28/05/19 Gent
Introduction to HMS
Introduction
4 Product brands :
Hardware meets Software©
Fieldbus gateways/converters
..
Access your machine remotely Collect your machine data
10111
... 101101011
MQTT
MQTT
Introduction
• Message-centric publish/subscribe protocol, i.e. the contents of a message is not specified in the
MQTT specification.
• Extremely lightweight protocol used e.g. in M2M communication, IoT applications, and home
automation.
• Runs over TCP/IP or other network protocols that provide ordered, lossless, bi-directional
connections.
MQTT
MQTT Publish/Subscribe Architecture
• Client
• Establishes a connection to a server (Broker)
• Publish messages and/or subscribe to Publishing Client Subscribing Client
messages from other clients
• Broker (Server)
Publishing Client Broker Subscribing Client
• Acts as an intermediary between clients
• Accept connections from clients
• Receives messages published by clients Publishing Client Subscribing Client
• Publishing clients and subscribing clients are not aware of each other, so it is not
possible for a publisher to know if anyone subscribes to its data.
MQTT
MQTT Publish/Subscribe Architecture
• Published data is identified by a unique ”topic” string (= Name of Messages queue)
E.g.
• ”Factory1/DeviceA/Temperature”
• ”Factory2/DeviceC/OperatingHours”
• The broker uses the topic string to distribute messages to the subscribers
• Subscribing clients can use wildcards to subscribe to multiple messages queues
• The data payload can be encoded in different formats: JSON, CSV, XML, etc.
SUBSCRIBE(topic)
PUBLISH(topic, data)
PUBLISH(topic, data)
MQTT
Example
MQTT
Publish msg to topic Server/Broker Subscribe to topic
« /data/flow » « /data/flow »
Topic : /data/flow
{flow:125,36 m³/s} New Message : {flow:125,36 m³/s}
<empty>
{flow:125,36 m³/s}
MQTT MQTT
Client Client
MQTT
Reliability & Security
• Reliability
• Quality of Service (QoS) (0, 1 or 2)
• Do you need an acknowledgment when publishing or receiving messages
• Will message – ”Last Will and Testament”
• What must the broker send to subscribers when the publisher connection is down.
• Keep Alive Time
• To detect disconnections
• Connection State Saved
• In case of connection loss, the subscriptions are saved at the next connection
• Security
• Provides authentication with usename and password when a client is connecting to the
broker.
• TLS (Transport Layer Security) is used to provide encrypted MQTT connection (same as
HTTPS)
MQTT
Use Case
MQTT
Broker
Demo
OPC UA
OPC Foundation
A little bit of History
• OPC foundation = an industry consortium that creates and maintains standards for
open connectivity of industrial automation devices and systems, such as industrial
control systems and process control generally.
• Design the first Interop specifications around OLE (Object Linking and Embedding ),
a Microsoft technology.
OPC Foundation
Old topology
ETHERNET/IP
FINS
LAN
OPC Foundation
OPC UA Server
OPCUA Protocol
OPC UA Server
SCADA
OPC UA Client
OPC UA Server
OPC UA
Security
• Communication as well as Authentication can be secured.
• Communication Encryption
• Based on X509 certificate
• Sign & encrypt the messages
• Authentication through
• User/Password
• Client certificate/Private key
OPC UA
Different kinds of OPC UA profiles
IT
OPCUA Clients
OT
Demo
www.hms-networks.com