I use connext dds version 6.0.0 . I want to disable "multicast discovery" and use "unicast discovery" for all domain participants in domain.
First of all I set this Qos for domain participant in modern c++:
dds::domain::qos::DomainParticipantQos dpQos = dds::core::QosProvider::Default()
.participant_qos(rti::core::builtin_profiles::qos_lib::baseline());
std::map<std::string,std::string> dpPropertyMap = {{"dds.transport.UDPv4.builtin.multicast_enabled", "0"}};
dpQos << rti::core::policy::Property(dpPropertyMap.begin(),dpPropertyMap.end());
dpQos->discovery.multicast_receive_addresses(dds::core::StringSeq({}));
...
I set environment variable in linux:
NDDS_DISCOVERY_PEERS="119@builtin.shmem://,119@localhost,119@192.168.12.5"
In rti persistence service's xml I set this qos:
...
<participant_qos>
<discovery>
<!-- disable the reception multicast for discovery -->
<multicast_receive_addresses/>
<initial_peers>
<element>builtin.shmem://</element>
<element>119@localhost</element>
<element>119@192.168.12.5</element>
</initial_peers>
</discovery>
<property>
<value>
<element>
<name>dds.transport.UDPv4.builtin.multicast_enabled</name>
<value>0</value>
</element>
</value>
</property>
</participant_qos>
...
In Admin Console xml I set this qos:
...
<participant_qos>
<discovery>
<multicast_receive_addresses/>
<initial_peers>
<element>builtin.shmem://</element>
<element>119@127.0.0.1</element>
<element>119@192.168.12.5</element>
</initial_peers>
</discovery>
<property>
<value>
<element>
<name>dds.transport.UDPv4.builtin.multicast_enabled</name>
<value>0</value>
</element>
<element>
<name>dds.transport.UDPv4.builtin.unicast_enabled</name>
<value>1</value>
</element>
</value>
</property>
</participant_qos>
...
I think all things works unless that I have two problem with admin console:
1. Admin console can not discover domains automatically and I should Manually join and leave domains. I mean I should active Preferences>Domains>"Manually join and leave domains" and I should give it domainId and click on "join Domains".
2. Admin console will not open and can not show domains if all initial_peers that set in admin console xml are not connected. In xml that I showed above, admin console will not open if I choose my domain and my pc is not connected to "192.168.12.5" ip.
For automatic domain discovery, Admin Console must use multicast. Since you disabled multicast in your system, Admin Console will not be able to automatically join any domains since it won't discovery any. So, yes, you will have to use manual discovery mode.
What do you mean that Admin Console "won't open"? Do you mean that it crashes?
If so, is there information in the log file?
Documents\rti_workspace\6.0.0\user_config\admin_console\x64Win64\admin_console.log
And finally, is there a reason that you are using the value 119 in "119@locahost" or "119@w.x.y.z"? This will cause Connext DDS to send out 120 packets every 30 seconds to try to find applications at the addresses given. That's a waste of CPU and network bandwidth if you don't expect to create 120 DomainParticipants simultaneously on each host address.
I'm not sure what was the problem when I opened Admin Console in that time.
I use 119@w.x.y.z because I dont know how many domain participants will be in each host address; may I have many. Unfortunately if I don't do that, it wont discover all domain participants. If there is any better solution to discover all domain participant in host ips in unicast, please tell me.
Unless you really expect to run 120 participants on each host, you shouldn't need to use "119@w.x.y.z". You only need to use a number that represents the maximum number of participants that you expect to run in the SAME DOMAIN at the same time on a host.
Thank you Mr. Howard.
I don't undrestand why we need to connect any domain participantin a node to a unique port, that forces domain participants in another node to send discovery packet to all tha ports. I think at least it would be better that there was one port for unicast discovery.
On a host, only a single unicast socket can be created to receive on a port. So, 2 different DomainParticipants cannot create a socket to receive unicast data on the same port on the same host.
Which is why the DDS specification has an equation used to calculate the ports used for a Domain ID by a specific participant.
On the other hand, multicast does not suffer the same restriction. So, for multicast, there is only a single port used for each Domain, and thus any number of participants on a host can listen to the same port (on the same multicast address) simultaneously.
Which is also why multicast discovery is what is used by default by the DDS specification for "automatic" discovery with no additional configuration required.
Thank you again