Server to Client PUBREC 5 Client to Server or Publish received (QoS 2 delivery part 1) Server to Client PUBREL 6 Client to Server or Publish release (QoS 2 delivery part 2) Server to Client PUBCOMP 7 Client to Server or Publish complete (QoS 2 delivery part 3) Server to Client SUBSCRIBE 8 Client to Server Subscribe request SUBACK 9 Server to Client Subscribe acknowledgment UNSUBSCRIBE 10 Client to Server Unsubscribe request UNSUBACK 11 Server to Client Unsubscribe acknowledgment PINGREQ 12 Client to Server PING request PINGRESP 13 Server to Client PING response DISCONNECT 14 Client to Server or Disconnect notification Server to Client AUTH 15 Client to Server or Authentication exchange Server to Client Flags The remaining bits [3-0] of byte 1 in the Fixed Header contain flags specific to each MQTT Control Packet type as listed in the . Where a flag bit is marked as in , it is reserved for future use and MUST “Reserved” be set to the value listed in that table [MQTT-2.1.3-1]. If invalid flags are received it is a Malformed Packet. Refer to section 4.13 for details about handling errors. Table 22 Flag Bits MQTT Control Fixed Header flags Bit 3 Bit 2 Bit 1 Bit 0 Packet CONNECT Reserved 0 0 0 0 CONNACK Reserved 0 0 0 0 PUBLISH Used in MQTT v5.0 DUP QoS RETAIN PUBACK Reserved 0 0 0 0 PUBREC Reserved 0 0 0 0 PUBREL Reserved 0 0 1 0 PUBCOMP Reserved 0 0 0 0 SUBSCRIBE Reserved 0 0 1 0 SUBACK Reserved 0 0 0 0
Server to Client PUBREC 5 Client to Server or Server to Client Publish received (QoS 2 delivery part 1) PUBREL 6 Client to Server or Server to Client Publish release (QoS 2 delivery part 2) PUBCOMP 7 Client to Server or Server to Client Publish complete (QoS 2 delivery part 3) SUBSCRIBE 8 Client to Server Subscribe request SUBACK 9 Server to Client Subscribe acknowledgment UNSUBSCRIBE 10 Client to Server Unsubscribe request UNSUBACK 11 Server to Client Unsubscribe acknowledgment PINGREQ 12 Client to Server PING request PINGRESP 13 Server to Client PING response DISCONNECT 14 Client to Server or Server to Client Disconnect notification AUTH 15 Client to Server or Server to Client Authentication exchange Flags The remaining bits [3-0] of byte 1 in the Fixed Header contain flags specific to each MQTT Control Packet type as listed in the . Where a flag bit is marked as “Reserved” in , it is reserved for future use and MUST be set to the value listed in that table [MQTT-2.1.3-1]. If invalid flags are received it is a Malformed Packet. Refer to section 4.13 for details about handling errors. Table 22 Flag Bits MQTT Control Packet Fixed Header flags Bit 3 Bit 2 Bit 1 Bit 0 CONNECT Reserved 0 0 0 0 CONNACK Reserved 0 0 0 0 PUBLISH Used in MQTT v5.0 DUP QoS RETAIN PUBACK Reserved 0 0 0 0 PUBREC Reserved 0 0 0 0 PUBREL Reserved 0 0 1 0 PUBCOMP Reserved 0 0 0 0 SUBSCRIBE Reserved 0 0 1 0 SUBACK Reserved 0 0 0 0