OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

mqtt message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (MQTT-269) MQTT-SN Feature: Topic Registration


     [ https://issues.oasis-open.org/browse/MQTT-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Niblett updated MQTT-269:
-------------------------------

    Proposal: 
A. Add a new  Identifier/Value pair for CONNACK (section 3.2.2)
Byte 34 (0x22) Identifier of the Alias Maximum. Followed by the Two Byte Integer representing the Alias Maximum value. It is a protocol error to include the Alias Maximum value more than once, or for it to have a negative value.
The Server uses this value to limit the number of topic aliases that it is willing to hold on this Connection. It also undertakes not to request any more than this number of aliases when sending packets to the Client. 
If this value is Identifier/Value pair is not present the client MUST act as if its value is zero. A value of zero means that Topic Aliases cannot be used on this connection.

B. Replace the paragraph in wd-06 section 3.3.2.1
Current text:
"To avoid repeating the same Topic Name in successive PUBLISH Packets the sender can use a zero-length Topic Name to mean the same Topic Name as was used with the previous PUBLISH packet  flowing on the TCP connection. The zero length UTF-8 String representing the Topic Name consists of two zero bytes only."

Replacement text: 
"A Topic Name might be quite long, and to reduce the size of the PUBLISH packet the sender can use a shorter Topic Alias instead. The Topic Alias is described in section 3.2.2.x.  If it provides a Topic Alias the sender is permitted to supply a zero-length String, consisting of two zero bytes only, for the Topic Name. "

C. Add a new identifier/value pair to section 3.3.2 called Topic Alias

"3 (0x03) Byte, Identifier of the Topic Alias. Followed by the Two Byte Integer representing the Topic Alias
A Topic Alias is an integer value that can be used to identify the Topic, instead of including the full Topic Name.  This reduces the size of the PUBLISH packet, and is of use if Topic Names are lengthy and the same Topic Names are used repetitively within a given Connection.

If a Topic Alias has been established at the receiver a sender is permitted to send a PUBLISH packet that contains that Topic Alias and supplying a zero-length String in place of the Topic Name.  The receiver then treats the incoming PUBLISH as if it had contained the full Topic Name corresponding to the alias.

The Sender decides whether to use an alias and gets to choose the alias value. It establishes an alias by including a non-zero length Topic Name and a Topic Alias value in the PUBLISH packet. When it receives a packet like this the Receiver processes the packet as normal, but it also records the mapping of Topic Alias to full Topic Name. 

A Sender is permitted to send a subsequent PUBLISH in the same session that has the same Topic Alias value and a different Topic Name. If it does this the Topic Alias is remapped to the Topic Name in this subsequent packet. 

Like Packet Identifiers, Topic Alias mappings are scoped to the MQTT Connection and last only for the lifetime of that Connection.  A receiver MUST NOT carry forward any Topic Alias mappings from one Connection to another. 

The Sender (either client or server)  MUST NOT attempt to establish more aliases, for a given Connection, than the Alias Maximum value that was returned in the CONNACK packet.  

In an MQTT Connection the server acts a receiver for PUBLISH packets sent by the client and the client acts as a receiver for PUBLISH packets sent by server. Both senders can establish aliases for use when sending PUBLISH packets up to the Alias Maximum value. For example if the Alias Maximum for the Connection is 4, the client can use up to 4 Topic aliases when sending PUBLISH packets to the server, and the server can use up to 4 Topic aliases when sending PUBLISH packets to the client. "


D. Add new paragraphs at the end of section 3.3.5 Actions

The receiver MUST reject a  PUBLISH packet if it has a zero-length String in the Topic Name field and does not contain a Topic Alias. In the case of a QoS 1 or QoS 2 PUBLISH the receiver sends a No Topic return code on the PUBACK or PUBREL response.

If the PUBLISH packet contains a Topic Alias, the Receiver processes it as follows:
a) If the receiver has already established a mapping for the Topic Alias then
If the packet has a zero-length String in the Topic Name field, the receiver processes it using the Topic Name that corresponds to the Topic Alias
If the packet contains a non-zero length Topic Name, the receiver processes the packet using that Topic Name and updates its mapping for the Topic Alias to point to the Topic Name from the incoming packet
b) If the Receiver doesn't already have a mapping for this Topic Alias
If the packet has a zero-length String in the Topic Name field, the receiver MUST reject it. In the case of a QoS 1 or QoS 2 PUBLISH the receiver sends a No Topic return code in the PUBACK or PUBREL response.
If the packet contains a non-zero length Topic Name, the receiver processes the packet using that Topic Name and in addition it adds the Topic Alias to its list of established Topic Alias mappings, provided that this new entry would not cause it to exceed the Alias Maximum limit for this connection.
If adding this new alias mapping would cause the Alias Maximum limit to be exceeded, the receiver still processes the packet using the Topic Name from the packet, but does not add the Topic Alias mapping to its list.  In the case of a QoS 1 or QoS 2 PUBLISH it sends an Alias Not Accepted  return code on the PUBACK or PUBREL response.

E. Add the following return codes to Tables 3.4 PUBACK Return codes and 3.5 PUBREC Return codes

17	0x11	Alias Not Accepted	The number of alias topics mappings was exceeded
136 	0x88	No Topic		No Topic Name given, or Topic Alias was invalid

F. Revert the bulleted list in 4.7.3 back to the 3.1.1 version
Specifically this means :
1. "All Topic Filters MUST be at least one character long " goes back to being "All Topic Names and Topic Filters MUST be at least one character long [MQTT-4.7.3-1]"
2. Remove "If a Topic Name containing zero characters is received, then the most recent Topic Name received containing at least one character, on the same TCP connection is used in its place. "
3. Remove "It is a protocol error to send only PUBLISH packets containing Topic Names containing zero characters on a TCP connection. "


  was:
4.7.3 Topic semantic and usage 
The following rules apply to Topic Names and Topic Filters: 
o	All Topic Names and Topic Filters MUST be at least one character long [MQTT-4.7.3-1] 

Becomes... 

4.7.3 Topic semantic and usage 
The following rules apply to Topic Names and Topic Filters: 
o	All Topic Filters MUST be at least one character long [MQTT-4.7.3-1] 
o If a Topic Name containing zero characters is received, then the most recent Topic Name
        received containing at least one character, on the same TCP connection is used in its place. 
o It is a protocol error to send the first PUBLISH packet containing a Topic Name with 
        zero characters on a TCP connection. 

Non normative comment. 
The sender can avoid repeatedly sending the same Topic Name by sending a zero length Topic Name in its 
place in the second and subsequent PUBLISH packets of a sequence with the same Topic Name. 
The receiver is required to cache the last non zero length Topic Name it receives in case 
it receives a zero length Topic Name next.


> MQTT-SN Feature: Topic Registration
> -----------------------------------
>
>                 Key: MQTT-269
>                 URL: https://issues.oasis-open.org/browse/MQTT-269
>             Project: OASIS Message Queuing Telemetry Transport (MQTT) TC
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 5
>            Reporter: Ian Craggs
>            Assignee: Peter Niblett
>
> MQTT-SN allows topic names to be registered with the server (and client) so that a topic id only has to be sent on subsequent packets.  This can reduce the data flowing on the wire and is consistent with the goals of MQTT.  It would however complicate the packet flows.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]