ABSTRACT

In recent years, many applications of Internet of Things (IoT) use the internet to monitor, analyse, and control the physical objects. MQTT stands for message queuing telemetry transport. It is lightweight publish-subscribed system where the data can publish or subscribe by MQTT client. It is originally developed by IBM, and it is freely available to the user. MQTT is a simple messaging protocol, is designed based on low bandwidth applications in mind. It is a perfect protocol for IoT devices. This protocol runs over TCP/IP or over other protocol that provides ordered, lossless, bidirectional connections. It uses publish/subscribe message patterns, which provide one to many message distributions and decoupling of applications. The publish/subscribe messages are agnostic to the content of the payload. Various quality of services (QoS) like at most once, at least once, and exactly once are used to receive payload without fail or lost in between by critical IoT devices. The practical implementation of MQTT in IoT application is discussed in this chapter. It is used to reduce transport overhead, protocol exchanges with minimized information, to reduce network traffic, and it includes a mechanism to notify interested parties when an abnormal disconnection occurs. MQTT client and MQTT broker (server) exchange information using messages called as topics. Every sensor is a client and connects to the server or broker over TCP/IP. The client publishes a discrete chunk of data, opaque to the broker. Every message is published to an address, known as the topic. Clients can be subscribed to multiple topics. Every client subscribes to different topics and receives published message with respect to the corresponding topic.