TheThingsArchive / ttn

The Things Network Stack V2
https://www.thethingsnetwork.org
MIT License
461 stars 279 forks source link

Warning text for "reset frame counters" is incorrect #745

Closed avbentem closed 3 years ago

avbentem commented 5 years ago

This is a bug report for the console.

What do you want to do?

When I reset the frame counters I want to understand that really bad things can happen.

What steps did you take?

Click "Reset frame counters" in TTN Console.

What went wrong or what is missing?

As per (my own) #626 the warning/help says, emphasis mine:

Are you sure you want to reset the frame counters?

⚠️After resetting the frame counters, any uplink counter the device sends will work. However, the first downlink sent to the device will have a zero frame counter. This implies that the downlink counter in the device needs to be reset as well.

However, "any uplink counter the device sends will work" is false:

So, for large values of a 32 bits FCnt, resetting the frame counters might also require resetting the uplink counter of the device. I suggest to make the warning message far more scary. Maybe:

You should only reset the frame counters if you are sure that the device's counters have been reset as well. When the device is not reset, the device's messages will be rejected if its current uplink counter is much larger than zero. Also, the first downlink sent to the device will have a zero frame counter. This implies that the downlink counter in the device needs to be reset as well.

Asides:

Do you have Screenshots?

image

What kind of OS/Browser/Gateway are you using? Which version?

N/A.

What are the IDs and EUIs of your Device/Gateway? (if applicable)

N/A.

What do your configuration files look like?

N/A.

What do your log files look like?

N/A.

Can you fix this yourself and submit a pull request?

No.

johanstokking commented 5 years ago

CC @kschiffer @bafonins

htdvisser commented 5 years ago

I don't think the v3 console should just copy the "reset frame counters" functionality in its current form. Instead it should have functionality to inform the network server about what's actually going on: an ABP device device completely lost its state. This state is more than just frame counters, as the device also lost its MAC state and radio parameters.

879 [...] The frame counters (both uplink & downlink) SHALL NEVER be reset in ABP
880 devices.

Considering that frame counter resets are forbidden in LoRaWAN 1.1 (and were already highly discouraged in LoRaWAN pre-1.1), I propose that we call this functionality simply a "device reset". This will completely reset the device to its initial state. For ABP devices this means destroying all session information, for OTAA devices this should destroy join nonces as well.

The UI should indicate that doing this is (A) not spec-compliant (B) not secure and (C) requires the device to be reset to factory state (if it didn't already do that by itself).

cc: @rvolosatovs

rvolosatovs commented 5 years ago

Indeed, "device reset"/"factory reset" functionality would make more sense here IMO, however I believe that would just be a shortcut to simply deleting the device and re-creating it.

hiyasbie commented 4 years ago

Hello, I have the same problem as this. I clicked reset frame counters and now I can't see data from my node/device in my TTN console. How to solve this? thank you. by device/factory reset, meaning click the reset button(next to LED) from lopy4?.. thanks. (newbie here)

johanstokking commented 4 years ago

@hiyasbie this is too specific to the device and the software to answer this here. Please consult the forums; https://www.thethingsnetwork.org/forum

htdvisser commented 3 years ago

This is not going to get fixed in V2 anymore.