

Fixed Header (Control field + Length) + Variable Header -Example PUBACK.Fixed Header (Control field + Length) – Example CONNACK.The MQTT packet or message format consists of a 2 byte fixed header (always present) + Variable-header (not always present)+ payload (not always present). The Payload excluding MQTT protocol information like Client ID etc is binary data and the content and format is application specific. Topic names, Client ID, User names and Passwords are encoded as UTF-8 strings. That means each command has an associated acknowledgement.


MQTT uses a command and command acknowledgement format. MQTT is a binary based protocol were the control elements are binary bytes and not text strings. In this tutorial we will take a more detailed look at the MQTT protocol, and how MQTT messages or packets are formatted.
