Standard MQTT (version 3.1.1 and 5.0) was built as a minimalist publish-subscribe transport, not an industrial data model. That simplicity is a gift for constrained networks, but on a factory floor it immediately creates three integration headaches: every integrator invents a different topic hierarchy, payloads devolve into ad-hoc JSON blobs with inconsistent timestamps and types, and downstream SCADA or analytics clients have no reliable way to tell whether a quiet sensor is simply unchanged or physically powered off.
Eclipse Sparkplug B — standardized as ISO/IEC 20237 with the Sparkplug 3.0 specification — solves these exact problems without abandoning standard MQTT brokers. It defines an interoperable topic namespace, a compact binary payload encoding based on Google Protocol Buffers, and strict state-aware session semantics built around Birth and Death certificates.
Why plain MQTT breaks down in plant-wide OT deployments
Engineers evaluating OPC UA vs MQTT quickly notice that MQTT decouples producers from consumers through a broker, eliminating brittle point-to-point polling. Yet unconstrained MQTT deployments regularly fail when scaled beyond a single pilot line:
- No self-describing tag discovery: A subscriber receiving
{"t": 72.4}online4/oven/tempcannot tell the engineering unit, data type (Float vs Int32), scaling factor, or whether more tags exist on that PLC until someone shares a spreadsheet. - Ambiguous silence: Because MQTT works best with Report by Exception (RBE) — publishing only when values change — an hour of silence on a tank-level topic could mean steady operation or a severed Ethernet cable.
- No authoritative state synchronization: If an industrial edge gateway drops offline and reconnects while a primary SCADA server is rebooting, stale retained messages can overwrite live operational state.
Sparkplug B overlays a strict contract on top of standard MQTT 3.1.1 (and optionally MQTT 5.0) brokers so any compliant edge node, SCADA server, historian, or cloud consumer can interoperate out of the box.
The Sparkplug B topic namespace and message types
Every Sparkplug B message follows a fixed five-segment topic structure:
spBv1.0/{group_id}/{message_type}/{edge_node_id}[/{device_id}]
Each segment carries an explicit architectural role:
spBv1.0identifies the Sparkplug B namespace and payload version.group_idgroups edge nodes logically — commonly by site, plant area, or business unit (for exampleplant_ohioorpackaging_east).message_typespecifies lifecycle and data semantics (detailed below).edge_node_iduniquely identifies an Edge of Network (EoN) Node — typically an edge gateway, PLC with native Sparkplug firmware, or IPC running a protocol bridge.device_id(optional) identifies a physical or logical downstream asset connected behind the EoN node, such as a serial Modbus flow meter or a legacy PLC polled over Ethernet.
| Message Type | Direction | Purpose | QoS |
|---|---|---|---|
NBIRTH | EoN → Broker | Announces Edge Node online and publishes its complete metric list, types, aliases, and current values | 0 |
NDEATH | Broker → Subscribers | Registered as the MQTT Last Will & Testament (LWT); published automatically by the broker on abrupt disconnect | 0 (or 1) |
DBIRTH | EoN → Broker | Announces a downstream device online behind the EoN node with its full tag schema and initial values | 0 |
DDEATH | EoN → Broker | Published by the EoN node when a polled downstream PLC/sensor stops responding while the EoN stays connected | 0 |
NDATA / DDATA | EoN → Broker | Report-by-Exception updates containing only changed metrics (referenced by integer alias to shrink payloads) | 0 |
NCMD / DCMD | Host → EoN | Command messages from an authorized host application (e.g., write a setpoint or request Node Control/Rebirth) | 0 |
STATE | Host → Broker | Retained JSON health message (spBv1.0/STATE/{host_id}) announcing whether the Primary Host Application is ONLINE or OFFLINE | 1 (Retained) |
Notice an important detail that often surprises newcomers: Sparkplug explicitly prohibits the MQTT Retain flag on data and birth/death topics (NBIRTH, NDATA, DBIRTH, DDATA). Only the host STATE topic uses MQTT retained delivery. Why? Because stale retained tag values from days ago are dangerous in industrial control; instead, fresh state is guaranteed through controlled Rebirth handshakes.
State management: NBIRTH, NDEATH, bdSeq and Primary Host
Sparkplug B turns stateless MQTT into a continuously state-aware industrial bus using three interlocking mechanisms:

