Back to blog Back to blog

Getting to Know MQTT - Key IIoT Protocol

Getting to Know MQTT - Key IIoT Protocol

Do you know why MQTT is one of the top IIoT protocols? Read on.

Although MQTT has been kicking around for around 20 years now, its prevalence is now increasing as IoT takes hold. As a matter of fact, it’s quickly becoming the most preferred IIoT protocol for connecting devices to the cloud - even the biggest cloud vendors expose their IoT PaaS through MQTT.

But where does its strength lie? What makes it age so well?

This article is a deep-dive into MQTT, its history, how it works, and its future. But, most importantly, it answers the question WHY it’s taking the IIoT world by storm.

A Background Story on MQTT

MQTT (Message Queuing Telemetry Transport) is a publish-subscribe messaging protocol. It is designed specifically for restricted (low-bandwidth) and wireless networks with varying levels of latency and unreliable connections, as well as for IIoT devices with extremely high latency. These are just some of the things that make MQTT an ideal protocol to meet the demands of industrial control systems, that is, IIoT.

It was originally invented and developed in 1999 by Andy Stanford-Clark and Cirrus Link’s Arlen Nipper. They wanted to enable pipelines on the oil and gas industry to communicate with SCADA systems, which, at the time, were not able to communicate with each other. By leveraging MQTT capabilities, they managed to overcome inter-communication problems. As a result, the protocol was lightweight, data-agnostic, bandwidth-efficient and very simple to implement — a de-facto protocol for low-power devices and the ones with the limited battery lives including an ever-increasing number of connected devices (like smartphones).

For example, Facebook uses MQTT not only because it saves battery, but also because it allows messages to be delivered in milliseconds even if the Internet connections are bad or inconsistent globally.

Before the invention of MQTT, around 80% of data was being left at remote locations, even though it could have been leveraged by businesses to make smarter decisions. MQTT’s lightweightedness and efficiency make it ideal for connecting remote devices with minimal network bandwidth and small code footprint allowing users to significantly increase the amount of data being monitored or controlled. This is what businesses recognised as the biggest value MQTT could bring to the IIoT environment.

How It Works

Before we dive deeper into how MQTT benefits IIoT, let’s first understand its terminology. A communication system built on MQTT includes a publishing server, a broker and one or more clients.


Broker - A software that receives all the messages from the publishing clients and sends them to the subscribing clients.

Client - Any IoT sensor in the field or an application in a data centre that processes data and can interact with the broker over a network.

Topic - An endpoint, a well-known location to which the clients connect. It’s created once either of the clients establishes a connection with the broker. For instance, building1/room1/temperature and building1/room1/humidity are valid topic names.

Connection - MQTT runs on TCP/IP to ensure that all the data communication between devices is reliable, encrypted and secure.

Publish/Subscribe Model

In a nutshell, the protocol uses a publish-subscribe pattern which includes the following steps:

  1. The publisher client connects to the broker. It can subscribe to any message “topic” in the broker.
  2. The publisher client creates the messages and publishes them to a certain topic by sending the message and the topic to the broker.
  3. The broker then forwards the message to the subscriber clients which have subscribed to that topic.

The publisher and the subscriber do not know anything about each other. The MQTT broker plays the role of a “traffic cop” which directs the messages from a publisher to a subscriber. Each device can subscribe, or register, to particular topics. Once another client publishes a message on a subscribed topic, the broker forwards the message to any client that has subscribed. Also, the broker buffers messages sent during the connection laps and pushes them out to subscribers when they are back online. What’s more, an application developer has the freedom to specify which clients can only interact with certain messages. The number of publishers and subscribers can be unlimited. This way, it makes it super easy to establish communication between multiple devices.

MQTT enables the creation of a communication channel hierarchy - something that resembles a branch with leaves.


MQTT Publish/Subscribe Architecture


MQTT in IIoT

