简体   繁体   中英

multicast packet order on localhost

since multicast packets are udp based in general it's unreliable

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)? if it does not, why?
  2. what are the concrete differences in differnt operating systems handling (win,mac,linux)?

thank you

Can I assume correct package order in general on localhost for multicasting (or 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.

What are the concrete differences in differnt operating systems handling (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). 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.

Also : the argument that UDP is "unreliable," while true, can be misleading. A lot of security-conscious software works via UDP, and, in general, only a small percentage of packets are dropped. 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. But if you're that worried about it, why not use TCP?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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