Sparkplug B in one page
The topic namespace, birth certificates, and state awareness that turn MQTT from a transport into a plug-and-play OT data fabric.
MQTT gives you a broker and a topic tree. It says nothing about what topics should exist, what payloads mean, or whether a device is alive. Every project answers those questions differently, and that is why two factories running "MQTT" often cannot exchange a single tag without custom integration work.
Sparkplug B is the missing contract. Maintained as an Eclipse specification, it defines three things on top of MQTT: a topic namespace, a payload definition, and a session-state mechanism. Adopt all three and any compliant edge node can appear on the broker, describe itself, stream data, and disappear cleanly — with any compliant host application picking it up without per-device configuration.
The namespace
Every Sparkplug message lives under a structured topic:
spBv1.0 / <group> / <message_type> / <edge_node> [/<device>]
- group organizes nodes logically: a line, cell, or site.
- message_type is one of a fixed set: birth (
NBIRTH,DBIRTH), death (NDEATH,DDEATH), data (NDATA,DDATA), and commands (NCMD,DCMD). - edge_node is the gateway or device managing the MQTT session; device is an optional downstream asset behind it (a PLC, drive, or sensor cluster hanging off one gateway).
Because the structure is fixed, a host application can subscribe with wildcards and learn the whole fleet from the topic stream alone.
Birth and death certificates
State awareness is Sparkplug's core trick, and it rests on two MQTT features: retained messages and Last Will and Testament.
When an edge node connects, it publishes an NBIRTH message listing every metric it will ever send — names, datatypes, engineering units, and current values. The broker stores this as a retained message, so any host that subscribes later immediately receives the node's full self-description. Devices behind the node do the same with DBIRTH.
When the node connects, it also registers a will message: NDEATH. If the TCP session drops for any reason, the broker publishes the death certificate on the node's behalf. Nobody polls for health; liveness is a property of the session. The node's metrics carry a quality flag, and on death the host marks everything from that node stale.
This is what "report by exception with full state on birth" means in practice: birth gives the complete picture, data messages carry only what changed, and death invalidates it all. Bandwidth stays low and state stays unambiguous.
The payload
Sparkplug B payloads are Google Protocol Buffers with a fixed schema: a timestamp, a list of metrics (name, datatype, value, quality, timestamp), and optional properties and template definitions. B distinguishes this binary encoding from Sparkplug A (now deprecated), which used a different payload format.
Templates deserve a mention: a birth message can define reusable metric templates (say, "Motor" with current, temperature, and vibration), and devices then instantiate them. Consumers that understand templates get structured objects; consumers that don't still see flat metric names.
Commands and the host application
Traffic is bidirectional. The host application — SCADA, historian, MES connector, or UNS consumer — subscribes to birth, data, and death traffic and publishes command messages (NCMD/DCMD) back through the broker. A primary-host mechanism lets edge nodes know whether their designated host is online, so they can buffer (store and forward) instead of publishing into the void.
Note what Sparkplug deliberately does not do: it does not browse, it does not model relationships between assets, and it does not replace request/response reads of individual registers. For that, pair it with something like OPC UA or keep the device's native protocol below the edge node. Sparkplug owns the edge-to-enterprise path: one namespace, many producers, many consumers.
When to use it
Sparkplug B fits when you have many data producers, many consumers, unreliable networks, and a mandate to stop writing point-to-point integrations. It is weakest as a device-configuration protocol and as a deterministic control bus — it rides TCP through a broker, so it will never be EtherCAT.
If you remember one sentence: MQTT moves bytes; Sparkplug defines what the bytes mean and who is alive to send them.
Cite this page: Sparkplug B in one page
, Shopfloor, 2026-09-21. https://shopfloor.space/articles/sparkplug-b-in-one-page/