- Last Will and Testament (
NDEATH) bound tobdSeq: Before opening its TCP/TLS session, the EoN node constructs anNDEATHpayload carrying a Birth/Death sequence number (bdSeq, 0–255) and registers it with the broker inside the MQTTCONNECTpacket. Immediately after connecting, the node publishesNBIRTHwith the exact samebdSeq. If the network cable is cut or the gateway loses power, the broker detects the missed MQTT keep-alive and automatically emitsNDEATHto every subscriber, which marks all child tags STALE / BAD QUALITY immediately. - Per-message sequence counter (
seq): EveryNBIRTH,DBIRTH,NDATA,DDATA, andDDEATHincrements a rollingseqcounter (0–255). If a SCADA host receivesseq=42followed byseq=44, it detects a dropped packet and issues anNCMDwithNode Control/Rebirth = true, forcing the edge node to re-publish a freshNBIRTH/DBIRTHsnapshot. - Primary Host Application (
STATE): In mission-critical setups, one SCADA or historian acts as the Primary Host Application. Edge nodes subscribe tospBv1.0/STATE/{primary_host_id}. Under Sparkplug 3.0, an edge node waits untilSTATEreports{"online": true, "timestamp": ...}before issuingNBIRTH, and if the Primary Host goesOFFLINE, edge nodes can buffer telemetry locally in store-and-forward queues until the host returns online — ensuring zero data loss during SCADA maintenance windows.
Protobuf payloads, metric aliases and Report by Exception bandwidth
Where raw JSON repeats tag names, keys, braces, and ASCII digits on every message, Sparkplug B serializes payloads with Google Protocol Buffers (Payload). Each payload carries a UTC millisecond timestamp, seq, and an array of strongly typed Metric objects supporting Int8–Int64, UInt8–UInt64, Float, Double, Boolean, String, DateTime, DataSet (tabular structures), and reusable Template (UDT) definitions.
Two features dramatically reduce cellular, satellite, and WAN bandwidth consumption:
- Integer metric aliases: During
NBIRTHorDBIRTH, the edge node assigns a compact integeralias(e.g.,alias = 17) to a verbose tag path such asLine03/Extruder/BarrelZone2/TemperaturePV. SubsequentDDATAupdates omit the name string completely and transmit onlyalias: 17, a 64-bit millisecond timestamp, and a 4-byte IEEE 754 float. - Report by Exception (RBE) with deadband filtering: Instead of polling and transmitting 500 tags every second (500 values/sec even when a line is idle), the edge node samples the PLC locally and publishes only metrics that changed beyond a configured absolute or percentage deadband.
| Transmission Pattern (500 Tags, 1 s Scan) | Typical Wire Payload | Approx. Monthly WAN Data (per Node) |
|---|---|---|
| Poll-all JSON over MQTT (every 1 s) | ~28 KB/s uncompressed | ~72 GB / month |
| Sparkplug B RBE (10% tags change/s, full names) | ~2.4 KB/s | ~6.2 GB / month |
| Sparkplug B RBE + Integer Aliases (10% change/s) | ~0.9 KB/s | ~2.3 GB / month |
Across remote pump stations, oilfields, and distributed cold-storage plants running on LTE/5G links, switching from polled JSON or Modbus-over-VPN to aliased Sparkplug B routinely cuts cellular data traffic by 85% to 95% while preserving sub-second change visibility.
Sparkplug B vs. plain MQTT JSON vs. OPC UA in a Unified Namespace
Architects building a Unified Namespace (UNS) often ask whether Sparkplug B replaces ISA-95 topic trees or OPC UA entirely. In practice, each technology fits a distinct layer:
| Dimension | Plain MQTT (JSON / ISA-95 Topics) | Eclipse Sparkplug B (ISO/IEC 20237) | OPC UA (Client/Server & PubSub) |
|---|---|---|---|
| Topic Structure | Flexible (Enterprise/Site/Area/Line/Cell) | Rigid (spBv1.0/group/type/eon/device) | Address Space Nodes (not topic-based in C/S) |
| State & Disconnect Awareness | Manual (custom LWT per project) | Built-in (NBIRTH/NDEATH, bdSeq, STATE) | Built-in session keep-alive & subscriptions |
| Payload Format | Human-readable JSON | Compact binary Protobuf | Binary UA / JSON |
| UDT / Complex Models | Unstandardized JSON nesting | Templates & DataSets | Rich Companion Specifications (PackML, Euromap) |
| Best Fit in Plant Architecture | Enterprise event bus, MES/ERP context, analytics | OT telemetry ingestion from edge gateways, remote RTUs, SCADA | Machine-to-machine, high-context PLC/OEM interfaces |
Because Sparkplug's rigid spBv1.0/{group_id}/{message_type}/{edge_node_id}/{device_id} topic path cannot directly encode a five-level ISA-95 hierarchy at the topic level, mature UNS implementations follow a two-tier convention: ingest raw OT tags reliably via Sparkplug B at the edge (gaining automatic discovery, birth/death quality, and store-and-forward), and place deep ISA-95 path context inside metric folder names (Area1/Packaging/Filler02/SpeedRPM) or enrich streams into an ISA-95 enterprise namespace inside the broker/historian tier.
Edge deployment and OT cybersecurity checklist
Deploying Sparkplug B across production networks requires careful attention to broker resilience and IEC 62443 OT cybersecurity:
- Always enforce TLS 1.2/1.3 (port 8883) with mutual certificates or per-node credentials: Never run cleartext MQTT on port 1883 outside an isolated lab bench. Issue unique client certificates per EoN node so revoking a compromised gateway never disrupts the rest of the plant.
- Restrict
NCMD/DCMDACLs strictly at the broker: A read-only analytics subscriber should only haveSUBSCRIBEpermission onspBv1.0/+/NBIRTH/#,DBIRTH/#,NDATA/#,DDATA/#, andNDEATH/#. Only authorized SCADA hosts should holdPUBLISHrights onNCMDandDCMD— and disable write-back completely at the edge node when monitoring-only integration is intended. - Separate Sparkplug brokers across zones via bridging: Place a local OT broker inside the control or DMZ zone so local SCADA keeps running if WAN connectivity drops, and bridge outbound-only TLS streams to enterprise/cloud brokers.
- Right-size MQTT Keep-Alive and deadbands: Setting Keep-Alive too short (e.g., 5 seconds) over cellular links triggers spurious
NDEATH/Rebirth storms; 30–60 seconds is typical for WAN links and 10–15 seconds for plant LANs. Apply realistic deadbands to noisy analog signals (4–20 mA pressure or vibration transmitters) so quantization jitter does not defeat Report by Exception. - Verify store-and-forward ordering: Confirm your edge node tags buffered records with the
is_historical = trueflag inside Sparkplug metrics when draining offline queues, so real-time SCADA displays and alarm management engines do not fire false real-time alarms on hours-old catch-up data.



