UDP Broadcast or IP Multicast?

Thorsten79 picture Thorsten79 · Dec 28, 2008 · Viewed 12.2k times · Source

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

Answer

Hudson picture Hudson · Dec 28, 2008

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.