如何在AWS IoT上测量MQTT(连接)消息的有效载荷?

huangapple go评论62阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年5月13日 16:50:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76241864.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定