IoT Protocols | HTTP/2, WebSocket, MQTT, Zigbee, Matter, and Thread.

Soulaiman Ghanem
Code Factory Berlin
6 min readJun 25, 2023

IoT devices are everywhere in our life. We have them at work, at home, and in the city. They use a private network or the internet to send and receive data based on their state and duties. Consider the popularity of Amazon Echo and Google Home for examples of how IoT will eventually dominate our lives like smartphones. As this technology evolves, so must the protocols by which it operates.

I will try in this post to give you an overview of the available IoT protocols nowadays!

Please note that ChatGPT helped to summarize each protocol's key features :)

HTTP/2

HTTP/2 is the World Wide Web protocol that was developed as an enhancement over its predecessor, HTTP/1.1. It is designed to improve the performance and efficiency of web communication by reducing latency, enabling faster page load times, and optimizing resource delivery.

HTTP/2 brings several improvements to IoT communication. It introduces multiplexing, enabling multiple requests and responses to be sent over a single TCP connection, eliminating the need for multiple connections and improving efficiency. It adopts a binary protocol, which is more compact and efficient than the text format used in HTTP/1.1, resulting in faster and more reliable communication. HTTP/2 incorporates header compression with the HPACK algorithm, reducing data transmission overhead and benefiting requests with repetitive or redundant headers. Additionally, it introduces server push, allowing servers to proactively send resources to the client’s cache, reducing round trips and speeding up page load times.

HTTP/2 (github.com)

WebSocket

Unlike the traditional request-response model in HTTP/1, WebSocket enables real-time, bidirectional communication between a client and a server over a single TCP connection. It is full-duplex similar to HTTP/2. It persists the connection between the client and the server reducing the overhead and latency. WebSocket uses a lightweight header, resulting in lower overhead compared to HTTP/1. This makes it efficient for sending small packets of data frequently, which is especially useful for real-time applications.

We should notice the similarities between HTTP/2 and WebSocket and ask the question: Why not just use HTTP/2 as the newer technology? The point here is that the server push introduced in HTTP/2 transmits the data to the client, not directly to a client application. For this, many devices would still require an additional handshake like the one provided by a WebSocket.

http2 — Does HTTP/2 make websockets obsolete? — Stack Overflow

websockets/ws: Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js (github.com)

MQTT

Message Queuing Telemetry Transport is a dedicated lightweight IoT protocol in a resource-constrained environment. It is designed for efficient machine-to-machine communication in a publish-subscribe pattern.

Here are some of the MQTT’s key features:

  1. Lightweight and Efficient: MQTT is designed to be lightweight and efficient, making it suitable for resource-constrained devices and low-bandwidth networks. It uses a small message header and binary payload format, minimizing data overhead.
  2. Quality of Service (QoS) Levels: MQTT supports different levels of Quality of Service to ensure reliable message delivery. The three QoS levels are “at most once” (fire and forget), “at least once” (acknowledgment), and “exactly once” (guaranteed delivery). The appropriate level can be chosen based on the application’s requirements.
  3. Persistent Connections: MQTT allows for persistent connections between devices and brokers. Once a connection is established, devices can keep it open, minimizing the overhead of establishing new connections for each message.
  4. Last Will and Testament (LWT): MQTT provides a feature called Last Will and Testament, where a device can specify a message to be published by the broker if the device disconnects unexpectedly. This feature enables the detection and handling of offline devices.

eclipse/mosquitto: Eclipse Mosquitto — An open source MQTT broker (github.com)

Zigbee

Zigbee is a wireless communication protocol. It has found applications in various domains, including smart homes, building automation, industrial automation, and wireless sensor networks. Its focus on low power consumption, mesh networking, and reliability makes it well-suited for scenarios where battery-powered devices need to communicate wirelessly within a local network.

