I just wanted to know on how MQTT broker identifies different MQTT clients hardware, as I understand MQTT clients are not assigned any IP addresses unlike web clients yet communicate over internet at ease.
2 Answers
Can the question be phrased:
How does the MQTT server talk to the MQTT client with out prior knowledge of the IP address of MQTT client?
The MQTT client sends the MQTT broker a CONNECT messsage. The connection must be left open so that the MQTT server can push messages to the MQTT client.
-
1Sure. I'll change it. There is a disconnect command. But I'm not sure under what conditions a client would disconnect. Maybe if the client were to power down.st2000– st20002025-05-01 01:55:18 +00:00Commented May 1 at 1:55
MQTT clients are identified by the client id that is contained in the connect packet, they can also optionally provided a username and password (or a client certificate) to assert they own the identity.
All of this runs over a single persistent TCP/IP connection (normally) so once connected the broker always a open connection to any given client
MQTT clients are not assigned any IP addresses unlike web clients... you may be misunderstanding something