Uploaded image for project: 'OASIS Message Queuing Telemetry Transport (MQTT) TC'
  1. OASIS Message Queuing Telemetry Transport (MQTT) TC
  2. MQTT-586

Suggestion for MQTT multiplexing on one TCP/IP connection

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: futures
    • Labels:
      None

      Description

      The source for this suggestion comes from the implementation of MQTT-SN to MQTT gateways. In the MQTT-SN specification, there are two types of gateway described:

      1. Aggregating. The gateway establishes one MQTT connection to the MQTT server, and all MQTT traffic for all devices attached to the gateway travels on that one connection.
      2. Transparent. The gateway establishes one MQTT connection to the MQTT server for each device connected to the gateway. This also means, in the convential MQTT approach, one TCP/IP connection for each MQTT connection.

      The advantage of the transparent configuration is that the MQTT server is aware of each device that is connected to the gateway, similar to the situation if the device were directly connected to the server, hence "transparent". This can provide advantages for device management amongst other things.

      The disadvantage is the extra resources needed to open a lot of TCP/IP connections, especially if there are many devices, each of which has a relatively low message rate.

      A compromise, which would combine the device visibility of the transparent gateway with the efficiency of the aggregating gateway, would be to allow multiple MQTT sessions to be carried on one TCP/IP connection.

      To achieve this, each MQTT packet would need to carry additional information tagging it with the MQTT client it originated from or was destined for. There would also need to be extra operations to establish and stop a communication session, corresponding to the opening and closing of a TCP/IP socket.

      One of the essential features would be that stopping a communication session within the gateway's TCP/IP connection would result in the same behaviour on the server as if the TCP/IP connection were broken in the usual MQTT configuration. Firing of the will message, MQTT session cleanup, etc.

      All of this can be implemented with a specifically implemented gateway and server. But to allow any gateway to connect to any server with MQTT multiplexing, both gateway and server need to implement it in the same way, hence the need to have a standard approach.

      There is an implementation (although I don't have the documentation for it) here: https://github.com/eclipse/mosquitto.rsmb/tree/master/amqtdd

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ian.craggs Ian Craggs
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: