Prioritized DDS Samples

Note: This feature is not supported when using the Ada API.

The Prioritized DDS Samples feature allows you to prioritize traffic that is in competition for transmission resources. The granularity of this prioritization may be by DataWriter, by instance, or by individual DDS sample.

Prioritized DDS Samples can improve latency in the following cases:

To configure a DataWriter to use prioritized DDS samples:

A single FlowController may perform traffic shaping for multiple DataWriters and multiple DataWriter channels. The FlowController’s configuration determines how often publication resources are scheduled, how much data may be sent per period, and other transmission characteristics that determine the ultimate performance of prioritized DDS samples.

When working with prioritized DDS samples, you should use these operations, which allow you to specify priority:

If you use write(), unregister(), or dispose() instead of the _w_params() versions, the affected DDS sample is assigned priority 0 (undefined priority). If you are using a multi-channel DataWriter with a priority filter, and you have no channel for priority 0, the DDS sample will be discarded.

Designating Priorities

For DataWriters and DataWriter channels, valid publication priority values are:

For individual DDS samples, valid publication priority values are 0 and positive integers.

There are three ways to set the publication priority of a DataWriter or DataWriter channel:

  1. For a DataWriter, publication priority is set in the priority field of its PUBLISH_MODE QosPolicy (DDS Extension). For a multi-channel DataWriter (see MULTI_CHANNEL QosPolicy (DDS Extension)), this value will be the default publication priority for any member channel that has not been assigned a specific value.
  2. For a channel of a Multi-channel DataWriter, publication priority can be set in the DataWriter’s MULTI_CHANNEL QosPolicy (DDS Extension) in channels[].priority.
  3. If a DataWriter or a channel of a Multi-channel DataWriter is configured for publication priority inheritance (DDS_PUBLICATION_PRIORITY_AUTOMATIC), its publication priority is the highest priority among all the DDS samples currently in the publication queue. When using publication priority inheritance, the publication priorities of individual DDS samples are set by calling the write_w_params() operation, which takes a priority parameter.

The effective publication priority is determined from the interaction of the DataWriter, channel, and DDS sample publication priorities, as shown in Effective Publication Priority of Samples.

Effective Publication Priority of Samples

 

Priority Setting Combinations

Writer Priority

Undefined

Don’t care

AUTOMATIC

Don’t care

Designated positive
integer > 0

Channel Priority

Undefined

AUTOMATIC

Undefined

Designated positive integer > 0

Undefined

DDS Sample Priority

Don’t care

Designated positive
integer > 0

Designated positive
integer > 0

Don’t care

Don’t care

Effective Priority

Lowest
Priority

DDS Sample
Priority1Highest sample priority among all DDS samples currently in the publication queue.

DDS Sample
Priority2Highest sample priority among all DDS samples currently in the publication queue.  

Channel
Priority

Writer
Priority

Priority-Based Filtering

The configuration methods explained above are sufficient to create multiple DataWriters, each with its own assigned priority, all using the same FlowController configured for publication priority-based scheduling. Such a configuration is sufficient to assign different priorities to individual topics, but it does not allow different publication priorities to be assigned to published data within a Topic.

To assign different priorities to data within a DataWriter, you will need to use a Multi-channel DataWriter and configure the channels with different priorities. Configuring the publication priorities of DataWriter channels is explained above. To associate different priorities of data with different publication channels, configure the channel[].filter_expression in the DataWriter’s MULTI_CHANNEL QosPolicy (DDS Extension). The filtering criteria that is available for evaluation by each channel is determined by the filter type, which is configured with the DataWriter’s filter_name (also in the MULTI_CHANNEL QosPolicy (DDS Extension)).

For example, using the built-in SQL-based content filter allows channel membership to be determined based on the content of each DDS sample.

If you do not want to embed priority criteria within each DDS sample, you can use a built-in filter named DDS_PRIFILTER_NAME that uses the publication priority that is provided when you call write_w_params() (see Writing Data). The filter’s expression syntax is:

@priority OP VAL

where OP can be < , <= , > , >= , = , or <> (standard relational operators), and VAL is a positive integer.

The filter supports multiple expressions, combined with the conjunctions AND and OR. You can use parentheses to disambiguate combinations of AND and OR in the same expression. For example:

@priority = 2 OR (@priority > 6 AND @priority < 10)

© 2018 RTI