📜  MQTT 和 HTTP 协议的区别

📅  最后修改于: 2021-09-13 02:51:48             🧑  作者: Mango

1.消息队列遥测传输(MQTT):
它是由 Andy Standford-Clark 和 Arlen Nipper 创建的。它是一种基于发布/订阅模型的物联网交互协议。该模型是提供对 QoS(服务质量)支持的简单模型。由于它的能力,它可以在每一秒的基于物联网的设备中找到。该协议具有许多功能,因为它基于 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.