History of Message Queuing Telemetry Transport (MQTT)
MQTT was developed by Andy Stanford-Clark with IBM and Arlen Nipper in 1999 to connect measurement equipment on oil pipelines to their SCADA (Supervisory Control and Data Acquisition) systems via satellite. They developed this protocol because they needed some lightweight, bandwidth-rich, and low-power protocol to use over satellite links.
MQTT officially became an OASIS (Organization for the Advancement of Structured Messaging Standards) open standard in 2014. It aims to remain an open source implementation to ensure widespread adoption in the machine-to-machine (M2M) industry.
In 2019, OASIS released the official updated MQTT 5.0 standard. Version 5.0 includes many new features: such as reason codes, shared subscriptions, message expiration, and topic aliases.
Today, MQTT is adopted by many industrial sectors, including automotive, utilities, logistics, manufacturing, smart home, consumer goods, and transportation, connecting millions of devices around the world.
What is Message Queuing Telemetry Transport (MQTT)?
MQTT, which stands for Message Queuing Telemetry Transport, is a communication protocol that uses the publish/subscribe (PubSub) model for the Internet of Things (IoT) and Industry 4.0. It is extremely lightweight, executes on top of the TCP/IP stack, and is designed to connect distributed devices requiring minimal coding from developers.
MQTT is bandwidth efficient and resource-neutral. It also runs over Secure Sockets Layer (SSL)/Transport Layer Security (TLS), a security protocol built on TCP/IP, to ensure that all data messages between devices are encrypted and secure.
Publish-Subscribe Model
In the MQTT PubSub model, clients are either message producers (publishers) or consumers (subscribers). Clients do not establish direct links between each other and do not know each other's location or IP address. Instead, they all connect to an MQTT broker, which only acts as a traffic (message) storage and director, as shown in Figure 1.
Figure 1. The publish/subscribe model in MQTT. Image courtesy of Behr Technologies
In this example, there is one publisher and two subscribers subscribing to the same publisher to obtain the same information. However, in many applications, you will often see many-to-many relationships, as shown in Figure 2.
Figure 2. Many-to-many relationships in MQTT. Image courtesy of ResearchGate
An MQTT broker only sends messages it receives from publishers to subscribers who have subscribed to MQTT topics. We'll discuss MQTT topics next.
Internals of Message Queuing Telemetry Transport (MQTT)
Message Queuing Telemetry Transport (MQTT) topics
In MQTT, a topic is a hierarchical UTF-8 text string that the broker uses to filter messages and deliver them to each subscriber. A topic consists of one or more topic levels, each separated by a forward slash. All messages must contain a topic, and subscribers must subscribe to that topic. Topic examples are presented in the following format (it is important to note that topics are case-sensitive).
My House/First Floor/Room 1/Temperature
My House/First Floor/Room 4/Temperature
My House/Second Floor/Room 2/Humidity
MQTT is a messaging protocol that supports asynchronous communication. It decouples message producers and consumers in space by publishing or subscribing to messages knowing only the IP address and port number of the broker. It also decouples time by storing messages for clients when the network is disconnected. This makes the protocol highly scalable in unstable networks such as cellular and radio networks.
MQTT sends the connection credentials in plain text and therefore provides no security measures and authentication itself. This can be addressed by using TLS encryption with a username, password to protect the connection and requiring the client to present a certificate that matches the broker's certificate.
The default unencrypted MQTT port is 1883. The encrypted port is 8883.
Message Queuing Telemetry Transport (MQTT) Quality of Service (QoS)
Quality of Service (QoS) in MQTT is an agreement between publishers and subscribers on guaranteed message delivery.
There are three levels of QoS:
0 – at most once, agent is not sure
1 – At least once, the broker sends an acknowledgment to the publisher
2 – Exactly once, handshake between publisher and subscriber
When a publisher publishes a message to an MQTT broker, it determines the QoS level for that message. When the broker forwards the message to a subscriber, it also sends the same QoS set by the publisher.
Level 0 is less taxing on bandwidth and is used when the connection is considered reliable. Using the highest level, 2, guarantees delivery but increases the load on data transfer.
Message Queue Telemetry Transport (MQTT) Sparkplug B
The Eclipse Foundation manages a Sparkplug protocol specification that is compatible with MQTT, where MQTT is the communication protocol and Sparkplug defines the data structures. This specification was chosen for real-time and mission-critical industrial applications by adding new requirements and features on top of MQTT.
Sparkplug B adds three main requirements to the MQTT implementation:
Mandatory state awareness. A publisher must publish proofs when connected, define all topics, and broadcast its online status to subscribers through the broker. It also submits proofs to the broker for distribution if it is disconnected from the network. Figure 3 depicts the process of establishing device communication with an MQTT broker.
Figure 3. Device session establishment in MQTT Sparkplug. Image courtesy of the Eclipse Foundation [PDF]
Payload definition. MQTT is data agnostic and can run with any client, but at the same time adds the burden that subscribers will add data. Sparkplug packages the MQTT payload with structured metadata so that any Sparkplug client can identify the message. The entire payload is then compressed into a smaller footprint.
Standard topic format. Topics in MQTT can obscure interoperability because different edge devices can use different naming conventions. Sparkplug defines a standard topic format to reduce inconsistencies between clients and enable them to correctly interpret the data.
Edge-to-Cloud Connectivity
MQTT is cross-platform. The broker can be installed and run on Windows, Linux, and other platforms. Going forward, more and more installations will run on cloud servers such as Azure and Google Cloud. Hosting the broker on the cloud allows developers to quickly launch, easily manage and monitor the broker, and scale when more devices need to be connected.
Security becomes even more important when data passes through the cloud. Developers must pay attention to and properly configure and handle secure connections, authentication, authorization, and encryption to maintain the security and integrity of the data.
MQTT was developed in 1999 to connect oil pipelines to SCADA and has been used in industrial environments ever since. It is a communication protocol used in a variety of industrial sectors.
Previous article:MIKROE's new SiBRAIN MCU development standard allows easy replacement of MCUs without hardware cost
Next article:Intel officially announced the development of RISC-V processor: the first 7nm process will be launched next year
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Senior Electronic Engineer (FPGA) Recruitment
- Should I choose a slow-blow or fast-blow fuse for the power module?
- Join [Micron VIP] and win a 200 yuan JD card!
- [GD32L233C-START Review] 8. TRNG True Random Number Generation
- How to set the grid of PCB more efficiently
- Input Considerations for SAR ADCs
- Enabling BLE in ESP-S3 using micropython
- The LM5118 buck-boost circuit has poor load capacity?
- GD32L233C Review: Unboxing
- What do you think about FAE career change?