# 1 Introduction ✔️ - [x] 1.5 Data representation - [x] 1.5.1 Bits - [x] 1.5.2 Two Byte Integer - [x] 1.5.3 Four Byte Integer - [x] 1.5.4 UTF-8 Encoded String - [x] 1.5.5 Variable Byte Integer - [x] 1.5.6 Binary Data - [ ] 1.5.7 UTF-8 String Pair - [x] 1.6 Security - [x] 1.7 Editing convention - [x] 1.8 Change history - [x] 1.8.1 MQTT v3.1.1 - [x] 1.8.2 MQTT v5.0 # 2 MQTT Control Packet format ✔️ - [x] 2.1 Structure of an MQTT Control Packet - [x] 2.1.1 Fixed Header - [x] 2.1.2 MQTT Control Packet type - [x] 2.1.3 Flags - [x] 2.1.4 Remaining Length - [x] 2.2 Variable Header - [x] 2.2.1 Packet Identifier - [x] 2.2.2 Properties - [x] 2.2.2.1 Property Length - [x] 2.2.2.2 Property - [ ] 2.3 Payload - [x] 2.4 Reason Code # 3 MQTT Control Packets - [ ] 3.1 CONNECT – Connection Request - [x] 3.1.1 CONNECT Fixed Header - [ ] 3.1.2 CONNECT Variable Header - [x] 3.1.2.1 Protocol Name - [x] 3.1.2.2 Protocol Version - [x] 3.1.2.3 Connect Flags - [ ] 3.1.2.4 Clean Start - [ ] 3.1.2.5 Will Flag - [ ] 3.1.2.6 Will QoS - [ ] 3.1.2.7 Will Retain - [ ] 3.1.2.8 User Name Flag - [ ] 3.1.2.9 Password Flag - [ ] 3.1.2.10 Keep Alive - [ ] 3.1.2.11 CONNECT Properties - [ ] 3.1.2.11.1 Property Length - [ ] 3.1.2.11.2 Session Expiry Interval - [ ] 3.1.2.11.3 Receive Maximum - [ ] 3.1.2.11.4 Maximum Packet Size - [ ] 3.1.2.11.5 Topic Alias Maximum - [ ] 3.1.2.11.6 Request Response Information - [ ] 3.1.2.11.7 Request Problem Information - [ ] 3.1.2.11.8 User Property - [ ] 3.1.2.11.9 Authentication Method - [ ] 3.1.2.11.10 Authentication Data - [ ] 3.1.2.12 Variable Header non-normative example - [ ] 3.1.3 CONNECT Payload - [ ] 3.1.3.1 Client Identifier (ClientID) - [ ] 3.1.3.2 Will Properties - [ ] 3.1.3.2.1 Property Length - [ ] 3.1.3.2.2 Will Delay Interval - [ ] 3.1.3.2.3 Payload Format Indicator - [ ] 3.1.3.2.4 Message Expiry Interval - [ ] 3.1.3.2.5 Content Type - [ ] 3.1.3.2.6 Response Topic - [ ] 3.1.3.2.7 Correlation Data - [ ] 3.1.3.2.8 User Property - [ ] 3.1.3.3 Will Topic - [ ] 3.1.3.4 Will Payload - [ ] 3.1.3.5 User Name - [ ] 3.1.3.6 Password - [ ] 3.1.4 CONNECT Actions - [ ] 3.2 CONNACK – Connect acknowledgement - [ ] 3.2.1 CONNACK Fixed Header - [ ] 3.2.2 CONNACK Variable Header - [ ] 3.2.2.1 Connect Acknowledge Flags - [ ] 3.2.2.1.1 Session Present - [ ] 3.2.2.2 Connect Reason Code - [ ] 3.2.2.3 CONNACK Properties - [ ] 3.2.2.3.1 Property Length - [ ] 3.2.2.3.2 Session Expiry Interval - [ ] 3.2.2.3.3 Receive Maximum - [ ] 3.2.2.3.4 Maximum QoS - [ ] 3.2.2.3.5 Retain Available - [ ] 3.2.2.3.6 Maximum Packet Size - [ ] 3.2.2.3.7 Assigned Client Identifier - [ ] 3.2.2.3.8 Topic Alias Maximum - [ ] 3.2.2.3.9 Reason String - [ ] 3.2.2.3.10 User Property - [ ] 3.2.2.3.11 Wildcard Subscription Available - [ ] 3.2.2.3.12 Subscription Identifiers Available - [ ] 3.2.2.3.13 Shared Subscription Available - [ ] 3.2.2.3.14 Server Keep Alive - [ ] 3.2.2.3.15 Response Information - [ ] 3.2.2.3.16 Server Reference - [ ] 3.2.2.3.17 Authentication Method - [ ] 3.2.2.3.18 Authentication Data - [ ] 3.2.3 CONNACK Payload - [ ] 3.3 PUBLISH – Publish message - [ ] 3.3.1 PUBLISH Fixed Header - [ ] 3.3.1.1 DUP - [ ] 3.3.1.2 QoS - [ ] 3.3.1.3 RETAIN - [ ] 3.3.1.4 Remaining Length - [ ] 3.3.2 PUBLISH Variable Header - [ ] 3.3.2.1 Topic Name - [ ] 3.3.2.2 Packet Identifier - [ ] 3.3.2.3 PUBLISH Properties - [ ] 3.3.2.3.1 Property Length - [ ] 3.3.2.3.2 Payload Format Indicator - [ ] 3.3.2.3.3 Message Expiry Interval - [ ] 3.3.2.3.4 Topic Alias - [ ] 3.3.2.3.5 Response Topic - [ ] 3.3.2.3.6 Correlation Data - [ ] 3.3.2.3.7 User Property - [ ] 3.3.2.3.8 Subscription Identifier - [ ] 3.3.2.3.9 Content Type - [ ] 3.3.3 PUBLISH Payload - [ ] 3.3.4 PUBLISH Actions - [ ] 3.4 PUBACK – Publish acknowledgement - [ ] 3.4.1 PUBACK Fixed Header - [ ] 3.4.2 PUBACK Variable Header - [ ] 3.4.2.1 PUBACK Reason Code - [ ] 3.4.2.2 PUBACK Properties - [ ] 3.4.2.2.1 Property Length - [ ] 3.4.2.2.2 Reason String - [ ] 3.4.2.2.3 User Property - [ ] 3.4.3 PUBACK Payload - [ ] 3.4.4 PUBACK Actions - [ ] 3.5 PUBREC – Publish received (QoS 2 delivery part 1) - [ ] 3.5.1 PUBREC Fixed Header - [ ] 3.5.2 PUBREC Variable Header - [ ] 3.5.2.1 PUBREC Reason Code - [ ] 3.5.2.2 PUBREC Properties - [ ] 3.5.2.2.1 Property Length - [ ] 3.5.2.2.2 Reason String - [ ] 3.5.2.2.3 User Property - [ ] 3.5.3 PUBREC Payload - [ ] 3.5.4 PUBREC Actions - [ ] 3.6 PUBREL – Publish release (QoS 2 delivery part 2) - [ ] 3.6.1 PUBREL Fixed Header - [ ] 3.6.2 PUBREL Variable Header - [ ] 3.6.2.1 PUBREL Reason Code - [ ] 3.6.2.2 PUBREL Properties - [ ] 3.6.2.2.1 Property Length - [ ] 3.6.2.2.2 Reason String - [ ] 3.6.2.2.3 User Property - [ ] 3.6.3 PUBREL Payload - [ ] 3.6.4 PUBREL Actions - [ ] 3.7 PUBCOMP – Publish complete (QoS 2 delivery part 3) - [ ] 3.7.1 PUBCOMP Fixed Header - [ ] 3.7.2 PUBCOMP Variable Header - [ ] 3.7.2.1 PUBCOMP Reason Code - [ ] 3.7.2.2 PUBCOMP Properties - [ ] 3.7.2.2.1 Property Length - [ ] 3.7.2.2.2 Reason String - [ ] 3.7.2.2.3 User Property - [ ] 3.7.3 PUBCOMP Payload - [ ] 3.7.4 PUBCOMP Actions - [ ] 3.8 SUBSCRIBE - Subscribe request - [ ] 3.8.1 SUBSCRIBE Fixed Header - [ ] 3.8.2 SUBSCRIBE Variable Header - [ ] 3.8.2.1 SUBSCRIBE Properties - [ ] 3.8.2.1.1 Property Length - [ ] 3.8.2.1.2 Subscription Identifier - [ ] 3.8.2.1.3 User Property - [ ] 3.8.3 SUBSCRIBE Payload - [ ] 3.8.3.1 Subscription Options - [ ] 3.8.4 SUBSCRIBE Actions - [ ] 3.9 SUBACK – Subscribe acknowledgement - [ ] 3.9.1 SUBACK Fixed Header - [ ] 3.9.2 SUBACK Variable Header - [ ] 3.9.2.1 SUBACK Properties - [ ] 3.9.2.1.1 Property Length - [ ] 3.9.2.1.2 Reason String - [ ] 3.9.2.1.3 User Property - [ ] 3.9.3 SUBACK Payload - [ ] 3.10 UNSUBSCRIBE – Unsubscribe request - [ ] 3.10.1 UNSUBSCRIBE Fixed Header - [ ] 3.10.2 UNSUBSCRIBE Variable Header - [ ] 3.10.2.1 UNSUBSCRIBE Properties - [ ] 3.10.2.1.1 Property Length - [ ] 3.10.2.1.2 User Property - [ ] 3.10.3 UNSUBSCRIBE Payload - [ ] 3.10.4 UNSUBSCRIBE Actions - [ ] 3.11 UNSUBACK – Unsubscribe acknowledgement - [ ] 3.11.1 UNSUBACK Fixed Header - [ ] 3.11.2 UNSUBACK Variable Header - [ ] 3.11.2.1 UNSUBACK Properties - [ ] 3.11.2.1.1 Property Length - [ ] 3.11.2.1.2 Reason String - [ ] 3.11.2.1.3 User Property - [ ] 3.11.3 UNSUBACK Payload - [ ] 3.12 PINGREQ – PING request - [ ] 3.12.1 PINGREQ Fixed Header - [ ] 3.12.2 PINGREQ Variable Header - [ ] 3.12.3 PINGREQ Payload - [ ] 3.12.4 PINGREQ Actions - [ ] 3.13 PINGRESP – PING response - [ ] 3.13.1 PINGRESP Fixed Header - [ ] 3.13.2 PINGRESP Variable Header - [ ] 3.13.3 PINGRESP Payload - [ ] 3.13.4 PINGRESP Actions - [ ] 3.14 DISCONNECT – Disconnect notification - [ ] 3.14.1 DISCONNECT Fixed Header - [ ] 3.14.2 DISCONNECT Variable Header - [ ] 3.14.2.1 Disconnect Reason Code - [ ] 3.14.2.2 DISCONNECT Properties - [ ] 3.14.2.2.1 Property Length - [ ] 3.14.2.2.2 Session Expiry Interval - [ ] 3.14.2.2.3 Reason String - [ ] 3.14.2.2.4 User Property - [ ] 3.14.2.2.5 Server Reference - [ ] 3.14.3 DISCONNECT Payload - [ ] 3.14.4 DISCONNECT Actions - [ ] 3.15 AUTH – Authentication exchange - [ ] 3.15.1 AUTH Fixed Header - [ ] 3.15.2 AUTH Variable Header - [ ] 3.15.2.1 Authenticate Reason Code - [ ] 3.15.2.2 AUTH Properties - [ ] 3.15.2.2.1 Property Length - [ ] 3.15.2.2.2 Authentication Method - [ ] 3.15.2.2.3 Authentication Data - [ ] 3.15.2.2.4 Reason String - [ ] 3.15.2.2.5 User Property - [ ] 3.15.3 AUTH Payload - [ ] 3.15.4 AUTH Actions # 4 Operational behavior - [ ] 4.1 Session State - [ ] 4.1.1 Storing Session State - [ ] 4.1.2 Session State non-normative examples - [ ] 4.2 Network Connections - [ ] 4.3 Quality of Service levels and protocol flows - [ ] 4.3.1 QoS 0: At most once delivery - [ ] 4.3.2 QoS 1: At least once delivery - [ ] 4.3.3 QoS 2: Exactly once delivery - [ ] 4.4 Message delivery retry - [ ] 4.5 Message receipt - [ ] 4.6 Message ordering - [ ] 4.7 Topic Names and Topic Filters - [ ] 4.7.1 Topic wildcards - [ ] 4.7.1.1 Topic level separator - [ ] 4.7.1.2 Multi-level wildcard - [ ] 4.7.1.3 Single-level wildcard - [ ] 4.7.2 Topics beginning with $ - [ ] 4.7.3 Topic semantic and usage - [ ] 4.8 Subscriptions - [ ] 4.8.1 Non‑shared Subscriptions - [ ] 4.8.2 Shared Subscriptions - [ ] 4.9 Flow Control - [ ] 4.10 Request / Response - [ ] 4.10.1 Basic Request Response (non-normative) - [ ] 4.10.2 Determining a Response Topic value (non-normative) - [ ] 4.11 Server redirection - [ ] 4.12 Enhanced authentication - [ ] 4.12.1 Re-authentication - [ ] 4.13 Handling errors - [ ] 4.13.1 Malformed Packet and Protocol Errors - [ ] 4.13.2 Other errors # 5 Security (non-normative) - [ ] 5.1 Introduction - [ ] 5.2 MQTT solutions: security and certification - [ ] 5.3 Lightweight crytography and constrained devices - [ ] 5.4 Implementation notes - [ ] 5.4.1 Authentication of Clients by the Server - [ ] 5.4.2 Authorization of Clients by the Server - [ ] 5.4.3 Authentication of the Server by the Client - [ ] 5.4.4 Integrity of Application Messages and MQTT Control Packets - [ ] 5.4.5 Privacy of Application Messages and MQTT Control Packets - [ ] 5.4.6 Non-repudiation of message transmission - [ ] 5.4.7 Detecting compromise of Clients and Servers - [ ] 5.4.8 Detecting abnormal behaviors - [ ] 5.4.9 Handling of Disallowed Unicode code points - [ ] 5.4.9.1 Considerations for the use of Disallowed Unicode code points - [ ] 5.4.9.2 Interactions between Publishers and Subscribers - [ ] 5.4.9.3 Remedies - [ ] 5.4.10 Other security considerations - [ ] 5.4.11 Use of SOCKS - [ ] 5.4.12 Security profiles - [ ] 5.4.12.1 Clear communication profile - [ ] 5.4.12.2 Secured network communication profile - [ ] 5.4.12.3 Secured transport profile - [ ] 5.4.12.4 Industry specific security profiles # 6 Using WebSocket as a network transport - [ ] 6.1 IANA considerations # 7 Conformance - [ ] 7.1 Conformance clauses - [ ] 7.1.1 MQTT Server conformance clause - [ ] 7.1.2 MQTT Client conformance clause Appendix A. Acknowledgments Appendix B. Mandatory normative statement (non-normative) Appendix C. Summary of new features in MQTT v5.0 (non-normative)