3

I am still trying to understand DDS and its concepts. I have a configuration where 2 laptops run dds based application. My environment does not permit multicast so I decided to go for peer to peer connection(unicast). To bring both the laptops in the same network, I connected them using ethernet cable (Not sure if it was necessary or not).

Now I did not change anything in the QoS i.e. i did not do any settings for unicasting. But now my applications are communicating with each other.

Question :

  1. How are the participants being discovered ? Multicasting ? as I did not do any settings for unicasting.
  2. Was it necessary to bring them under one network i.e. connect with ethernet cable if I wanted to use unicasting ?

EDIT :

Configuration is as follows :

  • First laptop : Windows OS : Native DDS based application : Publisher : Multicast not allowed.
  • Second Laptop : Linux : ROS2 based subscriber : Multicast no problem
Vishal Rawat
  • 325
  • 1
  • 3
  • 19

2 Answers2

4

Out of the box, DDS is required to support Multicast and Unicast Discovery. Anonymous connections are handled through multicast. If you know the IP address of the recipient, you can manually configure those addresses into the unicast discovery list (each vendor will have their own way to name/process this list).

"Multicast is not permitted on our network", in most cases, means that your IT department has turned off multicast packet forwarding at the switch (or the switches) that define the fabric that is your network.

The as-shipped, standard-compliant DDS configuration, however, has no knowledge of this local policy (how could it?). If you haven't changed the configuration in line with your local policies, the DDS Participants are still going to try to connect via Multicast, because you haven't turned it off.

If the DDS-using machines are connected to the same hub, or to an unmanaged switch (defined here as one that your IT department doesn't care about, or is misconfigured), and the network topology does not cross a managed switch, and they are using the default configuration, and they find each other, then they are using Multicast anonymous discovery.

Figure out how to configure your DDS implementation, to add the unicast ip addresses of the machines that need to communicate. Because discovery is usually only needed in one direction (if A discovers B, then it is true that B has discovered A, assuming neither A nor B are configured to ignore the other[1]).

Once you have configured for unicast discovery, you can configure for no-multicast. If the machines are on IP hopping networks (WiFi, etc) it will be difficult unless the DDS implementation understands multipathing. Talk to the vendor to see if this is the case.

[1] DDS is nothing if not overly configurable.

rip...
  • 996
  • 5
  • 20
2

How are the participants being discovered ? Multicasting ? as I did not do any settings for unicasting.

It is not possible for me to answer this question with complete certainty since you are using DDS as part of the ROS2 framework and I am not familiar with the exact details of how the two are set up to interact together. Having said that, from your description it does seem that the participants are indeed using multicast to discover each other.

The best way to get a conclusive answer is by sniffing the network -- assuming that you have the required privileges to do so. For example you can use Wireshark , which comes with an RTPS dissector that allows you to filter on RTPS messages. (RTPS is the name of the standardized DDS wire protocol.) Check out the destination address and see if you detect any addresses in the multicast range. You can do this while firing up a single DDS-based application. It will start announcing itself over the network immediately.

Was it necessary to bring them under one network i.e. connect with ethernet cable if I wanted to use unicasting ?

If you want to use unicasting, you will need to know IP addresses or host names of all peer nodes. As long as those peer nodes can reach each other over UDP, you are good to go. Often, but not always, ping will let you know whether this is the case. Firewalls are a typical cause of problems.

However, be aware that different types of network have their own specific properties that you might have to adjust your configuration to. Over WiFi for example, the likelihood of packets being dropped (especially with bursts of data) is much larger than when connecting nodes directly with a wire. DDS allows for tuning its protocol to deal with that.

Reinier Torenbeek
  • 16,669
  • 7
  • 46
  • 69
  • I am still confused. First, if I did not configure Unicast and they were still discovering each other, i guess it should be multicast discovery. But how ? multicast is not allowed on one PC. Does that mean, the second PC (ROS2 based), where multicast is restricted, is discovering the application running on the first PC and then once the discovery takes place, then both can communicate, as said by @rip... – Vishal Rawat Aug 30 '18 at 16:18
  • And the ROS2 based PC, where multicasting is enabled : when I run the ROS2 node there and look at wireshark, the distination is always **239.255.0.1** which is a multicast address. But as soon as I switch on the other application on the first laptop, the destination changes to the IP address of the 1st laptop. – Vishal Rawat Aug 30 '18 at 16:25
  • It depends on what you mean by "multicast is disabled". Does that mean it can not receive data on a multicast address either? If one of the PCs can send out on multicast and the other is able to receive that, then the discovery process can already be completed. DDS Discovery packets include information about unicast addresses as well, even when going over multicast. Those do not to be configured and are obtained by querying the OS. Like I said, the only way to know for sure is to sniff the network. – Reinier Torenbeek Aug 30 '18 at 16:26
  • Responding to your second comment: so even though it has "multicast disabled", it looks like the machine that you call "the first laptop" is able to receive multicast packets that contain the initial announcements of the DDS Participant on the ROS2 based PC. From that, the first laptop is able to learn how to reach out with unicast to the ROS2 based PC and they continue unicasting after that. This is the default behavior, you do not need to configure anything to achieve that. By default, multicast is only used for the initial announcements. – Reinier Torenbeek Aug 30 '18 at 16:29
  • By multicast disabled I mean that it can neither receive nor publish on the multicast address ! this is what i think so but i am not sure though...is there a way to check that ? Because what you mentioned in your second comment makes sense...and for this, the first laptop should be able to receive multicast packets. – Vishal Rawat Aug 30 '18 at 16:35
  • What operating system is "the first laptop" using? Wiresharking on the receiving side works as well, if you have the proper privileges. – Reinier Torenbeek Aug 30 '18 at 16:41
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/179121/discussion-between-vishal-rawat-and-reinier-torenbeek). – Vishal Rawat Aug 30 '18 at 16:46