Performance degradation when adding subscriber over Ethernet
Hello,
I’m experiencing communication problems using Cyclone DDS with ROS2 Jazzy. Below are the details:
Setup
Robot CPU: Intel i7, 8GB RAM, Ubuntu 24.04 Server
Runs all the robot software.
IP: 192.168.33.198
Development VM: Ubuntu 24.04 Desktop, 8GB RAM, 6 CPUs (host is also an Intel i7 running Windows)
Used for development and testing.
IP: 192.168.33.197
Both connected via Ethernet (100 Mbps), same subnet. I want to have smooth topic communication between them through Ethernet.
Tests performed
On the CPU (robot), I have a ROS 2 publisher of a PointCloud2 topic publishing at ~10Hz with Best Effort QoS.
I ran the following tests:
Test 1 — CPU only, with <AllowMulticast>true</AllowMulticast>:
- Publisher and subscribers running on the CPU.
- Adding subscribers caused the topic rate to drop significantly as I added more.
Test 2 — CPU only, with <AllowMulticast>spdp</AllowMulticast>:
- Publisher and subscribers running on the CPU.
- The rate problem was resolved: the publisher maintained ~10Hz even with multiple subscribers.
- (I’m not entirely sure why setting
<AllowMulticast>spdp</AllowMulticast>fixed this.)
Test 3 — Publisher on CPU, subscriber on VM, both with <AllowMulticast>spdp</AllowMulticast>:
- Publisher runs on CPU.
- Single subscriber runs on the VM over Ethernet.
- The topic rate drops drastically to about ~5.5Hz — even with just one subscriber on the VM
So, the change to <AllowMulticast>spdp</AllowMulticast> solved the issue on a single machine, but subscribing from the VM still halves the rate, even with a single subscriber.
DDS configuration
On the robot (CPU) — cyclonedds.xml
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="0">
<General>
<Interfaces>
<NetworkInterface name="enp2s0" multicast="default" />
</Interfaces>
<AllowMulticast>spdp</AllowMulticast>
</General>
<Internal>
<SocketReceiveBufferSize min="10MB"/>
</Internal>
<Discovery>
<Peers>
<Peer address="192.168.33.198"/>
<Peer address="192.168.33.197"/>
</Peers>
</Discovery>
</Domain>
</CycloneDDS>
On the VM — cyclonedds.xml
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="0">
<General>
<Interfaces>
<NetworkInterface name="enp0s3" multicast="default"/>
</Interfaces>
<AllowMulticast>spdp</AllowMulticast>
</General>
<Internal>
<SocketReceiveBufferSize min="10MB"/>
</Internal>
<Discovery>
<Peers>
<Peer address="192.168.33.197"/>
<Peer address="192.168.33.198"/>
</Peers>
</Discovery>
</Domain>
</CycloneDDS>
Notes
- Discovery works fine — the VM sees the topics and connects.
- 3.15MB pointcloud published at 10Hz
Questions
- Is there something wrong or missing in my DDS configuration that could explain the degraded performance over Ethernet when subscribing from the VM?
- Why does
<AllowMulticast>spdp</AllowMulticast>solve the problem on a single machine, but not when the subscriber is on a separate machine? - Any advice on further tuning or on how to debug this? I am not a DDS expert, honestly.
Thanks for your support!