简体   繁体   English

本地主机上的多播数据包顺序

[英]multicast packet order on localhost

since multicast packets are udp based in general it's unreliable 由于多播数据包通常基于udp,因此不可靠

on localhost i would assume that a packet is just copied from one process's buffer to another thus it would be kinda queued in the order as the sender transmitted, right? 在本地主机上,我会假设一个数据包只是从一个进程的缓冲区复制到另一个进程,因此按发送方发送的顺序将其排在队列中,对吗?

what i'm not sure about is: 我不确定的是:

  1. can i assume correct package order in general on localhost for multicasting (or udp)? 我可以假定本地主机上用于多播(或udp)的包顺序正确吗? if it does not, why? 如果没有,为什么呢?
  2. what are the concrete differences in differnt operating systems handling (win,mac,linux)? 不同的操作系统处理(win,mac,linux)有什么具体区别?

thank you 谢谢

Can I assume correct package order in general on localhost for multicasting (or udp)? 我是否可以在本地普遍采用正确的软件包顺序来进行多播(或udp)? If it does not, why? 如果没有,为什么?

No, because the packets aren't cataloged. 不,因为未对数据包进行分类。 Plus, as you may already know, there are no guarantees that a loop-back connection will keep UDP in order. 另外,您可能已经知道,无法保证环回连接将使UDP保持顺序。

What are the concrete differences in differnt operating systems handling (win, mac, linux)? 不同操作系统处理(win,mac,linux)的具体区别是什么?

There are no differences in protocol (see the RFC ) but the nitty-gritty details are most likely platform (and version) dependent and I'm sure no one knows them off-hand (some are close-sourced anyway). 协议没有什么区别(请参阅RFC ),但具体细节很可能取决于平台(和版本),而且我敢肯定没有人会立刻了解它们(无论如何都是近源的)。 This is another reason why in-orderness most likely can't be guaranteed. 这是最有可能无法保证有序性的另一个原因。 Even if you do test this and the packets come in order, it's a very bad idea (tm) to rely on something like the order of UDP packets in loop-back connections. 即使您确实对此进行了测试并且数据包按顺序排列,在环回连接中依赖UDP数据包的顺序之类的东西也是一个非常糟糕的主意(tm)。

Also : the argument that UDP is "unreliable," while true, can be misleading. 另外 :关于UDP是“不可靠的”的说法虽然正确,但可能会引起误解。 A lot of security-conscious software works via UDP, and, in general, only a small percentage of packets are dropped. 许多具有安全意识的软件都可以通过UDP运行,并且通常只丢弃一小部分数据包。 With appropriate contingencies in place, a piece of software should not blow up if using UDP (for the sake of performance, lets say) and a packet drops. 有了适当的应急措施,如果使用UDP(为了性能起见,可以说)和丢包,则不应破坏某个软件。 But if you're that worried about it, why not use TCP? 但是,如果您对此感到担心,为什么不使用TCP?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM