Sparkplug B: Definition, Architecture and Comparison with MQTT and UNS

What is Sparkplug B?

In short: Sparkplug B, often called MQTT Sparkplug, is the current variant of Sparkplug, an open specification that defines how industrial devices and applications exchange data over MQTT. It adds three things MQTT leaves open: a fixed topic structure, a compact binary payload based on Google Protocol Buffers and session state management with birth and death certificates, so every consumer knows whether a value is current. Sparkplug is maintained by the Eclipse Foundation, and version 3.0 has been an international standard (ISO/IEC 20237) since 2023. Sparkplug B plays to its strengths where Sparkplug-aware applications such as SCADA systems consume the data, while a Unified Namespace read by many different systems is often better served by open JSON payloads.

Jump to: How it works · Sparkplug B vs. MQTT · Sparkplug B vs. UNS · Decision guide · Challenges · UNS checklist · Examples · Security · Implementation · FAQ

From SCADA projects to ISO/IEC 20237: where Sparkplug comes from

Sparkplug grew out of SCADA practice. Cirrus Link published version 1.0 of the specification in May 2016 with a clear goal: make MQTT usable for industrial control systems in which the state of every device has to be known at all times. In 2019, Sparkplug became a project of the Eclipse Foundation. Version 3.0, released in November 2022, was the first version developed under the Eclipse Foundation Specification Process. It clarified ambiguities from version 2.2, added explicit normative statements and introduced a Technology Compatibility Kit (TCK) that implementations can be tested against.

In 2023, Sparkplug 3.0 was published as the international standard ISO/IEC 20237. The Eclipse Foundation remains the steward of the specification, and version 4.0 is currently in development.

Sparkplug A, Sparkplug B, spBv1.0 and 3.0: what the names mean

The naming regularly causes confusion, because letters and version numbers refer to different things.

TermMeaning
SparkplugThe specification as a whole: topic namespace, payload definition and state management on top of MQTT
Sparkplug AThe first payload definition, based on the Eclipse Kura Protobuf format. It is deprecated and no longer part of the specification.
Sparkplug BThe current payload definition with richer metrics: data types, properties, templates for complex data types and datasets for tables
spBv1.0The first element of every Sparkplug B topic. It identifies the namespace and the generation of the payload format and is independent of the specification version.
3.0The current version of the specification, published as ISO/IEC 20237:2023

MQTT moves data and leaves three questions open

MQTT defines how messages travel between clients and a broker. It deliberately says nothing about how topics are named, what a payload contains or whether the device behind a value is still connected. In a project with a single integrator, a team can agree on its own conventions. In a plant with equipment from a dozen vendors and several integrators, every party brings its own, and each integration into SCADA or MES has to learn them again.

  • Where is the value? Without a shared topic convention, every consuming application needs documentation of each vendor’s topic layout.
  • What does the value mean? A payload like 73.4 says nothing about data type, unit or timestamp unless the publisher adds them in a format every consumer understands.
  • Is the value still current? A retained message from a gateway that went offline an hour ago looks exactly like a fresh one. MQTT’s Last Will mechanism can signal a disconnect, but only if every client uses it the same way.

Sparkplug answers all three questions with one set of rules. A host application can then work with edge devices from different vendors without project-specific configuration for each of them, which is why the Eclipse Foundation describes Sparkplug as the basis for a plug-and-play Industrial IoT.

How the Sparkplug B specification works

Sparkplug defines four kinds of participants and the rules between them. The requirements for the broker in the middle are deliberately minimal, while edge nodes and host applications follow precise rules for topics, payloads and state.

Edge nodes, devices, host applications and an MQTT server

  • Edge node: An MQTT client, for example a gateway next to a PLC, that publishes data for itself and for the devices behind it. Any MQTT 3.1.1 or 5.0 client library can be used to implement an edge node.
  • Device: A sensor, controller or machine attached to an edge node. It reaches the MQTT server only through its edge node.
  • Host application: A consumer such as a SCADA system, an MES or a historian that subscribes to Sparkplug data and can send commands. One host can be configured as the primary host application, whose availability the edge nodes monitor. While it is offline, edge nodes can store data locally and send it once the host is back.
  • MQTT server: The broker in the middle. Edge nodes and host applications never talk to each other directly.

The topic namespace: spBv1.0/group_id/message_type/edge_node_id/device_id

