📜  MQTT和HTTP协议之间的区别

📅  最后修改于: 2021-08-25 18:05:49             🧑  作者: Mango

1.消息队列遥测传输(MQTT):
它是由Andy Standford-Clark和Arlen Nipper创建的。它是基于发布/订阅模型的物联网交互协议。该模型是提供对QoS(服务质量)的支持的简单模型。由于其功能,可以在每隔一台基于IoT的设备中找到它。该协议基于TCP,具有许多功能,并使用SSL / TLS进行安全保护。对于服务器之间的消息传递,它使用CONNECT,PUBLISH,SUBSCRIBE,DISCONNECT等。

2.超文本传输协议(HTTP):
万维网(WWW)使用它来定义将如何传输和格式化其消息。该协议负责服务器在通过网络发送信息时必须采取的措施。在浏览器中输入URL时,此协议将HTTP请求发送到服务器,然后将HTTP响应发送回浏览器。该协议还负责控制万维网上的网页的格式和表示形式。

MQTT和HTTP协议之间的区别:

Parameter MQTT HTTP
Abbrevation Message Queuing Telemetry Transport Hyper Text Transfer Protocol
Architecture It works on publish/subscribe model. It works on request/response model.
Complexity It has less complexity. It is more complex.
Runs over It runs over Transmission Control Protocol. It runs over User Datagram Protocol.
Protocol Design This protocol’s design is Data centric. This protocol’s design is Document centric.
Message Size The message size generated is less as it uses binary format. The message size generated is more as it uses ASCII format.
Header Size It is of 2 bytes. It is of 8 bytes.
Port Number It works on 1883 port. It works on 80 or 8080 port.
Data Security It provides data security with SSL/TLS. It does not provide security but Https is built for that.