|
MQTT Control Packet
|
A packet of information sent across the network
|
|
Application Message
|
The data carried by the protocol
|
|
Topic Name
|
A label attached to an Application Message that can be subscribed by clients
|
|
Topic Filter
|
An expression used to express interest in one or more topics (can use wildcards)
|
|
Session
|
Stateful interaction between a client and a server
|
|
Bits
|
Bits in a byte, from 7 (MSB) to 0 (LSB).
|
|
Integers
|
Big-endian ordered, 16-bits
|
|
Strings
|
UTF-8 strings, prefixed by its length
|
|
At Most Once
|
0
|
|
At Least Once
|
1
|
|
Exactly Once
|
2
|
|
Must be at least 1 character long
|
|
|
Case sensitive
|
|
|
Can include spaces
|
|
|
Name structured divided by slashes
|
/news/sports/europe
|
Multi level
|
#
|
Used to match any number of levels within a topic tree, including the parent level itself.
|
|
Single level
|
+
|
Used to match a single level within a topic tree.
|
|
Reserved
|
$
|
Topics starting with the dollar sign ('$') are reserved for server purposes and should not be used by clients.
|
+/sports/# - valid sports+ - not valid
|
Field
|
Description
|
|
Control Packet Type
|
4 bit representation of the packet type.
|
|
Flags
|
4 bit flags specific to each packet type.
|
|
Remaining Length
|
Number of bytes remaining in the packet.
|
|
Field
|
Description
|
|
Packet Identifier
|
Used to establish a relationship between different MQTT Control Packets
|
|
Payload
|
A payload associated with the MQTT Control Packet
|
|
Packet
|
Name
|
|
CONNECT
|
Client request to connect
|
|
CONNACK
|
Connect ACK
|
|
PUBLISH
|
Publish message
|
|
PUBACK
|
Publish ACK
|
|
PUBREC
|
Publish received
|
|
PUBREL
|
Publish release
|
|
PUBCOMP
|
Publish complete
|
|
SUBSCRIBE
|
Client subscribe request
|
|
SUBACK
|
Subscribe ACK
|
|
UNSUBSCRIBE
|
Unsubscribe request
|
|
UNSUBACK
|
Unsubscribe ACK
|
|
PINGREQ
|
Ping request
|
|
PINGRESP
|
Ping response
|
|
DISCONNECT
|
Client disconnecting
|
|
Code
|
Description
|
|
0x00
|
Connection accepted
|
|
0x01
|
Connection refused (protocol version)
|
|
0x02
|
Connection refused (identifier rejected)
|
|
0x03
|
Connection refused (server unavailable)
|
|
0x04
|
Connection refused (bad user/password)
|
|
0x05
|
Connection refused (Unauthorized)
|
|
6-255
|
Reserved
|
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.