Every Sparkplug B message uses the same topic structure. The device_id element only appears on device-level messages:

spBv1.0/<group_id>/<message_type>/<edge_node_id>[/<device_id>]

spBv1.0/plant-hamburg/DDATA/press-line-01/press-04

The group_id groups edge nodes logically, for example by site or production line. The combination of group_id and edge_node_id has to be unique across the entire infrastructure. Host applications announce their availability on a separate topic outside this structure, spBv1.0/STATE/<host_id>.

Nine message types and who sends them

Message typeSent byPurpose
NBIRTHEdge nodeBirth certificate of the edge node with every metric it will report, including data types and aliases
NDEATHEdge node or MQTT serverDeath certificate of the edge node. It is registered as the MQTT Last Will, so the server publishes it if the connection drops.
DBIRTHEdge nodeBirth certificate of a device behind the edge node
DDEATHEdge nodeDeath certificate of a device that is no longer reachable
NDATAEdge nodeMetrics of the edge node that have changed
DDATAEdge nodeMetrics of a device that have changed
NCMDHost applicationCommand to the edge node, for example a write or a rebirth request
DCMDHost applicationCommand to a device, for example a new setpoint
STATEHost applicationOnline or offline state of a host application, as a retained JSON message

Birth and death certificates: every consumer knows what is current

When an edge node connects, it registers its NDEATH message as MQTT Last Will with QoS 1. It then publishes its NBIRTH and one DBIRTH per device. These birth certificates list every metric with name, data type and current value, so a host application learns the complete data model of the node without any manual configuration. If the connection drops unexpectedly, the MQTT server publishes the NDEATH on behalf of the edge node, and every host application marks the metrics of that node as stale.

Two counters keep this reliable. The bdSeq number links each death certificate to the birth certificate it belongs to, so a host can tell an outdated death message from a current one. The seq number runs from 0 to 255 across all messages of an edge node and reveals missing messages. If a host notices a gap or connects late, it sends a rebirth request: it writes the value true to the metric Node Control/Rebirth through an NCMD, and the edge node publishes its birth certificates again.

Protobuf payloads, aliases and report by exception

Sparkplug B encodes its payloads with Google Protocol Buffers, a compact binary format. The only exception is the STATE message, which is plain JSON. Each metric carries a name, a timestamp, a data type and a value, and can add properties such as an engineering unit. Templates describe complex data types, for example a motor with all its parameters, and datasets carry tables.

To keep messages small, a metric can be given a numeric alias in its birth certificate. NDATA, DDATA, NCMD and DCMD messages then carry only the alias. The specification also prescribes report by exception: edge nodes publish a metric when its value changes and should not publish data on a fixed cycle. Data and command messages are sent with QoS 0, and gaps are closed through the sequence numbers and rebirth requests described above. Together, these rules make Sparkplug a lean form of event-driven architecture.

What the broker has to provide

Sparkplug defines the clients and leaves the broker largely unchanged. Any MQTT broker that fully supports MQTT 3.1.1 or 5.0 with QoS 0 and 1, retained messages and Last Will messages meets the requirements of a Sparkplug infrastructure. The specification also describes an optional Sparkplug Aware MQTT Server. It stores the latest NBIRTH and DBIRTH messages and offers them as retained messages under $sparkplug/certificates/..., so a host that connects later receives the birth certificates without a rebirth request.

Because the session state lives on the broker that the clients are connected to, all participants in the birth and death handshake have to connect to the same MQTT server. Copies forwarded to other brokers can be used for monitoring, but they do not carry the session state.

Sparkplug B vs. MQTT: a rulebook on top of the transport

Every Sparkplug message is a regular MQTT publish, and any compliant broker can route it. The difference lies in what publishers and subscribers agree on.

Plain MQTTSparkplug B
Topic structureFree, defined per projectFixed: spBv1.0/group/message type/edge node/device
PayloadFree: JSON, plain values or binary formatsProtobuf with typed metrics, timestamps and aliases
Data types and metadataOnly if the project defines a schemaPart of the specification, declared in the birth certificate
Device stateLast Will and retained messages, used by conventionMandatory birth and death certificates with sequence numbers
DiscoveryConsumers need documentation of topics and payloadsHost applications learn all metrics from the birth certificates
Delivery of dataQoS 0, 1 or 2, chosen per messageQoS 0 for data and commands, gaps closed by rebirth
ReadabilityJSON is readable in any MQTT clientBinary, a Sparkplug decoder is needed
InteroperabilityWithin the project’s own conventionsBetween all implementations that follow the specification, testable with the TCK

