Category Archives: MQTT Protocol

MQTT is a lightweight, publish/subscribe messaging protocol designed to move small amounts of data efficiently across networks where bandwidth is scarce, latency varies, and connections are unreliable. Invented in 1999 by Andy Stanford-Clark and Arlen Nipper for connecting remote sensors over satellite links, it has since become an OASIS and ISO/IEC standard and one of the most widely used protocols in the Internet of Things.
This category is a complete technical reference for the MQTT protocol. The articles explain how MQTT actually works rather than just what it does: the decoupled publish/subscribe model and the role of the broker, the binary packet format and its 15 control packet types, topic structure and wildcards, and the three Quality of Service levels that guarantee delivery over unreliable transports. They also cover the session and reliability mechanisms (persistent sessions, retained messages, Last Will and Testament, and keep alive) and the protocol’s security layers.
A dedicated set of articles covers MQTT 5, the current version, including user properties, session and message expiry, shared subscriptions, topic aliases, the request/response pattern, flow control, and enhanced authentication.

MQTT Retained Messages Explained: Last Known Value

In MQTT, a publishing client has no guarantee that a subscribing client will actually receive its message, because pub/sub decouples them. The publisher’s only guarantee is that the message arrives at the broker; from there, delivery to subscribers depends on who is currently subscribed. Similarly, a client that has just connected and subscribed has no guarantee about when… Read More: MQTT Retained Messages Explained: Last Known Value »

MQTT Persistent Sessions & Message Queuing Explained

MQTT does not behave like a classical message queue, but under specific conditions it can queue messages for clients. That capability is one of the protocol’s most important reliability features for devices on unreliable networks, and it depends entirely on a concept called the persistent session. Understanding when a session is persistent, what the broker stores in it,… Read More: MQTT Persistent Sessions & Message Queuing Explained »

MQTT Topics and Wildcards Explained

Topics are how MQTT decides which client receives which message. Because MQTT uses topic-based filtering (sometimes called subject-based filtering), the topic attached to every message is the entire basis for routing: the broker matches published topics against the topic filters that clients have subscribed to, and delivers accordingly. One distinction is worth fixing in your mind from the… Read More: MQTT Topics and Wildcards Explained »

MQTT Publish, Subscribe & Unsubscribe: Packets Explained

Once a client has connected to a broker, almost everything it does comes down to three operations: publishing messages, subscribing to topics, and unsubscribing from them. Each operation has its own control packet, and most are confirmed by an acknowledgement packet from the broker. Understanding the fields these packets carry, and the acknowledgements they trigger, is what lets… Read More: MQTT Publish, Subscribe & Unsubscribe: Packets Explained »