1. MQTT PROTOCOL
PRESENTED BY:
GAJULA MOHAN SAI NITHIN (1BM20EC046)
H RAHUL DEV SHARMA (1BM20EC054)
Department of Electronics and Communication Engineering, Bangalore
BMS College of Engineering
Bull Temple Road, Basavanagudi, Bangalore-560019
(Autonomous college affiliated to Visvesvaraya Technological University, Belgaum)
2. What is MQTT?
MQTT stands for Message Queuing
Telemetry Transport which is functioned as
publish/subscribe, is an extremely simple
and lightweight messaging protocol,
designed for constrained devices and low-
bandwidth, high-latency or unreliable
networks.
3. Features of MQTT
MQTT is a very light weight protocol designed for IoT which supports lots
of features with consistent accuracy.
MQTT is a binary format that requires a minimum bandwidth.
MQTT control packet headers are kept as small as possible.Each MQTT
control packet consists of three parts, a fixed header, variable header and
payload.
4. MQTT Applications
MQTT finds applications in various domains, such as IoT, real-time data
transmission, telemetry, and messaging systems. It is used for remote device
monitoring and control, home automation, asset tracking, energy
management, and smart city implementations. Its lightweight nature and
publish/subscribe model make it suitable for efficient communication
between distributed devices and systems.
5. How does it work?
● It follows publish/subscribe messaging protocol
which allows a message to be published once
and multiple subscribers to receive the message
providing decoupling between the publisher and
subscriber.
● A publisher publishes a message (Publication) in
the Topics.
● The subscribers subscribe to the Topics for
message (publications). A ssage server or Broker
matches publications to subscriptions. If it
found no matches the message will be discanied.
If one or more marches the message the broker
will deliver the message to each subscriber.
6. MQTT Broker
An MQTT broker acts as a go-between for the clients who are sending messages
and the subscribers who are receiving those messages. In a post office analogy,
the broker is the post office itself. All messages have to go through the broker
before they can be delivered to the subscriber.
7. MQTT Message
An MQTT session is divided into four stages:
connection, authentication, communication and
termination.
A client starts by creating a Transmission
Control Protocol/Internet Protocol (TCP/IP)
connection to the broker by using either a
standard port or a custom port defined by the
broker's operators.
When creating the connection, it is important to
recognize that the server might continue an old
session if it is provided with a reused client
identity.
8.
9. Benefits of MQTT
● efficient data transmission and quick to implement, due to its being
a lightweight protocol;
● low network usage, due to minimized data packets;
● efficient distribution of data;
● successful implementation of remote sensing and control;
● fast, efficient message delivery
● uses small amounts of power, which is good for the connected
devices; and
● optimizes network bandwidth.
10. Use cases
● synchronization of sensors, such as fire detectors or motion sensors for
theft detection, to determine if a hazard is valid;
● monitoring health parameters using sensors for patients leaving a
hospital; and
● sensors alerting people of danger.
11. MQTT in IoT
●Smart metering. The MQTT protocol can be used to transmit data with
guaranteed message delivery to provide accurate meter readings in real
time. This helps make billing more accurate.
●Gathering ambient sensor data. Sensors used in remote environments are
often low-power devices, so MQTT is a good fit for IoT sensor buildouts with
lower-priority data transmission needs.
●Machine health data. Ably, which provides a pub/sub messaging platform,
gives the example of a wind turbine requiring "guaranteed delivery of
machine health data to local teams even before that information hits a data
center."
●Billing systems. MQTT helps eliminate duplicate or lost message packets in
billing or invoicing.
12. MQTT
1. MQTT v3.1.1: Lightweight and widely used protocol for constrained
devices and unreliable networks.
2. MQTT v5.0: Enhanced version with improved security, message
properties, shared subscriptions, and request/response messaging.
3. MQTT-SN: MQTT for Sensor Networks, optimized for sensor/actuator
networks using protocols like UDP, Zigbee, or Bluetooth.
4. MQTT over WebSockets: Extension enabling MQTT usage over WebSocket
connections, suitable for web browsers and WebSocket-supported
environments.
13. MQTT v3.1.1
MQTT v3.1.1: MQTT v3.1.1 is a widely adopted lightweight messaging
protocol for IoT and M2M communication. It uses a publish/subscribe model
and supports QoS levels for reliable message delivery. It operates on top of
TCP/IP and is known for its simplicity, low overhead, and efficient data
transmission.
14. MQTT-SN
MQTT-SN: MQTT-SN (MQTT for Sensor Networks) is a variation of MQTT
designed for resource-constrained devices in sensor networks. It uses a
different transport layer and is optimized for low-power, lossy networks.
MQTT-SN allows devices to connect to MQTT brokers over various network
protocols, including UDP, Zigbee, and LoRaWAN.
15. MQTT over WebSockets
MQTT over WebSockets: MQTT over WebSockets is a protocol that enables
MQTT communication over the WebSocket protocol. It allows MQTT clients
to establish bidirectional communication with MQTT brokers using standard
WebSocket connections. This allows MQTT to be used in web applications,
enabling browser-based clients to communicate with MQTT brokers without
the need for additional plugins or libraries.
16. MQTT v5.0
MQTT v5.0: MQTT v5.0 is the latest version of the MQTT protocol. It
introduces advanced features like message properties, enhanced
authentication mechanisms, shared subscriptions, and improved error
handling. It provides more flexibility and control over MQTT communication,
making it suitable for complex IoT scenarios and applications.
17. Drawbacks of MQTT
● MQTT has slower transmit cycles compared to Constrained Application
Protocol (CoAP).
● MQTT's resource discovery works on a flexible topic subscription,
whereas CoAP uses a stable resource discovery system.
● MQTT is unencrypted. Instead, it uses TLS/SSL (Transport Layer
Security/Secure Sockets Layer) for security encryption.
● It is difficult to create a globally scalable MQTT network.
● Other MQTT challenges relate to security, interoperability and
authentication.
18. conclusion
MQTT provides a lot of functions for the internet of Things. It can help in
providing a great performance and create new areas for messaging and can
handle billions of things connected through the internet. It is a very light
weight protocol that can work with every type of device and won using a
minimum bandwidth. Nowadays facebook.com is using MQTT protocol for
their messenger which is working great in our messaging in social
networks.
19. References
[1] https://www.techtarget.com/iotagenda/definition/MQTT-MQ-Telemetry-Transport
[2] https://www.javatpoint.com/mqtt-protocol
[3] A. R. Alkhafaji; Abbas M. Ali Al-Muqarm; Ali H. Alwan; Zaid Rajih Mohammed
“Security and Performance Analysis of MQTT Protocol with TLS in IoT Networks” 22
september 2021
[4] N. Naik, "Choice of effective messaging protocols for IoT systems: MQTT CoAP AMQP
and HTTP", Proc. IEEE Int. Syst. Eng. Symp. (ISSE), pp. 1-7, Oct. 2017.
[5] T. Yokotani and Y. Sasaki, "Comparison with HTTP and MQTT on required network
resources for IoT", Proc. Int. Conf. Control Electron. Renew. Energy Commun. (ICCEREC),
pp. 1-6, Sep. 2016.
[6]A. Niruntasukrat, C. Issariyapat, P. Pongpaibool, K. Meesublak, P. Aiumsupucgul and
A. Panya, "Authorization mechanism for MQTT-based Internet of Things", Proc. IEEE Int.
Conf. Commun. Workshops (ICC), pp. 290-295, May 2016.