The Protocol Name field will be referred to as an immutable string, following the standard convention of two prefix bytes indicating length followed by the content 'MQTT'.
The Protocol Version field will be renamed Protocol Level, specified as an unsigned 8bit integer, and for this release of the specification set as the value 4.
The Protocol Name field will be referred to as an immutable string, following the standard convention of two prefix bytes indicating length followed by the content 'MQTT'.
The Protocol Version field will be renamed Protocol Level, specified as an unsigned 8bit integer, and for this release of the specification set as the value 4.
Description
The draft specification states that the Bytes 1 to 9 of the variable header section of the CONNECT packet are currently a spec encoded string (2 prefix bytes indicating the string length followed by the string data) containing the letters 'MQIsdp' followed by the number 3. Changing these fields would be an easy way to differentiate between old and OASIS spec compliant clients.
Reasons for wanting to differentiate between clients include using discrimination of access to MQTT servers and understanding/implementing behavioural differences.
Whilst it's nice to have this string use the same generic encoding, simple deep packet inspectors (eg firewalls) will want the offset of this version string to be constant, and the size to be constant
It may be worth considering that the size and offset should remain constant even between major versions
I'd suggest we end the differentiation in the spec between the letters and the number - and just make the whole thing a 'version token'. After all, any inspector is simply going to do a 'string switch' or hash map like dispatch. That's not to say that the value could be 'MQTT311' or whatever, just that there's no separation (ie it's opaque).
Raphael Cohen (Inactive)
added a comment - Some observations:-
Whilst it's nice to have this string use the same generic encoding, simple deep packet inspectors (eg firewalls) will want the offset of this version string to be constant, and the size to be constant
It may be worth considering that the size and offset should remain constant even between major versions
I'd suggest we end the differentiation in the spec between the letters and the number - and just make the whole thing a 'version token'. After all, any inspector is simply going to do a 'string switch' or hash map like dispatch. That's not to say that the value could be 'MQTT311' or whatever, just that there's no separation (ie it's opaque).
I have no issue with removing the first two bytes that indicate the size of the Protocol Name string, and agree its size should be constant between versions.
I would however want there to be a notional difference between the Protocol Name and the Protocol Level, the latter remaining a single integer rather than a character representation of the version number. It would be simpler to programatically determine whether a client Protocol Level is a supported one.
Allan Stockdill-Mander (Inactive)
added a comment - I have no issue with removing the first two bytes that indicate the size of the Protocol Name string, and agree its size should be constant between versions.
I would however want there to be a notional difference between the Protocol Name and the Protocol Level, the latter remaining a single integer rather than a character representation of the version number. It would be simpler to programatically determine whether a client Protocol Level is a supported one.
Following from the TC decision that the formal protocol name should be 'MQTT' I propose that the Protocol Name string should also be 'MQTT', and additionally that the Protocol Version field be renamed to Protocol Level (to decouple it from the version number on the specification) and specified as an unsigned 8bit integer and be incremented to 4 (anticipating that potential future revisions would also increment this number).
Following from the TC decision that the formal protocol name should be 'MQTT' I propose that the Protocol Name string should be fixed as 4 bytes in length with no size prefix and contain only the characters 'MQTT', and additionally that the Protocol Version field be renamed to Protocol Level (to decouple it from the version number on the specification) and specified as an unsigned 8bit integer and be incremented to 4 (anticipating that potential future revisions would also increment this number).
Following from the TC decision that the formal protocol name should be 'MQTT' I propose that the Protocol Name string should be fixed as 4 bytes in length with no size prefix and contain only the characters 'MQTT', and additionally that the Protocol Version field be renamed to Protocol Level (to decouple it from the version number on the specification) and specified as an unsigned 8bit integer and be incremented to 4 (anticipating that potential future revisions would also increment this number).
The Protocol Name field will be referred to as an immutable string, following the standard convention of two prefix bytes indicating length followed by the content 'MQTT'.
The Protocol Version field will be renamed Protocol Level, specified as an unsigned 8bit integer, and for this release of the specification set as the value 4.
Some observations:-