MQTT 3.1.1 backward compatibility

306 views
Skip to first unread message

Tim Kellogg

unread,
Jan 16, 2014, 3:25:54 PM1/16/14
to mq...@googlegroups.com
Hi All,

I'm digging through the MQTT v3.1.1 spec and realized that the CONNECT packet seems to have changed the variable header from this in v3.1

byte 1 Length MSB (0)
byte 2 Length LSB (6)
byte 3 'M'
byte 4 'Q'
byte 5 'I'
byte 6 's'
byte 7 'd'
byte 8 'p'

to this in v3.1.1:

byte 1 Length MSB (0)
byte 2 Length LSB (4)
byte 3 'M'
byte 4 'Q'
byte 5 'T'
byte 6 'T'

I was under the impression that there wouldn't be any packet-level changes in v3.1.1. Was I wrong in this assumption?

Raphael Cohn

unread,
Jan 16, 2014, 4:03:10 PM1/16/14
to mq...@googlegroups.com

Tim

Thankyou for your comments. We'll prepare a consolidated response at the end of the consultation but this connect packet change is intended.

> --
> To learn more about MQTT please visit http://mqtt.org
> ---
> You received this message because you are subscribed to the Google Groups "MQ Telemetry Transport" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
> To post to this group, send email to mq...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mqtt.
> For more options, visit https://groups.google.com/groups/opt_out.

Stefano Costa

unread,
Jan 17, 2014, 1:31:07 AM1/17/14
to mq...@googlegroups.com
My comment: we've gone through this already in past years with Bluetooth and Zigbee already, standards change and upgrades not compatible. This causes slowing a wide and consistent and convinced adoption of a smart idea. And MQTT as it is now didn't raise relevant concern while being used by a fairly amount of players. So can't see any serious reason for making a new version not compatible at the packet level, if this is the idea.

Never happened from the very beginning to the most successful networking protocols as far as I know by the way.

Thanks for your work Raphael! S
--
  Stefano Costa


Raphael Cohn

unread,
Jan 17, 2014, 3:27:20 AM1/17/14
to mq...@googlegroups.com
All,

Stefano, I fully understand your points. The new MQTT version is packet-level compatible - all existing packet decode logic, etc, would be the same, although edge cases have been clarified and the meaning (or not) of some obscure opcode combinations explicitly stated. The only changes are very minor ones to CONNECT. That's why this is 3.11 - the changes are exceedingly small.

The CONNECT packet change is nothing more than the necessary protocol version-ing (for ever; a policy has been decided that meets this) and a forward compatible change to the password field to allow binary passwords. This is less than what changed between, say, HTTP/0.9, 1.0 and 1.1 - arguably the most successful protocol in history. It has been thoughtfully designed to ensure:-
- protocol versioning is consistent for all MQTT versions going forward;
- deep packet inspectors (firewalls, Application Security Modules, routers) can detect MQTT 3.1 and 3.11 traffic and route or reject as appropriate (including traffic splitting) by inspecting as few bytes as possible;
- any existing implementation using the common programming techniques for protocol handshaking can be trivially upgraded (eg, looking at the first few bytes for efficient Denial of Service purposes BEFORE reverting to the packet decode logic for all subsequent data)
- any implementation that wants to support 3.1 and 3.11 can make the necessary changes at protocol start and share high 99s (eg 99%) of its network code base between them


Raphael Cohn
Chief Architect, stormmq
Co-Chair, OASIS MQTT Standard
Secretary, OASIS AMQP Standard
raphae...@stormmq.com

UK Office:
Hamblethorpe Farm, Crag Lane, Bradley BD20 9DB, North Yorkshire, United Kingdom
Telephone: +44 845 3712 567

Registered office:
16 Anchor Street, Chelmsford, Essex, CM2 0JY, United Kingdom
StormMQ Limited is Registered in England and Wales under Company Number 07175657
StormMQ.com

Stefano Costa

unread,
Jan 17, 2014, 4:04:56 AM1/17/14
to mq...@googlegroups.com
On 01/17/2014 09:27 AM, Raphael Cohn wrote:
> All,
>
> Stefano, I fully understand your points. The new MQTT version is
> packet-level compatible - all existing packet decode logic, etc, would
> be the same, although edge cases have been clarified and the meaning
> (or not) of some obscure opcode combinations explicitly stated. The
> only changes are very minor ones to CONNECT. That's why this is 3.11 -
> the changes are exceedingly small.

Raphael thanks a lot for your explanation. The issue has been well
discussed it seems and conclusions are probably a good compromise.

S

--
Stefano Costa, R&D Manager
M +39 335 6565749
Skype stefanocosta.bluewind
Twitter @stefanobluewind
http://www.bluewind.it

Reply all
Reply to author
Forward
0 new messages