Protocol

This page describes the Relay encapsulated payload that is used for relaying uplink and downlink transmissions.

Stored context

This section describes which context must be known at the different components in the Mesh architecture. Unless otherwise specified, this context must be known at both the Relay Gateway and Border Gateway.

Signing key

An AES128 key which is used to add a message integrity code to each mesh packet. Each Relay and Border gateway must be configured with this same key in order to sign and validate all mesh packets.

TX Power table

A TX Power table, which maps the (downlink) TX Power to an integer (0 - 15) and back. Ideally this matches the TX Power table of the Concentratord configuration (if there is no exact match, the Concentratord will use the highest value, that is less than the requested TX Power).

Data-rate table

A data-rate table, which maps the data-rate parameters to an integer value (and back). There is no requirement that this follows the data-rate indices as specified in RP002.

An uplink channel table, which maps an uplink channel to an integer value (and back). There is no requirement that this follows the channel indices as specified in RP002.

The Relay Gateway stores a list of Uplink IDs (integer value) mapped to data required to transmit a downlink. Typically the Uplink ID maps to the concentrator counter value of the received uplink. On Class-A downlink to the same device, the Relay Gateway will receive the Uplink ID + a relative delay to the Uplink ID.

On receiving an uplink, the Relay creates and re-transmits a Relay encapsulated LoRaWAN payload. The Relay encapsulation overhead is 14 bytes.

Bytes:

1 byte5 bytes4 bytesn bytes4 bytes
Uplink MHDRUplink MetadataRelay IDLoRaWAN PHYPayloadMIC

Bits:

7..54..32..0
MTypePayload typeHop count
  • MType = 111 (= Proprietary LoRaWAN MType)
  • Payload type = 00 (= Relayed uplink)
  • Hop count = 000 = 1, ... 111 = 8

Note: The hop count is incremented each time the uplink payload is relayed by an other Relay Gateway. As this changes the uplink payload, the MIC must be re-calculated.

Bytes:

2 bytes1 byte1 byte1 byte
Uplink ID + Data-rateRSSISNRChannel

Bits:

15..43..0
Uplink IDData-rate

Unique identifier (to the Relay Gateway) identifying the received uplink. Internally the Relay Gateway must temporarily store this in the Uplink table.

Data-rate

Uplink data-rate, unsigned integer with a minimum value of 0 and a maximum value of 15.

RSSI

Encoded as RSSIdBm = -1 x RSSI

SNR

Bits:

7..65..0
RFUSNR

SNR is a signed integer with a minimum value of -32 and a maximum value of 31.

Channel

Uplink channel, unsigned integer.

Relay ID

This contains the Relay ID which received the uplink from the End Device.

Bytes:

4 bytes
Relay ID

LoRaWAN PHYPayload

The received LoRaWAN PHYPayload.

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 uplink payload (- MIC bytes), and using the first 4 bytes of the calculated CMAC as MIC.

On downlink, the Border Gateway creates and re-transmits a Relay encapsulated to the Relay Gateway in the following format. The Relay encapsulation overhead is 15 bytes.

Bytes:

1 byte6 bytes4 bytesn bytes4 bytes
Downlink MHDRDownlink MetadataRelay IDLoRaWAN PHYPayloadMIC

Bits:

7..54..32..0
MTypePayload typeHop count
  • MType = 111 (= Proprietary LoRaWAN MType)
  • Payload type = 01 (Relayed downlink)
  • Hop count = 000

Note: The hop count is incremented each time the downlink payload is relayed by an other Relay Gateway. As this changes the downlink payload, the MIC must be re-calculated.

Bytes:

2 bytes3 bytes1 byte
Uplink ID + Downlink data-rateDownlink FrequencyDelay + TX Power

Bits:

15..43..0
Uplink IDDownlink data-rate

Unique identifier (to the Relay Gateway) identifying the uplink to which this downlink relates. E.g. the Relay Gateway uses this to retrieve the uplink counter value.

Data-rate

Downlink data-rate, unsigned integer with a minimum value of 0 and a maximum value of 15.

Encoded as FrequencyHz = Downlink Frequency x 100.

Delay + TX Power

Bits:

7..43..0
TX PowerDelay
TX Power

The TX Power which must be used for sending the downlink.

Delay

The relative delay in seconds to the Uplink ID which must be used for the downlink transmission. Delay is an unsigned integer, encoded as:

DelaySeconds = Delay + 1.

Relay ID

This contains the Relay ID that must relay the downlink to the End Device using the provided Downlink metadata.

LoRaWAN PHYPayload

The LoRaWAN PHYPayload that must be sent to the End-Device.

MIC

Message integrity code, used by other Relay gateways to check the data integrity of the packet. This is obtained by calculating the CMAC over the downlink payload (- MIC bytes), and using the first 4 bytes of the calculated CMAC as MIC.

Relay heartbeat format

Periodically, each Relay Gateway will send a heartbeat message to indicate that that it is still online. Each Relay Gateway relaying this heartbeat payload will add its own Relay ID to the path, such that after the Border Gateway has receive the payload, the full path from sending Relay Gateway to Border Gateway can be obtained. The maximum payload size (with hop count = 8) is 55 bytes.

Bytes:

1 byte4 bytes4 bytes0 - 28 bytes4 bytes
Heartbeat MHDRTimestampRelay IDRelay path (repeated)MIC

Heartbeat MHDR

Bits:

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

Note: The hop count is incremented each time the heartbeat payload is relayed by an other Relay Gateway. As this changes the heartbeat payload, the MIC must be re-calculated.

Timestamp

Unix timestamp (seconds).

Relay ID

The Relay ID of the Relay Gateway sending the heartbeat message.

Relay path

Bytes (repeated):

4 bytes1 byte1 byte
Relay IDRSSISNR

Each Relay Gateway relaying the heartbeat payload adds its Relay ID, and the RSSI and SNR of the received heartbeat payload to the end of the Relay path field. Initially this field is empty. If the heartbeat payload is not relayed by any other Relay Gateway, then this field remains empty.

MIC

Message integrity code, used by other Relay gateways to check the data integrity of the packet. This is obtained by calculating the CMAC over the heartbeat payload (- MIC bytes), and using the first 4 bytes of the calculated CMAC as MIC.