Author: EMQ Technology
With the development and popularization of IoT technology, more and more smart devices are equipped with network connectivity and data transmission capabilities.
Due to the complexity and diversity of IoT scenarios, factors such as hardware conditions at the device end, network stability, traffic limitations, device power consumption, and the number of devices connected have resulted in significant differences in message transmission for IoT devices compared to traditional internet scenarios. This has led to the emergence of various IoT communication protocols.
This article will select several mainstream IoT protocols and introduce them one by one based on their technical characteristics, applicable scenarios, relative advantages, and market conditions, providing references for IoT practitioners to help them choose suitable IoT protocols for their actual projects.
Protocol Classification
Before the introduction, we will briefly classify IoT protocols to facilitate readers’ understanding of their application scenarios.
From a functional perspective
From a functional perspective, we can divide them into two major categories: one is physical layer/data link layer protocols, and the other is application layer protocols.
Physical layer/data link layer protocols generally handle networking and communication between devices, such as 2G/3G/4G/5G, NB-IoT, WiFi, ZigBee, and LoRa for long-distance communication, as well as short-distance protocols like RFID, NFC, Bluetooth, and wired protocols like RS232 and USB.
Application layer protocols primarily operate on top of the traditional internet TCP/IP protocols, facilitating data exchange and communication between devices and cloud platforms. Common protocols include HTTP, MQTT, CoAP, LwM2M, and XMPP.
From an application perspective
From the perspective of protocol application in IoT systems, we can classify protocols into cloud protocols and gateway protocols.
Cloud protocols are built on TCP/IP, and IoT data from sensors and control devices typically needs to be transmitted to the cloud, connecting users and integrating with enterprise systems.
IoT devices that support TCP/IP can connect to the cloud via WiFi, cellular networks, and Ethernet, using application layer protocols such as HTTP, MQTT, CoAP, LwM2M, and XMPP.
Gateway protocols are suitable for short-distance communication that cannot connect directly to the cloud, such as Bluetooth, ZigBee, and LoRa. Such devices need to connect to a gateway for conversion before accessing the cloud via TCP/IP.
ZigBee
ZigBee is a mesh network wireless protocol designed for building and home automation applications. It is one of the most popular mesh protocols in IoT environments. Currently, it is mainly used for connections within local area networks, acting as a gateway to control various devices.
Protocol Features
-
Low Power Consumption: The transmission power is only 1mW, and in low-power standby mode, two AA batteries can last up to 2 years, eliminating the hassle of recharging or frequent battery replacements.
-
Low Cost: The simple and compact protocol significantly reduces its requirements for communication control, thus lowering hardware costs, with no protocol patent fees.
-
Low Speed: ZigBee operates at a rate of 20-250kbps, providing raw data throughput rates of 250 kbps (2.4GHz), 40kbps (915 MHz), and 20kbps (868 MHz), meeting the needs of low-speed data transmission applications.
-
Short Range: The transmission range between adjacent nodes is between 10-100m, covering typical home and office environments; increasing transmission power can extend this to 1-3km, and through routing and relaying between nodes, transmission distances can be further increased.
-
Low Latency: ZigBee has a fast response time, generally taking only 15ms to transition from sleep to active mode, and 30ms for nodes to connect to the network, further saving energy. In comparison, Bluetooth takes 3-10s, and WiFi takes 3s.
-
High Capacity: ZigBee can adopt star, cluster, and mesh network structures, with one master node managing up to 254 child nodes; the master node can also be managed by a higher-level network node, allowing for a large network of up to 65,000 nodes.
-
High Security: ZigBee provides CRC packet integrity checking, supports authentication, and uses AES-128 encryption, allowing each application to flexibly determine its security attributes.
-
License-Free Frequency Bands: Direct sequence spread spectrum is used in the Industrial, Scientific, and Medical (ISM) frequency bands: 2.4GHz (global), 915MHz (North America), and 868MHz (Europe).
Market Status
ZigBee technology has outstanding advantages such as low power consumption, high node capacity, low latency, and high reliability, making it suitable for smart home applications and is the core wireless networking technology for smart homes.
Thanks to the rapid development of the smart home market in China, the number of smart home devices using ZigBee technology continues to grow, and the pace of application promotion for ZigBee technology is accelerating.
Compared to other wireless local area network technologies like WiFi and Bluetooth, ZigBee technology has significant advantages in power consumption, node capacity, self-organizing network capability, and security, with its application scale continuously expanding.
NB-IoT
NB-IoT is a new cellular technology standardized by the 3GPP organization, belonging to low-power wide-area (LPWA) IoT connections. It is mainly used to connect terminals with limited bandwidth resources, allowing terminals to collect and exchange data with fewer resources than GRPS, 3G, and LTE technologies.
NB-IoT developed rapidly from 2017 to 2018, with many global operators achieving commercial deployment successively. The low cost, low power consumption, and wide coverage of NB-IoT enable users to achieve new scenarios and applications that traditional cellular networks cannot support.
On July 9, 2020, 3GPP announced the freezing of the 5G R16 standard, officially incorporating NB-IoT into the 5G standard, making it a core technology for massive IoT connections in 5G mMTC.
Protocol Features
-
Introduced Low Power Sleep Modes (PSM, eDRX).
-
Reduced Communication Quality Requirements and simplified terminal design (half-duplex mode, simplified protocol stack, etc.).
-
Two Functional Optimization Modes (CP mode, UP mode) simplify processes and reduce interactions between terminals and networks.
-
Ultra-High Coverage: Coverage is enhanced by 20dB compared to GPRS, with a coverage range three times that of GPRS.
Market Status
Currently, NB-IoT has entered the era of hundreds of millions of connections. With the subsequent construction of full coverage of commercial NB-IoT 5G networks by global operators, NB-IoT will continue to explode in various fields such as smart homes, smart agriculture, industrial manufacturing, energy metering, fire alarm systems, logistics tracking, and financial payments.
Taking the China Telecom IoT open platform as an example, this platform achieves centralized access to China Telecom’s NB-IoT and other network IoT devices, providing IoT device management, data interfaces, and application enablement services for government and enterprise users.
EMQ Technology has participated in the construction of this platform from the beginning, collaborating with Tianyi IoT to develop NB-IoT device access and message routing capabilities, while also supporting access for protocols such as Telecom TLINK and MQTT, achieving a centralized access capability of hundreds of millions of connections. For more details, please refer to: During the NB-IoT Explosion Period, EMQ Assists Enterprises in Opening the Era of Hundreds of Millions of IoT Connections.
LoRa
The LoRa protocol is a low-power, long-range, wireless wide-area network standard protocol, with its name derived from the abbreviation for ‘Long Range’.
Compared to other wireless propagation protocols like ZigBee, Bluetooth, and WiFi, the biggest feature of LoRa is its ability to achieve longer transmission distances under the same power consumption, unifying low power consumption and long-range capabilities, expanding the communication distance by 3-5 times compared to traditional wireless RF communications at the same power consumption.
LoRa has various wireless technologies in IoT applications, capable of forming local or wide-area networks. A LoRa network mainly consists of four parts: terminals (which can have built-in LoRa modules), gateways (or base stations), servers, and the cloud.
LoRaWAN’s data transmission rate ranges from 0.3 kbps to 37.5 kbps. To maximize the battery life of terminal devices and the overall network capacity, the LoRaWAN network server controls data transmission rates and the RF output power of each terminal device through an Adaptive Data Rate (ADR) scheme.
Protocol Features
-
Coverage Area: A single LoRa gateway typically covers a distance of 3-5km, and in open areas, it can exceed 15km.
-
Low Power Consumption: Battery-powered systems can last for several years or even over a decade.
-
High Capacity: Thanks to the characteristics of terminal devices without connections, it can ensure the access of a large number of terminals.
-
Low Cost: The cost of communication networks is extremely low, and it also supports narrowband data transmission.
-
High Security: Utilizes AES128 encryption, providing high security.
Market Status
LoRa offers high flexibility for applications in smart agriculture, smart cities, industrial IoT (IIoT), smart environments, smart homes and buildings, smart utilities and metering, as well as smart supply chains and logistics.
LoRa networking is convenient, leveraging LoRa’s strong penetration capability to achieve low-cost connections for devices over a large area. Compared to connecting through NB-IoT and operator SIM cards, LoRa does not require annual card replacements or payments, resulting in lower long-term costs.
MQTT
The MQTT protocol is an IoT communication protocol based on the publish/subscribe model. With its simplicity, ease of implementation, support for QoS, and small message size, it occupies a significant share of the IoT protocol landscape.
MQTT is widely used in IoT, mobile internet, smart hardware, vehicle networking, electricity, energy, and other fields. It can serve as a gateway for device-side communication and as a communication protocol between devices and the cloud.
Most gateway protocols such as ZigBee and LoRa ultimately convert to MQTT for cloud access.
Protocol Features
-
Lightweight and Reliable: MQTT messages are compact and can achieve stable transmission on severely constrained hardware devices and low-bandwidth, high-latency networks.
-
Publish/Subscribe Model: Based on the publish/subscribe model, the advantage is the decoupling of publishers and subscribers: subscribers do not need to establish direct connections with publishers and do not need to be online simultaneously.
-
Designed for IoT: Offers a heartbeat mechanism, last will messages, QoS quality levels + offline messages, topic and security management, and other comprehensive IoT application features.
-
More Complete Ecosystem: Covers client and SDK support for all language platforms, has mature Broker server software, can support massive topics, and tens of millions of device connections, providing rich enterprise integration capabilities.
Communication Mode
MQTT uses a publish-subscribe communication model, distinguishing it from traditional client-server models. This model separates the sending client (publisher) from the receiving client (subscriber). Multiple publishers can send messages to a single subscriber, and multiple subscribers can simultaneously receive messages from a single publisher.
Market Status
MQTT is one of the most important standard protocols in the IoT field, widely used in IoT, vehicle networking, industrial IoT, smart homes, smart cities, and energy sectors.
MQTT is the standard communication protocol for top cloud vendors’ IoT platforms such as AWS IoT Core, Azure IoT Hub, and Alibaba Cloud IoT Platform. It is the preferred protocol for various industries, including industrial internet, vehicle networking, and smart homes, as well as many gateway protocols transitioning to the cloud.
EMQX, as a popular and mature MQTT Broker, provides a cloud-native distributed IoT access platform that operates anywhere with infinite connections and any integration. Its integrated distributed MQTT messaging service and robust IoT rules engine power high-reliability, high-performance real-time data movement, processing, and integration, assisting enterprises in rapidly building IoT platforms and applications for critical business needs.
CoAP
CoAP is an HTTP-like protocol in the IoT world, designed for resource-constrained IoT devices, with its detailed specifications defined in RFC 7252.
Since most IoT devices are resource-constrained in terms of CPU, RAM, Flash, and network bandwidth, it is unrealistic for such devices to directly use existing networks’ TCP and HTTP to exchange information. CoAP protocol was created to enable these devices to connect to the network smoothly.
Protocol Features
CoAP references many design ideas from HTTP while improving various design details based on the specific conditions of resource-constrained devices, adding many practical features.
-
Based on Message Model
-
Transport Layer Based on UDP Protocol, supporting constrained devices
-
Uses a request/response model similar to HTTP requests; HTTP is text-based, while CoAP is binary and more compact than HTTP.
-
Supports Bidirectional Communication
-
Lightweight and Low Power Consumption
-
Supports Reliable Transmission, Data Retransmission, Block Transmission, ensuring data reliably reaches its destination.
-
Supports IP Multicast
-
Supports Observe Mode
-
Supports Asynchronous Communication
Market Status
Compared to MQTT, CoAP is more lightweight and has lower overhead, making it more suitable for certain specific devices and network environments.
EMQX and some public cloud IoT platforms provide CoAP access capabilities.
LwM2M
LwM2M is a lightweight IoT protocol suitable for managing resource-constrained terminal devices.
The LwM2M protocol was proposed and defined by OMA (Open Mobile Alliance) at the end of 2013. The current mature version remains 1.0, while OMA experts are working on version 1.1.
Protocol Features
The main entities of the LwM2M protocol include the LwM2M Server and the LwM2M Client.
-
LwM2M Server acts as a server deployed at M2M service providers or network service providers.
-
LwM2M Client acts as a client deployed on various LwM2M devices.
Additionally, LwM2M bootstrap servers or smart cards can be added as needed to complete the initial bootstrapping of the client.
The LwM2M protocol has several outstanding characteristics:
-
Protocol Based on REST Architecture
-
Message Transmission Achieved via CoAP Protocol
-
Defines a Compact, Efficient, and Extensible Data Model
In line with current trends, the LwM2M protocol adopts REST for a simple and comprehensible style. However, since the protocol serves resource-constrained terminal devices, traditional HTTP data transmission methods are overly heavy and difficult to support with limited resources. Thus, CoAP, which has a REST style, was chosen for message and data transmission.
On one hand, CoAP is based on UDP, making it more adept in environments with limited network resources and where devices cannot always be online (for security reasons, it uses the DTLS security transport protocol based on UDP). On the other hand, CoAP’s message structure is very simple, with compressed messages that can be kept particularly small, requiring minimal resources.
For similar reasons, the protocol’s data structure must be simple enough. The LwM2M protocol defines a model based on resources (Resource), where each resource can carry values or point to addresses to represent each available piece of information in the LwM2M client. Resources exist in object instances (Object Instance), which are instantiations of objects (Object).
The LwM2M protocol predefines 8 types of objects (Object) to meet basic needs, which are:
Object |
Object ID |
Security (Security Object) |
0 |
Server (Server Object) |
1 |
Access Control (Access Control Object) |
2 |
Device (Device Object) |
3 |
Connectivity Monitoring (Connectivity Monitoring Object) |
4 |
Firmware (Firmware Object) |
5 |
Location (Location Object) |
6 |
Connectivity Statistics (Connectivity Statistics Object) |
7 |
Considering extensibility, the protocol also allows for the customization of more objects as necessary. In this data model, resources, object instances, and objects are represented using numerical IDs to achieve maximum compression, allowing any resource to be represented in a concise manner with up to 3 levels, e.g., /1/0/1 represents the server object (Server Object) in the first instance of the server short ID resource.
During the registration phase, the LwM2M client passes the object instances carrying resource information to the LwM2M server to notify the server of the capabilities of its device.
EMQ has also implemented LwM2M access capabilities on the EMQX server, realizing most functions of the LwM2M protocol. LwM2M devices can register with EMQX-LWM2M, allowing for access and management of devices, and devices can report information to EMQX-LWM2M and use EMQ’s backend services to collect data.
XMPP
XMPP (Extensible Messaging and Presence Protocol) is an XML-based instant messaging protocol that embeds communication context information into XML-structured data, enabling real-time communication between people, application systems, and between people and application systems.
Protocol Features
-
All XMPP Messages Are Based on XML, making it a fact standard for information exchange with strong extensibility.
-
XMPP Systems Are Distributed, with each server controlling its own resources.
-
XMPP Protocol Is Open Source, defining interactions between clients and servers using XML.
Market Status
XMPP is characterized by mature protocols and extensions, with complete functionalities designed specifically for instant messaging (IM) scenarios. It is an established instant messaging protocol, with applications like Google Hangouts and WhatsApp Messenger based on XMPP.
However, due to XMPP’s reliance on XML protocols, it is considered too heavy for IoT transmission scenarios, thus it is generally unsuitable for IoT transmission.
Conclusion
Horizontally, IoT has a wide range of application scenarios across almost all industries, each with different working conditions and networking modes; vertically, IoT systems encompass the entire hardware and software chain, including sensors/control devices, data access, transmission, routing and switching components, as well as data storage and processing, each of which requires reasonable and efficient technical solutions.
Currently, IoT protocols are diversifying, with different industries and scenarios suitable for different protocols. In the same scenario, multiple protocols may also be available for selection, with no single protocol dominating the market. Various protocols exhibit certain complementary effects.
Therefore, to achieve interconnectivity of IoT devices and data, the key point lies not in protocol unification but in the interconnectivity between different protocols and the unification of upper-layer business application layer protocols.
EMQ is committed to solving the data connectivity issues of IoT devices. The EMQX IoT messaging server can connect any device through open standard protocols such as MQTT, CoAP, and LwM2M. For complex and diverse industrial protocols in industrial scenarios, it can also convert to a unified MQTT protocol through the edge industrial protocol gateway software Neuron, meeting the data collection needs in most IoT scenarios and providing an efficient and reliable data access layer for enterprises’ IoT businesses.
end
One Click Linux
Follow and reply 【1024】 to receive a wealth of Linux materials
Collection of Wonderful Articles
Article Recommendations
Click “Read the Original” for more shares, and feel free to share, save, like, and view