In Terminology Add:
Virtual Connection:
Carries the MQTT-SN data between a Client and a Gateway, or a broadcast to all Gateways and all clients.
Refer to section 3.2 Networks & Transport Layers for non-normative examples.
In 3.2 Networks & Transport Layers replace with:
The MQTT-SN V2.0 protocol requires an underlying transport to create a Virtual Connection,
this carries datagrams from a Client to a Gateway and a Gateway to a Client.
The underlying transport may also broadcast datagrams from a Client to all Gateways and from a Gateway to all Clients.
The datagrams carry the MQTT-SN V2.0 Packets which must be received unaltered and complete.
- The underlying transport does not need to be reliable,
it is expected that datagrams will be lost or delivered out of order.
- If the network might deliver a datagram more than once, then it is highly recommended that the PROTECTION
packet Monotonic Counter is used to eliminate the duplicates.
- The MQTT-SN V2.0 protocol will tolerate out of order Packets and it will retransmit lost Packets.
- The MQTT-SN V2.0 does not perform error correction. If a
corrupted or partial Packets is received it will cause a protocol error.
- The MQTT-SN V2.0 implementation may use either the origin network address or the sender identifier in the
PROTECTION Packet to determine the identity of the Virtual Connection.
- The underlying network does not need to provide low latency transmission.
- The networks may be connectionless, the virtual connections do not need to have an event that signals when they begin or end.
- The networks may be radio networks.
Non-normative comment
UDP as defined in [RFC0768] can be used for MQTT-SN v2.0 if the Maximum Transmission Unit
is configured to be more that the MQTT-SN Packet size used and no datagram fragmentation occurs.
Depending on the network configuration, UDP can duplicate datagrams.
If this can happen, the PROTECTION Packet monotonic counter should be used.
Examples of possible consequences of not removing duplicates datagrams are:
– DISCONNECT Packet applied to the wrong Virtual Connection
– SUBSCRIBE and UNSUBSCRIBE Packets applied to the wrong Session
– PUBLISH QOS=2 published more than once
The following transport protocols are also suitable:
DTLS v1.2 [RFC6347]
DTLS v1.3 [RFC9147]
QUIC [RFC9000]
Other non-IP protocols
TCP/IP [RFC0793], TLS [RFC5246], WebSocket [RFC6455] can be used for MQTT-SN v2.0 however, they do not provide
a broadcast capability so the optional ADVERTISE, SEARCHGW, GWINFO and PUBLISH MINUS -1 Packets cannot be implemented.
Non-normative comment
TCP ports 8883 and 1883 are registered with IANA for MQTT TLS and non-TLS communication respectively.
==> MQTT reserved both the UDP and TCP ports but prohibits the use of UDP,
we should approach the MQTT TC to get this redesignated as MQTT/MQTT-SN.
==> Is there a recommended way to test whether an MQTT CONNECT is being sent to an MQTT-SN Gateway
or an MQTT-SN CONNECT is being sent to an MQTT Server?