Closed johanstokking closed 2 years ago
I updated the original comment; we should assume that dwell time is activated in this band and version, but it should be possible to disable it explicitly via a new field in MAC settings. This is because the boot value is undefined in this band and version (which is fortunately fixed in RP2).
@NicolasMrad let's triage this based on @adriansmares assessment.
725
That is since 1.0.3. The behavior in this issue applies specifically to 1.0.2 Rev. B, where the end device's boot parameters in AS923 aren't defined.
TxParamSetupReq
to deactivate downlink dwell time while it was already deactivated.This issue and #725 can probably be resolved in one go, once the MAC state reset configure the current parameters correctly. In case of 1.0.2 Rev. B, downlink dwell time should be activated (unless overridden via MAC settings), while in 1.0.3 and higher it should be deactivated.
Doesn't look like this is going to get finished for v3.17.0, so pushing to v3.17.1.
Summary
Maximum downlink payload size is exceeded when the end device has dwell time enabled, but the Network Server's frequency plan does not.
Steps to Reproduce
AS_920_923_TTN_AU
(dwell time is deactivated)What do you see now?
That downlink message can be too long for the end device, which assumes that dwell time is activated. Consequently, the end device may reject the downlink, leading to an invalid state and potential loss of the downlink path.
For instance, it may carry FOpts
06 07 07 a0 af 8c 50 03 31 ff 00 01 09 05
, i.e.TxParamSetupReq
,DevStatusReq
,LinkADRReq
andNewChannelReq
. ThisTxParamSetupReq
deactivates dwell time, but this downlink frame is discarded.What do you want to see instead?
Network Server should not exceed the maximum payload size for downlink, even when dwell time is deactivated in the frequency plan, because it may still be activated in the end device.
In RP1 1.0.2 Rev. B band AS923, there is no default value specified for end device boot parameters. This means that NS cannot assume that dwell time is activated or not when the device joins. Wrongly using dwell time activated breaks the RX1 DR offset; wrongly using dwell time deactivated breaks the maximum payload size.
Environment
TTS 3.16.1, AS923 band, AS_920_923_TTN_AU frequency plan, LoRaWAN 1.0.2, RP1 1.0.2 rev. B.
How do you propose to implement this?
NS always considers the dwell time setting from the frequency plan: https://github.com/TheThingsNetwork/lorawan-stack/blob/v3.16/pkg/networkserver/downlink.go#L1243
To support AS923 RP1 1.0.2 Rev. B end devices with dwell time activated and deactivated on boot, we need a new
MACSettings
field (BoolValue
). This should take precedence when configuring current parameters on MAC state reset.Since LoRaMac-node has dwell time activated in this band and version, NS should assume that dwell time is activated when the new MAC settings field is not set and false.
In short:
BoolValue {uplink,downlink}_dwell_time
toMACSettings
true
for RP1 1.0.2 Rev. B band AS923. It should be commented that the assumed value comes from LoRaMac-nodeHow do you propose to test this?
Unit testing
Can you do this yourself and submit a Pull Request?
Can review