IoT: MQTT outperforms 300% over HTTP

Data Consumption Pattern of MQTT Protocol for IoT Applications

Sikandar Khan
3 min readJan 14, 2019
mqtt.org

A quick Google of “IoT protocol” will return a number of pages suggesting MQTT(Message Queue Telemetry Transport) and, by the second page of search results, it’s almost entirely MQTT-related links.

In connecting the networks and people, the HTTP Protocol played a greater role and it is the most widely used protocol for data transfer in a variety of applications. In IoT, we got to establish connections between “machines and things”. Their communication requirements were different from the current needs of the Internet and associated data communications. So, HTTP protocol looks quite heavy for the Internet of Things (IoT) applications, due to the overheads of HTTP.

MQTT is better choice that HTTP for IOT applications

MQTT Protocol is a lightweight and an extremely simple protocol. The publish/subscribe architecture of MQTT is designed with the characteristics of openness and easiness to implement, which can be scaled by a single server to support up to thousands of clients accessible from the remote.

The other key highlights include:

  • Open and royalty-free.
    MQTT is easy to adopt, open to make and fit for a variety of platforms, devices, and operating systems that are used at the network edge.
  • Messaging model.
    The publish/subscribe messaging model facilitates one-to-many distribution. Sender devices or applications need not to know anything about the receiving device or applications, not even its address.
  • Ideal for constrained networks.
    MQTT message headers are retained as small as possible and ideal for fragile connections, low bandwidth, data limits, high latency networks. The fixed header is only two bytes, that too on demand, push-style message distribution keeping the network utilization low.
  • Multiple service levels.
    It gives the flexibility in handling various types of messages. For example, developers can design that the messages will be delivered exactly once, at least once, or at most once.
  • Design.
    Its designed to support remote devices with low processing power and minimal memory.
  • Ease of use.
    Usage and implementation are quite easy with a simple set of command messages. Various applications of MQTT will be accomplished using CONNECT, DISCONNECT, SUBSCRIBE, UNSUBSCRIBE and PUBLISH methods.
  • Built-in support for contact loss.
    If the connection with client connection breaks abnormally, the information is sent to server facilitating the message either to get preserved for later delivery or to re-send.

Comparison of HTTP vs MQTT

overall differences

1) High Power consumption by HTTP

  • HTTP protocol consumes 10 times higher power than MQTT protocol.
  • The power consumption of MQTT Protocol is way lower and 30% faster performance than CoAP

2) High Bandwidth consumption in HTTP

  • For MQTT topics cases, where zero payload exists and only the transmission bytes exists reveals, HTTP consumes 300% higher bandwidth as in Fig
Characteristics with ZERO payload
  • For MQTT message sharing cases, where payload and transmission bytes exists, HTTP consumes 250% higher bandwidth as in Fig.
Characteristics with payload and overhead

3)High Protocol overheads in HTTP

  • Communication sequences of HTTP
Communication over HTTP
  • Communication sequences of MQTT use case where CONNECT/CONNACK is eliminated
Communication over MQTT

Happy Exploration
Learn — Grow — Glow
Reach me at LinkedIn

--

--

Sikandar Khan

Head of Engineering | Product Management, Strategic Thinking