44.8 TRANSPORT_MULTICAST_MAPPING QosPolicy (DDS Extension)

The multicast address on which a DataReader wants to receive its data can be explicitly configured using the 48.5 TRANSPORT_MULTICAST QosPolicy (DDS Extension). However in systems with many multicast addresses, managing the multicast configuration can become cumbersome. The TransportMulticastMapping QosPolicy is designed to make configuration and assignment of the DataReader's multicast addresses more manageable. When using this QosPolicy, the middleware will automatically assign a multicast receive address for a DataReader from a range by using configurable mapping rules.

DataReaders can be assigned a single multicast receive address using the rules defined in this QosPolicy on the DomainParticipant. This multicast receive address is exchanged during simple discovery in the same manner used when the multicast receive address is defined explicitly. No additional configuration on the writer side is needed.

Mapping within a range is done through a mapping function. The middleware provides a default hash (md5) mapping function. This interface is also pluggable, so you can specify a custom mapping function to minimize collisions.

To use this QosPolicy, you must set the kind in the 48.5 TRANSPORT_MULTICAST QosPolicy (DDS Extension) to AUTOMATIC.

This QosPolicy contains the member in Table 44.9 DDS_TransportMulticastMappingQosPolicy.

Table 44.9 DDS_TransportMulticastMappingQosPolicy

Type

Field Name

Description

DDS_TransportMapping
SettingsSeq

value

A sequence of multicast communication settings, each of which has the format shown in Table 44.10 DDS_TransportMulticastSettings_t.

Table 44.10 DDS_TransportMulticastSettings_t

Type

Field Name

Description

char *

addresses

A string containing a comma-separated list of IP addresses or IP address ranges to be used to receive multicast traffic for the entity with a topic that matches the topic_expression.

See 44.8.1 Formatting Rules for Addresses.

char *

topic_expression

A regular expression used to map topic names to corresponding addresses.

See 35.5.5 SQL Extension: Regular Expression Matching.

DDS_TransportMulticast
MappingFunction_t

mapping_function

Optional. Defines a user-provided pluggable mapping function. See Table 44.11 DDS_TransportMulticastMappingFunction_t.

 

Table 44.11 DDS_TransportMulticastMappingFunction_t

Type

Field Name

Description

char *

dll

Specifies a dynamic library that contains a mapping function.

You may specify a relative or absolute path.

If the name is specified as "foo", the library name on Linux systems will be libfoo.so; on Windows systems it will be foo.dll.

char *

function_name

Specifies the name of a mapping function in the library specified in the above dll.

The function must implement the following interface:

int function(const char* topic_name, int numberOfAddresses);

The function must return an integer that indicates the index of the address to use for the given topic_name. For example, if the first address in the list should be used, it must return 0; if the second address in the list should be used, it must return 1, etc.

44.8.1 Formatting Rules for Addresses

  • The string must contain IPv4 or IPv6 addresses separated by commas. For example: "239.255.100.1,239.255.100.2,239.255.100.3"
  • You may specify ranges of addresses by enclosing the start and end addresses in square brackets. For example: "[239.255.100.1,239.255.100.3]".
  • You may combine the two approaches.
    For example: "239.255.200.1,[239.255.100.1,239.255.100.3], 239.255.200.3"
  • IPv4 addresses must be specified in Dot-decimal notation.
  • IPv6 addresses must be specified using 8 groups of 16-bit hexadecimal values separated by colons. For example: FF00:0000:0000:0000:0202:B3FF:FE1E:8329.
  • Leading zeroes can be skipped. For example: FF00:0:0:0:202:B3FF:FE1E:8329.
  • You may replace a consecutive number of zeroes with a double colon, but only once within an address. For example: FF00::202:B3FF:FE1E:8329.

44.8.2 Example

This QoS policy configures the multicast ranges and mapping rules at the DomainParticipant level. You can configure a large set of multicast addresses on the DomainParticipant.

In addition, you can configure a mapping between topic names and multicast addresses. For example, topic "A" can be assigned to address 239.255.1.1 and topic "B" can be assigned to address 239.255.1.2.

This configuration is quite flexible. For example, you can specify mappings between a subset of topics to a range of multicast addresses. For example, topics "X", "Y" and Z" can be mapped to [239.255.1.1, 239.255.1.255], or using regular expressions, "X*" and "B-Z" can be mapped to a sub-range of addresses. See 35.5.5 SQL Extension: Regular Expression Matching.

44.8.3 Properties

This QosPolicy cannot be modified after the DomainParticipant is created.

44.8.4 Related QosPolicies

44.8.5 Applicable DDS Entities

44.8.6 System Resource Considerations

See 48.5.5 System Resource Considerations.