Communication is essential and crucial for the Internet of Things (IoT). Both short-range wireless transmission technologies and mobile communication technologies influence the development of IoT. Among these, communication protocols are particularly important, serving as the rules and agreements that must be followed by both parties to complete communication or provide services. This article introduces several available IoT communication protocols, which differ in performance, data rates, coverage, power, and memory. Each protocol has its own advantages and disadvantages. Some of these protocols are only suitable for small home appliances, while others can be used in large-scale smart city projects.
Internet of Things (IoT) communication protocols are divided into two main categories:
One type is the access protocol: it is generally responsible for networking and communication between devices within a subnet.
One type is communication protocols: these are device communication protocols that run on top of the traditional Internet TCP/IP protocol and are responsible for devices to exchange data and communicate over the Internet.
01. Physical Layer and Data Link Layer Protocols
1. Long-distance cellular communication (1) 2G/3G/4G communication protocols, which refer to the second, third and fourth generation mobile communication system protocols respectively.
(2) Narrow Band Internet of Things (NB-IoT) has become an important branch of the Internet of Everything. NB-IoT is built on cellular networks, consuming only about 180kHz of bandwidth, and can be directly deployed on GSM, UMTS, or LTE networks to reduce deployment costs and achieve smooth upgrades. NB-IoT focuses on the Low Power Wide Coverage (LPWA) Internet of Things (IoT) market and is an emerging technology that can be widely used globally. It features wide coverage, high connectivity, high speed, low cost, low power consumption, and superior architecture.
Application scenarios: Application scenarios brought about by NB-IoT networks include smart parking, smart fire protection, smart water management, smart street lights, shared bicycles, and smart home appliances.
(3) 5G is the fifth-generation mobile communication technology, the latest generation of cellular mobile communication technology. The performance goals of 5G are high data rate, reduced latency, energy saving, cost reduction, increased system capacity and large-scale device connectivity. Application scenarios: AR/VR, Internet of Vehicles, smart manufacturing, smart energy, wireless healthcare, wireless home entertainment, connected drones, ultra-high-definition/panoramic live streaming, personal AI assistance, smart cities.
2. Long-distance non-cellular communication (1) WiFi Due to the rapid popularization of home WiFi routers and smartphones in recent years, the WiFi protocol has also been widely used in the smart home field. The biggest advantage of the WiFi protocol is that it can directly access the Internet. Compared with ZigBee, smart home solutions using the WiFi protocol eliminate the need for an additional gateway, and compared with the Bluetooth protocol, it eliminates the dependence on mobile terminals such as mobile phones.
The coverage of commercial WiFi in public places such as urban public transportation and shopping malls has clearly demonstrated the application potential of commercial WiFi.
(2) ZigBee ZigBee is a low-speed, short-range wireless communication protocol and a highly reliable wireless data transmission network. Its main features include low speed, low power consumption, low cost, support for a large number of network nodes, support for various network topologies, low complexity, speed, reliability, and security. ZigBee technology is a new technology that has recently emerged. It mainly relies on wireless networks for transmission and can make wireless connections at short distances. It belongs to wireless network communication technology.
The inherent advantages of ZigBee technology have made it a mainstream technology in the Internet of Things industry, with large-scale applications in fields such as industry, agriculture, and smart homes.
(3) LoRa LoRa (Long Range) is a modulation technology that provides a longer communication distance compared to similar technologies. LoRa gateways, smoke detectors, water monitoring, infrared detection, positioning, power strips, and other IoT products are widely used. As a narrowband wireless technology, LoRa uses time difference of arrival (TDOA) to achieve geographic positioning. Application scenarios for LoRa positioning include: smart cities and traffic monitoring, metering and logistics, and agricultural positioning monitoring.
3. Short-Range Communication (1) RFID Radio Frequency Identification (RFID) is an abbreviation for Radio Frequency Identification. Its principle is that the reader and the tag conduct non-contact data communication to achieve the purpose of identifying the target. RFID has a wide range of applications, typical applications include animal microchips, car microchip anti-theft devices, access control, parking management, production line automation, and material management. A complete RFID system consists of three parts: a reader, an electronic tag, and a data management system.
(2) NFC. NFC stands for Near Field Communication. NFC is developed based on contactless radio frequency identification (RFID) technology and combined with wireless interconnection technology. It provides a very secure and fast communication method for various electronic products that are becoming increasingly popular in our daily lives. The "near field" in the Chinese name NFC refers to radio waves near electromagnetic fields.
Application scenarios: It can be used in access control, attendance, visitor management, meeting check-in, and patrol systems. NFC has functions such as human-computer interaction and machine-to-machine interaction.
(3) Bluetooth technology is an open global standard for wireless data and voice communication. It is a special short-range wireless technology connection based on low-cost short-range wireless connection to establish a communication environment for fixed and mobile devices.
Bluetooth enables wireless information exchange between a wide range of devices, including mobile phones, PDAs, wireless headsets, laptops, and related peripherals. Utilizing Bluetooth technology, communication between mobile communication terminal devices can be effectively simplified, as can communication between devices and the Internet, making data transmission faster and more efficient, thus paving the way for wireless communication.
4. Wired Communication (1) USB USB is an abbreviation for Universal Serial Bus, an external bus standard used to regulate the connection and communication between computers and external devices. It is an interface technology used in the PC field.
(2) Serial communication protocol. A serial communication protocol is a specification that defines the content of a data packet, which includes a start bit, main data, parity bit, and stop bit. Both parties need to agree on a consistent data packet format in order to send and receive data normally. Commonly used protocols in serial communication include RS-232, RS-422, and RS-485.
Serial communication refers to a communication method in which peripherals and computers transmit data bit by bit via data cables. This communication method uses fewer data cables, which can save communication costs in long-distance communication, but its transmission speed is lower than that of parallel transmission. Most computers (excluding laptops) contain two RS-232 serial ports. Serial communication is also a commonly used communication protocol for instrumentation and equipment.
(3) Ethernet Ethernet is a computer local area network technology. The IEEE 802.3 standard organized by IEEE has formulated the technical standard for Ethernet, which specifies the contents including physical layer wiring, electronic signals and media access layer protocols.
(4) MBus MBus remote meter reading system (symphonic mbus) is a European standard 2-wire bus, mainly used for consumption measuring instruments such as heat meters and water meters.
02. Network Layer, Transport Protocol
1. IPv4, the fourth version of the Internet Protocol, is the fourth revision in the development of the Internet Protocol and the first version to be widely deployed. IPv4 is the core of the Internet and the most widely used version of the Internet Protocol.
2. IPv6 (Internet Protocol version 6) addresses the major problem with IPv4: the limited number of network address resources, which severely restricts the application and development of the internet. The use of IPv6 not only solves the problem of limited network address resources but also removes obstacles for various access devices to connect to the internet.
3. The Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP is designed to adapt to layered protocol hierarchies that support multiple network applications. Pairs of processes in host computers connected to different but interconnected computer networks rely on TCP for reliable communication services. TCP assumes that it can obtain simple, potentially unreliable datagram services from lower-level protocols.
4. 6LoWPAN 6LoWPAN is a low-speed wireless personal area network standard based on IPv6, namely IPv6 over IEEE 802.15.4.
03. Application Layer Protocol
1. MQTT protocol
MQTT (Message Queue Telemetry Transport) is a telemetry transport protocol that primarily provides two message modes: publish/subscribe. It is simpler, lighter, and easier to use, making it particularly suitable for message distribution in constrained environments (low bandwidth, high network latency, and unstable network communication). It is a standard transport protocol for the Internet of Things (IoT).
In many situations, including constrained environments, such as machine-to-machine (M2M) communication and the Internet of Things (IoT), it is widely used in sensors communicating via satellite links, medical devices making occasional dial-up calls, smart homes, and some miniaturized devices.
2. CoAP Protocol: CoAP (Constrained Application Protocol) is a web-like protocol used in the Internet of Things (IoT) world. It is suitable for small, low-power sensors, switches, valves, and similar components that require remote control or monitoring over a standard internet network. Servers may not respond to unsupported types.
3. REST/HTTP Protocol RESTful is a resource-based software architecture style. A resource is an entity on the network, or a specific piece of information on the network. An image or a song is a resource. RESTful APIs are implementations based on the HTTP protocol. (HTTP is an application layer protocol, characterized by its simplicity and speed).
An application or design that conforms to the REST specification is called RESTful, and an API designed according to the REST specification is called a RESTful API.
4. DDS Protocol: DDS (Data Distribution Service) is a middleware protocol for distributed real-time data distribution services. It is the "TCP/IP" in distributed real-time networks, used to solve the interconnection of network protocols in real-time networks. Its role is equivalent to a "bus on a bus".
5. AMQP Protocol AMQP, or Advanced Message Queuing Protocol, is an application-layer standard that provides a unified messaging service. It's an open standard for application-layer protocols, designed for message-oriented middleware. Clients and message middleware based on this protocol can exchange messages without being limited by different client/middleware products or different development languages. Implementations in Erlang include RabbitMQ.
6. XMPP Protocol XMPP is a protocol based on XML, a subset of Standard Generalized Markup Language (SGML), inheriting the flexibility and extensibility inherent in the XML environment. Therefore, applications based on XMPP possess superior scalability. Extended versions of XMPP can handle user requests by sending extended information, and applications such as content publishing systems and address-based services can be built on top of XMPP.
04. Comparison of Some Communication Protocols
1. Comparison of NB-IoT and LoRa protocols
First, the frequency band. LoRa operates in unlicensed frequency bands below 1GHz, so no additional fees are required for its application. NB-IoT and cellular communication use licensed frequency bands below 1GHz, which require payment.
Second, battery life. LoRa modules have unique characteristics in handling interference, network overlap, and scalability, but they cannot provide the same quality of service as cellular protocols. NB-IoT, for the sake of quality of service, cannot provide the same battery life as LoRa.
Third, equipment costs. For end nodes, the LoRa protocol is simpler and easier to develop than NB-IoT, and it has better applicability and compatibility with microprocessors. Meanwhile, low-cost, relatively mature LoRa modules are already available on the market, and upgraded versions will continue to emerge.
Fourth, network coverage and deployment timeline. The NB-IoT standard was released in 2016. Besides network deployment, the corresponding commercialization and industry chain establishment will require even more time and effort to explore. The LoRa industry chain is relatively mature, and its products are poised for launch. Meanwhile, many countries around the world are currently undertaking or have already completed nationwide network deployments.
2. Comparison of Bluetooth, WiFi, and ZigBee protocols: Currently, WiFi's advantage lies in its widespread application, having reached countless households; ZigBee's advantages are low power consumption and self-organizing networks; UWB carrier-free wireless communication technology's advantage is its transmission speed; and Bluetooth's advantage is its simple networking capabilities. However, each of these three technologies also has its own shortcomings, and no single technology can fully meet all the requirements of a smart home.
The emergence of Bluetooth technology has made short-range wireless communication possible, but its complex protocol, high power consumption, and high cost make it unsuitable for industrial control and home networks that require low cost and low power consumption. In particular, Bluetooth's biggest obstacle is its limited transmission range, which is generally effective at around 10 meters. Weak anti-interference capabilities and information security issues are also major factors restricting its further development and large-scale application.
WiFi is also a short-range wireless transmission technology that allows for on-the-go access to wireless signals, offering high mobility and making it suitable for office and home environments. However, WiFi also has a fatal flaw. Because WiFi uses radio frequency technology to send and receive data through the air, transmitting data signals using radio waves, it is relatively susceptible to external interference.
ZigBee is an internationally recognized wireless communication technology. Each of its network ports can connect up to 65,000 devices, making it suitable for use in various fields such as home, industry, and agriculture. In contrast, Bluetooth and WiFi networks can only connect 10 ports, which is clearly insufficient for home use. ZigBee also has the advantages of low power consumption and low cost.
3. Comparison of MQTT and CoAP protocols: MQTT is a many-to-many communication protocol used to transmit messages between different clients through an intermediary broker, decoupling producers and consumers. It allows clients to publish messages, while the broker determines the routing and copies the messages. Although MQTT supports some persistence, it is best used as a real-time data communication bus.
CoAP is primarily a point-to-point protocol used to transfer state information between clients and servers. While it supports observing resources, CoAP is best suited for stateful transport models and is not entirely event-based.
The MQTT client establishes a long TCP connection, which usually indicates that there is no problem. Both the CoAP client and the server send and receive UDP packets. In a NAT environment, tunneling or port forwarding can be used to allow CoAP, or like LWM2M, the device may initialize the front-end connection first.
MQTT does not provide support for type tagging or other metadata to help clients understand messages. MQTT messages can be used for any purpose, but all clients must know the data format to allow communication. CoAP, on the other hand, provides built-in support for content negotiation and discovery, allowing devices to probe each other to find ways to exchange data. Both protocols have their advantages and disadvantages; the appropriate choice depends on the application.