ros2 networking ai_generated true

ROS2 nodes on different VLANs or subnets cannot discover each other

ID: ros2/dds-discovery-vlan-multicast

Also available as: JSON · Markdown
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

ROS2 DDS discovery relies on UDP multicast (239.255.0.1:7400). Corporate networks, VLANs, and cloud VPCs often block multicast. Nodes on different subnets can't discover each other without explicit peer configuration.

generic

Workarounds

  1. 92% success Configure DDS peer discovery with explicit IP addresses (unicast)
    CycloneDDS: <Peers><Peer address='192.168.1.100'/></Peers> in cyclonedds.xml; export CYCLONEDDS_URI=cyclonedds.xml
  2. 90% success Use FastDDS Discovery Server for large networks without multicast
    fastdds discovery -i 0 -l 192.168.1.1 -p 11811  # run discovery server; set ROS_DISCOVERY_SERVER env var on clients
  3. 82% success Use ROS_DOMAIN_ID to isolate node groups and reduce discovery traffic
    export ROS_DOMAIN_ID=42  # nodes with different domain IDs don't discover each other

Dead Ends

Common approaches that don't work:

  1. Assume ROS2 nodes on the same network will auto-discover each other 88% fail

    DDS multicast discovery requires multicast routing between subnets. Most enterprise networks, VPNs, and cloud VPCs block multicast.

  2. Switch DDS implementations to fix discovery issues 78% fail

    All DDS implementations (FastDDS, CycloneDDS, Connext) use the same multicast discovery by default. Switching DDS doesn't fix network-level multicast blocking.