4.5. DDS Domains¶
This section discusses how to use DomainParticipants. It describes the types of operations that are available for them and their QosPolicies.
The goal of this section is to help you become familiar with the objects you need for setting up your RTI Connext DDS Micro application. For specific details on any mentioned operations, see the C API Reference and C++ API Reference documentation.
4.5.1. Fundamentals of DDS Domains and DomainParticipants¶
DomainParticipants are the focal point for creating, destroying, and managing other RTI Connext DDS Micro objects. A DDS domain is a logical network of applications: only applications that belong to the same DDS domain may communicate using Connext DDS Micro. A DDS domain is identified by a unique integer value known as a domain ID. An application participates in a DDS domain by creating a DomainParticipant for that domain ID.
As seen in Figure 4.2: Relationship between Applications and DDS Domains, a single application can participate in multiple DDS domains by creating multiple DomainParticipants with different domain IDs. DomainParticipants in the same DDS domain form a logical network; they are isolated from DomainParticipants of other DDS domains, even those running on the same set of physical computers sharing the same physical network. DomainParticipants in different DDS domains will never exchange messages with each other. Thus, a DDS domain establishes a “virtual network” linking all DomainParticipants that share the same domain ID.
An application that wants to participate in a certain DDS domain will need to create a DomainParticipant. As seen in Figure 4.3: DDS Domain Module, a DomainParticipant object is a container for all other Entities that belong to the same DDS domain. It acts as factory for the Publisher, Subscriber, and Topic entities. (As seen in Sending Data and Receiving Data, in turn, Publishers are factories for DataWriters and Subscribers are factories for DataReaders.) DomainParticipants cannot contain other DomainParticipants.
Like all Entities, DomainParticipants have QosPolicies and Listeners. The DomainParticipant entity also allows you to set ‘default’ values for the QosPolicies for all the entities created from it or from the entities that it creates (Publishers, Subscribers, Topics, DataWriters, and DataReaders).
4.5.2. Discovery Announcements¶
Each DomainParticipant announces information about itself, such as which locators other DomainParticipants must use to communicate with it. A locator is an address that consists of an address kind, a port number, and an address. Four locator types are defined:
- A unicast meta-traffic locator. This locator type is used to identify where unicast discovery messages shall be sent. A maximum of four locators of this type can be specified.
- A multicast meta-traffic locator. This locator type is used to identify where multicast discovery messages shall be sent. A maximum of four locators of this type can be specified.
- A unicast user-traffic locator. This locator type is used to identify where unicast user-traffic messages shall be sent. A maximum of four locators of this type can be specified.
- A multicast user-traffic locator. This locator type is used to identify where multicast user-traffic messages shall be sent. A maximum of four locators of this type can be specified.
It is important to note that a maximum of four locators of each kind can be sent in a DomainParticipant discovery message.
The locators in a DomainParticipant’s discovery announcement is used for two purposes:
- It informs other DomainParticipants where to send their discovery announcements to this DomainParticipants.
- It informs the DataReaders and DataWriters in other DomainParticipants where to send data to the DataReaders and DataWriters in this DomainParticipant unless a DataReader or DataWriter specifies its own locators.
If a DataReader or DataWriter specifies their own locators, only user-traffic locators can be specified, then the exact same rules apply as for the DomainParticipant.
This document uses address and locator interchangeably. An address corresponds to the port and address part of a locator. The same address may exist as different kinds, in which case they are unique.
For more details about the discovery process, see the Discovery section.