UDP Multicast Fails on Linux RIO Device with a Static IP

Updated Dec 18, 2023

Reported In

Software

  • LabVIEW Real-Time Module

Driver

  • NI-RIO

Issue Details

I am trying to create a system that uses UDP Multicast to broadcast messages to or from my cRIO, sbRIO, or myRIO device running Linux RT. When I use DHCP to set the RIO's IP address, the multicast succeeds and the Linux RT device can process the messages. However, when the Linux RT device has a static IP address the operation times out or throws an error. I can see the packets are arriving on the device, but my real-time application cannot read them. Why is this happening, and what workarounds are there for using statically assigned IP addresses in my system?

Solution

There is a known issue for Linux Real-Time RIO devices where UDP multicast static IP routes are not always included in the default configuration. Although the RIO might be receiving the packets, they are not being properly routed from the multicast address to the primary NIC (Network Interface Card) on the hardware. You can manually add the rule to the routing table by entering the following command into the terminal over an SSH connection:

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

This will add the static routes for all packets arriving from the possible UDP multicast address range (224.0.0.0 through 239.255.255.255). To make the changes persist after rebooting the device, you can either write a script to run this command on device initialization or manually add the rule below to the network interface configuration files in /etc/ifplugd/ifplugd.actions and in /etc/natinst/networking/ifplugd.script. You can edit these files by using FileZilla to access the files on the target. Figure 1 shows the location within these two files where the following rule should be added.

/sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0;
 
Additionally, follow the steps below:
  1. Open the 'Sender VI' of the project. This will be the VI that has the UDP Multicast Open and UDP Write functions.
  2. Find the UDP Multicast Write-Only Open function. 
  3. Remove the input to the net address node.

Additional Information

These changes will only persist until a new version of the Base Operating System is installed onto the Linux Real-Time RIO device. Additionally, if you format or reinstall software onto the RIO, these changes will be erased.