MQTT – Introduction

MQTT, or Message Queuing Telemetry Transport is an open source, standard, publish-subscribe base network protocol. The use of the protocol is to transport messages over the network between devices. It is an OASIS and ISO Standard (ISO/IEC PRF 20922). It is designed to be a lightweight, small code footprint and limited network bandwith communication protocol.

There are two entities defined in the protocol: a message Broker (a server) and the Clients (or nodes). The Broker receive the messages from the clients and forward them to the approriate destination. The destination is defined by the path of the message. Think of path as a destination address.

When the clients connect to the broker they Subscribe to Topics (like “hello/world”, “myHome/bedroom/Temperature” or “myHome/bedroom/lamp”.
Multiple clients can join to the same address. The good thing of this Topic Like, Subscribe publish based communication is the instead of we need to know every IP address off the clients in our network (for example every IP adress of the sensors in our home) We only need to set the same Topic for each sensor if we want to communicate with them. The Broker will handle the message forwarding between the clients.

Example of an MQTT message:
Source: WikiPedia

MQTT used wide scale to communicate between network of sensors in a local network or even over the internet.

Useful Links:
List of Public MQTT Brokers
MQTT – QoS, Quality of Service
MQTT – Retained Messages
MQTT – LWAT, Last Will and Testament