Scaling MQTT Network for Better Operational Output

Patrick FamisaranArticles, Blog

mqtt networks

MQTT is a staple IoT messaging protocol to many organizations. Because MQTT is a lightweight protocol, it requires less overhead. MQTT ensures the relay of data over networks. From the point of view of clients, its straightforward approach makes it user-friendly.

The MQTT protocol traced its roots in 1999. Andy Stanford-Clark of IBM and Arlen Nipper of Arcom initiated the protocol to address their minimal bandwidth. The MQTT protocol was a practical solution for minimal battery consumption. It is in this regard that the two inventors rationalize the usefulness of the protocol in MQTT networks. 

  • Simple Implementation
  • Quality of Data Delivery
  • Lesser Bandwidth Required
  • Data Agnostic
  • Continuous Session Awareness

These are the core objectives of MQTT. Up to date, this core is the leading fundamental indicator of how MQTT can provide efficient messaging requirements to businesses alike. 

Establishing the Basics of MQTT Network

basics of mqtt

Photo Credit: article.sapub.org

A royalty-free version referred to as MQTT 3.1 was released by IBM in 2010. This has paved the way for many organizations to implement the protocol freely. From the initial version, OASIS ventured into standardizing MQTT. OASIS is an open organization that functions to advance standards. Previously released by OASIS include AMQP, SAML, and DocBook. 

Since the standardization of OASIS, the MQTT version changed from 3.1 to 3.1.1. Few general changes are specific to both versions. Changes also include terminologies for wider standard usage and acceptance. Some of these fundamental changes include:

  • Client ID may be restricted to alphanumeric characters
  • Flags in the fixed header are specific to a packet type
  • Allows WebSocket to connect
  • Clients are allowed to send control packets after sending a CONNECT packet

Terminology changes include pertaining purely to MQTT as a name. Message-ID is now referred to as Packet ID. Even the command message goes by Control Packet now.

These changes establish the central server in an MQTT Network. The broker is a focal point in data delivery. Instead of a command prompt, MQTT devices publish pre-programmed data to the broker. The data is relayed when a pre-programmed value also changes. 

An added feature in MQTT is the awareness of keeping devices alive in the network. There are instances that devices may not publish much as compared to others. It is very dependent on their activity demands, in perspective. In MQTT, these plateaued devices are maintained by a regular relay of keep-alive notification to the broker. 

To further validate MQTT’s function, some key protocol attributes determine its convenience and adaptability.

  • Free Flow Topics

In MQTT 3.1.1, topic filters are indicators provided by brokers in publishing data. In every client network session, topic filters are noted. These topic filters are then relayed to match updates from publishers. These updates will be routed to matching subscribers also.

Providing additional characters to a text string enables better matching of publication. This also indicates more flexibility in specifying a topic path. Due to this nature, one-to-many messaging is best achieved due to interest-based, intentional communication.

  • Better Payload

Relaying a message has a maximum of 256 MB in size. These messages vary from a simple process command to even a photo. MQTT uses a byte array payload to determine packet lengths and control codes.  

There are two most commonly used messaging transport, MQTT and HTTP. The cost-efficiency advantage, however, can be derived from MQTT. The data-agnostic capacity of MQTT and its feasibility in limited power and bandwidth is a deciding factor.

  • Fault Tolerance

MQTT is designed to handle disconnections. Any chance of client disconnect is a risk in consistently sending messages. 

  • Option to transmit messages to higher service levels to ensure delivery.
  • Retention of messages is available.
  • Using persistent sessions, the MQTT broker can configure and determine the service level of the message, in any event, the client is disconnected.
  • In disconnection cases, a client can compose the last will and testament message that will be relayed to subscribers when the connection stops.

Scaling Up MQTT

Scaling Mqtt

Photo Credit: assets-global.website-files.com

In a denser and diverse industrial network, IoT support from MQTT may not be the most streamlined. Efforts to tag and account data as it goes through IoT devices require more extensive processes. Added to the woes are connection risks that will be detrimental to data quality if not appropriately addressed. 

This is where an MQTT upgrade is necessary. Adding Sparkplug B to the equation will further smoothen messaging relay. This is especially helpful in high-density industrial settings. Sparkplug B is a specification for MQTT. It essentially works within the core objective of MQTT in sending and receiving messages. 

