# Why does CARP use multicast?



## rainer_d (Dec 2, 2017)

Hi,

apparently, on Linux VRRP/Keepalived can use broadcasts or even unicast.

The reason I ask is because it's a pain to get working in VMWare and esp. between different clusters in different datacenters.

(I know that stretching VLANs between datacenters is BS, the networking-people seem to know it, too, but do it nevertheless)....


----------



## PacketMan (Dec 2, 2017)

Multicast is chosen by 'designers' for many network protocols because its the best logical choice for that task/job at hand.  You have a bunch of of nodes that need to easily 'find' and communicate with each other, yet not waste CPU cycles on other machines that have no need to receive the protocol communications - multicast fits nicely.  Yeah it may pinch you in certain setups, but in the world of networking (routing and switching) it makes perfect sense.  Routing protocols like OSPF, and EIGRP are also multicast based.  VRRP and Cisco HRSP which is what CARP emulates (for lack of a better word) depend on multicast.


----------



## phoenix (Dec 4, 2017)

Broadcast traffic is spammed out every single port on all switches for the vlan that receives it.  A lot of unnecessary traffic that the endpoint devices need to drop, especially if you just need to communicate between a handful of devices.

Multicast traffic is only sent out switch ports that are part of the multicast group.  In other words, only the devices that need to receive the packet actually receives it.  And it's very bandwidth efficient to send a single multicast packet to a remote router/switch that then copies that packet to all the multicast group members; compared to sending individual packets to each of the devices over the link.

For a CARP/VRRP consisting of only a pair of devices, then unicast vs multicast is pretty much a wash.  The same number of packets are delivered for both setups, and most of the processing is done on the clients.

For a CARP/VRRP consisting of 3 or more devices, then multicast makes sense as only a single packet needs to be sent from the client to the switch, and it's up to the switch to do the copying and delivering to the rest of the group.  Using unicast between 3 or more devices would require each device to send multiple packets (1 to each remote device) and for the switches to deal with all those extra packets.

Scale that up to dozens or more devices, and unicast/broadcast will bog down the network.  

If only Apple would realise that broadcast-based protocols are the spawn of the most evil of demons and would move to multicast (or even unicast).  My god is Bonjour horrible to manage, especially on wireless networks!!!!!


----------



## SirDice (Dec 5, 2017)

Multicast can be routed, broadcasts not.


----------



## rainer_d (Dec 6, 2017)

Hi,

thanks for the answers.

We have a very "nice" problem in that CARP between two VM Clusters in two sites (yeah) doesn't work. It might be related to the fact that one of the VM clusters is built on top of HP Blades that don't have individual NICs, but rather a couple of large, shared NICs on the outside of the Blade System that are then (via some sort of SDN) funneled to each blade.

On the SDN, certain features can be en- and disabled, too (though apparently a lot of it only globally, not on a per-blade basis) and it is suspected that this is the reason why stuff does not work as expected.


----------



## SirDice (Dec 6, 2017)

For CARP to work make sure you enable "Promiscuous mode" on the network interface in the VM settings. At least that's what the setting is called on VirtualBox, I can't remember the exact setting on VMWare but it should have something similar.


----------



## rainer_d (Dec 6, 2017)

Yes, pfSense has a lot information on this:
https://doc.pfsense.org/index.php/CARP_Configuration_Troubleshooting

In fact, we have it running on a variety of VM-clusters, even between datacenters. But not this specific case.

I'm not in charge of running VMware, nor am I in charge of running the network. Nor do I control the hardware the VMs run on. I just configure FreeBSD.


----------

