4 - Implementing Adaptive Data Rate

Adaptive Data Rate (ADR) describes the scheme whereby the network server controls the data rate, RF transmit power, and channels an end device uses when sending uplinks, as well as the number of retransmissions made.

The network server uses the Received Signal Strength Indicator (RSSI) of the messages received from the end device to determine how close the end device is to the nearest gateway(s). This allows the network server to select the most appropriate settings for each end device.

The benefits of ADR are that it helps preserve the battery life of an end device and reduces interference, giving all end devices on the network the best chance of communicating successfully.

Processing LinkADRReq MAC Command

Interpret LinkADRReq and Validate Requests

This section describes how to validate each field in the LinkADRReq and decide whether or not to apply the changes requested.

If the end device is currently implementing ADR and passed the ADR bit in the previous uplink, it must work through all the following steps, and will either accept or reject the entire command.

If the end device is not currently implementing ADR, it must only process the Channel Mask updates described at the end of this section and will only accept the Channel Mask portion of the command.

Convert and Validate Data Rate Updates

Warning

When the end device is not implementing ADR, and not passing the ACK bit in uplinks, only the Channel Mask update in the LinkADRReq should be processed. The data rate updates described here must be ignored. In subsequent sections, consider the value of REQUESTED_DATA_RATE to be the current data rate the end device is using.

The Data Rate configuration (DataRate) is found in the Requested Data Rate and TX Output Power (DataRate_TXPower) field of the Link ADR Request MAC command (LinkADRReq). If there are multiple LinkADRReq commands present in the downlink frame, retrieve the data rate from the final LinkADRReq in the sequence. When converted to decimal, this will be a number between 0 and 15.

To determine the appropriate data rate for an end device, follow these steps:

  • If the data rate decimal is between 0 and 14, the exact data rate to use depends on the region the end device will operate in. Find the mapping for a given region in the ‘Data Rate and End-device Output Power encoding’ subsection for the region in Section 2 of the RP002-1.0.4 LoRaWAN® Regional Parameters specification.

  • If the data rate decimal is 15 (0xF), the end device should continue to use the data rate it is currently using.

The determined data rate to be used will be referred to in subsequent steps as REQUESTED_DATA_RATE.

The REQUESTED_DATA_RATE value should be validated against any channel mask updates, as described in the ‘Validating Channel Mask Updates’ section below.

Convert and Validate TX Power Updates

Warning

When the end device is not implementing ADR, and not passing the ACK bit in uplinks, only the Channel Mask update in the LinkADRReq should be processed. The TX output power updates described here must be ignored. In subsequent sections, consider the value of REQUESTED_TX_POWER to be the current EIRP the end device is using.

The TX output power configuration (TXPower) is found in the Requested Data Rate and TX Output Power (DataRate_TXPower) field of the Link ADR Request MAC Command (LinkADRReq). If there are multiple LinkADRReq commands in the downlink frame, retrieve the TX Power from the final LinkADRReq in the sequence. When converted to decimal, this will be a number between 0 and 15.

If the TX output power decimal is 0-14, the Equivalent Isotropically Radiated Power (EIRP) to use depends on the region the end device will operate in. Find the mapping for any given region in the ‘Data Rate and End-device Output Power encoding’ subsection for the region in Section 2 of the RP002-1.0.4 LoRaWAN Regional Parameters specification. This value is referred to as the REQUESTED_TX_POWER hereon and in subsequent steps.

The device must validate if it can use the corresponding REQUESTED_TX_POWER, and potentially alter it, as follows:

  • If the REQUESTED_TX_POWER is a lower EIRP than the end device can operate then the end device must instead continue to use the EIRP it is currently using and cannot accept any part of this request. The end device must not make any of the changes described in next section Apply Changes and then must respond with the LinkADRAns command with the PowerACK and all other status bits set to 0 and reject the command, as described in section Respond with LinkADRAns.

  • If the REQUESTED_TX_POWER is a higher EIRP than the end device can operate, then the REQUESTED_TX_POWER should be set to the highest EIRP the end device can operate.

