Discovery announcement messages are sent from the Publisher to the Subscribers and they can be sent through any Message Oriented Middleware and protocol mapping.

Discovery announcement messages are used to inform Subscribers about configuration changes in the Publisher. They are sent by the Publisher in the case of a configuration change. A Publisher can also be configured to send the discovery announcement messages periodically. A Message Oriented Middleware may be able to persist the latest announcement message for Subscribers.

Discovery probe messages are sent from Subscriber to Publisher and they are limited to Message Oriented Middleware and protocol mappings that support such a back channel. A discovery probe is typically answered with one or more discovery announcement messages.

Depending on the used Message Oriented Middleware and the protocol mapping, it may be possible and required for the Subscriber to request discovery announcement messages by sending discovery probe messages. One use case is a non reliable transport where the Subscriber did not receive the message or the Subscriber was not available at the time the Publisher sent the discovery announcement. Another use case is the collection of initial knowledge about a Publisher. Some discovery announcement messages may only be sent as result of a discovery probe message.

Discovery in a global scope requires unique PublisherIds. Publishers shall use the default PublisherIds as defined in 6.2.7.1 for the following discovery messages.

These messages use the standard discovery address if defined for the transport protocol mapping like the IANA registered IPv4 multicast address for UDP.

Other announcements below PubSubConnection level can use different PublisherIds for different transport protocol mappings. Such PubSubConnection specific PublisherIds could be two Byte PublisherIds for the Ethernet transport protocol mapping. These PublisherIds are known from the payload of the PubSubConnection configuration announcement messages.

The NetworkMessage flags used with the discovery announcement messages shall use the following bit values.

The setting of the flags ensures a known value for the first three bytes plus the PublisherId in the NetworkMessage, except for the Chunk bit 0 in ExtendedFlags2. The actual security settings for the NetworkMessage are indicated by the SecurityHeader.

The encoding of the discovery announcement header structure is specified in Table 149.

Table 149 – Discovery announcement header structure

Name

Type

Description

AnnouncementType

Byte

The following types of discovery announcement messages are defined.

0Reserved

1Publisher Endpoints message (see 7.2.4.6.6)

2DataSetMetaData message (see 7.2.4.6.4)

3DataSetWriter configuration message (see 7.2.4.6.9)

4PubSubConnection configuration message (see 7.2.4.6.8)

5 OPC UA Application information message (see Table 150)

SequenceNumber

UInt16

Sequence number, incremented by exactly one, for each discovery announcement sent in the scope of a PublisherId.

The encoding of the OPC UA Application information announcement message structure is specified in Table 150.

Table 150 – OPC UA Application information announcement message structure

Name

Type

Description

ApplicationInformationType

UInt16

The following types of application information are defined.

0Reserved

1Application description (see 7.2.4.6.5)

2Status (see 7.2.4.6.7)

The encoding of the DataSet metadata message structure is specified in Table 151. It contains the current layout and DataSetMetaData for the DataSet.

The ConfigurationVersion in the DataSetMessage header shall match the ConfigurationVersion in the DataSetMetaData.

The Publisher shall send this message without a corresponding discovery probe if the DataSetMetaData changed for the DataSet.

Table 151 – DataSetMetaData announcement message structure

Name

Type

Description

DataSetWriterId

UInt16

DataSetWriterId of the DataSet described with the MetaData.

MetaData

DataSetMetaDataType

The current DataSet metadata for the DataSet related to the DataSetWriterId. The DataSetMetaDataType is defined in 6.2.3.2.3.

statusCode

StatusCode

Status code indicating the capability of the Publisher to provide MetaData for the DataSetWriterId.

The encoding of the OPC UA Application description message fields for ApplicationInformationType 1 is specified in Table 152. It contains the ApplicationDescription and the capabilities.

Table 152 – ApplicationInformationType application description fields

Name

Type

Description

ApplicationDescription

ApplicationDescription

ApplicationDescription for the OPC UA Application. The ApplicationDescription DataType is defined in OPC 10000-4.

Capabilities

String[]

The list of capability identifiers for the application. The allowed capability identifiers are defined in OPC 10000-12.

The encoding of the available Server Endpoints of a Publisher is specified in Table 153.

