MQTT 协议术语:消息与数据包

发布于 2025-01-10 07:20:59 字数 660 浏览 0 评论 0原文

参考Stack Overflow问题协议术语:消息与数据包,我想联系一下以下是对 MQTT 协议的接受意见。

这些绝对是消息。 “数据包”是第 3 层(ISO 术语)协议单元,例如 IP 数据包; “数据报”是第 1 层或第 2 层单元,例如可能组成 IP 数据包片段的多个以太网数据报。 因此,一条消息可能会被拆分为多个数据包,特别是当您使用 TCP 等流协议时,并且一个数据包可能会被拆分为多个数据报。

MQTT 协议< /a> 定义控制数据包。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失眠症患者 2025-01-17 07:20:59

词语没有内在意义;他们的意思是我们同意的。由于答案提到“ISO 术语”,让我们从 ISO“信息技术 — 词汇”中给出的“数据包”定义开始 (ISO/IEC 2382:2015):

以特定格式排列的比特序列,包含控制数据和可能的用户数据,并且作为一个整体进行传输和交换

控制数据包是否满足此定义将取决于您如何解释“作为一个整体进行传输和交换”。

其他地方的定义略有不同;即使在其他 ISO 标准中也是如此。快速搜索发现 ISO/IEC 14476-1:2002 定义“数据包”更符合您引用的答案的方式:

代表传输数据的一个单元,相当于TCP/IP中的段和OSI模型中的传输协议数据单元(TPDU)...

所以我猜这个定义取决于上下文。话虽如此,我相信很难争论 MQTT 规范中的用法“在 ISO 术语中”是不正确的。我这样说是因为 MQTT 规范实际上是一个 ISO 标准 (ISO/IEC 20922:2016) 其中包括“MQTT 控制数据包”的定义:

通过网络连接发送的信息包。 MQTT 规范定义了 14 种不同类型的控制数据包,其中一种(PUBLISH 数据包)用于传送应用程序消息。

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):

sequence of bits arranged in a specific format, containing control data and possibly user data, and that is transmitted and switched as a whole

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:

Represents a unit of transport data, which is equivalent to a segment in TCP/IP and a transport protocol data unit (TPDU) in OSI model...

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":

A packet of information that is sent across the Network Connection. The MQTT specification defines fourteen different types of Control Packet, one of which (the PUBLISH packet) is used to convey Application Messages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文