← Back to the chapter · Next detail →

Technical detail · MQTT QoS Levels

MQTT QoS 0, 1 and 2 packet handshakes

Message Queuing Telemetry Transport (MQTT) quality of service (QoS) defines a delivery promise for each packet exchange. A packet is a unit of data sent on the network. A publisher sends messages, a broker routes them, and a subscriber receives matching messages. A hop is one delivery leg: publisher to broker and broker to subscriber have separate exchanges. A payload is a message’s application content, a packet identifier tracks an unfinished exchange, and session resumption restores saved client exchange state after reconnecting.

Start at Figure 5.1. There is no return packet, so a lost reading stays lost. Now look for the reply in the next flow.

In Figure 5.2, follow the lost PUBACK through session resumption to the repeated PUBLISH. The same packet identifier tracks unfinished work; the receiver may see the payload again.

In Figure 5.3, trace PUBLISH, PUBREC, PUBREL and PUBCOMP. Both peers keep exchange state until completion. That proves this protocol leg, while a controlled valve still needs a separate device reply or state report.

Follow the panels in Figure 5.5 to the device check at the end. For the shut-off valve, keep that boundary in view: a completed broker exchange does not prove a physical response.

Compare Figure 5.6 and Figure 5.7 with the sequences. Keep the valve’s device result separate as you compare these packet flows.

← Back to the chapter · Next detail →