Here are some key characteristics and features of Zigbee:

  1. Low Power Consumption: It utilizes a low-power sleep mode, allowing devices to conserve power when not actively transmitting or receiving data. This enables long battery life for Zigbee-enabled devices.
  2. Mesh Networking: Zigbee employs a mesh networking topology, where devices can act as both end devices and routers. Each device can communicate directly with other devices within its radio range or use neighboring devices to relay messages, forming a self-healing and self-configuring network. This provides extended coverage and increases network resilience.
  3. Reliability and Interference Avoidance: Zigbee utilizes a frequency hopping technique to avoid interference from other wireless devices operating in the same frequency band. It dynamically changes channels to maintain communication reliability, even in the presence of interference.
  4. Low Data Rate: Zigbee is optimized for applications that require low data transfer rates, typically ranging from a few kilobits per second to a few hundred kilobits per second. This makes it suitable for applications that prioritize energy efficiency and long battery life over high-speed data transmission.

SmartThingsCommunity/SmartThingsPublic: SmartThings open-source DeviceType Handlers and SmartApps code (github.com)

Matter

The Matter protocol is an open-source, royalty-free connectivity protocol that brings together major technology companies including Apple, Google, Amazon, and the Zigbee Alliance. The goal of Matter is to enable interoperability and easy setup of smart home devices from different manufacturers, regardless of the underlying connectivity technology.

Here are some key aspects of the Matter protocol:

  1. Interoperability: Matter aims to establish a common standard that allows smart devices to work seamlessly with each other, regardless of the brand or ecosystem they belong to.
  2. Connectivity Agnostic: Matter is designed to be independent of the underlying network technology. It can work over various connectivity protocols such as Wi-Fi, Ethernet, Thread, and even low-power wireless protocols like Zigbee and Bluetooth Low Energy (BLE).
  3. Easy Setup and Configuration: Matter simplifies the setup and configuration process for smart home devices. It introduces a unified setup experience that enables devices to be easily discovered, added, and controlled by various smart home platforms and apps.
  4. Developer-Friendly: The Matter protocol provides a developer-friendly environment, offering standardized APIs and tooling to streamline the development and integration of smart home devices.

project-chip/connectedhomeip: Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance. (github.com

Thread

Thread is a wireless networking protocol designed specifically for IoT and smart home applications. It is based on IPv6 and operates over low-power wireless networks. It ensures interoperability between different Thread-certified devices, enabling seamless communication and integration within a Thread network.

Here are some key features and characteristics of the Thread protocol:

  1. Mesh Networking: Thread utilizes a mesh networking topology, where devices can act as routers and relays to extend network coverage. Each device in the network can communicate directly with its neighboring devices or use intermediate devices to relay messages, creating a self-healing and robust network infrastructure.
  2. IP-based Protocol: Thread is built on IPv6, which provides a large address space and enables direct communication between devices over the internet.
  3. Low Power Consumption: Thread is designed to be energy-efficient, allowing devices to operate on battery power for extended periods. It incorporates mechanisms such as low-duty-cycle operation, sleep modes, and efficient routing protocols to minimize power consumption.
  4. Easy Setup and Commissioning: Thread simplifies the process of setting up and commissioning devices within a network. It provides mechanisms for easy discovery, onboarding, and configuration of devices, reducing the complexity of deployment and enhancing the user experience.

openthread/openthread: OpenThread released by Google is an open-source implementation of the Thread networking protocol (github.com)

Summary

The choice of protocol depends on specific requirements such as scalability, power consumption, interoperability, and the application domain. It is common to find implementations that combine multiple protocols to meet various needs within an IoT ecosystem.

HTTP/2 and WebSocket are primarily used for web-based applications, with HTTP/2 providing efficient and multiplexed communication, and WebSocket enabling real-time bidirectional communication between clients and servers.

MQTT, Matter, Thread, and Zigbee are specifically designed for IoT applications, with varying focuses on messaging, interoperability, mesh networking, and low-power capabilities.

  • MQTT is a general-purpose messaging protocol suited for scalable and real-time communication across IoT devices and systems.
  • Matter focuses specifically on creating an interoperable standard for smart home devices, simplifying setup, and enabling seamless communication between different brands.
  • Thread is a mesh networking protocol designed for IoT and smart home applications, emphasizing reliability, security, and low power consumption.
  • Zigbee is a wireless protocol optimized for low-power, low-data-rate applications, offering mesh networking and standardized profiles for interoperability in home automation and industrial control.

--

--