COAP vs MQTT | Difference between COAP and MQTT protocols
This page compares COAP vs MQTT and mentions difference between COAP and MQTT protocols.
COAP Protocol
• CoAP stands for Constrained Application Protocol.
• It is specified in RFC 7252.It is open IETF standard
• It is very efficient RESTful protocol.
• Easy to proxy to/from HTTP.
• It is Embedded web transfer protocol (coap://)
• It uses asynchronous transaction model.
• UDP is binding with reliability and multicast support.
• GET, POST, PUT and DELETE methods are used.
• URI is supported.
• It uses small and simple 4 byte header.
• Supports binding to UDP, SMS and TCP.
• DTLS based PSK, RPK and certificate security is used.
• uses subset of MIME types and HTTP response codes.
• Uses built in discovery mechanism.
Refer CoAP Protocol>> for more information.
MQTT Protocol
The figure-1 depicts simple MQTT protocol architecture (broker based).
Following are the features of MQTT protocol:
• It is over TCP.
• It uses SSL/TLS for security.
• There are many messages used in MQTT protocol such as CONNECT, PUBLISH, SUBSCRIBE, DISCONNECT etc.
• Username/Password is used in 'connect' message.
• It encrypts payload i.e. it is payload agnostic.
• 1883 port is used by MQTT protocol.
Refer tutorial on MQTT Protocol>> for more information.
Following table compares various features of COAP vs MQTT and tabulates difference between CoAP and MQTT protocols.
Features | CoAP | MQTT |
---|---|---|
Full Form | Constrained Application Protocol | Message Queue Telemetry Transport |
Model used for communication | Request-Response, Publish-Subscribe | Publish-Subscribe |
RESTful | Yes | No |
Transport layer | Preferably UDP, TCP can also be used. | Preferably TCP, UDP can also be used (MQTT-S). |
Header Size | 4 Bytes | 2 Bytes |
Number of message types used | 4 | 16 |
Messaging | Asynchronous & Synchronous | Asynchronous |
Application Reliability | 2 Levels | 3 Levels |
Security | IPSEC or DTLS | Not defined in the standard |
Intermediaries | YES | YES (MQTT-S) |
LLN Suitability (thousand nodes) | Excellent | Fair |
Application success stories | Utility Field Area Networks | Extending enterprise messaging into IoT applications |
IoT Wireless Technologies
➤WLAN ➤THREAD ➤EnOcean ➤LoRa ➤SIGFOX ➤WHDI ➤Zigbee ➤6LoWPAN ➤Zigbee RF4CE ➤Z-Wave ➤NFC ➤RFID ➤INSTEON
Difference between CoAP vs MQTT vs HTTP, MQTT vs DDS, MQTT vs REST, MQTT vs SMQTT
CoAP vs HTTP >> MQTT vs HTTP >> MQTT vs REST >> MQTT vs DDS >> MQTT vs SMQTT >>
What is difference between
Difference between OSI and TCPIP layers Difference between TCP UDP FTP vs HTTP FTP vs SMTP FTP vs TFTP ARP vs RARP NAT vs PAT RIP vs OSPF SLIP vs PPP IMAP4 vs POP3 IPV4 vs IPV6