7.2.4.6 Discovery messages
7.2.4.6.1 General

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.

7.2.4.6.2 Discovery scope for Datagram transport protocols

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.

OPC UA Application information announcement

Publisher endpoint announcement

PubSubConnection configuration announcement

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.

7.2.4.6.3 Discovery announcement header

The NetworkMessage flags used with the discovery announcement 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, bit 4 and 7 shall be true

ExtendedFlags2 bit 1 shall be false and the NetworkMessage type shall be discovery announcement

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 168.

Table 168 – Discovery announcement header structure
Name Type Description
AnnouncementTypeByte

The following types of discovery announcement messages are defined.

0 Reserved

1 Publisher Endpoints message (see 7.2.4.6.6)

2 DataSetMetaData message (see 7.2.4.6.4)

3 DataSetWriter configuration message (see 7.2.4.6.9)

4 PubSubConnection configuration message (see 7.2.4.6.8)

5 OPC UA Application information message (see Table 169)

6 ActionResponder configuration message (see 7.2.4.6.10)

7 ActionMetaData announce message (see 7.2.4.6.11)

SequenceNumberUInt16Sequence 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 169.

Table 169 – OPC UA Application information announcement message structure
Name Type Description
ApplicationInformationTypeUInt16

The following types of application information are defined.

0 Reserved

1 Application description (see 7.2.4.6.5)

2 Status (see 7.2.4.6.7)

7.2.4.6.4 DataSetMetaData

The encoding of the DataSet metadata message structure is specified in Table 170. 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 170 – DataSetMetaData announcement message structure
Name Type Description
DataSetWriterIdUInt16 DataSetWriterId of the DataSet described with the MetaData.
MetaDataDataSetMetaDataTypeThe current DataSet metadata for the DataSet related to the DataSetWriterId. The DataSetMetaDataType is defined in 6.2.3.2.3.
statusCodeStatusCodeStatus code indicating the capability of the Publisher to provide MetaData for the DataSetWriterId.
7.2.4.6.5 ApplicationDescription

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

Table 171 – ApplicationInformationType application description fields
Name Type Description
ApplicationDescriptionApplicationDescription ApplicationDescription for the OPC UA Application. The ApplicationDescription DataType is defined in OPC 10000-4.
CapabilitiesString[]The list of capability identifiers for the application. The allowed capability identifiers are defined in OPC 10000-12.
7.2.4.6.6 ServerEndpoints

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

Table 172 – Publisher Endpoints announcement message structure
Name Type Description
EndpointsEndpointDescription[]

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.

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

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

Table 173 – ApplicationInformationType status fields
Name Type Description
IsCyclicBoolean

If TRUE the Publisher periodically updates the status.

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

StatusPubSubStateThe current state of the PubSubConnection. This value is mandatory.
NextReportTimeUtcTime

When the Publisher expects to send the next update.

The field is present if IsCyclic=TRUE.

The field is not present if IsCyclic=FALSE.

TimestampUtcTime

When the message was sent to the Middleware.

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.

7.2.4.6.8 PubSubConnection

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

Table 174 – PubSubConnection configuration announcement message structure
Name Type Description
PubSubConnectionsPubSubConnectionDataType []

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.

7.2.4.6.9 DataSetWriter configuration announcement message

The encoding of the DataSetWriter configuration data message structure is specified in Table 175. 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 175 – DataSetWriter configuration announcement message structure
Name Type Description
DataSetWriterIdsUInt16[]

DataSetWriterIds contained in the configuration information.

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

DataSetWriterConfigWriterGroupDataType

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.

statusCodesStatusCode[]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.
7.2.4.6.10 ActionResponder configuration announcement message

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

Table 176 – ActionResponder configuration announcement message structure
Name Type Description
ActionResponderPubSubConnectionDataType []

ActionResponder configured for the OPC UA Application.

The PubSubConnectionDataType is defined in 6.2.7.5.1.

Only DataSetWriters used for Actions are included. All WriterGroups and DataSetWriters not used for Actions shall be excluded.

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.

7.2.4.6.11 ActionMetaData announcement message

The encoding of the ActionMetaData message structure is specified in Table 177.

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

Table 177 – ActionMetaData announcement message structure
Name Type Description
DataSetWriterIdUInt16 DataSetWriterId of the Actions described with the MetaData.
ActionTargetsActionTargetDataType[]

The set of Action targets that may be executed.

If an Action target is mapped to a Method of an Object in an OPC UA Server, then the related Object and Method are defined by the corresponding entry in the ActionMethods array.

The ActionTargetId in the ActionTargetDataType is used to address the Method referenced by the ActionMethodDataType.

RequestDataSetMetaDataType

The structure and content of the ActionRequest message.

The name of the Action is defined by the Name field in the DataSetMetaDataType.

ResponseDataSetMetaDataType

The structure and content of the ActionResponse message.

The fields Name and ConfigurationVersion of the Request and the Response DataSetMetaDataType shall have equal values.

ActionMethodsActionMethodDataType[]

The optional array of Action sources. If the source information is provided, the array shall match the size and order of the ActionTargets.

The namespace URIs for the NamespaceIdex in the NodeIds shall be contained in the Request DataSetMetaData.

7.2.4.6.12 UADP discovery probe NetworkMessage
7.2.4.6.12.1 General

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.

7.2.4.6.12.2 Traffic reduction

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.

7.2.4.6.12.3 Discovery probe header

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

Table 178 – Discovery probe header structure
Name Type Description
ProbeTypeByte

The following types of discovery probe messages are defined.

0 Reserved

1 Publisher information probe message (see 7.2.4.6.12.4)

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

7.2.4.6.12.4 Publisher information probe message

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

Table 179 – Publisher information probe message structure
Name Type Description
InformationTypeByte

The following types of Publisher information probes are defined.

0 Reserved

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 180.

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 180.

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 181

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 182

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 180.

Table 180 – DataSetWriter settings for Publisher information probe
Name Type Description
DataSetWriterIdsUInt16[]

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 181.

Table 181 – WriterGroup settings for Publisher information probe
Name Type Description
WriterGroupIdUInt16

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.

IncludeDataSetWritersBooleanFlag 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 182.

Table 182 – PubSubConnections settings for Publisher information probe
Name Type Description
TransportProfileUrisString []

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.

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

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.