MQTT background
MQTT (Message Queuing Telemetry Transport) is a publish/subscribe protocol in which clients exchange messages through a broker. It runs over TCP, and its fixed header can be as small as two bytes, which makes it a common choice for collecting equipment and sensor data.
Standards
Section titled “Standards”These pages explain concepts and cite the standards instead of reproducing them. Section numbers refer to MQTT 5.0 unless a page notes the MQTT 3.1.1 equivalent.
| Standard | Document |
|---|---|
| MQTT 3.1.1 | OASIS Standard, 29 October 2014 (published unchanged as ISO/IEC 20922:2016) |
| MQTT 5.0 | OASIS Standard, 7 March 2019 |
| MQTT mapping of OPC UA PubSub | OPC 10000-14 (OPC UA Part 14) §7.3.4 |
| Mosquitto configuration | Eclipse Mosquitto mosquitto.conf(5) manual page |
Reading order
Section titled “Reading order”| Step | Page | What it covers |
|---|---|---|
| 1 | Publish/subscribe and topics | Brokers, clients, topic names and filters, wildcards, topic design |
| 2 | QoS and retained messages | Packet flows of QoS 0, 1 and 2, message order, retained messages |
| 3 | Sessions, keep alive and Will | Clean Session and Session Expiry, keeping a connection alive, abnormal disconnects |
| 4 | MQTT 5.0 features | Properties, reason codes, topic aliases, user properties, flow control |
| 5 | TLS and authentication | Server authentication, client certificates, user names and passwords, authorization |
| 6 | MQTT in PDComm | Where you use MQTT and how the simulator connects to a broker |
Reference broker
Section titled “Reference broker”The hands-on pages use Eclipse Mosquitto 2.1 as the reference broker.
Mosquitto is an open-source broker that supports MQTT 3.1, 3.1.1 and 5.0.
It ships the mosquitto_pub and mosquitto_sub command-line clients, so you can send and watch traffic yourself.
Any other broker that supports MQTT 5.0 works the same way.
Broker configuration lists what a broker needs.