NDDS_DISCOVERY_PEERS specifies the default value of the com.rti.dds.infrastructure.DiscoveryQosPolicy.initial_peers and com.rti.dds.infrastructure.DiscoveryQosPolicy.multicast_receive_addresses fields, when the default participant QoS policies have not been explictly set by the user (i.e., com.rti.dds.domain.DomainParticipantFactory.set_default_participant_qos() has never been called or was called using DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT).
If NDDS_DISCOVERY_PEERS does not contain a multicast address, then the string sequence com.rti.dds.infrastructure.DiscoveryQosPolicy.multicast_receive_addresses is cleared and the RTI discovery process will not listen for discovery messages via multicast.
If NDDS_DISCOVERY_PEERS contains one or more multicast addresses, the addresses will be stored in com.rti.dds.infrastructure.DiscoveryQosPolicy.multicast_receive_addresses, starting at element 0. They will be stored in the order in which they appear in NDDS_DISCOVERY_PEERS.
Note: IPv4 multicast addresses must have a prefix. Therefore, when using the UDPv6 transport: if there are any IPv4 multicast addresses in the peers list, make sure they have "udpv4://" in front of them (such as udpv4://239.255.0.1).
Note: Currently, RTI Connext will only listen for discovery traffic on the first multicast address (element 0) in com.rti.dds.infrastructure.DiscoveryQosPolicy.multicast_receive_addresses.
NDDS_DISCOVERY_PEERS provides a mechanism to dynamically switch the discovery configuration of an RTI Connext application without recompilation. The application programmer is free to not use the default values; instead use values supplied by other means.
NDDS_DISCOVERY_PEERS can be specified either in an environment variable as comma (',') separated "peer descriptors"
(see Peer Descriptor Format) or in a file. These formats are described below.
locator
. Peer descriptor strings are used in the com.rti.dds.infrastructure.DiscoveryQosPolicy.initial_peers field and the com.rti.dds.domain.DomainParticipant.add_peer() operation.
The anatomy of a peer
descriptor is illustrated below using a special "StarFabric" transport example.
String based addressing
Note that the "participant ID limit" only applies to unicast locators; it is ignored for multicast locators (and therefore should be omitted for multicast peer descriptors).
A locator consists of:
address
portion of the locator. Note that a transport class name is an implicit alias that is used to refer to all the transport plugin instances of that class. If a transport name is specified, the address may be omitted; in that case, all the unicast addresses (across all transport plugin instances) associated with the transport class are implied. Thus, a locator string may specify several addresses.
If an address is specified, the transport name and the separator string may be omitted; in that case all the available transport plugins (for the com.rti.dds.infrastructure.Entity) may be used to parse the address string.
An address consists of:
The bits resulting from the transport address string are prepended with the network address. The least significant Transport.Property_t.address_bit_count bits of the network address are ignored (Transport Network Address).
If the separator is omitted and the string is not a valid IPv4 or IPv6 address, it is treated as a transport address with an implicit network address (of the transport plugin).
Examples
Multicast (maximum participant ID is irrelevant)
Default maximum participant ID on host himalaya accessed using the "udpv4" transport plugin(s) (IPv4)
Example:
;; NDDS_DISCOVERY_PEERS - Default Discovery Configuration File ;; ;; ;; NOTE: ;; 1. This file must be in the current working directory, i.e. ;; in the folder from which the application is launched. ;; ;; 2. This file takes precedence over the environment variable NDDS_DISCOVERY_PEERS ;; ;; Multicast 239.255.0.1 ; The default RTI Connext discovery multicast address ;; Unicast localhost,192.168.1.1 ; A comma can be used a separator FAA0::1 FAA0::0#localhost ; Whitespace can be used as a separator 1@himalaya ; Maximum participant ID of 1 on 'himalaya' 1@gangotri ;; UDPv4 udpv4://himalaya ; 'himalaya' via 'udpv4' transport plugin(s) udpv4://FAA0::0#localhost ; 'localhost' via 'updv4' transport ; plugin registered at network address FAA0::0 ;; Shared Memory shmem:// ; All 'shmem' transport plugin(s) builtin.shmem:// ; The builtin 'shmem' transport plugin shmem://FCC0::0 ; Shared memory transport plugin registered ; at network address FCC0::0 ;; StarFabric 0/0/R ; StarFabric node 0/0/R starfabric://0/0/R ; 0/0/R accessed via 'starfabric' ; transport plugin(s) starfabric://FBB0::0#0/0/R ; StarFabric transport plugin registered ; at network address FBB0::0 starfabric:// ; All 'starfabric' transport plugin(s)
;; Multicast (only on platforms which allow UDPv4 multicast out of the box) ;; ;; This allows any RTI Connext applications anywhere on the local network to ;; discover each other over UDPv4. builtin.udpv4://239.255.0.1 ; RTI Connext's default discovery multicast address ;; Unicast - UDPv4 (on all platforms) ;; ;; This allows two RTI Connext applications using participant IDs up to the maximum ;; default participant ID on the local host and domain to discover each ;; other over UDP/IPv4. builtin.udpv4://127.0.0.1 ;; Unicast - Shared Memory (only on platforms that support shared memory) ;; ;; This allows two RTI Connext applications using participant IDs up to the maximum ;; default participant ID on the local host and domain to discover each ;; other over shared memory. builtin.shmem://
shmem
- ShmemTransport udpv4
- UDPv4Transport udpv6
- UDPv6Transport If the local host platform does not support the shared memory transport, then you can include the name of the local host in the NDDS_DISCOVERY_PEERS list.
If the local host platform supports the shared memory transport, then you can do one of the following:
com.rti.dds.infrastructure.DiscoveryQosPolicy.initial_peers
com.rti.dds.domain.DomainParticipant.add_peer()
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT
com.rti.dds.domain.DomainParticipantFactory.get_default_participant_qos()