英文:
How to measure MQTT (connect) message payload on AWS IOT?
问题
I am using AWS IOT to send measures from an IOT device to AWS IOT. Now my network provider showed me how much data I am sending around and I want to see what messages are using all of the data. I was thus wondering how to measure the payload of the messages, especially the connect message.
Any idea, can I monitor this in Cloudwatch or with any other tool?
英文:
I am using AWS IOT to send measures from an IOT device to AWS IOT. Now my network provider showed me how much data I am sending around and I want to see what messages are using all of the data. I was thus wondering how to measure the payload of the messages, especially the connect message.
Any idea, can I monitor this in Cloudwatch or with any other tool?
答案1
得分: 0
MQTT连接数据包的详细信息可以在MQTT规范中找到(https://mqtt.org/mqtt-specification/)。
您可能会使用MQTT v3.11,因此CONNECT数据包将由以下部分组成:
- 2字节的固定标头
- 10字节的可变标头(包括有效负载的大小以及用于清除会话的标志和有效负载是否包含遗嘱、用户名、密码的标志)
- 可变有效负载(在可变标头的前两个字节中指定大小)
- 客户端ID
- 遗嘱主题
- 遗嘱有效负载
- 用户名
- 密码
英文:
Details of the MQTT connect packet can be found in the MQTT spec (https://mqtt.org/mqtt-specification/).
You will most likely be using MQTT v3.11, so the CONNECT packet will be made up of a header
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028
- 2 Byte fixed header
- 10 byte Variable header (includes size of payload then flags for clean sesasion and if payload contains will, username, password)
- Variable payload (size in first 2 bytes of the variable header)
- client id
- will topic
- will payload
- username
- password
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论