brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.48k stars 545 forks source link

Add ignore_frequency_for_deduplication setting as a stopgap #583

Closed danieroux closed 2 years ago

danieroux commented 2 years ago

For current data loss being experienced by us.

It defaults to false. If set to true, it will ignore the frequency on which the packets come in from the gateways. This allows a ghost packet to be gracefully collected as Just Another Packet to de-duplicate with.

Without this setting a ghost package gets in and overrides an established dev_addr. Leading to data being lost until the next JOIN request, with the edge device unaware that it has lost its JOIN status.

We have not been able to trace where the ghost JOINs come from. This stops those from being a problem for now.

brocaar commented 2 years ago

Thanks for taking the time to implement this workaround. However if possible, I would like to avoid merging workarounds. After digging a bit deeper in this, I might have found where the original issue comes from. As the device was not locked in the OTAA flow, there was a race-condition during which the same dev-nonce was accepted. This is fixed by the above commit. I have confirmed locally that when put the device antenna close to my gateway, that while two OTAA requests are received (1 + 1 ghost), only one is handled.

brocaar commented 2 years ago

Thanks for taking the time to implement this workaround. However if possible, I would like to avoid merging workarounds. After digging a bit deeper in this, I might have found where the original issue comes from. As the device was not locked in the OTAA flow, there was a race-condition during which the same dev-nonce was accepted. This is fixed by the above commit. I have confirmed locally that when put the device antenna close to my gateway, that while two OTAA requests are received (1 + 1 ghost), only one is handled.

brocaar commented 2 years ago

Talking about ghost uplinks, GitHub posted my comment twice ;-)