With the development and popularization of Internet of Things technology, more and more intelligent devices are equipped with network connection and data transmission capabilities. Due to the complexity and diversity of Internet of Things scenarios, the device hardware conditions, network stability, traffic limitation, device power consumption, device connection number and other factors cause the message transmission of Internet of Things devices is very different from that of traditional Internet scenarios, and therefore, a variety of Internet of Things communication protocols have been generated.

This paper will select several mainstream iot protocols and introduce them one by one in terms of their technical characteristics, applicable scenarios, relative advantages and market conditions, so as to provide reference for iot practitioners and help them choose appropriate iot protocols in practical projects.

Classification of agreement

Before the introduction, we give a simple classification of iot protocols to facilitate readers to understand their application scenarios.

From a functional perspective

In terms of functions, they can be divided into two categories: physical layer/data link layer protocols and application layer protocols.

Physical layer/data link layer protocols are generally responsible for networking and communication between devices, such as 2G/3G/4G/5G, NB-iot, WiFi, ZigBee, LoRa and other long-distance communications, as well as near-range wireless protocols such as RFID, NFC, Bluetooth, RS232, USB and other wired protocols.

Application layer protocols are mainly device communication protocols running on the traditional Internet TCP/IP protocol. These protocols support data exchange and communication between devices and cloud platforms through the Internet. Common protocols include HTTP, MQTT, CoAP, LwM2M and XMPP.

From an application perspective

From the perspective of protocol application in iot system, we can divide protocol into cloud protocol and gateway protocol.

The cloud protocol is a protocol based on TCP/IP. The iot data such as sensors and control devices usually need to be transmitted to the cloud to connect users through the cloud and integrate with enterprise systems.

Internet of Things devices that support TCP/IP can access the cloud through WIFI, cellular network and Ethernet, using APPLICATION layer protocols such as HTTP, MQTT, CoAP, LwM2M and XMPP.

Gateway protocol is a protocol for short distance communication that cannot be directly connected to the cloud, such as Bluetooth, ZigBee, LoRa, etc. Such devices need to access the cloud through TCP/IP after gateway conversion.

ZigBee

Zigbee is a mesh network wireless protocol designed for building and home automation applications and is one of the most popular mesh protocols in the Internet of Things environment. At present, it is mainly used for LAN connection, and accesses and controls various devices as a gateway on the device side.

Protocol characteristics

  • Low power consumption: the transmitting power is only 1mW, in low power consumption standby mode, two no.5 dry batteries can be used for up to 2 years, eliminating the trouble of charging or frequent battery replacement.
  • Low cost: Because the simple and compact protocol greatly reduces its communication control requirements, thus reducing the hardware cost, while eliminating the protocol patent fee.
  • Low rate: ZigBee works at a rate of 20 KBPS to 250 KBPS (2.4GHz), 40kbps(915 MHz), and 20 KBPS (868 MHz) respectively, meeting the requirements of low-rate data transmission applications.
  • Short distance: the transmission range of adjacent nodes is between 10 and 100m, which basically covers ordinary home and office environment. The transmission power can be increased to 1 ~ 3km, and the transmission distance can be longer through the relay of routing and communication between nodes.
  • Low latency: ZigBee has a fast response speed. Generally, it only takes 15ms to switch from sleep to work and 30ms for nodes to connect to the network, which further saves electricity. In contrast, bluetooth takes 3 to 10 seconds and WiFi takes 3 seconds.
  • High capacity: ZigBee can adopt star, sheet and mesh network structure. A master node manages several child nodes, and a master node can manage 254 child nodes at most. At the same time, the primary node can also be managed by the upper-layer network nodes, which can form a maximum of 65,000 nodes.
  • High security: ZigBee provides the CRC packet integrity check function, supports authentication and authentication, and uses the AES-128 encryption algorithm. Each application can flexibly determine its security attributes.
  • License-free band: direct sequence spread spectrum for industrial science medicine (ISM) band: 2.4GHz (global), 915MHz (North America), 868MHz (Europe).

Market conditions

Zigbee technology has outstanding advantages such as low power consumption, large node capacity, short delay, safety and reliability. It can meet the application requirements of smart home and is the core wireless networking connection technology of smart home. Thanks to the rapid development of China’s smart home market, the number of smart home devices using Zigbee technology is increasing, and the application and promotion of Zigbee technology is accelerating.

