IoT Messaging Protocols

IoT devices use various kinds of messaging and communication protocols in every layer in order to communicate with each other. While constructing an IoT device it is important to keep in mind its type, its functionality, and the layer. There are a wide range of messaging and communication protocols available in the market and the most common ones are discussed below.

Now, let us look at the common messaging protocol adapted in IoT.

IoT Messaging Protocols

1. Message Queuing Telemetry Transport(MQTT Protocol in IoT)

MQTT is an IoT communication protocol that is widely gaining popularity due to its lightweight publish/subscribe messaging transport. It is a protocol that transfers data between various machines. It has become one of important protocols in the internet of things.

All devices communicate through a broker or server. You can install the broker in your PC, MAC, Linux system and even in Raspberry pie. Two of the most famous brokers available in the market these days are HIVEMQ and Mosquito.

Client devices receive or accept information either from the broker or by just subscribing to specific topics. They can also publish specific topic messages to the broker. All devices communicate with each other through the broker.

Topics categorize the kind of messages that can be sent. Clients subscribe to a specific topic and receive messages from those topics only. The broker receives these messages and forwards them to other devices that also subscribe to that topic.

Message Queuing Telemetry Transport(MQTT)

There are three different kinds of QoS(quality of service):

  • QoS0: messages are sent once, regardless of any feedback from the broker.
  • QoS1: messages are sent over and over until they receive a confirmation from broker
  • QoS2: for every message sent, broker sends a confirmation message back

MQTT is lightweight in size and data power transmission and it is hence available in a large number of devices. MQTT mainly transmits its data through the TCP/IP protocol.

Features of MQTT

  • Lightweight protocol suits best for constrained nodes
  • Assists publish/subscribe messaging
  • Reduces size of data packets
  • OASIS standard protocol

Pros of MQTT

  • Flexible options to choose from for quality of service within functionality
  • Easy to act upon
  • Quick results

Cons of MQTT

  • Lack of encryption
  • Uses high power due to the TCP connections

MQTT Use Cases

A parking space with sensors that can sense empty parking spots to guide vehicle in the right direction

2. Advanced Message Queuing Protocol (AMQP)

AMQP transfers business messages between various applications and companies. This protocol is not specifically built for IOT applications but has a wide range of uses in the internet of things. But, it works effectively in transferring message communication.

It connects the system, serves the system with the required information and forwards the information to achieve the necessary goals.

Advanced Message Queuing Protocol

AMQP connects across various systems, technologies, time and space. There are three parts which manage the entire AMQP protocol:

  • Exchange: receives messages from publishers and directs these messages to the messaging queues depending on the availability.
  • Message Queue: Saves these messages in databases until they are put in use by an application.
  • Binding: Distinguishes the relation between an Exchange and Message Queue and gives the message steering criteria.

Features of AMQP

  • Application layer protocol is binary
  • Cabe used as point to point or publish/subscribe messaging
  • Highly suits messaging scenarios
  • Aids end to end encryption in communication

Pros of AMQP

  • Transfer messages through TCP or UDP
  • End to end encryption

Cons of AMQP

  • Uses large amounts of power and memory

Use Cases of AMQP

This protocol is mostly used in the business sector. It uses back office data centres to specify devices like mobile phones, handsets etc.

3. Data Distribution Service (DDS)

DDS protocol acts as a bridge between databases and user applications in a network and hence it is a middleware protocol. The protocol combines the parts of a system together. The protocol uses low computing data, it is highly efficient and reliable and its architecture is extremely extensible.

Since, DDS is a middleware software, its job is to provide effective communication and easy sharing of data. It handles the tiring and confusing job of managing the communication paths and allows developers to focus on building the applications.

DDS is a vital protocol whose main aim is M2M( machine to machine) communication. Data exchange happens through the well known publish-subscribe methodology. This protocol differs from the above two protocols as it is brokerless. It serves high quality QoS to the applications with the help of multicasting. DDS protocols are developed from low footprint devices to cloud.

DDS is data centric and is thus widely used in the internet of things technology, since IoT mainly involves the flow of data from one point to another. Data Centricity ensures that all messages include conceptual information and all applications require understanding the data that it receives.

Data Distribution Service

Features of DDS

  • Designs structure supports real time systems
  • Publish/subscribe messaging
  • Direct connection of devices
  • Low overhead

Pros of DDS

  • Easy architecture that aids “auto-discovery” of new applications
  • Scalable and effective
  • Effectively uses transport bandwidth
  • Committed Data delivery

Cons of DDS

  • DDS has a heavyweight protocol and it becomes difficult to use in embedded systems
  • It consumes double the bandwidth as compared to MQTT
  • It is not possible to interface with webpages

Use Cases of DDS

Hospitals and healthcare, military and borders, wind farms, tracking systems all use the DDS protocol.

4. Extensible Messaging and presence protocol(XMPP)/Jabber

As the name suggests, XMPP protocol applies to long distance messaging due its scalability and it involves human presence or human intervention. XMPP originates from XML, extensible markup language and XML originates from HTML, a protocol used to create web pages. Both are markup languages.

XMPP has a broad range of uses that can inter communicate with each other due to its extensibility. It uses the standard internet communication protocol(ICP) and this makes it universally communicable and it also communicates through HTTP. XMPP was created a long time ago and further extensions in its development make it more accessible.

XMPP networks contain gateways to connect to other protocols. It is designed in such a way that it supports instant message transfer through TCP link. This is highly useful in the internet of things technology.

Extensible Messaging and presence protocol(XMPP)

Features of XMPP

  • Extensible design
  • Open standards
  • Client/server architecture

Pros of XMPP

  • Labelling scheme to locate devices on the entire network easily

Cons of XMPP

  • End to end encryption not possible
  • Quality of service not available

XMPP Use Cases

  • Smartphones can access a smart thermostat via the internet
  • A gaming console that allows gamers to message other gamers instantly

5. Constrained Application Protocol (CoAP)

This is yet another important communication protocol in IoT. IoT devices are built in a way to operate in constrained devices or nodes and networks. CoAP runs on UDP and is therefore a connectionless protocol. It is a restful, efficient protocol and it has a header of 4 bytes. It has a lightweight protocol.

The CoAP follows the request/response protocol which is similar to HTTP, every request must generate a certain response. Similar to HTTP, the CoAP supports GET, POST, and PUT methods. Unlike HTTP, CoAP handles these methods asynchronously with UDP. The CoAP is built in a way which makes HTTP interface easy and at the same it is easily compatible with constrained nodes and networks.

CoAP supports 4 types of messages: confirmable, non-confirmable, acknowledgement and rest. Confirmable and non-confirmable messages transfer the request and response.

Constrained Application Protocol (CoAP)

Features of CoAP

  • Low power consumption
  • Ideal for constrained devices

Pros of CoAP

  • Uses DLTS for security
  • Quick device communication
  • Packet sizes are small

Cons of CoAP

  • Since it is a one to one protocol there is no broadcasting option
  • Can be unreliable

CoAP Use Cases

Smart homes, smart cities, smart grids etc

Summary

In this article, we made an effort to understand the most common communication or messaging protocols in the internet of things
We further discussed MQTTP, AMQP, DDS, AMPP and CoAP.