Why MQTT Is the Preferred IoT Transmission Protocol

Follow,Star Public Account Number, don’t miss out on exciting content

Why MQTT Is the Preferred IoT Transmission Protocol

Author: Engineer Huang
Public Account: strongerHuang
IoT (Internet of Things) devices need to connect to the internet, and there are many ways to connect, with various transmission protocols available. Why is MQTT the preferred transmission protocol for IoT?
This article focuses on the MQTT transmission protocol.
1. About MQTT
MQTT: Message Queuing Telemetry Transport.
The fundamental internet network protocol is TCP/IP, and MQTT (Message Queuing Telemetry Transport) is built on top of the TCP/IP protocol stack.
MQTT was released by IBM in 1999 and is a “lightweight” communication protocol based on the publish/subscribe model. At the end of 2014, it officially became an OASIS open standard and is supported in several popular programming languages (via various open-source implementations).
In a previous article titled “The Relationship and Differences Between HTTP and TCP/IP“, we mentioned the OSI (Open Systems Interconnection), where MQTT, like HTTP, belongs to Layer 7 (Application Layer).

Why MQTT Is the Preferred IoT Transmission Protocol

Reference URLs:

http://mqtt.org
http://mqtt.p2hp.com
https://www.ibm.com/developerworks/cn/iot/
https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
2. Features of MQTT

Features of MQTT:

  • Open messaging protocol, simple and easy to implement

  • Publish/subscribe model, one-to-many message publishing

  • Message QoS support, ensuring reliable transmission

  • Based on TCP/IP network connection, providing ordered, lossless, bidirectional connection.

  • 1-byte fixed header, 2-byte heartbeat message, minimizing transmission overhead and protocol exchange, effectively reducing network traffic.

Why MQTT Is the Preferred IoT Transmission Protocol

Design Principles:

Due to the unique environment of IoT, MQTT follows these design principles:

  • Simplistic, without adding unnecessary features;
  • Allows users to dynamically create topics, zero operational cost;
  • Minimizes transmission volume to enhance transmission efficiency;
  • Considers factors such as low bandwidth, high latency, and unstable networks;
  • Supports continuous session control;
  • Understands that client computing capability may be low;
  • Provides quality of service management;
  • Publish/subscribe (Pub/Sub) model, facilitating message transmission among sensors;
  • Assumes data is unknown, does not enforce data type and format for transmission, maintaining flexibility.
3. Why MQTT is the Preferred Choice for IoT

1. Why Choose MQTT

MQTT is a lightweight and flexible network protocol, designed to achieve an appropriate balance for IoT developers:

  • This lightweight protocol can be implemented on severely constrained device hardware and high-latency/low-bandwidth networks.

  • Its flexibility allows for support of diverse application scenarios for IoT devices and services.

To understand why MQTT is so suitable for IoT developers, we first analyze why other popular network protocols have not been successfully applied in IoT.

Why MQTT Is the Preferred IoT Transmission Protocol

2. Why Not Choose Other Numerous Network Protocols

Most developers are already familiar with HTTP web services. So why not connect IoT devices to web services? Devices can send their data in the form of HTTP requests and receive updates from the system in the form of HTTP responses. However, this request-response model has several serious limitations:

A.HTTP is a synchronous protocol. Clients must wait for server responses. Web browsers have this requirement, but at the cost of scalability. In the IoT field, numerous devices and potentially unreliable or high-latency networks make synchronous communication problematic. Asynchronous messaging protocols are more suitable for IoT applications. Sensors send readings, allowing the network to determine the best route and timing for delivering them to target devices and services.

B.HTTP is one-way. The client must initiate the connection. In IoT applications, devices or sensors are usually clients, meaning they cannot passively receive commands from the network.

HTTP is a 1-1 protocol. Clients make requests, and servers respond. Delivering messages to all devices on the network is not only difficult but also costly, which is a common use case in IoT applications.

C.HTTP is a heavyweight protocol with many headers and rules. It is not suitable for constrained networks.

For the above reasons, most high-performance, scalable systems use asynchronous message buses for internal data exchange rather than web services. In fact, the most popular messaging protocol used in enterprise middleware systems is called AMQP (Advanced Message Queuing Protocol). However, in high-performance environments, computational capacity and network latency are usually not an issue. AMQP aims to achieve reliability and interoperability in enterprise applications. It has a large feature set but is not suitable for resource-constrained IoT applications.

In addition to AMQP, there are other popular messaging protocols. For instance, XMPP (Extensible Messaging and Presence Protocol) is a peer-to-peer instant messaging (IM) protocol. It heavily relies on features supporting IM use cases, such as presence status and media connections. Compared to MQTT, it requires far more resources on devices and networks.

So, why is MQTT so lightweight and flexible? Because a key feature of the MQTT protocol is the publish and subscribe model. Like all messaging protocols, it separates the data publisher from the user.

‧ END
Recommended Reading:
Selected Collection | Directory | Search
Is It Difficult to Embed Assembly Code in C?
The Relationship and Differences Between HTTP and TCP/IP

Follow the WeChat public account ‘strongerHuang’, reply “1024” in the backend to see more exciting content.

Why MQTT Is the Preferred IoT Transmission Protocol

Long pressto recognize the QR code in the imageto follow

Leave a Comment