Keep Alive Logo

Keep Alive Logo, Welcome to the tenth part of MQTT Essentials, a blog series about the core features and concepts in the MQTT protocol. In this post, we talk about the Keep-Alive feature of MQTT and why this feature is especially important for mobile networks. This last part of our MQTT Essentials series is also available as a video which can be found at the end of this blog post.

Keep Alive Logo Company in India

The problem of half-open TCP connections

MQTT is based on the Transmission Control Protocol (TCP). This protocol ensures that packets are transferred over the internet in a “reliable, ordered, and error-checked” way. Nevertheless, from time to time, the transfer between communicating parties can get out of sync. For example, Keep-Alive Logo if one of the parties crashes or has transmission errors. In TCP, this state of the incomplete connection is called a half-open connection. The important point to remember is that one side of the communication continues to function and is not notified about the failure of the other side. The side that is still connected keeps trying to send messages and waits for acknowledgments.

keep alive logo

As Andy Stanford-Clark (the inventor of the MQTT protocol) points out, the problem with half-open connections increases in mobile networks:

MQTT Keep-Alive

MQTT includes a keep-alive function that provides a workaround for the issue of half-open connections (or at least makes it possible to assess if the connection is still open).

Keep alive ensures that the connection between the broker and client is still open and that the broker and the client are aware of being connected. When the client establishes a connection to the broker, Keep-Alive Logo the client communicates a time interval in seconds to the broker. This interval defines the maximum length of time that the broker and client may not communicate with each other.

As long as messages are exchanged frequently and the keep-alive interval is not exceeded, there is no need to send an extra message to establish whether the connection is still open.

If the client does not send messages during the keep-alive period, the Keep-Alive Logo must send a PINGREQ packet to the broker to confirm that it is available and to make sure that the broker is also still available.

The broker must disconnect a client that does not send a message or a PINGREQ packet in one and a half times the keepalive interval. Likewise, the client is expected to close the connection if it does not receive a response from the broker in a reasonable amount of time.

Keep Alive Logo

Looking for a Quick Quote

You will receive reply within 24 hrs

    We respect your privacy

    Keep-Alive is a header that maintains a persistent connection between a client and server. Learn more about the functionalities of …

    • Photoshop
    • Corel Draw
    • Adobe Illustrator

    Get inspired by these amazing Keep Alive Logo created by professional designers. Get ideas and start planning your perfect living logo today!

    Shaadi Dhoomdham LogoGaandhi Autonline Logo

    We have 15 years experience

    reach experienced into web and mobile development, custom solutions for your business.