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} on line4/oven/temp cannot 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.0 identifies the Sparkplug B namespace and payload version.
  • group_id groups edge nodes logically — commonly by site, plant area, or business unit (for example plant_ohio or packaging_east).
  • message_type specifies lifecycle and data semantics (detailed below).
  • edge_node_id uniquely 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 TypeDirectionPurposeQoS
NBIRTHEoN → BrokerAnnounces Edge Node online and publishes its complete metric list, types, aliases, and current values0
NDEATHBroker → SubscribersRegistered as the MQTT Last Will & Testament (LWT); published automatically by the broker on abrupt disconnect0 (or 1)
DBIRTHEoN → BrokerAnnounces a downstream device online behind the EoN node with its full tag schema and initial values0
DDEATHEoN → BrokerPublished by the EoN node when a polled downstream PLC/sensor stops responding while the EoN stays connected0
NDATA / DDATAEoN → BrokerReport-by-Exception updates containing only changed metrics (referenced by integer alias to shrink payloads)0
NCMD / DCMDHost → EoNCommand messages from an authorized host application (e.g., write a setpoint or request Node Control/Rebirth)0
STATEHost → BrokerRetained JSON health message (spBv1.0/STATE/{host_id}) announcing whether the Primary Host Application is ONLINE or OFFLINE1 (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:

Engineering diagram of Eclipse Sparkplug B topic hierarchy, NBIRTH and NDEATH Last Will session lifecycle with bdSeq tracking, and bandwidth comparison against polled JSON
Figure 1: Sparkplug B topic hierarchy, state-aware NBIRTH/NDEATH handshake bound to bdSeq, and Report-by-Exception Protobuf bandwidth savings.

  1. Last Will and Testament (NDEATH) bound to bdSeq: Before opening its TCP/TLS session, the EoN node constructs an NDEATH payload carrying a Birth/Death sequence number (bdSeq, 0–255) and registers it with the broker inside the MQTT CONNECT packet. Immediately after connecting, the node publishes NBIRTH with the exact same bdSeq. If the network cable is cut or the gateway loses power, the broker detects the missed MQTT keep-alive and automatically emits NDEATH to every subscriber, which marks all child tags STALE / BAD QUALITY immediately.
  2. Per-message sequence counter (seq): Every NBIRTH, DBIRTH, NDATA, DDATA, and DDEATH increments a rolling seq counter (0–255). If a SCADA host receives seq=42 followed by seq=44, it detects a dropped packet and issues an NCMD with Node Control/Rebirth = true, forcing the edge node to re-publish a fresh NBIRTH/DBIRTH snapshot.
  3. Primary Host Application (STATE): In mission-critical setups, one SCADA or historian acts as the Primary Host Application. Edge nodes subscribe to spBv1.0/STATE/{primary_host_id}. Under Sparkplug 3.0, an edge node waits until STATE reports {"online": true, "timestamp": ...} before issuing NBIRTH, and if the Primary Host goes OFFLINE, 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 NBIRTH or DBIRTH, the edge node assigns a compact integer alias (e.g., alias = 17) to a verbose tag path such as Line03/Extruder/BarrelZone2/TemperaturePV. Subsequent DDATA updates omit the name string completely and transmit only alias: 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 PayloadApprox. 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:

DimensionPlain MQTT (JSON / ISA-95 Topics)Eclipse Sparkplug B (ISO/IEC 20237)OPC UA (Client/Server & PubSub)
Topic StructureFlexible (Enterprise/Site/Area/Line/Cell)Rigid (spBv1.0/group/type/eon/device)Address Space Nodes (not topic-based in C/S)
State & Disconnect AwarenessManual (custom LWT per project)Built-in (NBIRTH/NDEATH, bdSeq, STATE)Built-in session keep-alive & subscriptions
Payload FormatHuman-readable JSONCompact binary ProtobufBinary UA / JSON
UDT / Complex ModelsUnstandardized JSON nestingTemplates & DataSetsRich Companion Specifications (PackML, Euromap)
Best Fit in Plant ArchitectureEnterprise event bus, MES/ERP context, analyticsOT telemetry ingestion from edge gateways, remote RTUs, SCADAMachine-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:

  1. 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.
  2. Restrict NCMD/DCMD ACLs strictly at the broker: A read-only analytics subscriber should only have SUBSCRIBE permission on spBv1.0/+/NBIRTH/#, DBIRTH/#, NDATA/#, DDATA/#, and NDEATH/#. Only authorized SCADA hosts should hold PUBLISH rights on NCMD and DCMD — and disable write-back completely at the edge node when monitoring-only integration is intended.
  3. 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.
  4. 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.
  5. Verify store-and-forward ordering: Confirm your edge node tags buffered records with the is_historical = true flag 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.