window – Which version of MQTT is Mosquitto broker hosting

The CONNECT packet is the first thing sent over the connection and includes a “Protocol Level” (v3.0 & 3.1 = 3 (cannot differentiate these two versions), v3.11 = 4, v5 = 5).

The broker will process this and, if it does not support the requested level, respond with ‘Unsupported Protocol Version’ and disconnect.

If the broker supports multiple versions of the protocol it will use the “Protocol Level” to determine which version of the protocol to use for the specific connection (it’s quite possible to have v3.1.1 and v5 clients connected to Mosquitto at the same time).

Read more here: Source link