An overview of networking protocols and message exchange protocols for IoT

Hello, Habr users! The first online IoT developer course in Russia is starting at OTUS this October. We are currently accepting applications for the course, and to support this, we continue to share useful materials with you.

An overview of networking protocols and message exchange protocols for IoT

The Internet of Things (IoT) will be built upon the existing network infrastructure, technologies, and protocols currently used in homes/offices and on the Internet, and will offer much more.

The aim of this guide is to provide a brief overview of the network and application protocols for IoT.

Note: You should have knowledge of the fundamentals of networking technologies.

IoT networks

IoT will operate on existing TCP/IP networks.

TCP/IP uses a four-layer model with specific protocols at each layer. See understanding the TCP/IP 4 layer model (exploring the four-layer TCP/IP model).

The diagram below shows a comparison of currently used protocols and those that are likely to be used for IoT.

An overview of networking protocols and message exchange protocols for IoT

Notes on the diagram:

  1. The font size displays the popularity of the protocol. For example, leftward IPv4 is larger because it is much more popular in today's Internet. However, to the right, it is smaller since IPv6 is expected to be more popular in IoT.

  2. Not all protocols are shown.

  3. Most changes are expected at the link (levels 1 and 2) and application layers (level 4).

  4. The network and transport layers are likely to remain unchanged.

Link layer protocols

At the link layer (Data Link), you need to connect devices to each other. They can be near, such as in local networks, or far apart: in metropolitan area networks and wide area networks.

Currently, Ethernet and Wi-Fi are used at this level in home and office networks (LAN), while 3G/4G are used in mobile networks (WAN). However, many IoT devices are low-power, such as sensors, and are powered only by batteries. In these cases, Ethernet is unsuitable, but low powered Wi-Fi and low powered Bluetooth can be used.

While existing wireless technologies (Wi-Fi, Bluetooth, 3G/4G) will still be used to connect these devices, it's also worth looking at new technologies specifically developed for IoT applications, which are likely to grow in popularity.

Among them:

  • BLE – Bluetooth Low Energy

  • LoRaWAN – Long Range WAN

  • SigFox

  • LTE-M

More details are described in the article An overview of IoT wireless technologies (an overview of IoT wireless technologies).

Network Level

At the network layer (Networking), the protocol will dominate in the long term IPv6. It is unlikely that IPv4 will be used, but it may play a certain role in the early stages. Most IoT devices for the home, such as smart bulbs, currently use IPv4.

Transport layer 

At the transport layer (Transport), TCP dominates on the internet and the web. It is used in both HTTP and many other popular internet protocols (SMTP, POP3, IMAP4, etc.).

MQTT, which I expect will become one of the main application layer protocols for messaging, currently uses TCP.

However, in the future, due to lower overhead, I expect UDP to become more popular for IoT. Perhaps there will be a wider adoption of MQTT-SN, which works over UDP. See the article on the comparison of TCP vs UDP .

Application layer and messaging protocols

Important characteristics for IoT protocols:

  • Speed — the amount of data transmitted per second.

  • Latency — the time required to transmit a message.

  • Power consumption.

  • Security.

  • Availability of software tools.

Currently, two main protocols are actively used at this level: HTTP and MQTT.

HTTP is probably the most well-known protocol at this level, underpinning the web (WWW). It will still be important for IoT as it is used for REST APIs — the primary mechanism for interaction between web applications and services. However, due to high overhead, HTTP is unlikely to become the primary IoT protocol, although it will continue to be widely used on the internet.

MQTT (Message Queuing Telemetry Transport) has become the primary messaging protocol in IoT due to its lightweight nature and ease of use. See the article Introduction to MQTT for beginners (Introduction to MQTT for beginners).

Comparison of HTTP and MQTT for IoT

MQTT is quickly becoming the de facto standard for IoT applications. This is due to its lightweight and speed compared to HTTP, along with the fact that it is a 'one-to-many' protocol rather than 'one-to-one' (like HTTP).

Many modern web applications would gladly use MQTT instead of HTTP if it had been available at the time of their development.

A good example is sending information to multiple clients, such as train/ bus/ flight arrivals and departures. In this scenario, a one-to-one protocol like HTTP has significant overhead and can create a heavy load on web servers. Scaling these web servers can be challenging. With MQTT, clients connect to a broker, which can easily be added for load balancing. Check out this tutorial with a video. Republish HTML Data Over MQTT (Flight Arrivals Example) and the article MQTT vs HTTP for IoT.

Other messaging protocols

HTTP was not designed for IoT applications, but as mentioned, it will be widely used for some time due to its broad adoption in API.

Almost all IoT platforms support both HTTP and MQTT.

However, there are other protocols worth considering.

Protocols

  • MQTT — (Message Queuing Telemetry Transport). Uses TCP/IP. The publisher-subscriber model requires a message broker.

  • AMQP — (Advanced Message Queuing Protocol). Uses TCP/IP. Supports both publisher-subscriber and point-to-point models.

  • COAP — (Constrained Application Protocol). Uses UDP. Specifically designed for IoT, it uses a request-response model similar to HTTP. RFC 7252.

  • DDS — (Data Distribution Service) 

, there will be a list of resources for preparation for the Azure Dev/Infra/Architecture exam. article the main protocols and their applications are discussed. The conclusion of this article is that IoT will use a set of protocols depending on their intended application.

However, looking back, in the early years of the Internet, the HTTP protocol, which later became dominant, was just one of many protocols.

Even though HTTP was not originally intended for file transfer and email, today it is used for both.

I expect a similar situation with messaging protocols in IoT: most services will use one dominant protocol.

Below are Google Trends graphs showing how the popularity of MQTT, COAP, and AMQP has changed over the past few years.

Google Trends Overview 

An overview of networking protocols and message exchange protocols for IoT

Protocol support across platforms

  • Microsoft Azure — MQTT, AMQP, HTTP, and HTTPS

  • AWS — MQTT, HTTPS, MQTT over websockets

  • IBM Bluemix – MQTT, HTTPS, MQTT

  • Thingworx — MQTT, HTTPS, MQTT, AMQP

Summary

Most changes are expected at the link (levels 1 and 2) and application layers (level 4).

The network and transport layers are likely to remain unchanged.

At the application level, IoT components will utilize messaging protocols. Although we are still in the early stages of IoT development, it is likely that one or perhaps two messaging protocols will emerge.

In recent years, MQTT has become the most popular, and this is what I am currently focusing on this site.

HTTP will also continue to be used, as it is already well-integrated into existing IoT platforms.

That’s all for now. We invite you to register for a free demo lesson on the topic “Chatbot for Quick Device Commands”.

Read more:

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster