Sure, It’s All Connected, But How? (Application Layer Protocols Explained)

steven arellano
4 min readJan 25, 2023

The Internet of Things is the growing network of physical devices that collect information from the environment and transfer it from device to device. These devices collect billions, if not trillions, of gigabytes of data; for this reason, standards must be set to ensure the efficiency and safe transfer of data. In the 1970s, the International Organization for Standardization created the Open Systems Interconnection reference model, a framework for understanding how communication protocols function and interact.

The OSI Model

The OSI model is an important framework for understanding networking as a seven-layer system, each with its own unique function. It is especially relevant for the Internet of Things — where connectivity is key. The OSI model is comprised of the following layers ordered from 1 to 7: physical, data link, network, transport, session, presentation, and application.

How each of them works is beyond the scope of this article; however, what is important is that each layer represents different parts of networking. Each layer provides a set of protocols for the respective platforms and resources to rely on. The 7th layer, the application layer, is the layer closest to the end-user and is responsible for receiving information from other devices and displaying data to the user. This layer provides protocols for applications such as Google Chrome, Firefox, etc., to rely on. These protocols enable the applications and the end-users to communicate over a given network. The rest of this article will discuss which application layer protocols you may see in the Internet of Things industry, how they work, and when to use them.

Photo by Ashwini Chaudhary(Monty) on Unsplash

Application Layer Protocols

Here are a few application layer protocols, how they work, and when to use them:

Hyper Transfer Protocol (HTTP)

Key Terms:

  • Request: an HTTP request is the way that a client asks for information from a server.
  • Response: the response is what is sent back the client from the server after a request.
  • Method: indicates the action that the HTTP request expects from the queried server.
  • Body: the body of both responses and requests contains key information meant to be passed between requests and responses.
  • Header: the headers of both responses and requests contains information about how the requests and responses should be read and handled.

How it works:

  • To transfer information with the server, the client sends an HTTP request containing a header and body; the server processes this request and returns a response to the client.

When to use:

  • Use when building web-based applications that require the transfer of large amounts of data, such as online shopping websites or social media platforms.
  • This protocol is starting to be less used in IoT due to energy constraints.

Message Queuing Telemetry Transport (MQTT)

Key Terms:

  • Topic: topics are a field of interest for devices to publish and subscribe to.
  • Publish: publishing is how the devices submit information on a particular topic.
  • Subscribe: subscribing enables devices to look out for a particular topic.
  • Broker: the broker is the device responsible for receiving subscriptions and publishments and consequently filtering them to the appropriate devices.

How it works:

  • To transfer information, a device will publish to a particular topic that has other devices subscribed to it. The broker handles publications and distributes them to the appropriate subscribers.

When to use:

  • Use when building IoT applications requiring low-power, low-bandwidth communication, such as smart home systems or industrial sensor networks.

Advanced Message Queueing Protocol (AMQP)

Key Terms:

  • Publisher: A publisher is a program or system that sends messages to a message broker.
  • Message: A message is a piece of data sent from a publisher to a subscriber via a message broker.
  • Subscriber: A subscriber is a program or system that receives messages from a broker.
  • Message Broker: A message broker is a system that acts as an intermediary between publishers and subscribers, routing messages between them.
  • Message Exchange: A message exchange is sending and receiving messages between publishers and subscribers via a message broker.
  • Message Queue: A message queue is a data structure that holds messages waiting to be processed by a subscriber.
  • Connection: A connection refers to the link between a publisher or subscriber and the message broker.
  • Channel: A channel is a virtual connection within a connection, allowing for multiple concurrent exchanges on a single connection.

How it works:

  • A publisher sends a message to an exchange on a broker, which then routes the message to one or more message queues. Subscribers connect to the message broker and consume messages from the message queues. The message broker ensures that each message is delivered to the correct subscriber.

When to use:

  • Use when building enterprise systems that require a high-performance, reliable messaging infrastructure, such as financial systems or supply chain management systems.

Constrained Application Protocol (CoAP)

Key Terms:

  • Endpoint: An endpoint is a device or application that communicates using CoAP.
  • Resource: A resource is specific information or functionality that an endpoint can access.
  • Request: A request is a message sent from an endpoint to a server to retrieve or manipulate a resource.
  • Response: A response is a message sent from a server to an endpoint in response to a request.
  • Observe: Observe is a feature of CoAP that allows an endpoint to receive notifications when the state of resource changes.
  • Blockwise transfer: Blockwise transfer is a feature of CoAP that allows a server to send large resources in smaller blocks, allowing for more efficient transfer over constrained networks.
  • URI: A URI (Uniform Resource Identifier) is a string that identifies a resource and can be used to access it.

How it Works:

  • An endpoint sends a CoAP request to access the server’s resources, which then sends back a response.
  • It uses REST-based principles to transfer ample resources in smaller blocks.

When to use:

  • Use when building IoT applications that operate on constrained networks, such as low-power, low-bandwidth networks, or when building applications that require the ability to observe and receive notifications when the state of resource changes.

--

--

steven arellano

builder. taking a break from blogging due to an internship.