Internet of Things (IoT) solutions employ some kind of messaging protocol for each individual IoT device to communicate in the system. These messaging protocols are used to transmit device telemetry (or messages) from the IoT devices to the IoT Messaging Hub (or Broker). Two of the most common messaging protocols used for IoT solutions are MQTT and AMQP, however, there are many other protocols used and supported by various IoT hardware. This article will introduce you to several of the most common IoT messaging protocols used across a variety of industries.
What is an IoT Messaging Protocol?
Internet of Things (IoT) messaging protocols are used to transmit telemetry (aka messages) from IoT devices to an IoT Messaging Hub. These protocols can operate over TCP, or even a higher level abstraction such as HTTPS.
Connecting IoT devices to a network, the Internet, or even each other may use one of a number of methods. IoT devices may be connected over Wifi, Cellular, Bluetooth, ZigBee, LoRaWAN, or some other connectivity method. Once the components of an IoT solution are connected to each other, there will be a messaging protocol used to transmit device telemetry (aka messages) to and from devices.
The below list includes several of the most popular IoT Messaging Protocols used by devices:
1) MQTT (Message Queue Telemetry Transport)
The MQTT, or Message Queue Telemetry Transport, protocol is a lightweight, publish/subscribe network protocol for transporting telemetry messages between IoT devices. This protocol typically runs over TCP/IP, however, it can operate on top of other networking protocols so long as they provide ordered, lossless, bi-directional connections.
MQTT is designed to be lightweight, and is ideal for connection scenarios where IoT devices may have limited bandwidth or other constraints requiring remote devices with small code footprints.
- Lightweight protocol (great for constrained networks)
- Supports Publish / Subscribe messaging
- Low power usage
- Minimized data packet size
- OASIS standard protocol
2) AMQP (Advanced Message Queue Protocol)
AMQP, or Advanced Message Queue Protocol, is an open standard application layer protocol. It’s a binary protocol designed to support a wide array of messaging applications and communications patterns. It’s not specifically built for Internet of Things (IoT) solutions, but it works very well for message communications which include many IoT scenarios.
- Binary application layer protocol
- Can be used for Point-to-Point and Publish / Subscribe messaging
- Broad compatibility with messaging scenarios
- Supports end-to-end encryption of messaging
3) DDS (Data Distributed Service)
DDS, or Data Distributed Service, protocol is designed to be used with real-time systems, and is an Object Management Group (OMG) machine-to-machine standard. The goals of DDS are to enable dependable, high-performance, interoperable, real-time, scalable data exchanges using a Publish / Subscribe messaging pattern.
The DDS protocol is designed to address the unique needs of application scenarios such as aerospace, defense, air-traffic control, autonomous vehicles, medical devices, robotics, power generation, transportation systems, and other real-time data exchange systems.
- Designed for Real-Time systems
- Provides Publish / Subscribe messaging
- Connects devices directly to each other
- Low overhead
4) XMPP (Extensible Messaging and Presence Protocol)
XMPP, or Extensible Messaging and Presence Protocol, is a communications protocol based on XML (Extensible Markup Language). It’s designed to provide near real-time exchange of structured XML data between two or more devices. The XMPP protocol was originally known as Jabber and was developed for near real-time messaging (IM), presence information, and contact list maintenance. More recently XMPP has been used for Publish / Subscribe messaging, VoIP (Voice over IP), Internet of Things (IoT), gaming, and other systems.
- Designed to be extensible
- Open Standard
- Client / Server architecture
5) CoAP (Constrained Application Protocol)
The CoAP, or Constrained Application Protocol, is a specialized application protocol designed for constrained devices. It’s designed to require low power, work across lossy networks, and can be used to connect devices to each other or other general nodes on the Internet. CoAP is not just used for IoT scenarios, but is also in use on other systems such as SMS on mobile communication networks.
- Low Power usage
- Used on constrained devices
Which IoT messaging protocol is best?
There is no “best” messaging protocol that is suitable for all IoT use cases. The best IoT messaging protocol for a particular application will depend on the specific requirements and constraints of the system. Some factors to consider when selecting an Internet of Things messaging protocol include:
- Performance: The protocol should be able to handle the required volume and rate of messages, and it should have low overhead and latency.
- Reliability: The protocol should support delivery guarantees and error handling mechanisms to ensure that messages are delivered reliably.
- Security: The protocol should support security features such as encryption and authentication to protect against unauthorized access and tampering.
- Compatibility: The protocol should be compatible with the devices and infrastructure that are being used in the system.
- Ease of implementation: The protocol should be easy to implement and integrate with the rest of the system.
Some popular messaging protocols that are commonly used in IoT applications include MQTT, CoAP, AMQP, XMPP, and DDS. Each of these protocols has its own strengths and weaknesses, and the best one for a particular application will depend on the specific requirements and constraints of the system.
Depending on the IoT devices you are integrating into your solution, there may be multiple different message protocols you’ll be required to deal with. There are also times where you may be able to choose the specific protocol to implement as a “standard” across your solution. When integrating with Microsoft Azure services, such as IoT Central and Azure IoT Hub, the MQTT and AMQP protocols are the most widely supported.