Compared with WiFi and Bluetooth, which are both wireless LAN technology systems, Zigbee technology has outstanding advantages in power consumption, node capacity, AD hoc networking ability and security, and its application scale is expanding.

Resources: How much do you know about ZigBee technology?

NB-IoT

Nb-iot is a new cellular technology developed by 3GPP standardization Organization. It belongs to low power Wide Area (LPWA) Internet of Things connection. It is mainly used to connect terminals with limited bandwidth resources, allowing terminals to collect and exchange data with less resources than GRPS, 3G, LTE and other technologies.

The NB-iot witnessed rapid growth in 2017-2018, with commercial deployments being implemented by many operators around the world. The low cost, low power consumption and wide coverage of the NB-iot enable users to implement new scenarios and applications that traditional cellular networks cannot support.

On July 9, 2020, 3GPP announced that 5G R16 standard was frozen, and NB-iot was officially included in 5G standard, becoming the core technology of 5G mMTC mass Internet of Things connection scenario.

Protocol characteristics

  • Low-power “sleep” mode (PSM, eDRX) was introduced.
  • It reduces the requirement of communication quality and simplifies terminal design (half duplex mode, simplified protocol stack, etc.).
  • Two function optimization modes (CP mode and UP mode) are adopted to simplify the process and reduce the amount of interaction between terminals and networks.
  • Ultra low coverage, on the basis of GPRS enhanced coverage 20dB, coverage is three times that of GPRS.

Market conditions

At present, The NB-iot has entered the era of 100 million connections. With the subsequent construction of commercial NB-iot 5G networks by global operators, the NB-iot will continue to explode in various fields such as smart home, smart agriculture, industrial manufacturing, energy meter, fire smoke sensor, logistics tracking, financial payment and so on.

Take China Telecom Internet of Things Open platform as an example. This platform realizes centralized access to China Telecom NB-iot and other Internet of Things devices, and provides IoT device management, data interface and application enablement services for government and enterprise users.

EMQ has participated in the platform from the beginning of its construction, and cooperated with Tianyi IoT to develop the NB-iot device access and message routing capabilities for the platform, and at the same time support telecom TLINK, MQTT and other protocol equipment access. The overall design of the platform access capacity reaches 100 million levels.

Resources: Learn about the four key features of the NB-iot and its implementation techniques

LoRa

LoRa is a standard protocol for low power, Long Range, and wireless wide area networks. Its name comes from Long Range.

Compared with other wireless communication protocols such as ZigBee, Bluetooth and WIFI, LoRa’s biggest feature is that the transmission distance is longer under the same power consumption, realizing the unification of low power consumption and long distance. The distance of LoRa is 3-5 times larger than that of traditional RADIO frequency communication under the same power consumption.

LoRa’s wireless technologies for iot applications come in a variety of forms, including lans and wans. LoRa network consists of terminal (LoRa module can be built in), gateway (or base station), Server, and cloud.

LoRaWAN’s data transfer rates range from 0.3 KBPS to 37.5 KBPS. To maximize terminal device battery life and overall network capacity, The LoRaWAN network server uses a Rate Adaptive Data Rate (ADR) scheme to control the Data transfer Rate and the RF output power of each terminal device.

Protocol characteristics

  • Coverage: The covering distance of LoRa single gateway is generally in the range of 3-5km, and even more than 15km in broad areas.
  • Low power consumption: rechargeable battery power supply system can support for many years or even more than 10 years.
  • High capacity: access to a large number of terminals can be guaranteed thanks to the feature of no terminal connection.
  • Low cost: the cost of communication network is very low, and it is suitable for narrowband data transmission.
  • Security factor: AES128 encryption is used for high security.

Market conditions

LoRa is extremely flexible for rural or indoor application scenarios in smart agriculture, smart cities, industrial Internet of Things (IIoT), smart environments, smart homes and buildings, smart utilities and metering, and smart supply chains and logistics.

LoRa is convenient for networking and can be used to connect a wide range of devices at a low cost due to its strong penetration. Compared with nB-iot and carrier SIM card access, LoRa does not require annual card replacement or payment, and has a lower cost for long-term use.

