In PubSubuse cases with dynamically changing message layouts or Event based DataSetMessages, the number and ordering of DataSetMessageswithin different NetworkMessagescan change arbitrarily. The header layouts described in this section are intended for use cases with dynamic DataSetsand ad-hoc identification of DataSetMessages.
With the header layout described in this section, the NetworkMessageheader only identifies the Publisherand the contained DataSetMessages. In contrast to the fixed layout, more header fields are enabled in the DataSetMessageheader with this header layout but the GroupHeaderis deactivated.
The header layout URI for the dynamic layout as specified in A.3.4, A.3.5, A.3.6and A.3.7is
http://opcfoundation.org/UA/PubSub-Layouts/UADP-Dynamic
A UADP NetworkMessageheader shall consist of the following fields according to this header layout:
Additional restrictions:
- The datatype for the PublisherIdshall be UInt64
Note:For the PublisherIdthe DataType UInt64was selected because it allows a simple way for a Publisherto generate unique PublisherIdsby using the local MAC address (48 Bit) as part of the PublisherId.
The NetworkMessageheader layout is shown in Figure A.7.
Figure A.7– UADP NetworkMessage header layout
Table A.7shows the configuration for the NetworkMessageheader.
Table A.7– UADP NetworkMessage header layout
Name |
Type |
Restrictions |
UADPVersion |
Bit[0-3] |
The version shall be 1 |
UADPFlags |
Bit[4-7] |
Bit 4: PublisherIdenabled = 1 Bit 5: GroupHeaderenabled = 0 Bit 6: PayloadHeaderenabled = 1 Bit 7: ExtendedFlags1 enabled = 1 |
ExtendedFlags1 |
Byte |
Bit range 0-2: PublisherIdType 011 The PublisherIdis of DataType UInt64 Bit 3: DataSetClassIdenabled = 0 Bit 4: SecurityHeaderenabled = 0 Bit 5: Timestampenabled = 0 Bit 6: PicoSecondsenabled = 0 Bit 7: ExtendedFlags2 enabled = 0 |
PublisherId |
UInt64 |
Configured value for the PubSubConnection. The datatype shall be UInt64. |
PayloadHeader |
Byte[*] |
Defined by Table 140. |
Table A.8defines the values for the configuration parameters representing this layout.
Table A.8– Values for configuration parameters
Parameter |
Value |
UadpNetworkMessageContentMask |
0x00000041
This value results of the following options: Bit 0: PublisherIdenabled = 1 Bit 6: PayloadHeader enabled = 1 |
When a PubSubConnectionis created by using the Method AddConnection()the element PublisherIdcontained in the argument PubSubConnectionDataType shall be of the DataType UInt64.
UADP messages may be signed to ensure integrity. In this case a security header and a signature have to be added to the message. See clause 7.2.2.4.3for a complete description of the signing mechanism.
This header layout is basically the same as the header layout defined in A.3.4but with additional security level ‘Signing but no encryption’. The NetworkMessageheader layout with signing is shown in Figure A.8.
Figure A.8– UADP NetworkMessage header layout with integrity (signing)
Table A.9shows the configuration for the NetworkMessageheader with signing. The table contains only the added or modified rows from Table A.7.
Table A.9– UADP NetworkMessage header layout with integrity (signing)
Name |
Type |
Restrictions |
ExtendedFlags1 |
Byte |
Bit 4: SecurityHeaderenabled = 1 |
SecurityHeader |
|
|
SecurityFlags |
Byte |
Bit 0: NetworkMessageSigned enabled = 1 Bit 1: NetworkMessageEncryption enabled = 0 Bit 2: SecurityFooterenabled = 0 Bit 3: Force key reset enabled = 0 Bit range 4-7: Reserved |
SecurityTokenId |
IntegerId |
The ID of the security token that identifies the security key in a SecurityGroup. |
NonceLength |
Byte |
The length of the Nonce used to initialize the encryption algorithm. |
MessageNonce |
Byte[NonceLength] |
A number used exactly once for a given security key. |
UADP messages may be signed and encrypted. In this case the SecurityHeaderand the Signaturehave to be added to the message. See clause 7.2.2.4.3for a complete description of the security mechanisms.
This header layout is basically the same as the header layout defined in A.3.4but with additional security level ‘Signing and encryption’. The NetworkMessageheader layout with signing and encryption is shown in Figure A.9.
Figure A.9– UADP NetworkMessage header layout with integrity and confidentiality
Table A.10shows the configuration for the NetworkMessageheader with signing and encryption. The table contains only the added or modified rows from Table A.7.
Table A.10– UADP NetworkMessage header layout with integrity and confidentiality
Name |
Type |
Restrictions |
ExtendedFlags1 |
Byte |
Bit 4: SecurityHeaderenabled = 1 |
SecurityHeader |
|
|
SecurityFlags |
Byte |
Bit 0: NetworkMessageSigned enabled = 1 Bit 1: NetworkMessageEncryption enabled = 1 Bit 2: SecurityFooterenabled = 0 Bit 3: Force key reset enabled = 0 Bit range 4-7: Reserved |
SecurityTokenId |
IntegerId |
The ID of the security token that identifies the security key in a SecurityGroup. |
NonceLength |
Byte |
The length of the Nonce used to initialize the encryption algorithm. |
MessageNonce |
Byte[NonceLength] |
A number used exactly once for a given security key. |
A UADP DataSetMessageheader shall consist of the following fields according to this header layout:
Additional remarks:
- Fields can use any encoding
- All types of DataSetMessages(Data Key Frame, Data Delta Frame, Event, etc.) are supported
The DataSetMessageheader layout is shown in Figure A.10
Figure A.10– UADP DataSetMessage header layout
Table A.11shows the configuration for the DataSetMessageheader.
Table A.11– UADP DataSetMessage header layout
Name |
Type |
Description |
DataSetFlags1 |
Byte |
Bit 0: Indicates whether this DataSetMessageis valid Bit range 1-2: Field Encoding <anything>Bit 3: DataSetMessageSequenceNumberenabled = 1 Bit 4: Statusenabled = 1 Bit 5: ConfigurationVersionMajorVersionenabled = 0 Bit 6: ConfigurationVersionMinorVersionenabled = 1 Bit 7: DataSetFlags2enabled = 1 |
DataSetFlags2 |
Byte |
Bit range 0-3: UADP DataSetMessagetype <anything> Bit 4: Timestampenabled = 1 Bit 5: PicoSecondsenabled = 0 (not included in the DataSetMessageheader) |
DataSetMessageSequenceNumber |
UInt16 |
Defined by Table 142. |
Timestamp |
UtcTime |
Defined by Table 142. |
StatusCode |
UInt16 |
Defined by Table 142. |
MinorVersion |
VersionTime |
Defined by Table 142. |
Table A.12defines the values for the configuration parameters representing this layout.
Table A.12– Values for configuration parameters
Parameter |
Value |
UadpDataSetMessageContentMask |
0x00000035
This value results of the following options: Bit 0: Timestampenabled = 1 Bit 2: Status enabled = 1 Bit 4: MinorVersion enabled = 1 Bit 5: SequenceNumber enabled = 1 |
DataSetFieldContentMask |
<anything> |
Figure A.11shows an example for a UADP NetworkMessagewith dynamic layout. As defined in A.3.3and A.3.7only the layout of the NetworkMessageheader and the DataSetMessageheader is fixed. The number, the type, the length, and the order of DataSetMessagescan vary from one NetworkMessage to the next.
Figure A.11– Example for dynamic message layout without security