Internet of Things (IoT) and Industrial IoT (IIoT) are key architectural components for several modern digital systems. Publish-subscribe (pub/sub) is an established messaging pattern for (I)IoT. Message Queuing Telemetry Transport (MQTT) is a popular pub/sub-based messaging protocols for (I)IoT. Unfortunately, MQTT insufficiently supports Real-Time (RT) requirements. A computer system is a RT system, when the correctness of its behavior depends not only on the logical results of the computations but also on the physical time when these results are produced.
In this work, we propose a minimally intrusive extension to the MQTT protocol in order to render MQTT RT capable. We first define a fourth new time-based Quality of Service (QoS) level for MQTT by using special messages and additional minimal functionalities at the client and broker sides. This QoS level allows publishers and subscribers to negotiate how many messages (m out of n) must be delivered in time. A scheduler on the broker processes received messages depending on (a) agreed message ratio m-out-of-n, (b) the residual lifetime of messages, i.e., time to deadline till desired delivery to destination, and (c) the expected round trip time to the destination. The “m out of n” principle allows to address the various RT classes such as soft-, firm- and hard-RT. In addition, this approach allows to trade-off the system efficiency and the achievable RT class. First simulations confirm that the proposed approach converges to a reasonable message drop-off level without endangering the agreed m-out-of-n messaging ratio, i.e., the targeted RT class.