Internet of Things  

Physical Design of IoT Part 2

Recap

In the Previous Part of this article (Physical Design of IoT Part 1 ), we have learned about the Physical design of IoT, covering its two components that are Things in IoT and IoT Protocols. Readers learn about IoT devices (that can perform sensing, acuating and monitoring capabilities) and differerent types of IoT Protocols in Three different layers that is the Link Layer (Ethernet, WiFi, WiMAX, LR-WPAN, and Cellular networks), the Network Layer (IPv4, IPv6, and 6LoWPAN), the Transport Layer (TCP and UDP).

Fourth Layer of IoT Protocols, which includes HTTP, CoAP, Websockets, MQTT, XMPP, DDS, AMQP Protocol, with their work, advantages, and disadvantages, we will cover in this part that is...

Application layer

Application layer protocols define how applications interface with the lower layer of protocols to send over the network.

HTTP( Hyper Text Transfer Protocol)

Hyper Text Transfer Protocol (HTTP) is an application layer protocol for communication between web hypermedia documents, such as HTML. It was designed for communication between web browsers and web servers, but it can also be used for other purposes. HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. HTTP is a stateless protocol, meaning that the server does not keep any data between two requests. Though often based on a TCP/IP layer, it can be used on any reliable transport layer, that is, a protocol that does not lose messages silently like UDP does. RUDP--- the real liable update of UDP--- is a suitable alternative.

CoAP (Constrained Application Protocol)

Constrained Application Protocol is a specialized internet application protocol for constrained devices, as defined in RFC 7252. It enables devices to communicate over the Internet. It is defined as a constrained application protocol, and is a protocol intended to be used in very simple hardware. The protocol is especially targeted for constrained Hardware such as 8-bit microcontrollers, low-power sensors, and similar devices that cannot run on HTTP or TLS. It is a simplification of the HTTP protocol running over UDP that helps save bandwidth. It is designed for use between devices on the same constrained network ( example- low power, lossy networks), between devices and general nodes on the internet, and between devices on different constrained networks, both joined by the internet. CoAP is also being used via other mechanisms, such as SMS on mobile communication networks.

Advantages of CoAP

  • It has reduced power requirements as it operates over UDP.
  • It has a similar packet size, leading to faster communication.
  • It has lower latency and consumes less power compared to HTTP.

Disadvantages of CoAP

  • It has reduced power requirements as it operates over UDP.
  • It has a similar packet size, leading to faster communication.
  • It has lower latency and consumes less power compared to HTTP.
  • CoAP is an unreliable protocol due to it use of UDP.
  • It acknowledges each recipient of the message and hence increases the processing time.
  • It does not verify whether the received message had been decoded properly or not.

Websockets

The WebSocket protocol enables two-way communication between a client running untrusted code in a controlled environment and a remote host that has opted in to communication from that code. The security model used for this is the origin-based security model commonly used by web browsers. The protocol consists of an opening handshake followed by basic message framing, layered over TCP. The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with a server that does not rely on opening multiple http connections ( example- using XMLhttpRequest or <iframe>s and long polling).

Advantages of WebSockets

  • It supports duplex communication.
  • Using websockets, one can send and receive data immediately faster than HTTP. Moreover, they are faster than AJAX.
  • Cross-platform compatibility ( web, desktop, mobile).
  • HTTP takes up to 2000 bytes of overhead, where as web as websocket takes only 2 bytes.

Disadvantages of WebSockets

  • It supports duplex communication.
  • Using websockets, one can send and receive data immediately faster than HTTP. Moreover, they are faster than AJAX.
  • Cross-platform compatibility ( web, desktop, mobile).
  • HTTP takes up to 2000 bytes of overhead where as web as, websocket takes only 2 bytes.
  • The web browser must be fully HTML5 compliant.
  • Websockets have no successful functions like AJAX.
  • Intermediary/Edge caching is not possible with WebSockets, unlike HTTP.
  • To build even a simple protocol of your own, one cannot be able to use friendly HTTP statues body etc.
  • If the application does not require a lot of dynamic interaction, HTTP is similar to implement.

XMPP ( Extensible Messaging and Presence Protocol )

It is a communication protocol for message-oriented middleware that is based on XML ( Extensible Markup Language ). It enables the near real-time exchange of structured yet extensible data between any two or more network entities. Designed to be extensible, the protocol has also been used for publish-subscribe systems, signalling for VoIP, video, file transfer, gaming, the Internet of Things (IoT) applications such as smart grid, and social networking services.