Traditional industrial automation platforms have included programmable logic controllers (PLCs) and human-machine interfaces (HMIs) connected using various networking and fieldbus communication methods. Larger combinations of PLCs and HMIs are called supervisory control and data acquisition (SCADA) systems. They are designed to control, monitor and analyse industrial processes and deliver around-the-clock reliability and on-site visibility.

However, easy and secure integration and communication were much less of consideration.

Today, many industrial protocols have matured to work well for on-site automation system communications such as EtherNet/IP and Modbus TCP, or have been developed over the past few years, like OPC UA. However, they have been less suited to deliver a good IIoT experience for IT, cloud and mobile networking systems.

First, these protocols typically require a rigorous configuration and hierarchy to move data from a field sensor to a field controller, to a site network, to a PC data server and then to the cloud. The resulting multi-layered architecture means these types of implementations can be complicated and expensive to create and manage. Furthermore, they impose some limitations such as lack of interoperability - even common industrial protocols, like Modbus TCP/IP or EtherNet/IP have limited compatibility with IT systems, where data is in the highest demand, and require additional software and hardware support for integration. Also, the more the network grows, the more congested it becomes. These protocols send frequent requests for information over and over again, thus creating security issues for which traditional industrial protocols and equipment, like PLCs, lack native support. Unfortunately, with so many different protocols in use large-scale integration can be impeded. Plus, these communication systems cannot maintain themselves.

MQTT has risen to prominence for addressing these issues.

With IIoT applications disrupting industries on a grand scale, MQTT has been recognised as an open, scalable and straightforward way to strike the right balance for IIoT developers.

What makes MQTT different? Efficiency.

With its publisher/subscriber architecture that includes only three roles (publisher, broker and subscriber), it provides many features to meet the needs of IIoT users. It is a lightweight and flexible protocol that makes the interaction between devices efficient regardless of their number.

MQTT achieves this efficiency using a radically different communication model from other IIoT protocols. Instead of establishing multiple one-to-one connections between master applications and slave devices, and then polling those devices repeatedly for information, MQTT establishes a shared server, a broker, as the endpoint for all applications and field devices. Its publish-subscribe communication model allows for many-to-many, reliable communication with reduced network traffic overall, making MQTT the kind of protocol that plant engineers are looking for.

Also, it is more secure than other protocols. Since the MQTT broker is the single node in charge of routing all traffic, data access rights for the entire network can be managed in one location. Also, it is supported by SSL/TLS encryption, which means its traffic can be safely routed over public networks. In fact, MQTT is the standard for all the major cloud IoT platforms.

Put simply, MQTT fits well into the concept of IIoT system where devices communicate with each other. These may be field devices which simply publish data or more complex devices like PLCs which need to publish and subscribe to data.

But, let’s further examine why MQTT is such a great fit for IIoT developers.

Why MQTT

Here are some of the features that make MQTT a leading protocol in solving the pain points in the process of building IIoT projects:


Lightweight and efficient


MQTT clients are very small, require minimal resources so can be used on small microcontrollers. All MQTT messages have a small code footprint leading to more efficient communications. Unlike the network traffic associated with typical business computing which is relatively large, industrial data packets are most often small and may change frequently. MQTT consumes little communication message overhead and is suitable for these types of small data payloads. In other words, it is optimized to communicate (and use bandwidth) only when needed.

Being lightweight, MQTT can be implemented on both high-latency/limited bandwidth networks and on a heavily constrained device hardware.


Simple and easy to implement


MQTT is designed to be simple, easier to implement and less expensive than traditional SCADA methods. A wide variety of hardware platforms, including very small devices, can be easily added and auto-discovered. Developers can follow the specs and implement it in a few days or weeks.


Flexible


MQTT is based on a publisher/subscriber model that separates these two clients. This means that subscribers don’t know who provides the information to which they are subscribed. The message sent can be in any data format, thus giving flexibility to the protocol. Being flexible, MQTT supports a variety of application scenarios for IoT devices and services.


It enables bi-directional communications


