networks//network protocols//MQTT
MQTT is a lightweight publish-subscribe protocol over TCP/IP, built for telemetry and events, and it is the usual protocol of IoT. A producer publishes to a topic on a broker; any number of clients subscribe to that topic and receive the message. The producer never needs to know who consumes.
MQTT is a lightweight publish-subscribe protocol over TCP/IP, built for telemetry and events, and it is the usual protocol of IoT. A producer publishes to a topic on a broker; any number of clients subscribe to that topic and receive the message. The producer never needs to know who consumes.
Born for constrained devices and unreliable links, which is why it fits IoT and the industrial edge: small headers, keep-alive, quality-of-service levels for delivery guarantees, retained messages and last-will announcements when a client drops.
MQTT distributes information between systems; it does not read or write a device's registers, and it was not designed to move a robot axis. In a plant it sits on the IT side of the boundary, fed by a gateway that speaks the fieldbuses (MQTT). Hundreds of wireless vibration sensors on pumps, each publishing a spectral summary every hour to a broker that feeds a time-series database, are the shape it was made for.
Its delivery guarantees are about arriving, never about arriving on time. A message held in a queue during a network outage and delivered a minute later looks like fresh data unless it carries its own acquisition timestamp (event time) and the subscriber checks its age (time synchronization). That is one reason no fast control loop is closed through a broker, let alone one in the cloud: the loop stays in the PLC and MQTT carries what supervision and analysis need.
Compared with raw TCP sockets, UDP or SSH tunnels, the point of MQTT is decoupling: A and B both know the broker and nothing about each other.
REST pulls a resource on demand and returns a status code; MQTT pushes a value the moment it changes to everyone subscribed. Polling a PLC over REST and subscribing to its tags over MQTT are opposite traffic shapes for the same data.