Table 153 – Publisher Endpoints announcement message structure

Name

Type

Description

Endpoints

EndpointDescription[]

The OPC UA Server Endpoints of the Publisher. The EndpointDescription is defined in OPC 10000-4.

The field is encoded as Array with number of elements encoded as Int32 value.

statusCode

StatusCode

Status code indicating the capability of the Publisher to provide Endpoints.

The encoding of the status message fields for ApplicationInformationType 2 is specified in Table 154.

Table 154 – ApplicationInformationType status fields

Name

Type

Description

IsCyclic

Boolean

If TRUE the Publisher periodically updates the status.

If FALSE the Middleware is responsible for detecting changes to the status.

Status

PubSubState

The current state of the Publisher. This value is mandatory.

NextReportTime

UtcTime

When the Publisher expects to send the next update.

The field is present if IsCyclic=TRUE.

The field is not present if IsCyclic=FALSE.

IsCyclic is set to FALSE if a PublisherId is used exclusively by a single application and the Message Oriented Middleware can detect when Publishers go offline. In these cases, the Publisher sends updates only when its state changes and the Message Oriented Middleware will send an update with PubSubState Error if the Publisher goes offline.

If IsCyclic is set to TRUE the Publisher only reports while they are Operational. The NextReportTime indicates when the Publisher will send an update. If the Subscriber does not receive updates and the NextReportTime is in the past, the Subscriber assumes the PubSubState Error.

The encoding of the PubSubConnection configuration announcement message structure is specified in Table 155. It contains an array of PubSubConnections configured in the OPC UA Application.

Table 155 – PubSubConnection configuration announcement message structure

Name

Type

Description

PubSubConnections

PubSubConnectionDataType []

PubSubConnections configured for the OPC UA Application.

The PubSubConnectionDataType is defined in 6.2.7.5.1.

The ReaderGroup lists in PubSubConnectionDataType shall be empty.

The WriterGroup list shall be contained, if the IncludeWriterGroups is true in the PubSubConnection information probe message.

The DataSetWriter lists in the WriterGroups shall be contained, if the IncludeDataSetWriters is true in the PubSubConnection information probe message.

The configuration properties shall not be included in the PubSubConnectionDataType, WriterGroupDataType and DataSetWriterDataType.

The encoding of the DataSetWriter configuration data message structure is specified in Table 156. It contains the current configuration of the WriterGroup and the DataSetWriter for the DataSet.

The Publisher shall send this message without a corresponding discovery probe if the configuration of the WriterGroup changed.

Table 156 – DataSetWriter configuration announcement message structure

Name

Type

Description

DataSetWriterIds

UInt16[]

DataSetWriterIds contained in the configuration information.

The field is encoded as Array with number of elements encoded as Int32 value.

DataSetWriterConfig

WriterGroupDataType

The current WriterGroup and DataSetWriter settings for the DataSet related to the DataSetWriterId. The WriterGroupDataType is defined in 6.2.6.7.

The field DataSetWriters of the WriterGroupDataType shall contain only the entry for the requested or changed DataSetWriters in the WriterGroup.

The configuration properties shall not be included in the WriterGroupDataType and DataSetWriterDataType.

statusCodes

StatusCode[]

Status codes indicating the capability of the Publisher to provide configuration information for the DataSetWriterIds. The size of the array shall match the size of the DataSetWriterIds array.

The NetworkMessage flags used with the discovery probe messages shall use the following bit values.

  • UADPFlags bits 5 and 6 shall be false, bits 4 and 7 shall be true
  • ExtendedFlags1 bits 3, 5 and 6 shall be false, bits 4 and 7 shall be true
  • ExtendedFlags2 bit 2 shall be true, all other bits shall be false

The setting of the flags ensures a known value for the first three bytes plus the PublisherId in the NetworkMessage on the Publisher as receiver. The actual security settings for the NetworkMessage are indicated by the SecurityHeader.

A variety of rules are used to reduce the amount of traffic on the network in the case of multicast or broadcast communication.

A Subscriber should cache configuration information for PublisherId and DataSetWriterIds of interest.

If a Subscriber requires information from Publishers after a startup or version change detection, discovery probes shall be randomly delayed in the range of 100 ms to 500 ms. The probe shall be skipped if the information is already received during this time or another Subscriber sent already a probe and the announcement to this probe is used.

