5.3.1. General Discovery Settings¶
Some discovery settings are shared across the different discovery mechanisms.
These settings are defined under the builtin public data member of the
WireProtocolConfigQos class.
These are:
Name |
Description |
Type |
Default |
|---|---|---|---|
The discovery protocol to use (see Discovery mechanisms). |
|
|
|
Filter discovery traffic for DomainParticipants in the same process, in different processes, or in different hosts. |
|
|
|
Indicates for how much time should a remote DomainParticipant consider the local DomainParticipant to be alive. |
|
20 s |
|
The period for the DomainParticipant to send PDP announcements. |
|
3 s |
5.3.1.1. Discovery Protocol¶
Specifies the discovery protocol to use (see Discovery mechanisms). The possible values are:
Discovery Mechanism |
Possible values |
Description |
|---|---|---|
Simple |
|
Simple discovery protocol as specified in the RTPS standard. |
Discovery Server |
|
The DomainParticipant acts as a hub for discovery traffic, receiving and distributing discovery information. |
|
The DomainParticipant acts as a client for discovery traffic. It sends its discovery information to the server, and it receives only the information that is relevant to it. |
|
|
The DomainParticipant acts as a client for discovery traffic. It sends its discovery information to the server, and it receives all other discovery information from the server. |
|
|
Creates a SERVER DomainParticipant which has a persistent |
|
Manual |
|
Disables PDP phase, therefore there is no EDP phase.
All matching must be done manually through the
|
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.discoveryProtocol =
DiscoveryProtocol::SIMPLE;
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
<profiles>
<participant profile_name="participant_discovery_protocol">
<rtps>
<builtin>
<discovery_config>
<discoveryProtocol>SIMPLE</discoveryProtocol>
</discovery_config>
</builtin>
</rtps>
</participant>
</profiles>
</dds>
5.3.1.2. Ignore Participant flags¶
Defines a filter to ignore some discovery traffic when received. This is useful to add an extra level of DomainParticipant isolation. The possible values are:
Possible values |
Description |
|---|---|
|
All Discovery traffic is processed. |
|
Discovery traffic from another host is discarded. |
|
Discovery traffic from another process on the same host is discarded. |
|
Discovery traffic from DomainParticipant’s own process is discarded. |
|
Discovery traffic from DomainParticipant’s own host is discarded. |
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.ignoreParticipantFlags =
static_cast<eprosima::fastdds::rtps::ParticipantFilteringFlags>(
ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS |
ParticipantFilteringFlags::FILTER_SAME_PROCESS);
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
<profiles>
<participant profile_name="participant_discovery_ignore_flags">
<rtps>
<builtin>
<discovery_config>
<ignoreParticipantFlags>FILTER_DIFFERENT_PROCESS | FILTER_SAME_PROCESS</ignoreParticipantFlags>
</discovery_config>
</builtin>
</rtps>
</participant>
</profiles>
</dds>
Note
To configure a DomainParticipant to not receive data from its own DataWriters, please refer to Ignore Local Endpoints.
5.3.1.3. Lease Duration¶
Indicates for how much time should a remote DomainParticipant consider the local DomainParticipant to be alive. If the liveliness of the local DomainParticipant has not being asserted within this time, the remote DomainParticipant considers the local DomainParticipant dead and destroys all the information regarding the local DomainParticipant and all its endpoints.
The local DomainParticipant’s liveliness is asserted on the remote DomainParticipant any time the remote DomainParticipant receives any kind of traffic from the local DomainParticipant.
The lease duration is specified as a time expressed in seconds and nanosecond using a Duration_t.
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.leaseDuration = Duration_t(10, 20);
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
<profiles>
<participant profile_name="participant_discovery_lease_duration">
<rtps>
<builtin>
<discovery_config>
<leaseDuration>
<sec>10</sec>
<nanosec>20</nanosec>
</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>
</profiles>
</dds>
5.3.1.4. Announcement Period¶
It specifies the periodicity of the DomainParticipant’s PDP announcements. For liveliness’ sake it is recommend that the announcement period is shorter than the lease duration, so that the DomainParticipant’s liveliness is asserted even when there is no data traffic. It is important to note that there is a trade-off involved in the setting of the announcement period, i.e. too frequent announcements will bloat the network with meta traffic, but too scarce ones will delay the discovery of late joiners.
DomainParticipant’s announcement period is specified as a time expressed in seconds and nanosecond using a
Duration_t.
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(1, 2);
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
<profiles>
<participant profile_name="participant_discovery_lease_announcement">
<rtps>
<builtin>
<discovery_config>
<leaseAnnouncement>
<sec>1</sec>
<nanosec>2</nanosec>
</leaseAnnouncement>
</discovery_config>
</builtin>
</rtps>
</participant>
</profiles>
</dds>