I am having some issues using ROS2 Humble and its DDS. I am using different nodes that run in the same machine and only communicate with other nodes in the same machine. I am using a router and the machine is connected via cable or wifi.
I am noticing that the connection is still saturated by the messages even if they should not pass within the router.
In fact with router A (Wifi, with lots of connections ongoing) the rate of the messages drops a lot when executing all the nodes. While on router B (connected via cable, where only this test is active) I noticed that by executing a benchmark with iperf3 I get really worse performance ( from >50 Mb/s to <1 Mb/s).
How can I avoid this behavior? Ideally I would like to have that the messages should not be transferred by the router if they are not used by other machines and the router bandwidth should remain totally free.
It is possible to enforce for some topics to use only the local network without going over the router?
And then the final doubt: In case the connection to the router is lost during operations does this mean that the nodes would not be able to communicate between them, even if they are on the same machine? How could this issue be solved?
These tests were performed on a Jetson Orin Nano with Ubuntu 22.04 and Ros2 Humble, I tested both fastdds and cycloneDDS but the behavior was the same.