A Subscriber shall wait for a announcement at least 500 ms. As long as not all announcements are received, the Subscriber requests the missing information. It should double the time period between following probes until all needed announcements are received or denied. The maximum period is Subscriber specific.

A Publisher shall delay subsequent announcements for a combination of probe type and identifier like the DataSetWriterId for at least 500 ms. Duplicate probes, that have not yet been responded to, shall be discarded by the Publisher. The maximum delay is Publisher specific.

If the Publisher receives discovery probes for different DataSetWriters in one WriterGroup, the Publisher shall send one aggregated discovery announcement.

The encoding of the discovery probe header structure is specified in Table 157.

Table 157 – Discovery probe header structure

Name

Type

Description

ProbeType

Byte

The following types of discovery probe messages are defined.

0Reserved

1 Publisher information probe message (see 7.2.4.6.10.4)

2FindApplications probe message.The message type does not have additional fields. The PublisherId is set to NULL.

The encoding of the Publisher information probe message structure is specified in Table 158.

Table 158 – Publisher information probe message structure

Name

Type

Description

InformationType

Byte

The following types of Publisher information probes are defined.

0Reserved

1 Publisher Server Endpoints

No additional fields are defined.

The information is provided with the Publisher Endpoints announcement message defined in 7.2.4.6.4.

2 DataSetMetaData

The settings for this InformationType are defined in Table 159.

The information is provided with the DataSetMetaData announcement message defined in 7.2.4.6.4.

3 DataSetWriter configuration

The settings for this InformationType are defined in Table 159.

The information is provided with the DataSetWriter configuration announcement message defined in 7.2.4.6.9.

4 WriterGroup configuration

The settings for this InformationType are defined in Table 160

The information is provided with the DataSetWriter configuration announcement message defined in 7.2.4.6.9.

5 PubSubConnections configuration

The settings for this InformationType are defined in Table 161

The information is provided with the PubSubConnection configuration announcement message defined in 7.2.4.6.7.

The additional field for DataSetWriter related InformationType in a Publisher information probe message are specified in Table 159.

Table 159 – DataSetWriter settings for Publisher information probe

Name

Type

Description

DataSetWriterIds

UInt16[]

List of DataSetWriterIds the information is requested for.

The field is encoded as Array with number of elements encoded as Int32 value.

For DataSetMetaData probes, the Publisher sends one discovery announcement NetworkMessage for each requested DataSetWriterId.

For DataSetWriter configuration probes, the DataSetWriters that belong to one WriterGroup are sent together in one DataSetWriter configuration message. If more than one WriterGroup is affected, this results in a DataSetWriter configuration message per WriterGroup.

The additional fields for WriterGroup related InformationType in a Publisher information probe message are specified in Table 160.

Table 160 – WriterGroup settings for Publisher information probe

Name

Type

Description

WriterGroupId

UInt16

This option allows a Publisher information probe for a WriterGroup and the contained DataSetWriters if only the WriterGroupId is known from NetworkMessages.

For WriterGroup configuration probes, the DataSetWriters that belong to the WriterGroup are sent together in one DataSetWriter configuration message.

IncludeDataSetWriters

Boolean

Flag indicating if the DataSetWriter should be contained in the PubSubConnection configuration announcement message.

The additional fields for PubSubConnection configuration in a Publisher information probe message are specified in Table 161.

Table 161 – PubSubConnections settings for Publisher information probe

Name

Type

Description

TransportProfileUris

String []

Filter criteria for the PubSubConnections to return in the PubSubConnection configuration announce message.

If TransportProfileUris are set, only PubSubConnection with matching TransportProfileUri shall be returned.

If the TransportProfileUris is null or empty, all PubSubConnections are returned.

IncludeWriterGroups

Boolean

Flag indicating if the WriterGroups should be contained in the PubSubConnection configuration announcement message.

IncludeDataSetWriters

Boolean

Flag indicating if the DataSetWriters should be contained in the PubSubConnection configuration announcement message.

This flag is ignored if IncludeWriterGroups is false.

Setting this flag increases the size of the PubSubConnection configuration announcement message and it is more likely that max message sizes are exceeded.