Should I use Multicast or broadcast for my software?

I am working on designing and writing some clustering software that involves one node sending out data to all nodes. To do this I am debating using either Broadcast or Multicast. My original idea was to have the master node just send out individual packets but the more I look into it the more I realize that it is way more efficient and scalable to use come sort of multihost transmission. In the network I have the master node sending out data and then the nodes responding back.

For sending out the data I figured that broadcast would be the easiest. However, broadcast has the downside of being very basic and potentially noisy. It can also be a great way to destroy a poorly designed network.

The other option is multicast. The problem with multicast is that it is much more complex. I don’t mind sitting down and learning the ends and outs but my concern is that the added complexity will end up backfiring.

I am leaning toward using broadcast as multicast seems like it is too complex for the scope of my project. Additionally, the broadcast domain could be limited by using a vlan that is limited to devices that need it.

Any thoughts?

1 Like

I don’t know, it depends on who your software is for. If it is for anyone that would want to run your software in datacenter A and datacenter B, if you go with broadcast, they’d now have to bridge layer 2 between these datacenters, which leads to poor network design.

Instead if you went with multicast, you now do not need to bridge layer 2 between these data center. You’d only need to ensure layer 3 and multicast is routing between the two. Much cleaner network design.

1 Like

Do you know where I can find detailed explanations of multicast? I can find plenty of higher level explanations but I am looking to dig into the weeds. I am especially confused on how to do addressing in a way that won’t conflict with anything else.

Since multicast isn’t used that often you just pick a address betwee 224.0.0.0 through 239.255.255.255 and hope for the best.

It would be 239.0.0.0/8 only as that it the only one administratively scoped and not publicly routable.

1 Like

Broadcast is unlikely to do damage on its own if the network was sane to start with. Multicast gives the option of making the traffic routable but that going to be an advanced skill. Broadcast is a sensible MVP for getting it done, and you can choose to support multicast (or plain unicast) later on.

Will you be support IPv6? What would make sense there is link-local multicast, which effectively mimics broadcast and would also be simple to implement.

And a very small program that implements multicast: