Sparkplug Specification: MQTT Topic Namespace and Payload Definition
Sparkplug Specification: MQTT Topic Namespace and Payload Definition
Version 1.0
Figure 5 – Ignition MQTT Engine Folder Structure using the Sparkplug Topic Namespace ....................... 15
The MQTT Engine Module: Adds the functionality to the Ignition platform to
bidirectional communicate with MQTT enabled edge-of-the-network devices securely
via an MQTT Server.
The MQTT Distributor Module: Adds an MQTT server to the Ignition platform that
enables MQTT clients to securely connect, publish, and subscribe to data.
The MQTT Transmission Module: Enables the TAGs within Ignition to be published as
MQTT client data within the MQTT Infrastructure. It is a bridge from Ignition TAGs to
MQTT.
The purpose of this document is to remain true to the original notion of keeping the Topic Namespace
and message sizes to a minimum while still making the overall message transactions between MQTT
Device Nodes and MQTT Engine installed on the Ignition Gateway simple, efficient and easy to
understand and implement.
One can implement the use (if required) of multiple MQTT servers for the purpose of redundancy, high
availability, and scalability within any given infrastructure.
3.3. Device
The Device represents any physical or logical device connected to the MQTT EoN Node providing any
data, process variables or metrics.
Within the Inductive Automation Ignition platform, it becomes the Host Node where the MQTT Engine
module enables its MQTT sessions for subscribing and publishing data. MQTT EoN Nodes and associated
Devices that follow this specification are automatically recognized by MQTT Engine and become a part
of the Ignition tag structure dynamically. This specification details the folder and tag structure created
for each level of the Topic Namespace.
3.7. Security
There are several levels of security and access control configured within an MQTT infrastructure. From a
pure MQTT client perspective, the client does need to provide a unique Client ID, and an optional
Username and Password. Although access control is not mandated in the MQTT specification for use in
MQTT Server implementations, Access Control List (ACL) functionality is available for most MQTT Server
implementations. The ACL of an MQTT Server implementation is used to specify which Topic Namespace
any particular MQTT Client can subscribe to and publish on. Examples are provided on how to setup and
manage MQTT Client credentials and some considerations on setting up proper ACL’s on the MQTT
Servers.
The MQTT specification does not specify any particular TCP/IP security scheme as it was envisaged that
TCP/IP security would (and did) change over time. Although this document will not specify any TCP/IP
security schema it will provide examples on how to secure an MQTT infrastructure using TLS security.
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html
Also referred is an addendum document to the MQTT V3.1.1 specification document that discusses best
practices for implementing security on MQTT TCP/IP networks:
http://docs.oasis-open.org/mqtt/mqtt-nist-cybersecurity/v1.0/mqtt-nist-cybersecurity-v1.0.doc
http://iot.eclipse.org/
4.2.1. Paho
Paho is an Eclipse Foundation project that offers excellent resources for mature, compliant MQTT Client
and MQTT Server implementations and well as additional resources for all things MQTT.
http://www.eclipse.org/paho/
4.2.2. Kura
Kura is another Eclipse Foundation project under IoT resources. Kura is a Java/OSGi-based framework
for IoT gateways, or EoN Nodes as defined in this specification. Kura also provides open source
resources for the Google Protocol Buffer representation of MQTT payloads as defined in this
specification:
https://www.eclipse.org/kura/
At the simplest level there are only two components required as shown below. An MQTT Client and an
MQTT Server. With proper credentials, any MQTT Client can connect to the MQTT Server without any
notion of other MQTT Client applications that are connected, and can issue subscriptions to any
particular MQTT message(data) that it might be interested in as well as start publishing any data that it
has. This is one of the principal notions of IIoT, that is the decoupling intelligent devices from any direct
connection to any one consumer application.
5.1. State
In any network architecture, network connection State is important. In SCADA, connection State is
extremely important. State is the session awareness of the MQTT EoN and the MQTT Server. The very
reason that the majority of this market sector are still using legacy poll/response protocols to maintain a
notion of the State of the connection between the SCADA application and the connected devices. I poll, I
get a response, I know the State of all of the I/O points, but now I must poll again because that State
may have changed.
Many implementations of solutions using MQTT treat it as a simple, stateless, pub/sub state machine.
The is quite viable for IoT and some IIoT applications, however it is not taking advantage of the
capability of MQTT based infrastructures.
For the proper implementation of any MQTT based within a SCADA system, the built in session state
mechanism of MQTT must be understood and properly implemented. If real-time control or state is not
used for the data and application, state is not required and the system will operate based on using time-
stamped data as LKG (last-known-good) values. (CHECK)
One of the primary applications for MQTT as it was originally designed was to provide reliable SCADA
communications over VSAT topologies. Due to propagation delay and cost, it was not feasible to use a
poll/response protocol. Instead of a poll/response protocol where all of the data was sent in response to
every poll, MQTT was used to “publish” information from remote sites only when the data changed. This
technique is sometimes called Report by Exception or RBE. But in order for RBE to work properly in real
time SCADA, the “state” of the end device needs to be known at all times. In other words, the SCADA
host applications like Ignition could only rely on RBE data arriving reliably if it could be assured of the
state of the MQTT session.
Every MQTT message published consist of a topic and a payload component. These components are the
“overhead” of an MQTT message as measured in bytes on the wire. The Sparkplug specification is
designed to keep these components meaningful and easy to understand, but not to get so verbose as to
negatively impact bandwidth/time sensitive data exchange.
namespace/group_id/message_type/edge_node_id/[device_id]
6.1.1. namespace Element
The namespace element of the Topic Namespace is the root element that will define both the structure
of the remaining namespace elements as well as the encoding used for the associated payload data. For
this initial version of the Sparkplug specification, the UTF-8 string constant for the namespace element
will be:
“spAv1.0”
This element identifies the message as being a Sparkplug “sp” defined message using version “A” of the
Sparkplug specification encoding scheme version “1.0”.
The specification for each of these message_type elements are detailed later in this document.
But once an EoN Node connects to the MQTT infrastructure, MQTT Engine starts using the Topic
Namespace defined to build out the Ignition folder structure representing EoN Nodes, Devices, and the
various metric, parameter, and process variable folders.
Figure 5 – Ignition MQTT Engine Folder Structure using the Sparkplug Topic Namespace
Sparkplug is addressing the absolute fact that the majority of devices connecting into next generation
IIoT infrastructure is legacy equipment using poll/response protocols. This means we must take in
account register based data from devices that talk protocols like Modbus. The existing legacy equipment
needs to work in concert with emerging IIoT equipment that are able to leverage message transports
like MQTT natively.
There is a plethora of data encoding technologies available that can ALL be used in conjunction with
MQTT. Conventional IT tooling provides XML and JSON as the most popular encoding technologies. But
neither of these encoding technologies are efficient in representing large quantities of register based,
real time process variables. These technologies all have their place in IT design strategies. Sparkplug
selected an existing, open, and highly available encoding scheme that efficiently encodes register based
process variables. The encoding technology selected for Sparkplug is Google Protocol Buffers also
referred to as Google protobufs.
Google Protocol Buffers, sometimes referred to as “Google protobufs”, provide the efficiency of packed
binary data encoding while providing the structure required to make it easy to create, transmit, and
parse register based process variables using a standard set of tools. Google Protocol Buffers
development tools are available for:
• C
• C++
• C#
• Java
• Python
• GO
• JavaScript
https://github.com/eclipse/kura/blob/KURA_1.4.0_RELEASE/kura/org.eclipse.kura.core.cloud/src/main/
protobuf/kurapayload.proto
The important thing to note in this Protocol Buffer schema is that the required parameters are the name
and type parameters. For most use case applications in SCADA, think of this schema providing an
efficient way to encode key:value pairs of a tag (or PLC register number) and an associated value. The
value enumerations here cover all of the required data types that Process Variables require include:
• DOUBLE
• FLOAT
• INT64
• INT32
• BOOL
• STRING
• BYTES
There are some metadata structures defined within the current Kura Protocol Buffers schema that can
be utilized (optionally) as well. This includes the INT64 timestamp that used to time stamp UTC
millisecond values as well as the KuraPosition structure for any Location Based services that might be
provided by some MQTT EoN Nodes or Devices.
Unlike the Death Certificate mechanism which is part of the MQTT transport, the Birth Certificate is a
Sparkplug definition. The Birth Certificate is a logical reciprocal of the Death Certificate that is used to
convey the fact that the associate MQTT EoN Node and/or MQTT Device now has an MQTT session
established and can now start providing real time Process Variable information.
The first MQTT message that an EoN Node MUST publish upon the successful establishment of an
MQTT Session is an EoN BIRTH Certificate.
namespace/group_id/NDEATH/edge_node_id
The Death Certificate topic and payload described here are not “published” as an MQTT message, but
used as provided parameters within the MQTT CONNECT control packet when this MQTT EoN Node first
establishes the MQTT Client session.
The MQTT payload associated with this topic will be a Google Protocol Buffer using the Kura schema
containing the following optional parameters:
The Birth/Death sequence number is a required Sparkplug specification feature that is utilized when the
infrastructure contains multiple MQTT Servers. The bdseq metric value MUST be the same value used in
the associated Birth Certificate payload defined below, and MUST be an incrementing value on all
subsequent MQTT session establishments.
namespace/group_id/NBIRTH/edge_node_id
The EoN Birth Certificate contains everything required to build out an Ignition tag tree structure for all
metrics and parameters for this EoN Node. Upon the reception of a valid EoN Birth Certificate, MQTT
Engine creates the tag folder information required to represent the EoN Node if it does not already
exist, and populate the provided metric information into the appropriate folders. The ONLINE state of
this EoN Node will be set to TRUE along with the associated ONLINE Date Time parameter. Note that the
EoN Birth Certificate ONLY indicates the node itself is online and in an MQTT Session, but any attached
MQTT Devices will still have “STALE” data quality until those devices come online with their associated
Birth Certificates.
The MQTT payload associated with this topic will be a Google Protocol Buffer using the Kura schema
containing the following optional parameters:
The Birth/Death sequence number is a required Sparkplug specification feature utilized when the
infrastructure contains multiple MQTT Servers. The bdseq metric value MUST be the same value used in
the associated Death Certificate payload defined above, and MUST be an incrementing value on all
subsequent MQTT session establishments.
The Message Sequence Number is a required parameter that guarantees proper message ordering
between an MQTT EoN Node and the SCADA /Host application. For real time solutions where Process
Variables are being published using Report by Exception (RBE), it is critical that all analog and state
Process Variables arrive in order. The MQTT specification state that all messages be delivered in the
UTC Milliseconds Timestamp is an optional parameter that can be provided in the EoN Birth Certificate.
Although any MQTT Host node can (and should) timestamp data on arrival, UTC timestamps in the
MQTT messages can provide important latency metrics to monitor the overall health of the MQTT
infrastructure. In many SCADA system implementations, all infrastructure components have access to
the same master time server (for example using a master NTP server). Including the UTC Millisecond
Timestamp with every MQTT message published allows the MQTT Host node the ability to provide real
time latency metrics from every MQTT EoN node in the system. This latency metric measures the time
for the message published from the EoN node traversing the infrastructure and arrive at the SCADA
host. For cellular and VSAT based systems, this is an important metric to keep track of. It can also be
used to ensure that there are no issues with the messages getting thru the MQTT Server infrastructure.
Informational parameters like the Hardware Manufacture ID, Model Number, Software Revision
Number, Configuration Revision Number, etc. can be provided here along with any EoN Node control or
configuration parameter. By using an appropriate parameter structure here, complete configuration
dashboards can be built with the Ignition tooling. Using the Raspberry Pi example code
(https://github.com/Cirrus-Link/Sparkplug), the following EoN Node folder structure and tags are
exposed:
Note that the tag folder hierarchy as it appears in Ignition can be controlled by the structure of the Birth
Certificate tag names. In the example given above, the “Up Time ms” tag will appear at the root level of
the Node. Tags that control aspects of the EoN Node are placed into a folder called “Node Control”.
Other, information only tags are shown above being placed into the “Properties” folder.
The only EoN Node tag structure that is mandatory in the Sparkplug specification is the “Node
Control/Rebirth” node control Boolean. Any MQTT Client that connects to the MQTT Server
infrastructure will want to request that a new Birth Certificate needs to be published in order to learn
about the node and associated Devices. MQTT Engine will assume this control tag exists for any EoN
Node connecting into the infrastructure.
Upon receipt of this message, MQTT Engine builds out the following folder/tag structure within Ignition:
After the EoN Node Birth Certificate has been published, all of the parameters defined in the BIRTH
message payload are now available as Ignition tags. These parameter tags have the same properties as
any other Ignition tag value. As shown in the tag browser view above, the EoN Node is online and
provides specific information about the node that can be displayed in dashboard views for the end user.
Various node commands are now available like sending a new scan_rate_ms parameter to read the
associated I/O t a new millisecond period. Commands like the Reboot node shown above can be
dynamically built into this structure very quickly. Metrics like the current node TCP/IP address and the
Configuration Change Counter can be used for alarming and diagnostics within Ignition.
As defined above, the Data Topic for an MQTT EoN Node is:
The Message Sequence Number is a required parameter that guarantees proper message ordering
between an MQTT EoN Node and the Host application.
UTC Milliseconds Timestamp is an optional parameter and if provided is the current UTC timestamp
value at the point this message is published.
From the example EoN Birth Certificate above, any parameters that change values is published and
placed into the corresponding tags in Ignition or any other interested MQTT client application. For
example, if someone were to update the configuration on the example Raspberry Pi example above the
following parameters would likely change value.
The new values would be published in a NDATA message with the topic of:
The corresponding tag values in the Parameter folder shown in Figure 7 - Ignition Tag Structure after
EoN Node BIRTH above would be dynamically updated with the new software version number and the
new configuration change counter.
namespace/group_id/DBIRTH/edge_node_id/device_id
The MQTT EoN Node is responsible for the management of all attached physical and/or logical MQTT
Devices. Once the EoN Node has published its Birth Certificate, MQTT Engine ensures that the Ignition
tag folder structure has the EoN node in an ONLINE state. But each physical and/or logical device
connected to this node will still need to provide this Birth Certificate before MQTT Engine
creates/updates the tag folder structure (if this is the first time this device has been seen) and set any
associated Process Variable tags in Ignition to a “GOOD_DATA” state.
The Message Sequence Number is a parameter that guarantees proper message ordering between an
MQTT EoN Node and the Host application.
UTC Milliseconds Timestamp is an optional parameter and if provided is the current UTC timestamp
value at the point this message is published.
With this information, MQTT Engine creates the tag structure within Ignition (if this is the first time this
device has connected) for each tag. Note that in most implementations this is the only time that ALL
tags are published. Since Sparkplug is leveraging the “Continuous Session Awareness” of MQTT using the
Birth/Death Certificates, once all current tag values are published, subsequent data messages can safely
report only tag values that have changed within the MQTT session.
Tag Names in the Sparkplug specification can be defined in a simple flat tag structure where all of the
process variable tags appear below the associated Device in the tag hierarchy. But in many cases it
makes sense to organize the tags in a hierarchical folder structure to make it easier to view and manage
the tags. The “Tag Name” parameter in the Birth Certificate payload can provide a hierarchical tag path
and MQTT Engine will create the required folder structure within Ignition. For the Raspberry Pi
reference implementation, the following device folder structure and process variable tags demonstrates
both a flat tag structure and well as creating more complex tag paths to better organize tag groups:
//Place some tags at the root level of the Device tag structure
‘button’:BOOL:[current button input state] //Pibrella Button input
//Create a folder call “Inputs” for the Pibrella digital input process variables.
//Create a subfolder under Outputs called LEDs for associated LED control/state
‘Outputs/LEDs/green’:BOOL:[current LED state] //Pibrella GREEN LED state
‘Outputs/LEDs/red:BOOL:[current LED state] //Pibrella RED LED state
‘Outputs/LEDs/yellow:BOOL:[current LED state] //Pibrella YELLOW LED state
[*Note: It is the responsibility of the EoN Device application to “upcast” unsigned integer values to the next integer resolution
that Ignition tags support. For example, a Modbus unsigned 16-bit integer value would be upcast to a signed 32 bit so that
the full resolution of the unsigned integer value can be represented. If 32-bit unsigned integer process variables are present,
accumulator or counter values for example, these would need to be “upcast” to 64-bit integer values.]
ANY folder/tag value can be populated in the Tag Map. The map above represents physical and
calculated Raspberry Pi I/O values but other real time tag values calculated by the MQTT EoN Node
connected to the device can be added to this structure as well.
Once the MQTT Device Birth Certificate is delivered to MQTT Engine, the physical/logical device is
considered online and able to deliver discrete tag data updates in real time using the DDATA message
topic and receive commands using the DCMD message.
Upon receipt of this message, MQTT Engine automatically builds out the following tag structure in
Ignition:
Once the initial tag structure is built out in Ignition from the information in the Device Birth Certificate,
any subsequent process variable changes are published using the DDATA message structure detailed in
section 0 below.
namespace/group_id/DDEATH/edge_node_id/device_id
In typical use case scenarios, it is the responsibility of the MQTT EoN Node to indicate the real time state
of either physical legacy device using poll/response protocols and/or local logical devices. Regardless of
the device being monitored and providing the real time tag information, in the event that any tag
information could be bad or questionable, it is the responsibility of the EoN Node to publish a Death
Certificate on behalf of the end device.
For most use cases, the reception of a MQTT Device Death certificate only requires the optional
parameters of the Message Sequence Number (seq) and the UTC Millisecond Timestamp (timestamp).
The Message Sequence Number is a required parameter that guarantees proper message ordering
between an MQTT EoN Node and the Host application.
UTC Milliseconds Timestamp is an optional parameter and if provided is the current UTC timestamp
value at the point this message is published.
or:
namespace/group_id/DDATA/edge_node_id/device_id
The payload for the Data message is a Google Protocol Buffer structure using the Kura schema.
The Message Sequence Number is a required parameter that guarantees proper message ordering
between an MQTT EoN Node and the Host application.
UTC Milliseconds Timestamp is an optional parameter and if provided is the current UTC timestamp
value at the point this message is published.
Using the Raspberry Pi reference implementation example given above, if any of the Pibrella process
variable values change, then a DDATA message is created and published. For example, if the button on
the Pibrella board were pressed then the following message would be published:
As many process variables can be published as required within the DDATA message payload. The simple
example above shows only the button state encoded into the Google Protocol Buffer payload. But if all
of the inputs changed at the same time then the payload could contain all four of the input states:
‘Inputs/a’:BOOL:[new state]
‘Inputs/b’:BOOL:[new state]
‘Inputs/c’:BOOL:[new state]
‘Inputs/d’:BOOL:[new state]
The topic that a Host node will use is identical for both the Birth and the Death certificate. The Topic
Namespace will be:
STATE/scada_host_id
It uses an aspect of the MQTT transport called a “RETAINED” publish in order to maintain the current
state of the Primary Host MQTT Client session state to all available MQTT Servers. How the Host state is
used is explained in detail in the section on Sparkplug MQTT Session Management.
STATE/scada_host_id
The Will Payload will be the STRING “OFFLINE”.
The Will RETAIN flag will be set to TRUE, and the Will QoS will be set to 0.
With these parameters set, the MQTT Client for the Host is an MQTT message published on the topic of
scada_host_id/STATE, with a string payload of “OFFLINE” and it will be a RETAINED MQTT message.
The Birth Certificate that is defined here is an application level message published by the Host MQTT
Client applications.
The topic used for the Host Birth Certificate is identical to the topic used for the Death Certificate:
STATE/scada_host_id
The RETAIN flag for the Birth Certificate is set to TRUE, and the Quality of Service (QoS) is set to 0.
namespace/group_id/NCMD/edge_node_id
The MQTT Payload is encoded using the same Google Protocol Buffers Kura Schema defined above.
This becomes a VERY convenient mechanism for the display of configuration parameters and controls
that might be on various EoN devices or even adding new ones dynamically. In the example given above
for the EoN Node Birth Certificate, some EoN Node controls provided can now be written to using this
message. By clicking on the ‘Next server’ coil in the Ignition tag structure, a Kura encoded payload is
published to cause the EoN Node to disconnect from the current MQTT Server and walk to the next one
in its configuration table shown in the following structure of topic[payload]:
Any time a new MQTT Application client joins the MQTT infrastructure it might want to see a completely
new set of Birth Certificates from this EoN Node to get in sync with all available data. Using the proper
group_id and device_id in the topic structure, a command message is sent to cause the EoN Node to
reissue all Birth Certificate information as:
With proper permissions in Ignition, the system could write to the Reboot coil mapped out in the
example above to cause the remove EoN Node to reboot:
namespace/group_id/DCMD/edge_node_id/device_id
The MQTT Payload is encoded using the same Google Protocol Buffers Kura Schema defined above.
Due to the nature of real time SCADA solutions, it is very important for the primary SCADA Host and all
connected MQTT EoN Nodes to have the MQTT Session STATE information for each other. In order to
accomplish this the Sparkplug Topic Namespace definitions for Birth/Death certificates along with the
defined payloads provide both state and context between the SCADA Host MQTT client and the
associated device side MQTT Clients. In most use cases and solution scenarios there are two primary
reasons for this “designation” of a primary SCADA Host:
1. Only the Primary Ignition Host should have the permission to issue commands to MQTT Devices.
2. In high availability and redundancy use cases where multiple MQTT Servers are used, MQTT EoN
Nodes need to be aware of whether Ignition has network connectivity to each and every MQTT
Server in the infrastructure. If the Primary Ignition STATE shows that an EoN Node is connected
to an MQTT Server that the Primary Ignition Gateway is NOT connected to, then the EoN Node
should walk to the next available MQTT Server where STATE for the Ignition Gateway is
‘ONLINE’.
The session diagram in Figure 9 - Host Session Establishment shows a very simple topology with a single
MQTT Server. The steps outlined in the session diagram are defined as follows:
1. MQTT Engine will try to create an MQTT Session using the MQTT CONNECT Control Packet (refer
to section 3.1 in the MQTT V3.1.1 specification). A Death Certificate is constructed into the Will
Topic and Will Payload of the of the Connect Control Packet with a Will QoS = 0 and Will Retain =
true. The MQTT CONNECT Control Packet is acknowledged as successful with a valid CONNACK
Control Packet. From this point forward in time, the MQTT Server is ready to deliver a Host
Death Certificate any time the MQTT Engine MQTT Client loses TCP/IP connectivity to the MQTT
Server.
The session diagram in Figure 10 - EoN Node MQTT Session Establishment shows a very simple topology
with a single MQTT Server. The steps outlined in the session diagram are defined as follows:
1. The EoN Node MQTT client will attempt to create an MQTT session to the available MQTT
Server(s) using the MQTT CONNECT Control Packet (refer to section 3.1 in the MQTT V3.1.1
specification). The Death Certificate constructed into the Will Topic and Will Payload follows the
format defined in section 7.2.1, EoN Death Certificate (NDEATH). The MQTT CONNECT Control
Packet is acknowledged as successful with a valid CONNACK Control Packet. From this point
forward in time, the MQTT Server is ready to deliver an EoN Node Death Certificate to any
subscribing MQTT Client any time TCP/IP connectivity is lost.
2. Once an MQTT Session has been established, the EoN Node MQTT client will publish an
application level Birth Certificate as defined in section 7.2.2, EoN Birth Certificate (NBIRTH). At
this point MQTT Engine will have all of the information required to build out the EoN Node
metrics and parameters into an associated Ignition tag folder structure and show the EoN Node
in an “ONLINE” state.
The preceding sections in this document detail how MQTT Engine interacts with the MQTT Server
infrastructure and how that infrastructure interacts with the notion of an MQTT EoN Node. But to a
large extent the technical requirements of those pieces of the infrastructure have already been
provided. For most use cases in this market sector the primary focus will be on the implementation of
the Sparkplug specification between the native device and the EoN Node API’s.
In order to expose and populate the metric, parameter, and process variable tag information from any
intelligent device, the following simple session diagram outlines the requirements:
The session diagram in Figure 11 - MQTT Device Session Establishment shows a simple topology with all
of the Sparkplug elements in place i.e. Ignition, MQTT Engine, MQTT Server(s), MQTT EoN Node and this
element, the MQTT Device element. The steps outlined in the session diagram are defined as follows:
1. This flow diagram assumes that at least one MQTT Server is available and operational within the
infrastructure. Without at least a single MQTT Server the remainder of the infrastructure is
unavailable.
2. The Session Establishment of Ignition using the MQTT Engine module is described in section 8.1,
Primary Ignition Session Establishment. The establishment of this session is actually VERY
arbitrary based on use case as EoN Nodes can and will establish sessions with MQTT
infrastructures with or without this component across “N” number of Host applications.
3. The Session Establishment of the associated MQTT EoN Node is described in section 8.2, EoN
Node Session Establishment. This flow diagram assumes that the EoN Node session has already
been established with MQTT Engine.
defined in 0,
But unlike legacy SCADA system implementations, all real time process variable information being
published thru the MQTT infrastructure is available to any number of additional MQTT Clients in the
business that might be interested in subsets if not all of the real time data.
The ONLY difference between a Primary Ignition MQTT client and all other clients that non-primary
Client do NOT issue the STATE Birth/Death certificates.
• Ignition Gateway
• MQTT Engine
• MQTT Server(s)
• Edge of Network (EoN) Nodes
• Devices
• Topic Namespace
• Payload Encoding
• Birth Certificates
• Death Certificates
• STATE Messages
• Ignition, EoN Node, and Device Session Establishment
All of these specifications and definitions get to the primary goal of Sparkplug, that is to deliver a rich set
of real time Device process variable data extremely efficiently to many data consumers within the
Enterprise while still providing a best in class Command/Control SCADA system.
The disruptive notion of the emerging IIoT mindset is that intelligent devices should be smart enough to
deliver process variable data to the infrastructure when it is required. But the fact of the matter is that
the existing population of 100’s of millions of the smart devices need to be “asked” if something has
changed using poll/response protocols. This is why we’re seeing the emergence of edge devices
throughout the industrial sector. For the decade or more that it will take for device manufactures to
embed IIoT technology natively, the solution being employed today is to place this capability in small
embedded devices closer to the data producers themselves. So within the Sparkplug specification these
devices called Edge of Network Nodes (EoN) represent this new class of Gateway, Edge Controller, Edge
of Network Node, Protocol Gateway, and many more acronyms for the same class of devices. The
capability of these devices are in an extreme range of low power microcontrollers to multicore Intel and
ARM based processors. The operating systems range from full embedded Linux kernels and Windows
embedded to small bare metal RTOS’s. Regardless of the category these gateway devices fall into, the
simplicity, of MQTT and the Sparkplug specification should be available across the board.
This section of the Sparkplug specification goes into detail on how metric, parameter, and process
variable data are published/subscribe within an MQTT infrastructure in real time and the resulting tag
information that Ignition can read/write to.
• EoN Rebirth command to republish all EoN and Device Birth Certificates.
• EoN Next server command to move to next available MQTT Server.
• EoN Reboot command to reboot the EoN Node.
• EoN Primary Network (PRI_NETWORK) where 1 = Cellular, 2 = Ethernet
The important point to realize is that the tags exposed in Ignition for use in the design of applications
are completely determined by what metric and parameter values are published in the EoN Birth
Certificate. Each specific EoN Node can best determine what data to expose, and how to expose it, and
it will automatically appear in the Ignition tag structure. Parameters can even be added dynamically at
runtime and with a new Birth Certificate, these parameters will automatically be added to the Ignition
tag structure.
The other VERY important distinction to make here is that EoN Node NDATA and NCMD messages are
decoupled from the Device level command and control messages of DDATA and DCMD. This decoupling
in the Topic Namespace is important because it allows interaction from all MQTT Clients in the system
(to the level of permission and application) with the EoN Nodes, but NOT to the level of sending Device
commands. MQTT Engine provides a configuration parameter that will BLOCK output DDATA and DCMD
messages but still allow NDATA and NCMD messages to flow. In this manner, multiple Ignition systems
can be connected to the same MQTT infrastructure, but only the ones with Device commands enabled
can publish Device commands.
The following simple message flow diagram demonstrates the messages used to update a changing
cellular RSSI value in Ignition and sending a command from Ignition to the EoN Node to use a different
primary network path.
The reason that the notion of an EoN Node is present in Sparkplug is a realization that if existing smart
device infrastructure cannot be addressed with emerging tools and development platforms, the
migration from legacy methodologies, protocols, infrastructures, and data silos will never occur and the
envisaged benefits of Factory 4.0 will never come to fruition. EoN Nodes can represent physical
hardware in the plant or in the field that can address converting legacy poll/response protocols (while
providing the often required network security at the same time) into real time MQTT messages. At the
same time, EoN Nodes can represent a logical software agent in next generation devices that can
natively provide real time process variables via MQTT. By using Google Protocol Buffers and the Kura
But ultimately the EoN Nodes are only in place to support the ultimate data producer/consumer, the
real devices on the plant floor or in the field. The Sparkplug specification provides a way to name the
process variables acquired from these devices along with defining the appropriate data type and current
value. Once the process variables are published into an MQTT infrastructure, they can be consumed by
any number of applications are are interested in the values, including one or more Ignition Gateway
instances.
Section 0,
Regardless of the tag naming convention used, upon receipt of the Device Birth Certificate, MQTT
Engine will create the process variable tag structure within Ignition where they will be immediately
usable by the Ignition platform. In the following message flow diagram, we’ll use the example of a
Modbus PLC. This example will also assume that the EoN Node connected to the PLC can provide
descriptive tag names to each of the Modbus register addresses:
Regardless of the reason for multiple MQTT Servers, there are several architectural considerations that
need to be addressed by the Sparkplug specification.
The single MQTT Server topology shown above is a perfectly viable solution in many instances. But it
does require a highly available MQTT Server and presents a single point of failure within the system.
In keeping with the KISS principal (Keep It Simple) all of the multiple MQTT Server topologies show non-
clustered MQTT Servers. The market today offers many choices of MQTT Servers, some of which are
clustered instances of MQTT Servers. But as a baseline functionality and to keep thing very simple the
current Sparkplug specification assumes that each and every MQTT Server is a standalone instance. One
of the unique features of MQTT Engine is that it seamlessly manages the multi-server topologies.
In the drawing shown in Figure 15 above, there are multiple MQTT Servers available in the topology. In
this topology, MQTT Engine connects to all available MQTT Servers in the infrastructure and provides
detailed metrics on each instance. These metrics include:
Note that all of the Ignition Gateway instances and well as any other “Line of Business” (LOB) application
can establish MQTT Sessions with all available MQTT Servers. In this manner, the EoN Nodes are free to
determine the best network path and MQTT Server availability to establish their MQTT Session with.
This topology does require that EoN Nodes using the Sparkplug specification keep a table of available
MQTT Servers and be able to connect to any number of them based on network and server availability.
Using this topology any EoN Node can use any of the available TCP/IP networks and connect to any one
of the available MQTT Servers. From the Ignition and LOB application side of the topology, they don’t
really care which of the N number of MQTT Servers the EoN Nodes connect to. The Birth/Death
certificate management automatically takes care of know which EoN Nodes are connected at any point
in time, and just as important, which nodes are not connected. MQTT Engine keeps metrics on every
EoN Node connecting into the MQTT infrastructure and includes:
MQTT Engine has a configuration option that specifies whether this Ignition Gateway instance is a
“Primary” command/control instance or not. If it is a primary instance then every time MQTT Engine
establishes a new MQTT Session with an MQTT Server, the STATE Birth Certificate defined in section
above is the first message that is published after a successful MQTT Session is established.
EoN Node devices in an infrastructure that provides multiple MQTT Servers can establish a session to
any one of the MQTT Servers. Upon establishing a session, the EoN Node should issue a subscription to
the STATE message published by Ignition. Since the STATE message is published with the RETAIN
message flag set, MQTT will guarantee that the last STATE message is always available. The EoN Node
1. When an EoN Node is configured with multiple available MQTT Servers in the infrastructure it
should issue a subscription to the Primary Ignition Gateway STATE message. The EoN Nodes are
free to establish an MQTT Session to any of the available servers over any available network at
any time and examine the current STATE value. If the STATE message payload is ‘OFFLINE’ then
the EoN Node should disconnect and walk to the next available server.
2. Upon startup, if MQTT Engine is configured to be the Primary Ignition instance, the MQTT
Session will be configured to register an Ignition DEATH Certificate that indicates STATE is
‘OFFLINE’ with the message RETAIN flag set to true. Then an Ignition BIRTH Certificate will be
published with a STATE payload of ‘ONLINE’.
3. As the EoN Node walks its available MQTT Server table, it will establish an MQTT Session with a
server that has a STATE message with a payload of ‘ONLINE’. The EoN Node can stay connected
to this server as long as its MQTT Session stays intact and it does not receive an Ignition DEATH
Certificate.
4. Having a subscription registered to the MQTT Server on the STATE topic will result in any change
to the current Ignition STATE being received immediately. In this case, a network disruption
causes the Ignition MQTT Session to server #2 to be terminated. This will cause the MQTT
Server, on behalf of the now terminated Ignition MQTT Client to publish the DEATH certificate to
But in some use cases, such as sending GPS coordinates for asset tracking or other IOT applications with
periodic data from sensors, MQTT enabled devices do not need to remain connected to the MQTT
infrastructure. In these use cases, all the Device needs to do is to issue an MQTT DISCONNECT control
packet prior to going offline in order to leave the MQTT infrastructure “gracefully”. In this case an MQTT
Device or associated Device DEATH certificate will most normally not be seen. System designers just
need to be aware that the tags in Ignition in this case will represent “Last Known Good” values with a
time stamp of this data where the current state of the of the MQTT Device is not a real time indication.
Ignition tag time stamp values can be used to determine when the values from this node were last
updated.
Non-persistent MQTT Enabled Devices should still register a proper DEATH Certificate upon the
establishment of an MQTT session. In this manner the Ignition can still have a good representation of
Last Known Good process variable versus the fact that the MQTT session was terminated prior to the
EoN Node being able to complete its transaction.