Advantages of XMPP

  • It offers and easy way to address a device.
  • It can be customized to individual user requirements.
  • Short messages are used for fast communication between the user and the server.
  • It is reactive to the presence of the user and his/her status.
  • It is an open platform that is constantly evolving.
  • It uses TLS and SASL to provide a secure end-to-end connection.
  • It allows servers with different architectures to communicate

Disadvantages of XMPP

  • It offers an easy way to address a device.
  • It can be customized to individual user requirements.
  • Short messages are used for fast communication between the user and the server.
  • It is reactive to the presence of the user and his/her status.
  • It is an open platform that is constantly evolving.
  • It uses TLS and SASL to provide a secure end-to-end connection.
  • It allows servers with different architectures to communicate.
  • It does not have a QOS mechanism as used by the MQTT protocol.
  • Streaming XML has overhead due to text-based communication compared to binary-based communication.
  • Server Mein overloaded with presence and instant messaging.

DDS ( Data Distribution Service )

It is a middleware protocol and API standard for data-centric connectivity from the Object Management Group (OMG). It integrates the component of a system together, providing low-latency data connectivity, extreme reliability, and a scalable architecture that business and mission-critical Internet of Things (IoT) applications need. In a distributed system, middleware is a software layer that lies between the operating system and applications. It enables the various components of a system to communicate easily and share data. It simplifies the development of distributed systems by letting software developers focus on the specific purpose of their application rather than the mechanics of passing information between applications and Systems.

Advantages of DDS

  • It uses a powerful QOS mechanism.
  • It is a scalable, extensible, and efficient standard.
  • It is suitable for real-time IoT applications.
  • It supports interoperability from different vendors to communicate on the wire by using RTPS ( Real Time Publish Subscribe) protocol.
  • It offers a low-latency communication architecture.
  • It offers a secure connection using TLS, DTLS, and DDS security mechanisms.

Disadvantages of DDS

  • It uses a powerful QOS mechanism.
  • It is a scalable, extensible, and efficient standard.
  • It is suitable for real-time IoT applications.
  • It supports interoperability from different vendors to communicate on the wire by using RTPS ( Real Time Publish Subscribe) protocol.
  • It offers a low-latency communication architecture.
  • It offers a secure connection using TLS, DTLS, and DDS security mechanisms.
  • It is too heavy to be used in embedded systems.
  • DDS does not interface with Web Services.
  • DDS consumes twice the bandwidth as the MQTT protocol.
  • QOS policies are only applied in a strict DDS environment.

AMQP ( Advanced Message Queue Protocol )

The iot protocol consists of hard and fast components that route and save messages within a broker carrier, with a set of policies for wiring the components together. The AMQP protocol enables petrol programs to talk to the dealer and engage with the  AMQP model. AMQP has three additives, which might be linked to processing changes in the server to create the desired capability.

  1. 1. Exchange: Receives messages from the publisher, primarily based on programs, and routes them to 'message queues'.
  2. 2. Message queues: store messages until they can be thoroughly processed via the eating client software.
  3. 3. Binding: state the connection between the message queue and the change.

Advantages of AMQP

  • It uses QOS and hence ensures the safe passage of important data.
  • It uses an already established publish-subscribe architecture for data sharing as used by the MQTT protocol.
  • It ensures interoperability as it uses a wire-level protocol that sends data as a stream of bytes.
  • It offers simpler peer-to-peer communication along with intermediaries.
  • The protocol has space to evolve to work with different standards.
  • It offers a secure connection to users using the SSL protocol, such as CoAP, MQTT, HTTP, and XMPP.

Disadvantages of AMQP

  • It uses QOS and hence ensures the safe passage of important data.
  • It uses an already established publish-subscribe architecture for data sharing as used by the MQTT protocol.
  • It ensures interoperability as it uses a wire-level protocol that sends data as a stream of bytes.
  • It offers simpler peer-to-peer communication along with intermediaries.
  • The protocol has space to evolve to work with different standards.
  • It offers a secure connection to users using the SSL protocol, such as CoAP, MQTT, HTTP, and XMPP.
  • It is not backward compatible with old versions.
  • It is not as simple as HTTP 1.0, HTTP 1.1, or any other wire protocol.
  • It requires higher bandwidth, unlike MQTT/CoAP/XMPP.
  • Resource Discovery is not supported, unlike CoAP/XMPP/HTTP.

Conclusion

In this article, we have learned about the Fourth Layer of IoT Protocols, which is the Application Layer, which includes HTTP, CoAP, Websockets, MQTT, XMPP, DDS, and AMQP Protocol, with their work, advantages, and disadvantages. Hope you found it informative!

Thank you for staying till the end !!