MQTT, CoAP and HTTP
Once a device is on a network, it needs a way to send its data. MQTT, CoAP and HTTP each suit different kinds of device.
Key points
- MQTT is a publish/subscribe protocol: devices publish messages to named topics on a broker, which forwards them to subscribers. MQTT 5.0 and 3.1.1 are OASIS standards; 3.1.1 is also ISO/IEC 20922.12
- MQTT offers three delivery levels: QoS 0 (at most once), QoS 1 (at least once) and QoS 2 (exactly once).1
- The registered TCP ports are 1883 for MQTT and 8883 for MQTT over TLS.31
- CoAP (RFC 7252) is a REST-style request/response protocol for constrained devices that runs over UDP, on port 5683, or 5684 when secured with DTLS.43
Where to go next
Spotted a mistake, or found this useful?
Tell usSources
- MQTT Version 5.0 · OASIS · Standard
- ISO/IEC 20922:2016 Message Queuing Telemetry Transport (MQTT) v3.1.1 · ISO · Standard
- Service Name and Transport Protocol Port Number Registry · IANA · Standard
- RFC 7252: The Constrained Application Protocol (CoAP) · IETF · Standard