byte 2 Length LSB (4) 0 0 0 0 0 1 0 0 byte 3 0 1 0 0 1 1 0 1 ‘M’ byte 4 0 1 0 1 0 0 0 1 ‘Q’ byte 5 0 1 0 1 0 1 0 0 ‘T’ byte 6 0 1 0 1 0 1 0 0 ‘T’ The Protocol Name is a UTF-8 Encoded String that represents the protocol name capitalized as “MQTT”, shown. The string, its offset and length will not be changed by future versions of the MQTT specification. A Server support multiple protocols uses the Protocol Name to determine whether the data is MQTT. The protocol name MUST be the UTF-8 String "MQTT". If the Server does not want to accept the CONNECT, and wishes to reveal that it is an MQTT Server it MAY send a CONNACK packet with Reason Code of 0x84 (Unsupported Protocol Version), and then it MUST close the Network Connection [MQTT-3.1.2-1]. Non-normative comment Packet inspectors, such as firewalls, use the Protocol Name to identify MQTT traffic. Protocol Version Figure 33 - Protocol Version byte Description 7 6 5 4 3 2 1 0 Protocol Level byte 7 Version(5) 0 0 0 0 0 1 0 1 The one byte unsigned value that represents the revision level of the protocol used by the Client. The value of the Protocol Version field for version 5.0 of the protocol is 5 (0x05). A Server supports multiple versions of the MQTT protocol uses the Protocol Version to determine which version of MQTT the Client is using. If the Protocol Version is not 5 and the Server does not want to accept the CONNECT packet, the Server MAY send a CONNACK packet with Reason Code 0x84 (Unsupported Protocol Version) and then MUST close the Network Connection [MQTT-3.1.2-2]. Connect The Connect Flags byte contains several parameters specifying the behavior of the MQTT connection. It also indicates the presence or absence of fields in the Payload. Figure 34 - Connect Flag bits Bit 7 6 5 4 3 2 1 0 User Name Password Will Retain Will QoS Will Flag Clean Reserved Flag Flag Start
byte 2 Length LSB (4) 0 0 0 0 0 1 0 0 byte 3 ‘M’ 0 1 0 0 1 1 0 1 byte 4 ‘Q’ 0 1 0 1 0 0 0 1 byte 5 ‘T’ 0 1 0 1 0 1 0 0 byte 6 ‘T’ 0 1 0 1 0 1 0 0 The Protocol Name is a UTF-8 Encoded String that represents the protocol name “MQTT”, capitalized as shown. The string, its offset and length will not be changed by future versions of the MQTT specification. A Server support multiple protocols uses the Protocol Name to determine whether the data is MQTT. The protocol name MUST be the UTF-8 String "MQTT". If the Server does not want to accept the CONNECT, and wishes to reveal that it is an MQTT Server it MAY send a CONNACK packet with Reason Code of 0x84 (Unsupported Protocol Version), and then it MUST close the Network Connection [MQTT-3.1.2-1]. Non-normative comment Packet inspectors, such as firewalls, use the Protocol Name to identify MQTT traffic. Protocol Version Figure 33 - Protocol Version byte Description 7 6 5 4 3 2 1 0 Protocol Level byte 7 Version(5) 0 0 0 0 0 1 0 1 The one byte unsigned value that represents the revision level of the protocol used by the Client. The value of the Protocol Version field for version 5.0 of the protocol is 5 (0x05). A Server supports multiple versions of the MQTT protocol uses the Protocol Version to determine which version of MQTT the Client is using. If the Protocol Version is not 5 and the Server does not want to accept the CONNECT packet, the Server MAY send a CONNACK packet with Reason Code 0x84 (Unsupported Protocol Version) and then MUST close the Network Connection [MQTT-3.1.2-2]. Connect The Connect Flags byte contains several parameters specifying the behavior of the MQTT connection. It also indicates the presence or absence of fields in the Payload. Figure 34 - Connect Flag bits Bit 7 6 5 4 3 2 1 0 User Name Flag Password Flag Will Retain Will QoS Will Flag Clean Start Reserved
mqtt-v5.0-cs02.docx