MQTT 协议术语:消息与数据包
参考Stack Overflow问题协议术语:消息与数据包,我想联系一下以下是对 MQTT 协议的接受意见。
这些绝对是消息。 “数据包”是第 3 层(ISO 术语)协议单元,例如 IP 数据包; “数据报”是第 1 层或第 2 层单元,例如可能组成 IP 数据包片段的多个以太网数据报。 因此,一条消息可能会被拆分为多个数据包,特别是当您使用 TCP 等流协议时,并且一个数据包可能会被拆分为多个数据报。
MQTT 协议的工作原理是按照定义的方式交换一系列 MQTT 控制数据包。
参考链接的 Stack Overflow 问题的已接受答案,MQTT 使用“数据包”一词是否不正确?或者是否还有其他需要考虑的因素使得“包”一词的使用正确?
Referring to the Stack Overflow question Protocol Terminology: Message versus Packet, I would like to relate the following accepted opinion to the MQTT protocol.
These are definitely messages. A "packet" is a layer-3 (in ISO terminology) protocol unit, such as an IP packet; and a "datagram" is a layer-1 or layer-2 unit, such as the several Ethernet datagrams that might make up the fragments of an IP packet.
So a message might be split across several packets, particularly if you're using a streaming protocol such as TCP, and a packet might be split across several datagrams.
The MQTT protocol defines control packets.
The MQTT protocol works by exchanging a series of MQTT Control Packets in a defined way.
Referring to the accepted answer of the linked Stack Overflow question, is MQTT using the word packet incorrect? Or is there something else to consider which makes the use of the word packet correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
词语没有内在意义;他们的意思是我们同意的。由于答案提到“ISO 术语”,让我们从 ISO“信息技术 — 词汇”中给出的“数据包”定义开始 (ISO/IEC 2382:2015):
控制数据包是否满足此定义将取决于您如何解释“作为一个整体进行传输和交换”。
其他地方的定义略有不同;即使在其他 ISO 标准中也是如此。快速搜索发现 ISO/IEC 14476-1:2002 定义“数据包”更符合您引用的答案的方式:
所以我猜这个定义取决于上下文。话虽如此,我相信很难争论 MQTT 规范中的用法“在 ISO 术语中”是不正确的。我这样说是因为 MQTT 规范实际上是一个 ISO 标准 (ISO/IEC 20922:2016) 其中包括“MQTT 控制数据包”的定义:
Words have no intrinsic meaning; they mean what we agree they mean. As the answer mentions "ISO terminology" lets start with the definition for "Packet" given in the ISO "Information technology — Vocabulary" (ISO/IEC 2382:2015):
Whether an MQTT Control packet meets this definition will depend upon how you interpret "transmitted and switched as a whole".
The definition differs somewhat elsewhere; even in other ISO standards. A quick search found ISO/IEC 14476-1:2002 which defines "Packet" more in line with the way the answer you refer to does:
So I guess the definition depends upon the context. Having said that, I believe that its difficult to argue that the usage in the MQTT spec is incorrect "in ISO terminology". I say this because the MQTT spec is, in fact, an ISO standard (ISO/IEC 20922:2016) which includes the definition for "MQTT Control Packet":