MQTT (Message Queuing Telemetry Transport) is a publish-subscribe protocol that is also registered in the ISO standard (ISO / IEC PRF 20922). This protocol operates on the TCP / IP protocol and is designed for connections to remote locations where small traces of code are required or network bandwidth is limited. Spread-sharing messaging template requires a message broker.
IBM’s Andy Stanford-Clark and Cirrus Link’s Arlene Nipper introduced the first version of the protocol in 1999.
In 2013, IBM introduced version 3.1 MQTT to the Organization for the Advancement of Organized Information Standards (OASIS) with permission to make minor changes to the protocol. MQTT-SN is a modified version of the original protocol developed for devices embedded in non-TCP / IP networks such as ZigBee .
Historically, the MQ in MQTT is derived from IBM’s IBM MQ messaging product line. However, queuing itself does not need to be supported as a standard feature in all situations.
Alternative MQTT protocols include Advanced Messaging Queuing Protocol (AMQP), Simple Text-Based Messaging Protocol (STOMP), IETF Restricted Application Protocol, XMPP, DDS, OPC UA, and Web Application Messaging Protocol (WAMP). .
MQTT Overview
An MQTT system consists of a set of clients that connect to a server. This server is often called a server. A client can be the publisher of information or its subscriber. Each client can connect to the server.
Information is organized hierarchically from topics. When a publisher has new data that it wants to distribute, it sends a control message with the data to the connected server. The broker then distributes this information to each of the clients who share that particular theme. In this way, the publisher no longer needs to have information about the number or location of subscribers, and likewise, subscribers do not need to be set up using information about the publisher in a specific way.
If the broker receives an item that it does not currently have a subscriber to, it will delete it unless the publisher notifies it that the item should be retained. This allows new subscribers of an issue to receive the latest version of the available information instead of waiting for the publisher to make the next update.
When a publisher client first connects to the broker, it can set the default message to be sent to all subscribers if the broker detects that the publisher client has unexpectedly lost contact with the broker. .
Clients only interact with the server, but a system may have multiple server servers that exchange information with each other depending on the topics of their current subscribers.
An MQTT control message with the smallest possible volume can contain two bytes of information, but if needed, the same control message can carry approximately 256 MB of information. In general, fourteen types of messages are defined for establishing and disconnecting a client from the broker, disseminating information, confirming receipt of information, and monitoring the communication between the client and the broker.
MQTT uses the TCP protocol to transmit data. A similar version, MQTT-SN, is used on other transmission interfaces such as Bluetooth.
MQTT sends the connection information in plain text and does not make any arrangements for authentication or security. Such arrangements may be made through the TCP Sub-Protocol, using measures to protect the integrity of transmitted information against eavesdropping or forgery.
Is MQTT a standard?
As of March 2013, the MQTT standardization process was underway by OASIS. The specifications of this protocol have been made available to everyone without the use of royalties for many years, and companies such as Eurotech (formerly known as Arcom) have implemented this protocol in their products. In November 2011, IBM and Eurotech announced that they would join the Eclipse machine-to-machine group and provide their MQTT code to the group’s Paho project.
What is WSMQTT?
WSMQTT is a product of IBM that implements the MQTT protocol in a fully scalable manner and operates directly between Websphere MQ family products. There are other MQTT implementations mentioned on the official website.
Does MQTT also support security features?
In version 3.1 of this protocol, you can also send a username and password via the MQTT package. Encryption is performed across the network via SSL and independently of the MQTT protocol. It should be noted that SSL is not one of the lightest protocols and adds a lot of workload to the network. More security measures can be taken through an application that encrypts the data sent and received, but this is not something that is present in this protocol by default because this protocol is designed to be simple and light. Be.
Types of messages
Connection:
It waits to communicate with the server and establishes a connection between nodes
Disconnection:
It waits for the MQTT client to do whatever it needs to do, and then waits for TCP / IP to disconnect.
Release:
After transferring the MQTT client request, it returns to the application field immediately
Quality of service (QoS) – Quality of service
Each connection to the broker can also specify a service quality measure. These actions are classified according to the degree of overhead increase:
- Up to once: The message is sent only once and the client and the broker do not take any additional steps to confirm the receipt of the message (send the message and forget it)
- At least once: The message is sent several times by the sender to finally send a confirmation of receipt from the other party (confirmation of receipt)
- Exactly once: the sender and receiver enter into a two-tier interaction to ensure that only one copy of the message is received (secure reception)
This does not change the transmission of TCP platform data and is used only between MQTT senders and receivers.
Real-time MQTT application
There are several projects that use MQTT:
- Facebook Messenger: Facebook has used aspects of MQTT in its messenger for online chat. However, it is not clear how much of this was used or exactly what it was used for.
- IECC Scalable: The latest version of DeltaRail’s IECC signaling control system uses MQTT to communicate between different parts of the system and other components of the signaling system. In fact, MQTT provides the infrastructure communication framework for a system that complies with CENELEC standards for secure communications.
- EVRYTHNG IoT platform: which uses MQTT as a machine-to-machine protocol for millions of connected devices.
- In 2015, Amazon Web Services introduced Amazon IoT under MQTT.
- The OGC SensorThings API considers the MQTT plug-in as an additional messaging protocol. The protocol was used to run an IoT test at the US Department of Homeland Security.
- The OpenStack platform’s Upstream Infrastructure services are interconnected via a single MQTT message bus, and Mosquitto acts as the MQTT server.
- In 2015, Adafruit launched a free MQTT cloud service called Adafruit IO for IoT enthusiasts.
- The Microsoft Azure Platform IoT Center uses MQTT as the primary protocol for telemetry messaging.
- In 2017, XIM, Inc. released the MQTT client called MQTT Buddy. This client is actually an MQTT application for Android and iOS users but has not been released for F-Droid. This application is published in English, Russian and Chinese.
- Node-RED supports MQTT nodes from version 0.14 onwards to properly configure TLS connections.
- The Home Assistant open source platform supports MQTT and provides MQTT brokers with four options.
- The Pimatic Home Automation Framework for Raspberry Pi, which is based on Node.js, offers the MQTT plug-in, which fully supports the MQTT platform.
- McAfee OpenDXL is based on MQTT, but changes have been made to the messaging agents themselves to support advanced features such as service, request / reply messaging, service transfer conditions in the event of a problem (Fail over), and regions. Services to understand the format of DXL messages inherently.