Skip to content

Latest commit

 

History

History
123 lines (90 loc) · 4.74 KB

mqtt-sn-implementation-guide.adoc

File metadata and controls

123 lines (90 loc) · 4.74 KB

MQTT-SN Version 2.0 Implementation Guide

Copyright © OASIS Open 2022. All Rights Reserved. “Non-Standards Track Work Product” is a Work Product produced and approved by an OASIS Technical Committee in accordance with the TC Process that may be progressed to Committee Note. Non-Standards Track Work Products are intended to be informative and explanatory in nature. They are not subject to the patent licensing and other obligations explained in the OASIS Intellectual Property Rights (IPR) Policy Non-Standards Track Work Products must not contain language that would otherwise fall within the definition of Normative Portion.

Introduction

This non-normative document providers implementers guidance on the usage of the MQTT-SN specification(s). The MQTT-SN specification provides a basis for interoperability between implementations of both MQTT-SN and MQTT system components. Implementers will be making important decisions regarding networking, authentication mechanisms, deployment architectures, session state and application taxonomies. These decisions will be guided by each unique set of deployment/infrastructure circumstances and therefore there is not one single "correct" way of using the specification. This should be taken into consideration when deploying a specified artefact. Further, not all functional areas of the normative behaviour need be implemented in order to be considered compliant to the specification. For example, a deployment may be limited by a transport medium which does not support broadcast capability. This will restrict the ability to provide discovery behaviour defined in the specification but in no way limits other aspects of the functionality. Implementers should be clear when publishing works where their artefacts diverge functionally or omit aspects of the specification so as to ease interoperability tasks.

The reader is assumed to be very familiar with:

MQTT Family of specifications
  • MQTT 3.1

  • MQTT 3.1.1

  • MQTT 5.0

  • MQTT-SN 1.2

  • MQTT-SN 2.0

Recommended reading
  • SASL (RFC 222 & RFC 442)

MQTT-SN Architectures

The IoT has brought about the advent of the mass deployment of "wireless sensor" / "sensor fusion" devices. These devices are more often-than-not simple, low cost, low powered (battery), connecting using unreliable network connections and deployed in high volume. They are typically (but not limited to) concerned with capturing; measurements, environmental conditions, process control and fault detection. Further, as systems become ever more complex and distributed the role of gateways, forwarders and inter-connected clients is all the more important as networking modalities are traversed in order for data to find its way back to the enterprise.

(NB: Ensure this para does not limit use in any way, think intra system BUS etc.)

Transparent Gateways

Aggregating Gateways

(SLJ - EoW 18th Nov)

Forwarder Gateways

Backends

Client Identifiers & Identification

(SLJ - EoW 18th Nov)

Format Restrictions

(SLJ - EoW 18th Nov)

Examples

(SLJ - EoW 18th Nov)

Client Connection (CONNECT / CONNACK)

Authentication

The authentication section doesn’t say anything about the use of the AUTH packet

Sessions

On the Client

On the Gateway

Topics (REGISTER / REGACK)

Subscription (SUBSCRIBE / SUBACK)

Topic Filter Matching

(SLJ - EoW 18th Nov)

Subscription Storage Examples At Scale

(SLJ - EoW 18th Nov)

Publishing (PUBLISH)

Quality of Service -1

Quality of Service 0

Quality of Service 1

Quality of Service 2

Sleeping Client (DISCONNECT)

Especially transparent gateways - which might be viewed as limiting

Network

Datagram

Retry / Error Algorithms

public static long getRetryWait(int retryCount, long max, boolean addFuzziness){
    long f = (long) (Math.pow(2, Math.min(retryCount, 10)) * 1000);
    if(addFuzziness){
        f += ThreadLocalRandom.current().nextInt(0, Math.min((int) f, 999));
    }
    f =  Math.min(f, max);
    return factor;
}

Security

Transport Security

Integrity Protection

Application Security