Resources: What’s so great about LoRa for iot applications?

MQTT

MQTT protocol is an Internet of Things communication protocol based on publish/subscribe mode. It occupies half of the Internet of Things protocols with the characteristics of simple implementation, QoS support and small message size.

MQTT protocol is widely used in Internet of Things, mobile Internet, intelligent hardware, Internet of vehicles, power, energy and other fields. It can be used as a gateway to access communication on the device side, and also as a device-cloud communication protocol. Most of the gateway protocols such as ZigBee and LoRa are eventually converted into MQTT protocols to access the cloud.

Protocol characteristics

  • Lightweight and reliable: MQTT packets are compact and can be transmitted stably on severely restricted hardware devices and networks with low bandwidth and high latency.
  • Publish/subscribe: Based on publish/subscribe, the publish/subscribe model has the advantage of decoupling publishers and subscribers: subscribers and publishers do not need to establish a direct connection, and do not need to be online at the same time.
  • Built for the Internet of Things: Provides comprehensive iot application features such as heartbeat mechanism, testament messaging, QoS quality level + offline messaging, themes and security management.
  • More complete ecosystem: client and SDK covering the whole language platform, mature Broker server software, can support a large number of topics, tens of millions of devices access, provide rich enterprise integration capabilities.

Communication mode

MQTT uses publish-subscribe mode to communicate. The publish-subscribe mode is different from the traditional client-server mode in that it separates the sending client (publisher) from the receiving client (subscriber), and the publisher and subscriber do not need to establish direct contact. We can have multiple publishers publishing messages to a subscriber, or multiple subscribers receiving messages from a publisher at the same time.

Market conditions

MQTT is one of the most important standard protocols in the field of IoT, widely used in the Internet of Things, Internet of vehicles, industrial Internet of Things, smart home, smart city, power, oil and energy industries.

MQTT is the standard communication protocol of Internet of Things platform of top cloud manufacturers such as AWS IoT Core, Azure IoT Hub and Ali Cloud IoT Platform. It is the preferred protocol of cloud in various industries such as industrial Internet, Internet of vehicles and smart home as well as many gateway protocols.

As one of the most popular and mature MQTT brokers in the world, EMQX provides a “run anywhere, unlimited connectivity, arbitrary integration” cloud native distributed Internet of Things access platform, integrated distributed MQTT messaging service and powerful IoT rules engine. It provides power for high reliability and high performance real-time data movement, processing and integration of the Internet of Things, and helps enterprises quickly build business-critical IoT platforms and applications.

Resources: Introduction and progression to the MQTT protocol

CoAP

CoAP is an HTTP-like protocol in the Internet of Things world for use on resource-constrained Internet of Things devices. Its detailed specification is defined in RFC 7252.

As most devices of the Internet of Things are resource-limited, such as CPU, RAM, Flash, network broadband, etc. For such devices, it is not practical to use TCP and HTTP directly to implement the device for information exchange. In order to enable these devices to access the network smoothly, CoAP protocol came into being.

Protocol characteristics

CoAP takes a lot of HTTP design cues, but also refines many of the design details and adds a lot of practical functionality for resource-constrained devices.

  • Message model-based
  • The transport layer is based on UDP and supports restricted devices
  • Use a request/response model similar to HTTP requests, with HTTP in text format and CoAP in binary format, and more compact than HTTP
  • Support for two-way communication
  • Light weight, low power consumption
  • Support reliable transmission, data retransmission, block transmission to ensure reliable data arrival
  • IP multicast is supported
  • Support observation mode
  • Support asynchronous communication

Market conditions

CoAP is lighter and less expensive than MQTT, and is more suitable for certain device and network environments. EMQX and some public cloud iot platforms provide CoAP access capability, please refer to a “date” between MQTT and CoAP in EMQX world.

LwM2M

LwM2M is a lightweight iot protocol for resource-limited end-device management. LwM2M protocol was born at the end of 2013, proposed and defined by OMA (Open Mobile Alliance). The current mature version number is still 1.0, and OMA experts are working on version 1.1.

Protocol characteristics

The main entities of LwM2M protocol include LwM2M Server and LwM2M Client.

  • As a Server, LwM2M Server is deployed at the M2M service provider or network service provider.
  • The LwM2M Client is deployed on each LwM2M device as a Client.

