There is a keep alive ping/pong message exchange that happens in the background. This is about 4 bytes of data in each direction at an interval you can choose through the ‘keep alive’ setting in the mqtt broker configuration node.
If we’re being pedantic, the keep alive interval determines how long the broker will wait for any data from a client before considering the client is dead and should be disconnected. Most brokers offer a 1.5x grace period. Clients will typically send pings (if needed) at something under the keepalive period to ensure they don’t get unexpectedly disconnected.
Read more here: Source link