26.4 Tuning domain_id_gain and participant_id_gain

The domain_id_gain is used as a multiplier of the domain ID. Together with participant_id_gain (26.4 Tuning domain_id_gain and participant_id_gain), these values determine the highest domain ID and participant_id allowed on this network.

In general, there are two ways to set up the domain_id_gain and participant_id_gain parameters.

  • If domain_id_gain > participant_id_gain, it results in a port mapping layout where all DomainParticipants in a DDS domain occupy a consecutive range of domain_id_gain ports. Precisely, all ports occupied by the DDS domain fall within:
  • (port_base + (domain_id_gain * domain ID)) 

    and:

    (port_base + (domain_id_gain * (domain ID + 1)) - 1)

    In this case, the highest domain ID is limited only by the underlying transport's maximum port. The highest participant_id, however, must satisfy:

    max_participant_id < (domain_id_gain / participant_id_gain) 
  • Or if domain_id_gain <= participant_id_gain, it results in a port mapping layout where a given DDS domain's DomainParticipant instances occupy ports spanned across the entire valid port range allowed by the underlying transport. For instance, it results in the following potential mapping:
  • Mapped Port

    Domain ID

    Participant ID

    higher port number

    1

    2

    0

    1

    1

    0

    1

    0

    lower port number

    0

In this case, the highest participant_id is limited only by the underlying transport's maximum port. The highest domain_id, however, must satisfy:

max_domain_id < (participant_id_gain / domain_id_gain) 

The domain_id_gain also determines the range of the port-specific offsets:

domain_id_gain > 

abs(builtin_multicast_port_offset - user_multicast_port_offset)

and

domain_id_gain > 

abs(builtin_unicast_port_offset - user_unicast_port_offset)

Violating this may result in port aliasing and undefined discovery behavior.

The participant_id_gain also determines the range of builtin_unicast_port_offset and user_unicast_port_offset.

participant_id_gain > 

abs(builtin_unicast_port_offset - user_unicast_port_offset)

In all cases, the resulting ports must be within the range imposed by the underlying transport.