MQTT publisher/subscriber protocol is bi-directional by nature. This means it allows messaging between the device to cloud and cloud to device, which makes for easy broadcasting messages to groups of things.


Scalable


For IIoT projects to achieve success on their digitalisation journey, data must be provided over an enterprise-wide solution architecture. MQTT was initially designed to serve multiple data producers and data consumers. Published data coming from a manufacturing asset can be consumed by multiple applications, all at the same time. MQTT can scale to connect with millions of IoT devices.>


Cost-effective


IIoT driven by MQTT provides access to data on brownfield devices at a lower cost. In its core, being a protocol that produces small messages, MQTT can reduce the cost per device and, subsequently, the total cost of operation by reducing the amount of data transmitted. Plus, MQTT can help reduce the layers of technology and integration, and therefore, prevent costs from spiralling out of control.


Secure and reliable


For today’s highly-networked IIoT systems, MQTT is the protocol of choice when it comes to security. It makes it easy to encrypt messages using TLS and authenticate clients using modern authentication protocols, such as OAuth. All communications are initiated by publishers, and centralised MQTT brokers ensure that only properly authenticated publishers can connect. Finally, the reliability of message delivery is important for all IIoT use cases. This is why MQTT has three defined quality of service levels: 0 - at most once, 1- at least once, 2 - exactly once.


Widely supported by vendors


From leading cloud vendors, IoT platforms to big data and other third-party applications, the number of vendors support MQTT.


Ideal for low bandwidth environments and unreliable networks


MQTT consumes less power to keep the connection open between a broker and a client. It features faster response throughput, and lower battery and bandwidth usage, making it well suited to use-cases where connectivity is intermittent. Also, many IoT devices connect over unreliable cellular networks. MQTT’s support for persistent sessions reduces the time to reconnect the client with the broker.

The Future of MQTT Looks Bright

Based on the Google Trends study, the interest in MQTT has quadrupled worldwide for the past five years. So, it seems that it is far from becoming obsolete — in fact, since it continues to advance, it is more likely to have a truly bright future. Much of its popularity is due to a massive growth of IIoT applications and continual persistence towards resource efficiency and simplicity. It has already been used in an enterprise infrastructure of all shapes and sizes including energy-monitoring systems, oil rigs and drilling sites, medical devices, the automotive and aerospace industries, supply chain, construction, retail and more. However, it has made and continues to make a groundbreaking impact in industrial settings, moving the boundaries of industry 4.0.

The latest MQTT 5.0 was released in March 2019. Its major functional objectives are:

  • Enhancements for scalability and large scale systems with respect to setups with 1000s and millions of devices.
  • Improved error reporting (Reason Code and Reason String)
  • Formalising common patterns including capability discovery and request-response
  • Extensibility mechanisms including user properties, payload format and content type
  • Performance improvements and improved support for small clients

The unique feature set is one of the reasons why MQTT is the number one IIoT protocol, and this is just the beginning. Easy implementation, simple architecture, reliable message delivery, high scalability, small size, low power usage and minimised data packets are the main reasons why we will witness even more MQTT-enabled systems in the years to come.

Also, MQTT has mainly been used for communication between a device and a cloud. With more and more organisations adopting microservice architecture, MQTT might be even used for communication between services in the future.

Leverage the Power of MQTT with WolkAbout

MQTT is a strong competitor and a well-suited option for building your industrial IoT project that will help you save money and time in the long run. Having recognised its major value, we use MQTT as a part of the protocol stack in our solution development. To learn more about how to connect your networked devices to WolkAbout IoT Platform, check out our Developer Guides.

Discover the ways how to drive your digitalisation forward with our industry-proven IIoT platform empowered by MQTT by reaching out to one of the WolkAbout experts.

Let us help you put MQTT-compliant fabrication processes into action and realise the promise of connected industry 4.0.

--

Follow us on social media to keep up-to-date with the latest IoT news and research highlights, and benefit from a range of useful resources: Twitter, LinkedIn, Facebook and YouTube.