However, an added feature for Sparkplug B (SpB) is its capacity to define how data should be sent and received. SpB determines MQTT architecture further that responds to viable use cases in more prominent industries. It adds crucial details on the relay of data that benefits the end client. Ultimately, Sparkplug distinguishes the primary roles of MQTT clients. It specifies two types of clients:

  • MQTT & Sparkplug B Edge of Network (EoN) Nodes

This refers to clients providing the gateway for MQTT communications. These communications are often relayed to legacy drivers and sensors. The EoN nodes are easy to access to smart devices and intelligent sensors. These smart technologies can publish data, compute and analyze metrics. These are then relayed directly to the broker.  

  • MQTT & Sparkplug B Application Nodes

This identification refers to software clients. This also accounts for clients that own a primary application capable of command prompts and accounting data history. Application nodes may also be referred to as a gateway to software systems. 

What Does The Sparkplug Add-On Offer?

Beyond the definition of data messaging, Sparkplug B enables redundancy checks, accessibility, and potential for scale. The risk involved in application communication results in error consequently. This is how sensors using network gateways may fail to account for historical logs, for example. While data is relayed to an MQTT broker, breaking down the data for better end-user interpretation is a must. As such, Sparkplug can be a beneficial integration to the MQTT network.

  • Limiting Errors

A standard format for MQTT topics can further break down the details of message relay. Identification of lost messages is more manageable, especially in an array of devices. Maintaining a standard format specifically enumerates the message type, user definition, and device ID. Tracing back for lost messages during network interruption hastens. 

  • Better Payload Definition

A significant limiting factor in MQTT is the burden for subscribers to interpret data. Proper data breakdown is not the most considerable facet of an MQTT protocol. This is in this nature that Sparkplug can negate such a problem. The capacity of Sparkplug to package MQTT payload in a more structured format can help clients significantly. Even with a full payload, properly structured metadata will only account for a small footprint.

  • Standard Topic Format

Even with MQTT’s flexibility, it will just complicate data relay in a highly dense IoT system. This complication will lead to limited interoperability that is crucial in smart applications and bigger industries. The different naming formats will reduce the capacity to scale as communications are negated to further data interpretation. Hence, a standard topic format through Sparkplug can lessen the side efforts in enabling data relay.

MQTT in Wireless Tunnel Gateway

Wireless Cabinet Analysis Sensor

Wireless Tunnel Gateway is essential, especially in remote monitoring. Providing long-range and low-power communication is a crucial function for these sensors. In line with this, operations have smoothened through the thorough aid benefited from sensor deployment. 

The AKCP wireless tunnel gateway (WTG) of AKCP is proof of the functionality of MQTT. Connect up to 30 wireless sensors by AKCP, MQTT enables their optimal monitoring capacities. MQTT can be enabled to sensorprobe+ and WTG units. Using the JSON string to pass sensor information, the following features are attained:

  • Sending sensor status change events on appropriate events from ALL types of sensors
  • Periodically send all sensor values
  • Use of up to MQTT servers to send MQTT values
  • Devices can randomly select a server to prompt relay of MQTT values

Additionally, AKCP sensorprobe+ and WTG units can queue up to 1020 MQTT messages. In any network disconnect, messages are maintained. Considering that sensor values are pertinent data to a monitoring operation, the queueing of messages assures that reading values are accounted for on a particular timestamp. If the connection has been re-established, the MQTT server can synchronize the queued values. 

Building an objective-specific MQTT network means establishing a thorough approach to intelligent solutions. These technologies, such as the AKCP wireless sensors, address gaps in running a more extensive IoT ecosystem. The cutting-edge solutions powered by MQTT and Sparkplug integrations provide robust support to all data relay needs. These solutions use more enormous volumes of data. In the case of a basic monitoring process of a data center, reading values are significant data bytes tracking a pre-programmed monitoring parameter. 

In this nature, technology solutions and messaging protocols should go hand in hand to yield the best results. In industrial applications, monitoring becomes the next level. Value is more enormous, and data communication is instantaneous. An MQTT scale-up adding Sparkplug B is the complete combination moving forward. 

Reference Links: 

https://www.automation.com/en-us/articles/march-2021/building-industrial-mqtt-networks-edge-computing

https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt/

https://github.com/mqtt/mqtt.org/wiki/Differences-between-3.1.0-and-3.1.1

https://www.mbtmag.com/best-practices/article/21172575/how-to-integrate-automation-data-with-mqttsparkplug-b

https://cogentdatahub.com/connect/mqtt/sparkplug-b/

 

Patrick FamisaranScaling MQTT Network for Better Operational Output