5.3.2. SIMPLE Discovery Settings
The SIMPLE discovery protocol resolves the establishment of the end-to-end connection between various DDS Entities. eProsima Fast DDS implements the SIMPLE discovery protocol to provide compatibility with the RTPS standard. The specification splits up the SIMPLE discovery protocol into two independent protocols:
Simple Participant Discovery Protocol (SPDP): specifies how DomainParticipants discover each other in the network; it announces and detects the presence of DomainParticipants within the same domain.
Simple Endpoint Discovery Protocol (SEDP): defines the protocol adopted by the discovered DomainParticipants for the exchange of information in order to discover the DDS Entities contained in each of them, i.e. the DataWriter and DataReader.
Name |
Description |
---|---|
It defines the behavior of the DomainParticipants initial announcements. |
|
It defines the use of the SIMPLE protocol as a discovery protocol. |
|
A list of DomainParticipant’s IP/port pairs to which the SPDP announcements are sent. |
5.3.2.1. Initial Announcements
RTPS standard simple discovery mechanism requires the
DomainParticipants to send announcements of their presence in the domain.
These announcements are not delivered in a reliable fashion, and can be disposed of by the network.
In order to avoid the discovery delay induced by message disposal, the initial announcement can be set up to make
several shots, in order to increase proper reception chances.
See InitialAnnouncementConfig
.
Initial announcements only take place upon participant creation.
Once this phase is over, the only announcements enforced are the standard ones based on the
leaseDuration_announcementperiod
period (not the period
).
Name |
Description |
Type |
Default |
---|---|---|---|
count |
It defines the number of announcements to send at start-up. |
|
5 |
period |
It defines the specific period for initial announcements. |
|
100ms |
C++ |
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.initial_announcements.count = 5;
pqos.wire_protocol().builtin.discovery_config.initial_announcements.period = Duration_t(0, 100000000u);
|
XML |
<participant profile_name="participant_profile_simple_discovery">
<rtps>
<builtin>
<discovery_config>
<initialAnnouncements>
<count>5</count>
<period>
<nanosec>100000000</nanosec>
</period>
</initialAnnouncements>
</discovery_config>
</builtin>
</rtps>
</participant>
|
5.3.2.2. Simple EDP Attributes
Name |
Description |
Type |
Default |
---|---|---|---|
SIMPLE EDP |
It defines the use of the SIMPLE protocol as a discovery |
|
true |
Publication writer and |
It is intended for DomainParticipants that implement only |
|
true |
Publication reader and |
It is intended for DomainParticipants that implement only |
|
true |
C++ |
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true;
pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true;
pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = false;
|
XML |
<participant profile_name="participant_profile_qos_discovery_edp">
<rtps>
<builtin>
<discovery_config>
<EDP>SIMPLE</EDP>
<simpleEDP>
<PUBWRITER_SUBREADER>true</PUBWRITER_SUBREADER>
<PUBREADER_SUBWRITER>false</PUBREADER_SUBWRITER>
</simpleEDP>
</discovery_config>
</builtin>
</rtps>
</participant>
|
5.3.2.3. Initial peers
According to the RTPS standard (Section 9.6.1.1), each
RTPSParticipant
must listen for incoming Participant Discovery Protocol (PDP) discovery metatraffic in two different ports, one linked
to a multicast address and another one linked to a unicast address.
Fast DDS allows for the configuration of an initial peers list which contains one or more such IP-port address
pairs corresponding to remote DomainParticipants PDP discovery listening resources, so that the local
DomainParticipant will only send its PDP traffic to the IP-port address pairs specified in the initial peers list.
A DomainParticipant’s initial peers list contains the list of IP-port address pairs of all other DomainParticipants with which it will communicate. It is a list of addresses that a DomainParticipant will use in the PDP discovery mechanism, and can hold both multicast and unicast addresses. The default multicast address will be used if the list is empty. Therefore, this approach also applies to those scenarios in which multicast functionality is not available.
According to the RTPS standard (Section 9.6.1.1), the RTPSParticipants’ discovery traffic unicast listening ports are calculated using the following equation: 7400 + 250 * domainID + 10 + 2 * participantID. Thus, if for example a RTPSParticipant operates in Domain 0 (default domain) and its ID is 1, its discovery traffic unicast listening port would be: 7400 + 250 * 0 + 10 + 2 * 1 = 7412. By default eProsima Fast DDS uses as initial peers the Metatraffic Multicast Locators.
The following constitutes an example configuring an Initial Peers list with one peer on host 192.168.10.13 with DomainParticipant ID 1 in domain 0.
Note
There is also the possibility of not defining the initial peer port.
In this case, the discovery information would be sent to every port ranging from participantID zero to the
maxInitialPeersRange
value set in the TransportDescriptorInterface.
Consequently, setting this value to at least the maximum expected number of DomainParticipants will ensure discovery
and communication.
C++ |
DomainParticipantQos qos;
// configure an initial peer on host 192.168.10.13.
// The port number corresponds to the well-known port for metatraffic unicast
// on participant ID `1` and domain `0`.
Locator_t initial_peer;
IPLocator::setIPv4(initial_peer, "192.168.10.13");
initial_peer.port = 7412;
qos.wire_protocol().builtin.initialPeersList.push_back(initial_peer);
|
XML |
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com">
-->
<participant profile_name="initial_peers_example_profile" is_default_profile="true">
<rtps>
<builtin>
<initialPeersList>
<locator>
<udpv4>
<address>192.168.10.13</address>
<port>7412</port>
</udpv4>
</locator>
</initialPeersList>
</builtin>
</rtps>
</participant>
|