Real Time Communications Featured Article

The Pros and Cons of the Major IoT Communications Protocols

August 20, 2015

Real-time communications is a fundamental component of the Internet-of-Things (IoT). Without the ability to communicate with each other, the utility of IoT is greatly reduced.

Yet, there is not a single real-time communications protocol that developers can use for their IoT applications; there are several options. Each has its advantages and its disadvantages, so it is worth reviewing the three major options so developers pick the best for their particular IoT needs.

The three major real-time communication protocols for IoT are eXtensible Messaging and Presence Protocol (XMPP), Constrained Application Protocol (CoAP), and Message Queue Telemetry Transport (MQTT).

Let’s start with XMPP, one of the oldest chat protocols and the foundation for Jabber, the longstanding chat service.

XMPP is a TCP protocol based on XML. It enables the exchange of structured data between two or more connected entities, and out of the box it supports presence and contact list maintenance (since it started as a chat protocol). Because of the open nature of XML, XMPP can be easily extended to include publish-subscribe systems, making it a good choice for information that is handed to a central server and then distributed to numerous IoT devices at once. It is decentralized, and authentication can be built in by using a centralized XMPP server.

The downsides of XMPP for IoT is that it lacks end-to-end encryption. It also doesn’t have quality-of-service functionality, which can be a real deal-breaker depending on the application.

CoAP is a protocol specifically developed for resource-constrained devices. It uses UDP instead of TCP, and developers can work with CoAP the same way they work with REST-based APIs. Since it uses minimal resources, it is a good option or low-power sensors. Since it uses UDP, it also can run on top of packet-based technologies such as SMS, and messages can be marked confirmable or nonconfirmable to work with QoS. Datagram Transport Layer Security (DTLS) can be used for encryption.

The downside of CoAP is that it is a one-to-one protocol, so broadcast capabilities are not native to the protocol.

MQTT, on the other hand, is a publish-subscribe messaging protocol that also was developed for resource-constrained devices. When a device or service publishes data to a topic, all of the devices subscribed will automatically get the updated information.

The trouble with MQTT is that it uses TCP connections to a MQTT broker.  Having an always-on connection will limits the time the devices can be put to sleep. This can be somewhat mitigated by using MQTT-S, which works with UDP instead of TCP. But MQTT also lacks encryption since the protocol was intended to be lightweight and encryption would add significant overhead.

So each protocol has its advantages and disadvantages when it comes to IoT. Choosing the right real-time protocol depends largely on the needs of a given developer and his IoT devices.

Edited by Stefania Viscusi

Article comments powered by Disqus

  Subscribe here for RTCW eNews