Plain MQTT is often enough when the consumers are applications the team builds or configures itself. A documented JSON payload with value, unit, timestamp and quality, combined with Last Will messages for the online state, covers much of what Sparkplug offers and stays readable for every client. Sparkplug pays off when devices from many vendors have to plug into a host application without project-specific configuration.

Sparkplug B vs. Unified Namespace: device view meets plant view

Sparkplug B and the Unified Namespace often appear in the same sentence, yet they answer different questions. Sparkplug B is a specification for how edge nodes and host applications exchange data. A Unified Namespace is an architectural principle: one central place where the current state of the whole company is available in a structure that reflects the business.

Sparkplug BJSON-based UNS
Structure followsEdge nodes and devices (group, edge node, device)The company, usually ISA-95 (enterprise, site, area, line, machine)
Hierarchy depthFixed at group, edge node and deviceAs many levels as the data model needs
PayloadBinary Protobuf, several metrics per messageJSON, usually one value with its context per topic
Typical consumersSparkplug-aware host applications such as SCADAAny system: MES, ERP, analytics, cloud, AI and dashboards
State handlingBuilt in through birth and death certificatesDefined by convention, for example status topics and Last Will
Rules set byThe specificationThe company: naming rules, payload schema and permissions
ReadabilityRequires a decoderReadable in any MQTT client

The decisive difference is who the data is meant for. Sparkplug is optimized for host applications that know the specification. A UNS is built for consumers that nobody knows yet: the next dashboard, a data lake or an AI model. In Sparkplug, spBv1.0/plant-hamburg/DDATA/press-line-01/press-04 carries a bundle of binary metrics. In a UNS, the same temperature sits at acme/hamburg/press-shop/line-01/press-04/temperature as readable JSON, and every subscriber finds it through the structure of the plant.

Building a Unified Namespace with Sparkplug B

In practice, two patterns are found:

  • Sparkplug inside the UNS: Edge nodes publish Sparkplug B directly to the central broker, and the spBv1.0 subtree is treated as part of the namespace. This works as long as all consumers are Sparkplug-aware. Every other consumer needs its own decoder, and the structure stays at group, edge node and device.
  • Sparkplug at the edge, JSON in the UNS: Sparkplug keeps connecting edge nodes and SCADA. A decoding step subscribes to the Sparkplug namespace, unpacks the metrics and publishes them as JSON into a topic tree based on ISA-95. The SCADA path keeps its birth and death semantics, and every other system reads plain JSON.

The second pattern keeps naming, payload schema and permissions under the control of the company, which matters most once several plants share one namespace. Some edge platforms can also publish plain JSON next to or in place of Sparkplug B, which removes the decoding step altogether.

Sparkplug B or JSON UNS: a decision guide

There is no answer that fits every plant. The following criteria help to decide where Sparkplug B is the better choice and where open JSON payloads in a Unified Namespace fit better.

CriterionPoints to Sparkplug BPoints to a JSON UNS
ConsumersMainly Sparkplug-aware SCADA or HMI systemsMany different systems, including MES, cloud, analytics and AI
DevicesMany edge devices from different vendors with native Sparkplug supportMixed protocols that are normalized in a connectivity layer anyway
StructureA technical grouping by edge node and device is sufficientThe namespace should mirror plants, lines and machines
NetworksNarrow or expensive links where compact payloads matterPlant networks with enough bandwidth for readable payloads
OperationsThe team works with Sparkplug tools and decodersThe team debugs with standard MQTT clients and needs readable data
GovernanceThe rules of the specification are sufficientThe company defines naming, schema and access rules itself

Many architectures end up using both: Sparkplug B where an existing SCADA world depends on it, and a JSON-based UNS as the shared layer for everything else. What matters is to decide per consumer and to convert the data once, at a defined place in the architecture, so that individual applications never need a decoder of their own.

Sparkplug B in practice: pitfalls and how to handle them

Most problems with Sparkplug B appear where a Sparkplug infrastructure meets systems and networks that were designed without it in mind.

