lorabasics / basicstation

LoRa Basics™ Station - The LoRaWAN Gateway Software
https://doc.sm.tc/station
Other
359 stars 183 forks source link

Data buffering and catchup #115

Open jpmeijers opened 3 years ago

jpmeijers commented 3 years ago

There are many situations in which a gateway can lose connectivity from the network server. During these times all packets that are received by the gateway is lost. I have a clear description of such a scenario in this forum post: https://www.thethingsnetwork.org/forum/t/discussion-recover-data-after-network-outage/49559/3

As stated there, buffering packets and sending them to the network server at a later stage can cause mac state corruption, or even be dropped because of packets arriving out of sequence.

Looking at all the suggestions and workarounds, my suggestion would be to have two channels of data that flows between Basic Station and the Network Server:

  1. Channel for live packets. As they are received they are sent to the network server. These packets contribute metadata to keep the mac state updated. These packets are checked for being in sequence.
  2. Channel for buffered data. This data only contributes payload data. It does not affect the mac state and also does not get checked for being in sequence.

Because the connection between the gateway and the network server is secure, all data from it can be trusted. That also includes packets that are out of sequence or which are delayed. We need to think about the possible attack vectors for replay attacks that are introduced with such a second channel.

A second channel for buffered/outdated packets will however solve the scenarios described in my post above, as well as the issues faced by satellite networks: https://github.com/TheThingsNetwork/lorawan-stack/issues/2708

smtc-bot commented 2 years ago

Thank you for your inquiry.

Customers are encouraged to submit technical questions via our dedicated support portal at https://semtech.force.com/ldp/ldp_support.

We invite all users to visit the LoRa Developer Portal Forum at https://forum.lora-developers.semtech.com and to join the thriving LoRa development community!