In addition, Bootstrap Server (LwM2M) or SmartCard (SmartCard) can be added as required to complete initial boot for the client.

LwM2M protocol has the following outstanding features:

  • The protocol is based on REST architecture.
  • The protocol messaging is done through the CoAP protocol.
  • The protocol defines a compact, efficient and extensible data model.

In order to keep pace with The Times and achieve a concise and easy to understand style, LwM2M protocol uses REST.

However, because the protocol serves terminal devices with limited resources, the traditional HTTP data transmission method is too cumbersome to support limited resources, so THE REST style CoAP is selected to complete the message and data transmission. On the one hand, CoAP is based on UDP. Compared with TCP, CoAP works better in environments where network resources are limited and devices cannot be always online (for security reasons, DTLS based on UDP is used). On the other hand, the message structure of CoAP itself is very simple, and the message is compressed. The main part can be very small and does not need to occupy too much resources.

For similar reasons, the data structure of the protocol must be simple. LwM2M protocol defines a model with Resource as the basic unit. Each Resource can carry a value and point to an address to represent every available information in LwM2M client. Resources exist in an Object Instance, that is, an instantiation of an Object. LwM2M protocol predefined 8 kinds of objects to meet basic requirements, which are as follows:

Object Object ID
Security (Security object) 0
Server (Server object) 1
Access Control objects 2
Device (Device object) 3
Connectivity Monitoring 4
Firmware (Firmware object) 5
Location (Location object) 6
Connectivity Statistics (Connectivity Statistics object) 7

For extensibility, the protocol also allows you to customize as many objects as you need. In such a data model, resources, object instances, and objects are represented by numeric ids for maximum compression, so any resource can be represented with up to three levels of conciseness, For example, /1/0/1 represents the Server short ID resource in the first instance of the Server Object. In the registration phase, the LwM2M client passes the object instance with the resource information to the LwM2M server to inform the server of the capability of its own device.

EMQ also realizes LwM2M access capability on EMQX server and most functions of LwM2M protocol. LwM2M devices can be registered on EMQX-LWM2M, so as to access and manage devices through EMQX-LWM2M. The device can also report information to emQX-LWM2M and use the EMQ backend service to collect data.

XMPP

XMPP extensible message processing field protocol is an INSTANT messaging protocol based on XML, which embed communication context information into XML structured data, enabling instant communication between people, application systems and between people and application systems.

Protocol characteristics

  • All XMPP information is xmL-based, the de facto standard for information exchange, and extensible.
  • The XMPP system is a distributed system in which each server controls its own resources.
  • The XMPP protocol is open source and uses XML to define client-server interactions.

Market conditions

XMPP features mature and functional protocols and extensions designed specifically for instant chat (IM) scenarios. XMPP is an old instant-messaging protocol, and instant messaging programs like Google Hangouts and WhatsApp Messenger are based on XMPP.

However, because XMPP relies on XML protocol and is too heavy for IoT scenarios, it is basically not suitable for Internet of Things transport.

conclusion

Horizontally, the Internet of Things has a wide range of application scenarios in almost all industries, and each industry has different working conditions and networking modes. From the vertical perspective, the Internet of Things system covers the whole hardware and software chain of sensors/control devices, data access, transmission, routing and switching components, and data storage and processing. Reasonable and efficient technical solutions are required for each link.

At present, Internet of Things protocols present diversified development. Different industries and scenarios apply different protocols. In the same scenario, there can be multiple protocols to choose from, and no protocol can dominate the market. Therefore, to realize the interconnection of devices and data in the Internet of Things, the key point is not the unification of protocols, but the interconnection between different protocols and the unification of upper-layer business application layer protocols.

EMQ is dedicated to solving the problem of data connectivity of iot devices. The core product EMQX Internet of Things messaging server can connect to any device through the open standard MQTT, CoAP and LwM2M protocols. For the complex and diverse industrial protocols in industrial scenarios, for example, it can also be connected to a unified MQTT protocol by using edge industrial protocol gateway software Neuron. It can meet the data acquisition requirements of most Iot scenarios and provide an efficient and reliable data access layer for enterprise iot services.

Copyright: EMQ

Original link: www.emqx.com/zh/blog/iot…