ChallengeWhy it mattersSolution
Binary payloadsGeneric MQTT clients, rule engines and dashboards only see raw bytesA central decoding step that publishes the metrics as JSON for all consumers that do not speak Sparkplug
Bridging between brokersThe birth and death handshake, retained STATE messages and bdSeq numbers live on the broker the clients are connected to. A bridge forwards the messages, while the session state stays on the original broker.Connect all participants of the handshake directly to the same broker and use bridged copies for monitoring only
Flat technical namespaceGroup, edge node and device do not map site, area, line and machineUse group IDs consistently, for example per site, and model the plant hierarchy in a UNS
Mixed specification versionsSince version 3.0, host applications publish STATE on spBv1.0/STATE/host_id as JSON. Clients based on 2.2 or earlier use STATE/host_id with text payloads.Take stock of the specification version of every client and allow both topics during a migration
QoS 0 for dataOver unstable wide-area links, data messages can be lost between rebirthsKeep Sparkplug traffic on the local network, let edge nodes buffer while the primary host is offline and forward selected data to remote sites
Spoofed stateA client with write access to the whole namespace can publish data or death certificates for other nodesPermissions per edge node that are restricted to its own topic subtree

Unified Namespace Checklist

Unified Namespace Checklist teaser

Sparkplug, JSON or both: where does your namespace stand?

The payload format is one of many decisions on the way to a Unified Namespace. Twelve questions across four areas show where your factory stands today, from data access and context to integration and governance, and what to clarify before you decide.



You are currently viewing a placeholder content from HubSpot. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information

Where Sparkplug B is used

SCADA with edge devices from many vendors

This is the classic use case. Gateways, controllers and edge devices with native Sparkplug support publish into one broker, and the SCADA system learns their tags from the birth certificates. A new device appears in the host application with its full data model, without anyone mapping its tags by hand.

Pipelines, utilities and distributed plants often connect over cellular or satellite links. Report by exception, metric aliases and compact Protobuf payloads keep the traffic low, and death certificates show a lost connection as soon as the broker detects it, so operators know which values they can still trust.

Opening an existing Sparkplug environment to more systems

Many plants already run Sparkplug between edge and SCADA. When MES integration, analytics or cloud applications need the same data, the existing Sparkplug infrastructure keeps running. Its metrics are decoded once and made available in the Unified Namespace, so the SCADA side does not change.

Hybrid architecture across plants

Each plant uses Sparkplug where edge devices and SCADA support it, and publishes harmonized JSON topics into a plant and enterprise UNS. Cross-site applications such as OEE comparisons subscribe to the same topic structure in every plant, regardless of which payload format the edge uses.

You can find more scenarios in our use cases.

Security and governance: one edge node, one topic subtree

Sparkplug defines structure and state and relies on MQTT and the broker for security. Because commands can write values to machines, the permission concept deserves the same attention as the topic namespace. A production-ready Sparkplug infrastructure needs:

  • Encryption: TLS on port 8883 for every edge node and host application
  • Individual identities: Separate credentials or client certificates per edge node and host application, never shared accounts
  • Least privilege per edge node: Write access only to its own birth, death and data topics and read access to its own command topics and the STATE topic of its primary host. A misconfigured or compromised node then cannot publish data or death certificates for another one.
  • Separate host roles: Host applications read the namespace, publish their own STATE and send commands only to the groups they are responsible for.
  • Monitoring: STATE messages and death certificates are watched centrally, so it is visible at all times which nodes and hosts are online.

Governance goes beyond permissions. Group IDs and edge node IDs are part of every topic, so the naming rules for them belong in the same governance as the rest of the namespace.

Introducing Sparkplug B in five steps

  1. Map the consumers: List the applications that will use the data and check which of them understand Sparkplug. This decides where Sparkplug ends and where JSON begins.
  2. Define group and edge node IDs: Set naming rules for group_id and edge_node_id, for example one group per site or line, before the first node connects.
  3. Set up broker and permissions: Run the broker with TLS, create one user per edge node restricted to its own topic subtree and give host applications separate roles.
  4. Plan the decoding step: Decide where Sparkplug metrics are decoded and published as JSON for all other consumers, and how they are mapped into the UNS topic tree.
  5. Test and scale: Test implementations against the TCK of the Eclipse Foundation, check rebirth, death certificates and reconnects on one line, then roll out the configuration as code (Infrastructure as Code) to further lines and plants.

