Relay command payload

The Relay command payload allows for executing one or multiple (pre-configured) commands on the gateway. The command payloads are encoded as TLV (like the event payloads), such that the command payloads can contain data for known and unknown (proprietary) command types.

Bytes:

1 byte4 bytes4 bytesn bytes4 bytes
Command MHDRTimestampRelay IDTLV payload (encrypted)MIC

Command MHDR

Bits:

7..54..32..0
MTypePayload typeHop count
  • MType = 111 (= Proprietary LoRaWAN MType)
  • Payload type = 11 (= Relay command)
  • Hop count = 000 = 1, ... 111 = 8

Note: The hop count is incremented each time the command payload is relayed by an other Relay Gateway. The MIC must be re-calculated on each relay.

Timestamp

Unix timestamp (seconds).

Relay ID

The Relay ID of the Relay Gateway that must execute the command(s).

TLV payload

Bytes:

1 byte1 byten bytes
TypeLengthPayload

Please see the TLV payloads page for the known payload types.

Encryption

The TLV payload is encrypted using the same encryption scheme as the LoRaWAN FrmPayload (see section 4.3.3 of the LoRaWAN 1.0.4 specs). For the encryption the block Ai is defined as follow:

Octets:

1414411
0x014 x 0x000x01Relay IDTimestamp0x00i

MIC

Message integrity code, used by other Relay and Border gateways to check the data integrity of the packet. This is obtained by calculating the CMAC over the command payload (- MIC bytes), and using the first 4 bytes of the calculated CMAC as MIC. Note: The MIC must be calculated after encrypting the TLV payload!