If the TX output power decimal is 15 (0xF), then the REQUESTED_TX_POWER should be set to the EIRP the end device is currently using.

The REQUESTED_TX_POWER EIRP value derived from the request following these rules will next be validated against any channel mask updates, as described in the Validating Channel Mask Updates section below.

Retrieve NBTrans Updates

Warning

When the end device is not implementing ADR, and not passing the ACK bit in uplinks, only the Channel Mask update in the LinkADRReq should be processed. The NBTrans updates described here must be ignored.

The Number of Transmissions per Uplink Frame (NBTrans) field is found in the Redundancy field of the Link ADR Request MAC command (LinkADRReq). If there are multiple LinkADRReq commands present in the downlink frame, retrieve the NBTrans field from the final LinkADRReq in the sequence. When converted to decimal, the NBTrans field will be a number between 0 and 15.

The NBTrans field tells the end device how many transmissions can be made for each uplink frame. This setting is used by the network server to increase and decrease the number of retransmissions, to control both network traffic and redundancy.

The mapping for the NBTrans field is as follows:

  • 0: use the default value of NBTrans, which is 1.

  • 1-15: use the value set, so for 1, send one transmission, for 2, send two transmissions, up to 15.

The value retrieved from the NBTrans field is referred to as NB_TRANS in subsequent steps.

Convert and Validate Channel Mask Updates

The channel mask updates should be processed, even if the end device is not currently implementing ADR.

The Channel Mask Control (ChMaskCntl) is found in the Redundancy field of the Link ADR Request MAC command (LinkADRReq). If there are multiple LinkADRReq commands within the downlink frame, process them all sequentially, as described in Section 5.2 ‘Link Check Commands (LinkCheckReq, LinkCheckAns)’ (page 31) of the TS001-1.0.4 LoRaWAN® L2 1.0.4 Specification.

The meaning of the Channel Mask Control field differs depending on the region in which the end device will operate. Find the guidance for any given region in the ‘LinkAdrReq command’ subsection for the region in Section 2 of the RP002-1.0.4 LoRaWAN Regional Parameters specification.

The Channel Mask (ChMask) is found in the ChMask field of the LinkADRReq command. The Channel Mask Control defines how the Channel Mask is to be interpreted. The Channel Mask field is a bitmask that defines which of the channels identified by the Channel Mask Control are to be used for sending uplinks. The usable channels are indicated by “1”. A bit set to 0 means the channel must not be used. Bit 0 is used to identify channel 1, and bit 15 is used to identify channel 16. If the bit mask is 1000 0000 0000 0001 then only Channel 1 and Channel 16 may be used.

If the Channel Mask Control and Channel Mask values result in all channels being disabled, or enable an undefined channel, then none of the requested changes in the command must be applied and the end device must respond with the LinkADRAns command with the ChannelMaskACK, and all other status bits set to 0, as described in section Respond with LinkADRAns.

Next, the end device must check if the channels requested are compatible with the REQUESTED_DATA_RATE and REQUESTED_TX_POWER values calculated in the previous sections. If any of the channels are not compatible, then none of the requested changes in the command must be applied and the end device must respond with the LinkADRAns command with the ChannelMaskACK, and all other status bits set to 0, as described in section Respond with LinkADRAns.

Note

As a reminder, REQUESTED_DATA_RATE is one of the following:

  • The existing data rate in use by the end device, if the end device is not implementing ADR, or the LinkADRReq DataRate field is set to decimal 15.

  • The data rate derived from the LinkADRReq DataRate field if the end device is implementing ADR.

REQUESTED_TX_POWER is one of the following:

  • The existing EIRP in use by the end device, if the end device is not implementing ADR, or the LinkADRReq TXPower field is set to decimal 15.

  • The EIRP derived from the LinkADRReq TXPower field if the device can use it.

  • The highest possible EIRP the device can use if the requested EIRP is too high.

If all the validation checks pass, the channels identified in REQUESTED_CHANNELS must be activated, as described in the section Apply Changes.