[ROS2] What does the "discovery multicast port" do?
According to this, RTI Connext in ROS2 uses four ports for UDP transport. Each port has its own purpose: discovery multicast, user multicast, discovery unicast, and user unicast. As far as I could tell, the other DDS implementations use roughly the same ports for the same purposes.
What I want to know is what these mean in the context of ROS2? Like:
- What does the discovery multicast port do? My impression from its name is that it serves as a socket for all the ros2_daemon to listen for all the nodes and take in any new nodes.
- I have no idea what the user multicast port does, because it doesn't show up when I use
lsof -iUDP
orss -uap
. Apparently7401
is the port number reserved for this function but no process is using this port on my machine. - I also do not know what the user unicast and discovery unicast ports do. I used WireShark to examine the UDP/RTPS traffic in my ROS2 communication graph. Apparently sometimes these ports receive packets from ephemeral ports from other nodes, at other times they do not send or receive any packets at all. So I do not understand what purpose these ports serve.
- On the use of WireShark, I also do not understand my findings when investigating the traffic going to the discovery multicast port.
The large numbers are ephemeral ports from the rest of the nodes in the computational graph, like rqt_gui_py_node
, _ros2cli_daemon_0
among other nodes that I created myself. However, they are all sending DATA
and INFO_TS
to port 7400
. I feel that if the discovery multicast node is for discovering new nodes and keeping track of existing ones, they should be sending messages like ACKNACK
or HEARTBEAT
, according to the legend here.
May I have a simple explanation of what each ports do. or perhaps a link to more documentation? Thank you.