The Field Length (L1, L2, ...) is the length of the Field Data (excluding Field Identifier and Field Length bytes).
The following fields are defined:
Table 13 - Event message format - Fields
Field number |
Description |
0x00 |
Event field |
0x01 |
Time event field |
0x02 |
Time message field |
0x80 |
Link field: IP Address |
0x81 |
Link field: IP Port |
0x82 |
Link field: URL |
0x83 |
Link field: Filename |
Field numbers above 0x80 provide a link to out-of-band additional information, like for example:
pictures accompanying the event (IP address and port number, filename);
audio or video streams
that are transmitted via a secondary channel. Note that the time fields can also be used to match events with the accompanying data.
These fields are explained in the next subclauses.
Event field
SPT: Mandatory
RCT: Mandatory
Table 14 - Event field
Relative Byte Index |
Bytes |
Description |
0 |
1 |
Protocol Identifier: (See Annex В for definition and message layout) |
1 |
L |
Event data, for example: <SIA Account BlockxSIA Event BlockxSIA ASCII Block> |
Time event field
SPT: Optional
RCT: Mandatory
Table 15-Time event field
Relative Byte Index |
Bytes |
Description |
0 |
8 |
Time format according to RFC958 (NTP) / RFC4330 (SNTP V4) |
This field holds the timestamp on which the event occurred.
Time format is a 64 bit integer as described in RFC958 (NTP) / RFC4330 (SNTP V4), allowing easy local synchronization. Note that NTP basically uses a 32 bit counter of seconds since 1.January. 1900, so a wrap-around will occur in 2036. Due to a 136 years “precision” in guessing the correct date (either 1900, 2036, 2172, ..) suffices to re-sync for the next 136 years. This should be easily handled by the devices, but shall be taken care by a special test-case during compliance test.
This approach is independent from daylight-saving zones and independent from time-zones, as NTP returns time based on UTC, so cross-country evaluations will be easier. Such local time adoptions against UTC (e g. displaying time / entering time in human readable format) are thus left to the enddevices.
Time message field
SPT: Optional
RCT: Mandatory
Table 16 - Time message field
Relative Byte Index |
Bytes |
Description |
0 |
8 |
Time format according to RFC958 (NTP) / RFC4330 (SNTP V4) |
This field holds the timestamp on which the event message is transmitted by the SPT.
This value is to be used for life-time checking of the datagrams, i.e. harden the protocol against attackers in the sense that a datagram is accepted as being valid only if it arrived at the communication partner’s end within a reasonable time (e.g. 51 h).
In addition, the difference Time event - Time message values give rises to check whether the alarm system fulfils the over-all maximum round-trip-delay times.
Link field - IP Address
SPT: Optional
RCT: Optional
Table 17 - Link field - IP Address
Relative Byte Index |
Bytes |
Description |
0 |
L |
IP Address: L=4 -> IPv4 address L=32 -> IPv6 address |
Defines the IP Address to which the additional info will be sent to.
Link field - IP Port number
SPT: Optional
RCT: Optional
Table 18 - Link field - IP Port number
Relative Byte Index |
Bytes I Description |
0 |
2 I Port number |
Defines the port number to which the additional info will be sent to.
Link field - URL
SPT: Optional
RCT: Optional
Table 19-Link field - URL
і Relative Byte Index |
і Bytes |
Description |
!0 |
I L |
URL |
Defines the URL to which the additional info will be sent to.
Link field - Filename
SPT: Optional
RCT: Optional
Table 20 - Link field - Filename
Relative Byte Index |
Bytes |
Description |
- |
0 |
L |
Filename |
The filename can be used for example to identify files uploaded to a TFTP server.
Event response format
The Event response message has the following format:
RCT -» SPT
Table 21 - Event response message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Result code a |
HL + 1 |
|
Padding |
|
|
Hash |
a Result code can be: RESP_ACKNOWLEDGE RESP_NEGATIVE_ACKNOWLEDGE RESP_EVENT_RCT_COULD_NOT_PROCESS_MESSAGE RESP_EVENT_PROTOCOL_ID_NOT_SUPPORTED RESP_EVENT_ACKNOWLEDGE_UNKNOWN_FIELD. |
In case the SPT includes optional fields in the event message that are not supported by the RCT, the event will still be acknowledged, but with a RESP_ACKNOWLEDGE_UNKNOWN_FIELD. This is a valid acknowledge, there is no need to resend the event.Configuration messages
General
This clause describes the contents of the configuration messages. For the message flow and further explanation see Clause 7.
The configuration messages are used for both commissioning methods (DTLS and ‘out-of-band’), as the messaging protocol needs the same parameters independently of how the connection was established.
Most configurable parameters are unique in the SPT for each RCT it reports to, e g.
Connection handle;
Device ID;
Encryption selection;
Session key;
Hash;
Path supervision.
In case the SPT reports to 2 RCTs, there will be 2 instances of each parameter, one for each connected RCT.
In case in the SPT the parameters of the RCT to which it shall connect are changed (e.g. change to another RCT), the SPT shall request new ones.
Other parameters (e.g. Time) are one value only that is used by the SPT for all RCTs it reports to.
Connection handle request
The Connection handle request message has the following format:
SPT -» RCT
Table 22 - Connection handle request message format
I Byte Index |
Bytes |
Description |
і 0 |
HL |
Header, Message ID and Message Length |
I HL |
|
Padding |
|
|
Hash |
This message is issued by the SPT to request a Connection handle, which is a random number. The Connection handle is created by the RCT instead of the SPT, as it has to be unique at the RCT, and the random generator of the RCT is usually of much better quality than the one of the SPTs. Both SPT and RCT use the same Connection handle.
In case the connection is broken, a next session will have a newly generated (different) Connection handle.
Connection handle response
The Connection handle response message has the following format:
Table 23 - Connection handle response message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Result code |
HL + 1 |
2 |
Connection handle |
HL + 2 |
|
Padding |
|
|
Hash |
This message itself and previous messages have a Connection handle with the value 0. The next message will be the first one with a valid Connection handle field.
Device ID request
The Device ID request message has the following format:
SPT RCT
Table 24 - Device ID request message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Flags |
HL + 1 |
16 |
Device ID |
HL+ 17 |
|
Padding |
|
|
Hash |
This message is issued by the SPT to request a Device ID.
The following applies to allow for 2nd channel commissioning:
when the Direction and Device ID flags are set, the SPT requests the RCT Device ID, and stores this RCT Device ID as received in the reply message in NVM;
when the Direction and Device ID flags are cleared, the SPT pushes its own Device ID to the RCT.
Table 25 - Device ID request flags
Bit |
Description |
0 |
Direction 0: Device ID push 1: Device ID request |
1 |
Device ID 0: SPT Device ID 1: RCT Device ID |
2..7 |
Unused |
Device ID response
The Device ID response message has the following format:Table 26 - Device ID response message format
Byte Index |
Bytes |
I Description |
0 |
HL |
і Header, Message ID and Message Length |
HL |
1 |
і Result code |
HL + 1 |
1 |
I Flags |
HL + 2 |
16 |
! Device ID |
HL + 18 |
I Padding |
|
|
I Hash і |
The next message will be the first one with a valid Device ID field in the message header.
Encryption selection request
The Encryption selection request message has the following format:
SPT ROT
Table 27 - Encryption selection request message format
Byte Index |
Bytes |
r ' ' ' ' ' ' Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Flags |
HL+ 1 |
1 |
Encryption 1 |
HL + 2 |
1 |
Encryption 2 (Optional) ... etc ... |
|
|
Padding |
|
|
Hash |
This message is issued during commissioning by the SPT to indicate the encryption methods it supports. See 5.5 for possible encryption methods.
Table 28 - ‘Master Encryption Selection request’ flag
Bit |
Description Encryption Selection |
0 |
0: Session Encryption Selection Request 1: Master Encryption Selection Request |
1..7 |
Unused |
Encryption selection response
The Encryption selection response message has the following format:
RCT -» SPTTable 29 - Encryption selection response message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Flags |
HL + 1 |
1 |
Result code |
HL + 2 |
1 |
Encryption method to be used |
HL + 3 |
|
Padding |
|
Hash |
The Flags field holds the value 0.
Encryption key exchange request
The Encryption key exchange request message has the following format:
SPT <- -» RCT
Table 30 - Encryption key exchange request message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Flags |
HL + 1 |
L |
Encryption key (typically 128 or 256 bits -> 16 or 32 bytes) |
HL + 1 + L |
|
Padding |
|
|
Hash |
Table 31 - ‘Master Key request’ flag
Bit |
Description |
0 |
Direction 0: Key Push (RCT) 1: Key Request (SPT) |
1 |
Key Request 0: Session Key 1: Master Key |
2..7 |
Unused |
This message is issued to request an encryption key update. Both SPT and RCT can request an encryption key update. When 'Direction' flag is set (request) the Encryption key field is 0. The ‘Key Request’ flag is used only during the commission phase to exchange the new master key.
New keys are created by the RCT instead of the SPT, as they shall be generated using a cryptographically strong random number generator, and the random number generator of the RCT is usually of much better quality than the one of the SPTs.
The RCT can push a new session key to the SPT by clearing the ‘Direction’ flag. The new key is in the ‘Encryption key’ field. The SPT will then acknowledge by replying back this key in the Encryption key exchange response message.
Encryption key exchange response
The Encryption key exchange response message has the following format:
SPT RCT
Table 32 - Encryption key exchange response message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Result code |
HL + 1 |
1 |
Flags |
HL + 2 |
L |
Encryption key (typically 128 or 256 bits -> 16 or 32 bytes) |
HL + 2 + L |
|
Padding |
|
|
Hash |
The new key will become effective immediately, e.g. the next message is encrypted using the new key (in case ‘Encryption selection’ > 0). To overcome transmission errors the RCT shall keep the previous key until a next message has successfully been received, as backup.
Hash selection request
The Hash selection request message has the following format:
SPT RCT
Table 33 - Hash selection request message format
Byte Index |
Bytes |
Description |
0 |
HL |
Header, Message ID and Message Length |
HL |
1 |
Hash 1 |
HL + 1 |
1 |
Hash 2 (Optional)... etc.... |
|
|
Padding |
|
|
Hash |
This message is issued during commissioning by the SPT to indicate the Hash functions it supports. See 5.4 for possible hash functions.
Hash selection response
The Hash selection response message has the following format:
RCT -» SPT
Table 34 - Hash selection response message format
Byte Index 0 |
Bytes HL |
Description Header, Message ID and Message Length |
HL |
1 |
Result code |
HL+ 1 |
1 |
Hash to be used |
HL + 2 |
|
Padding |
|
|
Hash |