Multicast simulator for multicast restricted networks
mcdist is a small system daemon that intercepts packets sent to a specified multicast address, and re-transmits those packets to list of specified unicast addresses.
mcdist has only been tested on Linux (specifically, Amazon Linux). To build the mcdist binary, you would need binutils, gcc and make packages installed. Then, simply typing 'make' in the repository copy will build mcdist.
Running 'make clean' will clear out any files created during build process.
If you have a multicast-based application deployed within a network that has no immediate multicast (realistically, broadcast, since multicast depends on broadcast for sending packets within the same network), and the application has no reasonable alternative configuration.
Normally, when a multicast packet is generated by an application, kernel sends it to internal multicast routing procedure. If there are any multicast routing tables, the packet will be sent there, but it is also distributed to broadcast address, for subnet multicast distribution. Routers may also join multicast groups, and retransmit the packet according to their routing rules.
Certain networks disable broadcast packets all together, and provide no alternative multicast routing as well. It is especially true for virtual networks where there is no actual wire that connects all the systems, and all packets are passed through software routers only. Such configuration often disable broadcast to avoid "broadcast radiation".
mcdist installs a packet listener into the kernel, and listens to all packets that the current system sends to a specified multicast address. mcdist then takes all such packets and retransmits them to all the configured IP addresses. These configured IP addresses should constitute the list of all other nodes. If a new node is added, all instances of mcdist must be restarted with new configuration. However, they can be restarted one-by-one, and restarting a single copy usually does not cause long term problems.
mcdist must be running on all application nodes. It should be started as a system daemon, or managed by init(8). Additional monitoring is recommended to ensure that it is running.
Unicast address that is used by the application to send packets to multicast address mut be supplied with the '-u' parameter. That address will be different on each node. The address must be an IPv4 address.
Multicast address must be supplied with the '-m' parameter. That address must be the same for all the nodes. You should avoid using that same multicast address for any other multicast communications. The address must be an IPv4 address.
Distribution list must be specified with the '-t' parameter. This parameter takes comma separated list of IPv4 addresses of all other nodes. This paramter will different for each instance of mcdist. Only one instnace of this parameter can be provided.
Packet delivery must be ensured between all unicast addresses used by the cluster, at least on the multicast ports that your application uses. Make sure that your packet filters and/or firewalls are configured accordingly.
mcdist will take any UDP packets sent from configured unicast address, and to configured multicast address, and retransmit them to all specified destination addresses, to the same port that was specified as destination port specified in that multicast packet.
-u IP
- specifies unicast source address -m IP
- specifies multicast destination address -t IP[,IP...]
- specifies list of IP addresses to retransmit to -f
- Instructs mcdist to fork itself upon startup and daemonize -d
- Enables debug output