I work with a cluster of 40 nodes running Debian 4. Each node starts a daemon that sits and listens on the IP address of the multicast.
I wrote some client software to send multicast over a local network with a client computer on the same switch as the cluster, so that every node in the cluster will receive a packet and respond.
It works fine, except when I run the client software on a computer with LAN and WAN interfaces. If there is a WAN interface, multicast does not work. Thus, I believe that multicasting was incorrectly passing through the WAN interface (eth0), and not on the LAN (eth1.) So, I use the socket parameter SO_BINDTODEVICE to force the multicast socket to use eth1, and that's fine.
But I thought the kernel routing table should determine that LAN (eth1) is obviously a cheaper destination for multicast. Is there any reason why I should explicitly force the socket to use eth1? And is there any way (possibly calling ioctl) that I can get the application to automatically detect if a particular interface is a local or global network?
Charles
source
share