Menu

MQTT

Protocol overview for MQTT covering publish and subscribe messaging, broker requirements, TLS handling, and telemetry integration design.

Categories:

What MQTT Is

MQTT is a lightweight publish and subscribe messaging protocol designed for low-overhead telemetry between clients and brokers. Its practical value is decoupled data distribution: one gateway can publish operational data once while multiple subscribers consume it without polling the original device directly.

MQTT is common in industrial Internet of Things (IIoT), edge-to-cloud telemetry, supervisory dashboards, and remote monitoring systems where many consumers need the same data stream. It is especially useful when the destination is a broker-centric platform rather than a traditional master polling network.

For field-level diagnostic workflow, use the MQTT Troubleshooting Guide.

Block diagram showing field systems feeding a Chipkin QuickServer that publishes normalized data to an MQTT broker and downstream consumers.

See QuickServer for MQTT publishing and protocol conversion options

History

MQTT was designed as a lightweight messaging protocol for constrained or distributed telemetry systems that needed efficient publish-and-subscribe behavior instead of repeated polling. That design made it attractive well beyond its original niche, especially once broker and cloud platforms started using MQTT as a standard ingestion layer.

In practice, the protocol is simple, but production MQTT projects still become engineering-heavy because TLS, identity, and topic-contract requirements live outside the core publish verb.

Core Concepts

MQTT integrations rely on a few core ideas:

  • Broker model: MQTT traffic flows through a broker, not directly between field devices and applications.
  • Topic hierarchy: topic names and wildcard subscriptions are the protocol’s routing model.
  • Publisher and subscriber roles: one client can publish, subscribe, or do both depending on the workflow.
  • QoS behavior: delivery level 0, 1, or 2 changes overhead, duplicate-handling expectations, and delivery assurance.
  • Retained and session state: retained messages, last-will behavior, and persistent sessions affect what a client sees after reconnect.
  • Transport and security defaults: MQTT commonly runs over TCP port 1883 or over TLS on port 8883, with broker-specific authentication layered on top.

Most MQTT failures are edge and security problems, not raw publish mechanics.

MQTT-Specific Information

MQTT defines two main network roles: clients and brokers. A broker receives messages from publishing clients and routes them to any clients that subscribed to matching topics. Clients do not communicate directly with each other, which is what makes MQTT useful when many systems need the same telemetry.

Key Components

ComponentWhat It DoesWhy It Matters
BrokerAccepts client connections, stores session state, and routes messages by topicIt is the hub of the system and the first place to validate endpoint, auth, and TLS settings
PublisherSends data to the broker on a specific topicA publisher only needs to know the broker and topic contract, not the downstream subscribers
SubscriberRegisters interest in one or more topics and receives matching messagesSubscribers depend on clean topic hierarchy and payload consistency
TopicHierarchical subject string used to route messagesTopic design is the protocol’s addressing model, so bad topic design creates long-term integration debt
QoSDelivery guarantee level between client and brokerThe wrong QoS level can create either data loss risk or unnecessary overhead
Retained messageLast stored value for a topicNew subscribers can receive the current state immediately instead of waiting for the next publish

Publisher, Subscriber, and Broker Workflow

An MQTT publisher opens a TCP connection to a broker, authenticates if required, and publishes payloads to a topic such as building/chiller-1/supply-temp. The broker then forwards that payload to every subscriber whose topic filter matches. A subscriber does not need to know who published the value, and the publisher does not need to know how many subscribers exist.

That decoupling is the protocol’s core advantage. It lets one telemetry producer serve many consumers without every consumer polling the original field device.

Packet Flow and Delivery Semantics

StepNative Protocol BehaviorWhy It Matters
ConnectClient opens a session to the broker and negotiates auth, keepalive, and session behaviorConnection policy often fails before any payload is exchanged
SubscribeSubscriber registers topic filters such as building/+/alarm/#Wildcards determine how much data the consumer receives
PublishPublisher sends payload, topic, retain flag, and QoS levelA valid connection can still produce unusable data if topic or payload design is wrong
AcknowledgeBroker and client exchange acknowledgements for higher QoS levelsDuplicate handling and latency expectations change with QoS
Disconnect or failoverBroker may publish a Last Will and Testament if a client drops unexpectedlyUseful for supervisory health monitoring and stale-connection detection

Topic and Broker Design

AreaWhy It MattersCommon Failure Mode
Topic hierarchyControls how downstream systems subscribe and parse dataGateway publishes data, but consumers cannot use it cleanly
TLS and certificate handlingDetermines whether the broker session can even startConnection fails before the first publish
Authentication modeChanges how the gateway must identify itselfUsername/password is assumed where certificates or tokens are required
Payload conventionControls downstream parsing and semanticsTopic path is correct, but the payload contract is wrong

Delivery and Session Behavior

FeatureTypical ChoicesWhy It Matters
QoS0, 1, 2Trades delivery assurance against protocol overhead
Retained messagesEnabled or disabled per publishHelps late subscribers receive current state immediately
Last Will and TestamentConfigured or not configuredAllows the broker to signal unexpected client disconnects
Persistent sessionsClean session or stored session stateAffects how subscriptions and queued messages survive reconnects

Common Variants

VariantWhere It FitsWhy It Matters
MQTTGeneral broker communicationCommon for on-premises and lab workflows
MQTT over TLSSecure broker communication, often on port 8883Same protocol, but with transport security and certificate requirements
Sparkplug BIndustrial topic and payload conventionsRelevant when SCADA or IIoT consumers expect a stricter contract

How To Get The Points List

For MQTT, the points list is really a topic and payload design. Point lists usually come from the source-point map and the required topic contract, then get validated against a live broker session.

Preferred sources:

  • Topic namespace specification
  • Payload schema or Sparkplug B definition
  • Source protocol point list mapped to publish topics
  • Existing broker sample used only to validate the contract

Common Integration Targets

  • BACnet when building-system data needs broker or cloud publishing
  • Modbus when meter and controller telemetry needs to be pushed upstream
  • SNMP when infrastructure telemetry is aggregated alongside building or controller data

Tools & Diagnostics

ToolTypeDescription
QuickServerGatewayUse when normalizing field-protocol data into MQTT topics for supervisory, cloud, or multi-consumer workflows
FieldServer ToolboxGateway diagnosticsUseful for separating source-protocol mapping issues from broker-session issues
MQTT ExplorerClientUseful for topic browsing and retained-message inspection
MosquittoBroker and CLIUseful for testing connections and publish and subscribe behavior
MQTTXClientUseful for cross-platform connection validation

Devices that Support MQTT

QuickServer is Chipkin’s primary gateway for publishing field-protocol data into MQTT and MQTT-adjacent broker environments.

Representative broker and consumer environments include:

EnvironmentTypical Role
Mosquitto and HiveMQ brokersLab validation, on-premises broker infrastructure, and local supervisory pipelines
Ignition and Sparkplug B ecosystemsIndustrial telemetry distribution and SCADA-adjacent consumers
AWS IoT Core and Azure IoT HubCloud ingestion layers with tighter auth and certificate requirements
Teltonika RUT and similar edge gatewaysRemote telemetry aggregation and WAN-published field data

Frequently Asked Questions

Why do MQTT TLS connections fail so often?

Because many failures come from certificate formatting, incomplete CA chains, expired certificates, or broker hostname mismatches rather than from the MQTT message flow itself.

What is the difference between a publisher and a subscriber?

A publisher sends data to a topic on the broker. A subscriber registers interest in one or more topics and receives matching messages from the broker.

Does MQTT require every device to know every other device?

No. Clients only need to know how to reach the broker and which topics to use.

When should MQTT be used instead of polling devices directly?

When multiple consumers need the same telemetry, when the destination is broker or cloud based, or when the gateway should push changes instead of having every consumer poll the source.

What is the first production question on an MQTT project?

Which broker or cloud platform is actually being targeted. That answer usually determines TLS, auth, topic rules, and payload expectations immediately.

Reference Documents

Protocol Logo Attribution

Credit: OASIS via Wikimedia Commons

Source: https://commons.wikimedia.org/wiki/File:Mqtt-hor.svg

License: Public domain text logo; may still be subject to trademark restrictions. (details)