What is new in MQTT 5? Features and Specifications

by Oct 9, 2020MQTT

The Message Queuing Telemetry Transport, popularly known as the MQTT is the best messaging protocol for connecting the Internet of Things devices to the cloud. In 1999, MQTT was initially developed by the engineers for monitoring the oil and gas pipelines via satellite networks. There was a necessity for a protocol to manage the devices from a remote location over a limited network bandwidth. The remarkable information is – there was not a thing called IoT or Cloud Computing at that time. The MQTT is an ISO standard protocol and works top of the TCP/IP. It is a publish-subscribe protocol which needs a message broker. 

MQTT 5 – Die Neuerungen für das IoT-Standardprotokoll - JAXenter
Source: jaxenter

To understand what this publish-subscribe protocol is, imagine you have already subscribed to your favourite You-Tube channel. Every week, the channel delivers a content, when you already subscribed to that channel, you will get a notification on your mobile whenever new content is uploaded. Here, the subscriber is you, and the publisher is your favourite channel. 

Timeline

In 2010 MQTT version 3.1 was released to the public.

In 2014, MQTT 3.1.1 was released by the OASIS Technical Community. The ISO released it in 2016. After five years, MQTT 5 was delivered in March 2019 by the Technical Committee.

Source: HiveMQ

Then MQTT v3.1.1 and now v5.0? Why there is no next release v4.0?

The explanation signifies in the fixed header of the MQTT CONNECT Control Packet. This header carries a singular byte value for the protocol version. If you examine some CONNECT packets on the wire, MQTT 3.1 holds the value “3” as protocol version. Also, for MQTT 3.1.1, the protocol version is “4”. To match the official MQTT version with the protocol version name, the TC had decided to name the latest version as MQTT v5. The new version gets to have the same number for both the protocol version name (0x05) as well as the official version name (MQTT v5).

MQTT v5

MQTT 5 is the most widespread and feature-rich update to the MQTT specification ever. These latest updates mainly help the developers to overcome the complexity in their projects and focus on increasing the productivity and the scalability. The MQTT 5 spec has enhanced the clear choice for most IoT use cases. 

The objective of MQTT 5 Specifications done by the Technical Committee:

  • Progress error reporting
  • Add specialities that long term users want without increasing overhead or decreasing ease of use.
  • Greater flexibility and easier implementation.
  • Shared Subscriptions
  • Negative Acknowledgements
  • Payload Format Indicators
  • User Properties Identifiers
  • Topic Aliases
  • Session and Message Expiry

MQTT v5 is an indispensable update for the messaging protocols available; the standards satisfy all the features required for the modern applications of IoT. 

Features of MQTT v5

These new features particularly befit for applications like cloud computing, reliable error handling to implement mission-critical messaging and seek easier integration of MQTT messages into their existing computing infrastructure. 

Session and Message Expiry

MQTT v5 has an exciting feature which improves the error checking between the client and the broker. This feature is a session and message expiry, which allows the user to set a time limit for each message to send and receive. If the message is not delivered at a certain period, then it is deleted or expired. Suppose the user sets a message delivery point to start a machine at a particular time. In that case, if that message does not deliver at a specific time, it will be automatically deleted, and the machine does not start at all. Due to critical safety systems, there should be no machine start at all.

Session and Message Expiry Intervals - MQTT 5 Essentials Part 4
source: HiveMQ

Negative Acknowledgements

Version 5 also introduced negative acknowledgements, which makes the messages secure for the client. Under predefined restrictions, the message broker can send an acknowledgement to reject particular messages. Those messages can be of maximum payload, maximum QoS (Quality of Service) or any unsupported features. This update can save the client-side from malicious attacks or erroneous activities. 

Shared Subscriptions

Shared Subscription is the other new feature where multiple MQTT clients share the same topic subscriptions from an MQTT broker. This feature makes the system highly scalable and available. The clients share the same subscriptions can deploy from different cloud cluster sensor nodes. This feature is useful when the messages stored in the back-end database and later used for the system integration or statistical analysis.

Topic Alias

Another impressive feature is the topic alias. Imagine you have millions of devices transmitting billions of messages in the system. A very long topic string makes the demands for the network. Topic Alias can implement to replace the string with an integer. Topic Aliases substitute UTF-8 String topic names with an integer. Supporting this feature is an option for both broker and the clients. But, the broker and client which is used should support this new feature.

MQTT v 5.0 New Features Overview
Source: Steve’s Internet Guide

For instance, if the topic name is data/india/southindia/tamilnadu/chennai/ambattur/pudur/box-32543y/junction/damage/power describes the power consumption in a particular junction box in a particular location in India. We can notice that sometimes the size of the topic name is more than that of the payload. So, the topic name can be replaced with a single integer. When you want to send many small messages in real-time with long topic names, the Topic Alias feature helps to increase performance. 

User Properties

The MQTT v5 adds another feature User Properties, which include a key-value property to the message header of an MQTT message. This feature allows you to add the meta-information to the header of the message which is a version number of the component use or the software version of the device that the user from the client-side can use to process the information and perform analysis.

Payload Format Indicators and Content-Type

To process the information or message easier, the payload format indicators and the Content-type have been introduced in this version. It is a binary or text form which adds to the information. The Payload Format Indicator determines whether a payload is an undefined array of bytes or a UTF-8 encoded message. In the case of UTF-8 encoded messages, the sender can use the content type to define the specifics of the payload.

So what does the indicator do? This indicator is any part of the MQTT packet that contains the payload. For example, the control system for a biometric system might send metrics to need to process by image recognition software. At the same time, other messages might require a different style of processing. The indicator is a byte value. A value of 0 symbolises an “unspecified byte stream”. A value of 1 means a “UTF-8 encoded payload”. If neither Payload Format Indicator provides, the default value is 0.

Conclusion

The latest MQTT 5 features favourably address the constraints of MQTT 3 and open the way for coming innovation. Over the following few years, we expect to see enormous growth in MQTT choosing across all industries, including manufacturing, automotive, critical infrastructure, logistics, smart cities, etc. MQTT is on the edge of growing the standard for all IoT.

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

How to use MQTTBox to debug MQTT messages?

How to use MQTTBox to debug MQTT messages?

MQTTBox is a versatile MQTT (Message Queuing Telemetry Transport) client tool that facilitates testing and debugging of MQTT-based applications. MQTT is a lightweight messaging protocol commonly used in IoT (Internet of Things) and other scenarios where low-bandwidth,...

How to enable Mosquitto MQTT over WebSocket on Windows

How to enable Mosquitto MQTT over WebSocket on Windows

WebSocket is one of the communication protocols which provides full duplex communication over a single TCP/IP connection. It uses HTTP as a intial connection establishment. The WebSocket enables the communication from the web browser (client) to the server, in which...

MQTT Mosquitto Broker on Windows via Windows PowerShell

MQTT Mosquitto Broker on Windows via Windows PowerShell

Eclipse Mosquitto is an open-source message broker (EPL/EDL licensed) that supports MQTT versions 5.0, 3.1.1, and 3.1. The MQTT protocol uses a publish/subscribe method to deliver a lightweight messaging method. This makes it outstanding for Internet of Things (IoT)...

How to Install the Mosquitto MQTT Broker on Linux (Ubuntu)?

How to Install the Mosquitto MQTT Broker on Linux (Ubuntu)?

With IoT becoming a leading name in the market, businesses are keen to import it in their strategy. Due to the increasing demand, many people seek to learn the use of Mosquitto MQTT broker Linux to pump up their IoT productivity. Eclipse Mosquitto is an open-source...

How to build an MQTT Server using Raspberry Pi

installing-and-testing-MQTT-on-Raspberry_Pi What is MQTT ? MQTT stands for Message Queuing Telemetry Transport and is a network messaging protocol commonly used for messaging between IoT devices. MQTT is a publish/subscribe protocol that allows edge-of-network devices...

CoAP and MQTT: Analyzing the Best IoT Protocol

CoAP and MQTT: Analyzing the Best IoT Protocol

INTRODUCTION TO CoAP and MQTT CoAP and MQTT are two of the most important and most used IoT protocols nowadays. Both are equally important in machine communication. CoAP is a considerable competitor for MQTT because of the similarities in their use. Yet both have...

Mosquitto MQTT Broker introduction

Mosquitto MQTT Broker introduction

In this tutorial, we will discuss about the intro of Mosquittto MQTT broker. MQTT Broker is responsible for receiving network connections from the client and handling the client’s requests of Subscribe/Unsubscribe and Publish, as well as forwarding the messages...

How to Install the Mosquitto MQTT Broker on Windows?

How to Install the Mosquitto MQTT Broker on Windows?

The Mosquitto or MQTT broker is an OASIS standard messaging protocol for IoT. The inculcation of IoT in modern-day lives has pulled MQTT in the picture. Being a lightweight messaging transport that can remotely connect devices, MQTT tutorials were in much demand. So,...

How to choose an MQTT broker for an IoT project?

How to choose an MQTT broker for an IoT project?

What is MQTT Broker? MQTT stands for Message Queuing Telemetry Transport is an open OASIS and ISO standard lightweight, a publish-subscribe network protocol that transports messages between devices. Basically, MQTT Broker is simply software running on the computer. It...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....