ros2 / rmw_cyclonedds

ROS 2 RMW layer for Eclipse Cyclone DDS
Apache License 2.0
117 stars 90 forks source link

Cannot get messages when communicating crossing different machines and docker containers via multicast by defining Peers #477

Open ipa-rwu opened 1 year ago

ipa-rwu commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

My setup as shown below: image

You can reproduce it from here

Actual behavior

In the log from machine2_talker running on the other laptop, it seems to find the route to communicate with nodes running in containers but got this error

1700260008.210406 [0] dq.builtin: ddsi_rebuild_writer_addrset(110af39:53bfa8dc:f76ce963:301c3): udp/172.18.0.3:7412@3 udp/172.18.0.4:7414@3 (burst size 4294901760 rexmit 283990)
1700260008.210428 [0] dq.builtin: directed SPDP packet -> not responding

In the log from listener running in a container, it wanted to answer

1700260008.217474 [0] dq.builtin: ddsi_rebuild_writer_addrset(110af78:b971ef08:4d53c42b:301c3): udp/172.18.0.3:7412@549 udp/192.168.0.213:7412@549 (burst size 4294901760 rexmit 283990)
1700260008.217612 [0] dq.builtin: broadcasted SPDP packet -> answering

You can full logs: listener_labeled.log, talker_labeled.log, machine2.log

Additional information

When I run netstat -tuln in the container where listener runs, I see there are also some other ports are open such as 54053, 42153, 46557. Are they used by DDS?

$ netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.11:46557        0.0.0.0:*               LISTEN     
udp        0      0 172.18.0.4:54053        0.0.0.0:*                          
udp        0      0 0.0.0.0:7414            0.0.0.0:*                          
udp        0      0 0.0.0.0:7415            0.0.0.0:*                          
udp        0      0 127.0.0.11:42153        0.0.0.0:* 

The result from the container where talker runs

netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.11:37417        0.0.0.0:*               LISTEN     
udp        0      0 172.18.0.3:42856        0.0.0.0:*                          
udp        0      0 0.0.0.0:7412            0.0.0.0:*                          
udp        0      0 0.0.0.0:7413            0.0.0.0:*                          
udp        0      0 127.0.0.11:33721        0.0.0.0:*   

Thank you for your help!

hjrnunes commented 1 month ago

@ipa-rwu did you manage to get it working? I'm trying to get an isolated docker container to talk but no luck.

It would be nice to know which ports we need to bind.