views:

1251

answers:

3

If you had to implement a network broadcast, would you use UDP broadcast or IP multicast in a new application? Why?

What are the benefits and drawbacks you encountered with either method? (Especially concerning problems with VPNs, different subnets, various routers etc.)

+1  A: 

The choice of which is most appropriate depends on the nature of the application and the configuration of the networks over which it's to be run - there's no hard or fast rules.

I therefore wouldn't enforce either - I'd allow configuration of the broadcast address.

If the user configures something in the 224.0.0.0/4 range then it's multicast, otherwise it's broadcast.

Alnitak
+3  A: 

Multicast has the drawback that it is not well supported by routers and NAT. If all of your clients are on the same network with only simple bridges, multicast works great and avoids the overhead of broadcast addressing for machines that are not part of the group. If the routers support IGMP and properly propagate the TTL it can work on local networks. There have been attempts to do multicast across the Internet, such as Mbone, with various levels of success. Most of them use some sort of tunnel to get around bridges and non-compliant routers.

One caveat for multicast packets, however, is if there are any WiFi connections the access point will use the slowest possible bit rate for the multicast packets and requires acks from all clients, even those who are not part of the multicast group. There are also drawbacks for non-participating clients and battery life.

Hudson
A: 

The way multicast behaves is almost, but not entirely, unlike every other type of network traffic. Your systems and network administrators won't thank you for forcing it on them. It's often voodoo, and IMO best avoided if you can.

Jon Topper
You should spill the beans here: multicast forces the network node to interrupt the higher level IP stack and see if any application is interested in the received multicast packet. Every time on every node on every multicast send. So, that's why net admins hate it.