MQTT & MQTT-SN & CoAP
MQTT
MQTT/MQTT-SN Protocol Specifications
MQTT: Get started with IoT protocols
MQTT is a Client Server publish/subscribe messaging transport protocol.
client a -> broker -> client b
client 向 broker 订阅/发布 消息,broker向已订阅某topic的client发布自身收到的该topic的消息
broker可以根据消息主题、内容、类型进行相关过滤、选取
通配符 + 单层,# 多层, $开头:
myhome/groundfloor/+/temperature
myhome/groundfloor/#/temperature
$SYS/
MQTT over TCP/IP : port 1883, MQTT over TLS : port 8883
支持oauth2认证,payload encryption(对称,非对称),完整性校验
MQTT-SN
MQTT For Sensor Networks (MQTT-SN)
https://emqttd-docs.readthedocs.io/en/latest/mqtt-sn.html
为嵌入式设备优化的协议,可以在非TCP/IP环境,例如Zigbee下使用。
RFC 7252 The Constrained Application Protocol (CoAP)
The Constrained Application Protocol (CoAP)
Constrained Application Protocol for Internet of Things
[What is CoAP IoT protocol | CoAP Architecture,message header](https://www.rfwireless-world.com/IoT/CoAP-protocol.html) |
CoAP 是受限环境下的client->server文本消息协议,使用UDP传输,协议交互类似于简化版的HTTP。
传输层加密可用DTLS。