kentoh - Fotolia

Common application layer protocols in IoT explained

IoT doesn't exist without connectivity, but those connections would not be possible without the right application layer protocols in IoT.

IoT is simple in theory: Use the vast connectivity of the internet to send data from the tiniest devices -- such as switches and sensors -- to the cloud, on-premises server farms or large-scale data platforms to model the world more accurately. That model forms the foundation for entire new classes of applications, analyses and previously unimagined efficiencies and optimizations.

The global growth in IoT-based applications makes the cloud look tame, as far as technological innovations and social importance go. IoT has given the world automated industrial operations, personal healthcare monitoring, traffic control and smart homes. The list is very long and growing.

However, for all the available connectivity and the technological revolution IoT promotes, it presents communication challenges rarely seen in more conventional networking scenarios.

Understand IoT communication challenges

Application layer protocols in IoT must address some major challenges in IoT's network communications. The data in IoT are more complex than in conventional networking. In a simple scenario, a sensor reports a temperature to a local network, which then passes the data to a cloud through the internet. Complex scenarios can get as tricky as dialog between multiple machines on a factory floor that selectively power down when environmental sensors report the detection of fire, while a cloud AI system monitors the shutdown and reports the event to multiple external systems. The simple scenario includes a single data type and a single message moving in one direction. The complex one includes many data types in many messages among many devices that must efficiently exchange the data. The hardware itself can vary wildly.

The conventional protocol standard, HTTP, isn't necessarily appropriate for small devices. Some IoT devices are HTTP-capable and benefit from the features of HTTP transport, but many, if not most, are not and cannot. HTTP is designed for very heavy, rich communications, while most IoT communications are necessarily minimal, given the small size and sparse hardware and firmware of most devices. An HTTP header can contain hundreds of bytes; that's nothing in most internet communications, but it's huge for most IoT devices. Protocols that are leaner and able to ride HTTP but not be HTTP are necessary.

How the application layer works

Some IoT devices have network capability directly built in, but most connect to the internet through a gateway.

IoT makes use of the Open Systems Interconnection model, which employs seven interactive layers to handle each phase of message transport. The IoT application layer is one of seven layers, three of which are of particular importance to IoT application protocols.

OSI application layer

The physical network layer is the actual infrastructure that is moving the data, such as Ethernet, Wi-Fi or Bluetooth.

The transport layer is the protocol supporting the movement of the data, such as Transmission Control Protocol (TCP), HTTP or User Datagram Protocol (UDP).

The application layer is the interface between the IoT device and the network with which it will communicate. It handles data formatting and presentation and serves as the bridge between what the IoT device is doing and the network handoff of the data it produces.

Top application layer protocols in IoT

Engineers have many IoT application layer protocols to choose from, covering a broad range of functionality. The right protocol for a particular IoT application depends on a number of factors based on the type of device involved and the function it will perform:

  • Data latency. How fast does data transport need to be? How much time can reasonably pass for a data packet to move from one point to another?
  • Reliability. How consequential is data loss in the IoT application? How redundant must device communication be?
  • Bandwidth. What's the volume of data that needs to be accommodated?
  • Transport. What's the best transport protocol for the IoT application? TCP, UDP and HTTP each offer features that can be exploited by application layer protocols with which they're compatible.

Engineers must answer these questions before considering specific protocols to pin down which features will be most important.

The application layer handles data formatting and presentation and serves as the bridge between what the IoT device is doing and the network handoff of the data it produces.

Five of the top protocols and their features that matter most to IoT are:

Constrained Application Protocol. Organizations use CoAP with limited hardware that has a low transmission rate because it's lightweight. The protocol is HTTP-friendly, using two basic message types: request and response. Messages can be confirmable or non-confirmable. Data packets are small, so message losses are few. The disadvantage is the protocol lacks security, which engineers normally can remedy with datagram transport layer security, but DTLS is of limited use in IoT.

Message Queue Telemetry Transport. MQTT is a publish/subscribe protocol, which is effective for lightweight machine-to-machine (M2M) connectivity over TCP and minimizes data loss. Publish/subscribe for IoT means clients don't have to call for updates, which lessens network traffic and processing load. The protocol also accommodates a range of quality enforcement levels, from single handshake delivery to acknowledgment requirement.

Extensible Message and Presence Protocol. XMPP is based on XML, the document-encoding markup language popular for its human-friendly readability. As an HTML extension, XMPP is useful for real-time communication, including presence, content syndication and instant messaging. The protocol is highly scalable and offers devices data-bearing nodes that can connect with other nodes by request to create complex local networking and data-sharing.

Advanced Message Queuing Protocol. AMQP is an asynchronous protocol. Like MQTT, it uses a publish/subscribe approach. Engineers use the protocol primarily over TCP, but it is also capable of other transport methods. The protocol is quality-flexible and offers an optional one-or-more delivery guarantee. AMQP implements security via Transport Layer Security and Secure Sockets Layer.

Representational State Transfer. REST is the most ubiquitous protocol and gives IoT synchronous request-response via HTTP. HTTP makes it feature-rich, as well as capable of authentication and caching, both of which are useful in complex environments, although difficult to implement in IoT. The protocol is both XML- and JSON-compatible, which is useful for M2M and communication with tablets and smartphones, a boon for IoT.

Dig Deeper on Internet of things networking