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-236) Consolidate Acks, enable negative acknowledgements.


    [ https://issues.oasis-open.org/browse/MQTT-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63185#comment-63185 ] 

Ed Briggs commented on MQTT-236:
--------------------------------

I have added the error messages requested by Andrew Banks above, and based on the motion in the MQTT-TC call last Thursday, I ask the editors to start adding the necessary text to the working draft.

Here is the latest copy of the text and error messages. Note that the error messages have not yet been consolidated to remove cases in which the same message may have multiple values.

MQTT 236 - Summary of Changes

The following is a summary of MQTT 236.

1. CONNACK - changes and additions to the return codes are enumerated in the table below.

2. DISCONNECT - Both clients and servers may send DISCONNECT messages to signal disconnection, or report error conditions. The DISCONNECT command packet will be modified to carry a one-byte disconnect reason code. This code is appended to the DISCONNECT command packet, and the remaining length field is adjusted to reflect this additional byte.  The DISCONNECT reason codes are enumerated in the table below. (The server initiated disconnect first appeared in issue MQTT-270 and is now subsumed by MQTT-236)

4. The following MQTT command packets are also extended to carry a single byte return code signifying success or failure. The encoding of the commands is unchanged except that a single byte is appended to contain the return code, and the remaining length field is adjusted to reflect the additional byte.
    PUBACK
    PUBREC
    PUBREL
    PUBCOMP
    
Return codes used on QoS 1 and QoS 2 are enumerated in the table below.  There are no response codes for QoS 0, since there is no 'acknowledgement message' for QoS 0. 

5. Handling of PUBACK, PUBREC, PUBREL and PUBCOMP errors

Reception of a PUBACK, PUBREC, PUBREL, or PUBCOMP containing an error code (NAK) shall be processed in the same way as an ACK for the purposes of retiring packet identifiers and retransmission.  Stated differently, reception of a NAK will not lead to the retransmission of QoS 1 or QoS 2 messages. The session and transport connection will not be disconnected and other messages will continue to flow.


6. SUBACK and UNSUBACK return codes

Additional SUBACK and UNSUBACK return codes have been added to indicate various sort of errors. These are enumerated in the table below. 


7. UNSUBACK Changed to return multiple values

The UNSUBACK has been modified to return an array of values corresponding to the array of topic filters contained in the corresponding UNSUBSCRIBE.


8. Consolidated Return Codes


Note 1: The values in this table may change, and additions may be made.
Accordingly, this table is 'editorial' not 'substantial' at this time.

Note  2: The error codes will be consolidated so that the same value
will be used if the error condition is the same.

Note 3: I've made a simplifying assumption that QoS 2 Method B will be
normative ( MQTT-286 ) If it isn't, I'll put the return codes that appear in
PUBREC back in PUBCOMP.


NB:
  - Request comments from the MQTT-TC on whether the re-numbering of the CONNACK
    return codes (below) presents a difficuty for implementers.
  - Need error codes for request/response. I've added one (invalid reply topic)
  - Need error codes for shared subscriptions (I've added one - shared subscriptions no supported)
  - Need to determine if invalid meta data format/tag is an error message (I've added it).


CONNACK Response Codes
----------------------

0 0x00 Connection Accepted.
1-127 Reserved for future use.

128 0x80 Connection Refused, Malformed Packet, e.g. user name indicated but not present. Followed by network disconnection.

129 0x81 Connection Refused, reason unspecified. Followed by network disconnection.
130 0x82 Connection Refused, the Client is not authorized to connect. Followed by network disconnection.
131 0x83 Connection Refused, implementation specific, eg. server capacity reached.Followed by network disconnection.

132 0x84 Connection Refused, unacceptable protocol version. The Server does not support the level of the MQTT protocol requested by the Client. Followed by network disconnection.

133 0x85 Connection Refused, identifier rejected. The Client identifier is correct UTF-8 but not allowed by the Server. Followed by network disconnection.

134 0x86 Connection Refused, Server unavailable. The Network Connection has been made but the MQTT service is unavailable. Followed by network disconnection.

135 0x87 Connection Refused, bad user name or password. The data in the user name or password is malformed. Followed by network disconnection.

136 0x88 Connection Refused, try another server.
137 0x89 Connection Refused, busy. Try again later.
138 0x8A Connection Refused, redirect (required redirect URL in metadata)
139 0x8B Message too large (big strings, metadata etc.)
140 0x8C Banned. You are banned from connecting. Please contact the administrator.
141 0x8D Exceeded Reconnect Rate Limit. Please try again, later.

142-255 Reserved for future use.


QoS 0 Response Codes
---------------------
NONE


PUBACK response codes (QoS 1)
---------------------------------------

0 0x00 Message Accepted, Publication proceeds.
1 0x01 Message Accepted, No matching subscribers. Should be used in preference to 0x00.
            If the server cannot determine whether there are any subscribers, e.g. because it is
            in a cluster, then use response code 0x00.

2-127 Reserved for future use.

128 0x80 Message Refused, Malformed Packet, e.g. invalid topic name. Followed by network disconnection.
129 0x81 Message Refused, reason unspecified.
130 0x82 Message Refused, publication not authorized.
131 0x83 Message Refused, implementation specific, e.g. client quota reached.
132 0x84 Not Authorized
133 0x85 Invalid topic name
134 0x86 Packet Identifier in use (possible session state issue)
135 0x87 QoS Level not supported
136 0x88 Retain not supported
137 0x89 Message too large. (probably needs and admin fix)
138 0x8A Message rate too high (wait and retry might work)
139 0x8B Server Quota Exceeded (might be temporary)
140 0x8C Receiver capacity reached
141 0x8D Invalid meta data tag
142 0x8E Invalid reply topic
143 0x8F Message Rate too High.
144-255 Reserved


PUBREC return codes (QoS=2)

0 0x00 Message Accepted, Publication message proceeds.
1 0x01 Message Accepted, No matching subscribers. Should be used in preference to 0x00.
       If the server cannot determine whether there are any subscribers, eg because it is
       in a cluster, then use response code 0x00.

2-127 Reserved for future use.

128 0x80 Message Refused, Malformed Packet, eg invalid topic name. Followed by network disconnection.
129 0x81 Message Refused, reason unspecified.
130 0x82 Message Refused, publication not authorized.
131 0x83 Message Refused, implementation specific, eg. client quota reached.
132 0x84 Not Authorized
133 0x85 Invalid topic name
134 0x86 Packet Identifier in use (possible session state issue)
135 0x87 QoS Level not supported
136 0x88 Retain not supported
137 0x89 Message too large. (probably needs and admin fix)
138 0x8A Message rate too high (wait and retry might work)
139 0x8B Server Quota Exceeded (might be temporary)
140 0x8C Receiver capacity reached
141 0x8D Invalid metadata tag
142 0x8E Invalid reply topic
143 0x8F Message Rate Too High
144-255 Reserved



PUBREL response codes (Qos=2)
-------------------------------------
0 0x00 Must Be Zero (placeholder)
1-255 Reserved

PUBCOMP response codes (QoS=2) (Assumes Method B)
-------------------------------------

0 0x00 Must Be Zero (placeholder)
1-255 Reserved


SUBACK response codes (one per topic filter)
----------------------------

0 0x00 Subscribe Success - Maximum QoS 0.
1 0x01 Subscribe Success - Maximum QoS 1.
2 0x02 Subscribe Success - Maximum QoS 2.
3-127 Reserved for future use.

128 0x80 Subscribe Refused, reason unspecified.
129 0x81 Subscribe Refused, not authorized.
130 0x82 Subscribe Refused, implementation specific, eg. client quota reached.
131 0x83 Shared Subscriptions Not Supported.
132 0x84 Overlapping Subscription Not Supported .
133 0x85 Invalid topic filter
134 0x86 Client Quota Exceeded
135-255 Reserved for future use.


UNSUBACK response codes
------------------------------

0 0x00 UnSubscribe Success.
1 0x01 UnSubscribe Success, No subscription existed.
2-127 Reserved for future use.

128 0x81 UnSubscribe Refused, reason unspecified.
129 0x82 UnSubscribe Refused, not authorized.
130 0x83 UnSubscribe Refused, implementation specific, e.g. client quota reached.
131 0x84 UnSubscribe Refused, invalid topic filter
132-255 Reserved for future use.


PINGRESP response codes
-------------------------
NONE


DISCONNECT reason codes
-----------------------

0 0x00 Normal Disconnect (initiated by client)
1-127 Reserved
128 0x80 Session Take-over eviction (initiated by server)
129 0x81 Administrative command (initiated by server)
130 0x82 Inactivity Timeout (initiated by server)
131 0x83 Maximum Connection Duration Exceeded (server initiated)
132 0x84 Server Shutting Down, try later
133 0x85 Websocket packet type invalid (must be binary)
134 0x86 Protocol error
135 0x87 Malformed Packet Received (malformed means non-compliant with spec, including header bits, UTF-8 etc.)
136-255 Reserved




> Consolidate Acks, enable negative acknowledgements.
> ---------------------------------------------------
>
>                 Key: MQTT-236
>                 URL: https://issues.oasis-open.org/browse/MQTT-236
>             Project: OASIS Message Queuing Telemetry Transport (MQTT) TC
>          Issue Type: New Feature
>          Components: futures
>    Affects Versions: 5
>            Reporter: Andrew Banks
>            Assignee: Ed Briggs
>            Priority: Critical
>
> Consolidate Acks, enable negative acknowledgements.
> ---------------------------------------------------
> Connack, SubAck, UnsubAck, PubAck, PubRec, PubRel, PubComp, PingResp
> are all flavours of an Ack. Currently there are no negative Acks.
> I suggest consolidating all of the acks into a single packet type eg the current Connack
> and using bits 3-0 of the fixed header to indicate the ack'd packet type. 
> Connect Ack     : 0010 0001 RL, SP, RC   
> Publish Ack     : 0010 0011 RL, ID, RC  (Ack Qos=0,1)
> Publish Ack     : 0010 0100 RL, ID, RC  (Ack Qos=2)
> Publish Ack     : 0010 0101 RL, ID      (Rel Qos=2)
> Publish Ack     : 0010 0110 RL, ID, RC  (Comp Qos=2)
> Subscribe Ack   : 0010 1000 RL, ID, RC(,RC)(,RC)... (Per topic)
> UnSubscribe Ack : 0010 1010 RL, ID, RC(,RC)(,RC)... (Per topic)
> Ping Ack        : 0010 1011 RL
> RL=RamainingLength, SP=SessionPresent, RC=ResponseCode ID=PacketIdentifier
> This would free up the remaining  SubAck, UnsubAck, PubAck, PubRec, PubRel, PubComp, 
> PingResp packet types for other uses.
> Connect Ack response codes
> --------------------------
> 0	0x00 Connection Accepted.
> 1-127   Reserved for future use.
> 128	0x80 Connection Refused, Malformed Packet, eg user name indicated but not present. Followed by network disconnection.
> 129	0x81 Connection Refused, reason unspecified. Followed by network disconnection.
> 130	0x82 Connection Refused, the Client is not authorized to connect. Followed by network disconnection.
> 131     0x83 Connection Refused, implementation specific, eg. server capacity reached.
>                                  Followed by network disconnection.
> 132	0x84 Connection Refused, unacceptable protocol version. The Server does not support
>                                  the level of the MQTT protocol requested by the Client.
>                                  Followed by network disconnection.
> 133	0x85 Connection Refused, identifier rejected. The Client identifier is correct UTF-8
>                                  but not allowed by the Server. Followed by network disconnection.
> 134	0x86 Connection Refused, Server unavailable. The Network Connection has been made but the 
>                                  MQTT service is unavailable. Followed by network disconnection.
> 135	0x87 Connection Refused, bad user name or password. The data in the user name or 
>                                  password is malformed. Followed by network disconnection.
> 136-255	Reserved for future use.
> Publish Ack response codes, Ack Qos=0,1
> ---------------------------------------
> A packet identifier of zero indicates an ack for a Qos=0 message, 
> rc=0,1 is not allowed for Qos=0 messages, instead no Ack should be sent.
> 0	0x00 Message Accepted, Publication of Qos=1 message proceeds, not allowed for Qos=0.
> 1	0x01 Message Accepted, No matching subscribers. Not allowed for Qos=0.
> 2-127   Reserved for future use.
> 128	0x80 Message Refused, Malformed Packet, eg invalid topic name. Followed by network disconnection.
> 129	0x81 Message Refused, reason unspecified.
> 130	0x82 Message Refused, publication not authorized.
> 131     0x83 Message Refused, implementation specific, eg. client quota reached.
> 132-255	Reserved for future use.
> Publish Ack response codes, Ack Qos=2
> -------------------------------------
> 0	0x00 Message Accepted, Publication of Qos=2 message proceeds.
> 1	0x01 Message Accepted, No matching subscribers. Should be used in preference to 0x00 
>                                If the server cannot determine whether there are any subscribers, eg because it is 
>                                in a cluster, then use response code 0x00.
>                                No PubRel,PubComp expected.
> 2-127	Reserved for future use.
> 128	0x80 Message Refused, Malformed Packet, eg packet identifier=0. Followed by network disconnection.
> 129	0x81 Message Refused, reason unspecified.  No PubRel,PubComp expected.
> 130	0x82 Message Refused, publication not authorized.  No PubRel,PubComp expected.
> 131     0x83 Message Refused, implementation specific, eg. client quota reached.  No PubRel,PubComp expected.
> 132-255	Reserved for future use.
> Publish Ack response codes, Rel Qos=2
> -------------------------------------
> There are no Publish Ack Rel Qos=2 response codes, should we add a 0x00 byte as a placeholder?
> Publish Ack response codes, Comp Qos=2
> --------------------------------------
> 0	0x00 Message Released, Publication of Qos=2 message completed.
> 1	0x01 Message Released, No matching subscribers.  Should be used in preference to 0x00 
>                                If the server cannot determine whether there are any subscribers, eg because it is 
>                                in a cluster, then use response code 0x00.
> 2	0x02 Message Released, No message existed eg. expired.
> 3-127	Reserved for future use.
> 128	0x80 Message Release Refused, Malformed Packet, eg packet identifier=0. Followed by network disconnection.
> 129	0x81 Message Release Refused, reason unspecified.
> 130	0x82 Message Release Completed without publication, publication not authorized.
> 131     0x83 Message Release Refused, implementation specific, eg. client quota reached.
> 132-255	Reserved for future use.
> Subscribe Ack response codes
> ----------------------------
> 0	0x00 Subscribe Success - Maximum QoS 0.
> 1	0x01 Subscribe Success - Maximum QoS 1.
> 2	0x02 Subscribe Success - Maximum QoS 2.
> 3-127	Reserved for future use.
> 128	0x80 Subscribe Refused, Malformed Packet, eg packet identifier=0. Followed by network disconnection.
> 129	0x81 Subscribe Refused, reason unspecified.
> 130	0x82 Subscribe Refused, not authorized.
> 131     0x83 Subscribe Refused, implementation specific, eg. client quota reached.
> 132-255	Reserved for future use.
> UnSubscribe Ack response codes
> ------------------------------
> 0	0x00 UnSubscribe Success.
> 1	0x01 UnSubscribe Success, No subscription existed.
> 2-127	Reserved for future use.
> 128	0x80 UnSubscribe Refused, Malformed Packet, eg. packet identifier=0. Followed by network disconnection.
> 129	0x81 UnSubscribe Refused, reason unspecified.
> 130	0x82 UnSubscribe Refused, not authorized.
> 131     0x83 UnSubscribe Refused, implementation specific, eg. client quota reached.
> 122-255	Reserved for future use.
> Ping Resp response codes
> -------------------------
> There are no Ping Resp response codes, should we add a 0x00 byte as a placeholder?



--
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]