How to design the Unified Namespace that the Sparkplug data flows into is discussed by experts from Cybus and MaibornWolff in the panel Define Your Unified Namespace.

Sparkplug B with Cybus Connectware

Cybus Connectware can run as the central MQTT broker of a Sparkplug B infrastructure. Edge nodes from different vendors and any number of host applications connect to the same instance, and Cybus Connectware provides the users, permissions and routing for the Sparkplug namespace. The Sparkplug B Integration guide in the documentation follows the Sparkplug 3.0 specification.

  • Central broker: The built-in broker supports Last Will and retained messages, which Sparkplug session management relies on. No Sparkplug-specific broker extensions are required.
  • Least privilege per edge node: Users and roles are defined in the Service Commissioning File, or devices register through the Client Registry. Each edge node is restricted to its own topic subtree.
  • Monitoring: Mappings mirror the Sparkplug namespace into an internal topic tree, and the JSON STATE messages can be turned into a host availability topic for dashboards and alerting.
  • Bridging: The MQTT connector forwards Sparkplug traffic to other brokers with the payloads unchanged, for example to a cloud broker.
  • Existing environments: Migration guides for Ignition and HighByte Intelligence Hub show how existing Sparkplug environments connect to Cybus Connectware.

Cybus Connectware routes Sparkplug B messages like any other MQTT message and enforces permissions on their topics. Rule Engine, mappings and Data Explorer work with the Protobuf payloads only after a decoding step. Consumers that need the metric values are either Sparkplug-aware themselves, for example a SCADA system, or receive the metrics as JSON from such a decoding step.

For a Unified Namespace that many systems read and that the company governs itself, Cybus recommends JSON payloads in a topic tree based on ISA-95. Sparkplug B remains the right choice where Sparkplug-aware host applications consume the data, and Cybus Connectware carries both formats on the same broker.

You can find all features and how to get started on the product page.

Frequently asked questions about Sparkplug B

What is the difference between Sparkplug A and Sparkplug B?

Sparkplug A used the Eclipse Kura Protobuf definition, which proved too limited for the metadata industrial payloads need. Sparkplug B added richer metrics with data types, properties, templates and datasets. Sparkplug A is deprecated, and current implementations use Sparkplug B.

Does Sparkplug B need a special MQTT broker?

No. Any broker that fully supports MQTT 3.1.1 or 5.0 with QoS 0 and 1, retained messages and Last Will messages meets the requirements. A Sparkplug Aware broker additionally stores birth certificates for hosts that connect later, but this is optional.

Sparkplug B or Unified Namespace: which one do I need?

That depends on who consumes the data. If Sparkplug-aware SCADA systems are the main consumers, Sparkplug B fits well. If many different systems read the data and the namespace should mirror plants and lines, a JSON-based Unified Namespace is the better fit. Many architectures use both.

Can Sparkplug B and a Unified Namespace be combined?

Yes. A common pattern keeps Sparkplug B between edge nodes and SCADA and adds a decoding step that publishes the metrics as JSON into a UNS topic tree based on ISA-95.

Why does Sparkplug B use Protobuf instead of JSON?

Protobuf is a compact binary format with defined data types. Together with metric aliases, it keeps messages small on narrow links. The trade-off is readability: without a decoder, the payloads cannot be read. Only the STATE message of host applications is JSON.

Which MQTT versions does Sparkplug B support?

Sparkplug 3.0 works with MQTT 3.1.1 and MQTT 5.0 clients and brokers.

What is a birth certificate in Sparkplug?

An NBIRTH or DBIRTH message that an edge node publishes when it connects. It lists every metric with name, data type and current value, so host applications learn the complete data model. A death certificate (NDEATH or DDEATH) signals that the node or device is offline.

Why does Sparkplug B send data with QoS 0?

The specification prescribes QoS 0 for data and command messages. Sequence numbers reveal lost messages, and a rebirth request restores a complete picture. Only the NDEATH registered as Last Will and the STATE messages of host applications use QoS 1.

Is Sparkplug an official standard?

Yes. Sparkplug 3.0 was published in 2023 as the international standard ISO/IEC 20237. The Eclipse Foundation remains the steward of the specification.

What is the current version of Sparkplug?

The current version is Sparkplug 3.0, released in November 2022. Version 4.0 is in development at the Eclipse Foundation.

Planning your Sparkplug or UNS architecture?

Talk to our experts about your data architecture.