TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
932 stars 301 forks source link

Handle MAC command rejections #2192

Closed rvolosatovs closed 3 years ago

rvolosatovs commented 4 years ago

Summary

Network Server should handle MAC command rejections.

Why do we need this?

To avoid endlessly rescheduling the same MAC commands over and over again

What is already there? What do you see now?

After receiving a rejection, Network Server just retries

What is missing? What do you want to see?

Record MAC command failures and avoid rescheduling MAC commands we know are going to fail. This data is to be stored per-MAC state.

How do you propose to implement this?

Record the rejections in MAC state and handle accordingly when scheduling. E.g. for LinkADR, if TxPowerIndex value is NACKed, record that and never attempt to send that value again. Probably it's best to have a field per-rejection in MAC state. For TxPowerIndex that would be repeated uint32 RejectedTxPowerIndexes.

Can you do this yourself and submit a Pull Request?

yes

rvolosatovs commented 4 years ago

Note, that in most cases a MAC command rejection indicate misconfiguration of the device(e.g. using PHY 1.0.2-b instead of PHY 1.0.2-a)

rvolosatovs commented 4 years ago

Partially implemented in https://github.com/TheThingsNetwork/lorawan-stack/pull/2401

rvolosatovs commented 3 years ago

This must be fixed before we make the next release, such that we can enable Sentry

rvolosatovs commented 3 years ago

Setting prio/high, since this affects customers