For software companies, the IoT model brings decisive changes to their hardware design and the services they provide. One of the most impactful aspects is the communication protocols.
Communication protocols can be thought of as a language, allowing two or more devices to communicate with each other. Just as there are rules in any system, communication protocols also follow a set of rules that enable devices to exchange meaningful information. In distributed systems, communication protocols are extremely important, as the same protocol can run independently in different parts across multiple locations. The processes within the system may vary, so a common set of instructions for communication is necessary.
The rise of IoT owes much to the concept of Cyber-Physical Systems (CPS), which integrates physical devices with the internet to transmit and receive data, forming the basis for the true realization of IoT solutions. At the same time, this also increases the complexity of existing communication protocols and the internet.
The development of IoT has brought many possibilities, but the only feasible approach is for machine-to-machine (M2M) connections to achieve real-time effective connectivity over the internet. A device being connected to the internet is merely seen as a product of human interaction rather than a natural outcome. Therefore, communication between protocols and the internet always develops on an unreliable and slow basis.
Besides communication protocols, another aspect of the internet protocol architecture is the TCP/IP stack, which controls data transmission between two computers. A connection is established through a three-way handshake, where the client confirms the receipt of data and sends a confirmation message to the server. The second handshake occurs when the server receives the client’s data and returns a confirmation receipt, and the third handshake involves the client sending a confirmation receipt back to the server, thus closing the communication channel.
The advantages of this communication method include reliability and the ability to share all transmitted data, but due to the verification process required, it can be time-consuming.
The User Datagram Protocol (UDP) is a faster communication method because it reduces the need for confirmation processes. It is a connectionless protocol that sends data packets directly without establishing a connection with the other party. Therefore, compared to TCP/IP, UDP’s reliability is relatively low, but it is faster. For rapid prototyping in M2M projects, a very simple solution is to use UDP, as the UDP header contains very few bytes, consuming less than TCP.
In IoT development, the biggest difference in protocols lies in the application layer of the OSI model. This layer specifies the interface methods in communication networks, determining how systems connect to servers and how data is transmitted.
In fact, the most popular communication protocol is the Hyper Text Transfer Protocol (HTTP), primarily used in web browsers. It operates on a client/server model, where the server responds to any client requests. Since web pages may load a lot of content, it is necessary for this protocol to be built on top of the TCP/IP stack.
MQ Telemetry Transport (MQTT) is a lightweight connection protocol designed for IoT applications. It uses a publish/subscribe method to transmit data over a TCP/IP network. The design philosophy is open, simple, lightweight, and easy to implement, making it an ideal platform for IoT development.
MQTT has many useful functions applicable to IoT applications. In simple terms, imagine a bulletin board where you can post or pin messages anytime. Anyone interested in what you have posted can see it.
MQTT essentially serves this function.
MQTT consists of two parts: the client and the broker. The client can access or modify device data, while the broker holds and transmits the data.
MQTT uses a publish/subscribe messaging model. Clients can publish specific parameter data to the broker under a topic. Another client interested in that topic can subscribe to it and receive updated messages regularly.
MQTT provides quality of service (QoS) from an IoT perspective, which essentially prioritizes messages. In any case, an important message can be transmitted to its destination, thus ensuring service quality (QoS). Although the transmission speed may slow down, delivery is guaranteed. A dynamic data source prioritizes speed over efficiency, but assigning a lower QoS is more like a “fire-and-forget” event, similar to UDP.
Under a topic, MQTT can retain the last received message, provided it is sent to subscribers once the subscription chain is initiated. This allows subscribers to connect asynchronously within an existing client and broker network. It also provides a tool for checking redundancy and data loss.
MQTT clients have a property known as Last Will and Testament. This property allows clients to send notifications to the broker in the event of an unexpected disconnection. This quick feedback is beneficial for wireless sensor networks to automatically regenerate while detecting and fixing missing nodes and anomalies, ultimately ensuring a perfect flow of data within the wireless sensor network.
CoAP is a RESTful model-based network transport protocol primarily used for lightweight M2M communications. Many devices in the Internet of Things are resource-constrained, with limited memory space and computing power, making traditional HTTP protocols too bulky and unsuitable for IoT. CoAP was born out of this necessity.
In terms of user visibility, CoAP mimics HTTP protocols. From this perspective, reading sensor data is essentially like making an HTTP request.
CoAP is considered a technology protocol that will not become obsolete. According to Gartner’s prediction, 50 billion devices will connect to the internet, and future developments will urgently require low-cost, low-power devices. The CoAP protocol is designed for systems with as little as 10 kb of RAM.
One of the more interesting features of CoAP is its ability to discover nodes within a network. This is very useful for the autonomous and self-healing designs of low-power wireless sensor networks. Regarding the scalability of wireless sensor networks, the CoAP protocol can be used to discover regular redundancies in nodes.
CoAP is built on top of the UDP stack, which is the main difference compared to HTTP or MQTT. It allows for faster and better resource optimization rather than being resource-intensive.
However, under the CoAP protocol, the QoS factor remains unchanged, making CoAP relatively less reliable compared to HTTP/MQTT. Nevertheless, the 4-byte header is a good choice for continuous flow systems like environmental monitoring sensor networks.
1.Mutual disdain between analog and digital electronics leads to unexpected outcomes…
2.Kai-Fu Lee discusses with the head of MIT lab: The transformation in the AI era is faster than any industrial revolution!
3.Devices eventually “die” either due to lifespan or pressure!
4.How to hide your programmer aura~
5.Why is Python considered the leading language in the AI era?
6.A comprehensive list of common mistakes made by electronic engineers; see if you have fallen victim!
Disclaimer: This article is a reprint from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact us, and we will confirm the copyright based on the materials you provide and either pay for the manuscript or delete the content.