MQTT Vs Opc Ua: Simon Detollenaere

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

MQTT vs OPC UA

Simon Detollenaere
Technical Services Team Leader
28/05/19 Gent
Introduction to HMS
Introduction
4 Product brands :
Hardware meets Software©
Fieldbus gateways/converters

Remote Access / Remote Data


650 gateways for machine builders
worldwide

CAN converters, Smart Grid


gateways,…
68
Gateways for BMS market
Introduction to HMS (2)
Ewon Solutions

Remote Access Remote Data (+ Remote Access)

..
Access your machine remotely Collect your machine data

10111
... 101101011
MQTT
MQTT
Introduction

• MQTT – The name


• MQTT : Message Queue Telemetry Transport Protocol
• Origins from the MQ product series developed by IBM.
• Designed for resource constrained devices and networks with limited bandwidth

• 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

• Register subscribtion from clients


• Forwards/dispatches the messages that match client subscriptions

• 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.

Publishing Client Broker Subscribing Client

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 = OLE for Process Control

• 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

OPC DCOM MELSEC

SCADA OPC Server

FINS

LAN
OPC Foundation

Old topology drawbacks

• Quite heavy topology


• Closely tied to Microsoft
• Sometimes, painful to configure
• Not fitted to go through the Internet.
• Not fitted to be integrated into devices directly.
• Specific OPC <-> Native PLC protocol driver must be developed for
each brand
OPC UA
The new OPC specifications

• OPC UA = Open Platforms Communications Unified Automation


• > 1200 pages of specifications !
• Open and free (GPL 2.0)
• Based on TCP/IP. Can be integrated directly in devices. Even tiny ones!
• Works well on slow connections  Internet
• Cross-platform - not tied to one operating system or programming language (Lots of SDK
available.)
• Very secured
• Allows Discovery.
• Allows the client to browse what data the server provides. No need to create a register addresses
mapping.
• Based on publish/subscribe (no simple polling)  only push data that changes. Save bandwidth
OPC UA
Topology

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

• OPC UA Data Access (DA)


• OPC UA Alarms and Conditions (AC)
• OPC UA Historical Access (HA)
• …

Different kinds of OPC UA connections

• Binary (opc.tcp://x.x.x.x ) : Best performance, less overhead, most used.


• Web Service (https://x.x.x.x) : Based on HTTPS (TCP 443), less used.
OPC UA Use Case
All PLC protocols supported :
• Siemens
• Allen Bradley
• Modbus
• Mitsubishi
• Omron
• OPCUA Client
• …
OPCUA Server

IT

OPCUA Clients
OT
Demo
www.hms-networks.com

You might also like