MQTT is one of the most commonly used protocols in IoT projects. It stands for Message Queuing Telemetry Transport.
In addition, it is designed as a lightweight messaging protocol that uses publish/subscribe operations to exchange data between clients and the server. Furthermore, its small size, low power usage, minimized data packets and ease of implementation make the protocol ideal of the “machine-to-machine” or “Internet of Things” world.
MQTT is a publish-subscribe-based messaging protocol used in the internet of Things. It works on top of the TCP/IP protocol, and is designed for connections with remote locations where a “small code footprint” is required or the network bandwidth is limited. The goal is to provide a protocol, which is bandwidth-efficient and uses little battery power.
The previous tutorial used HTTP as its transport mechanism between the devices and the IoT Agent. HTTP uses a request/response paradigm where each device connects directly to the IoT Agent. MQTT is different in that publish-subscribe is event-driven and pushes messages to clients. It requires an additional central communication point (known as the MQTT broker) which it is in charge of dispatching all messages between the senders and the rightful receivers. Each client that publishes a message to the broker, includes a topic into the message. The topic is the routing information for the broker. Each client that wants to receive messages subscribes to a certain topic and the broker delivers all messages with the matching topic to the client. Therefore the clients don’t have to know each other, they only communicate over the topic. This architecture enables highly scalable solutions without dependencies between the data producers and the data consumers.
It is a publish or subscribe, extremely simple and lightweight
messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable
networks. The design principles are to minimize network bandwidth and device resource requirements
whilst also trying to ensure reliability and some degree of assurance of delivery. These principles also
turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of
Things” world of connected devices, and for mobile applications where bandwidth and battery power
are at a premium.
MQTT excels in scenarios where reliable message delivery is crucial for an application but a reliable
network connection is not necessarily available. For example, mobile networks. Typical use cases of
• Smart Home
• Energy Monitoring
• Chat Applications
• Notification Services
• Healthcare Applications