TheThingsNetwork / lorawan-stack

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

LoRaWAN v1.1 ABP: FNwkSIntKey incorrectly listed as NwkSKey on console Overview #7006

Closed StevenCellist closed 3 months ago

StevenCellist commented 3 months ago

Summary

For LoRaWAN v1.1 devices registered in ABP mode, the SNwkSIntKey name in the device Overview tabs appears to be incorrect. As shown in this scheme, there should be SNwkSIntKey, FNwkSIntKey, NwkSEncKey and AppSKey. These are correctly listed on the tab General settings, under Network layer and Application layer. However, the Overview tab shows the NwkSKey instead of the SNwkSIntKey. The value of NwkSKey listed does align with the SNwkSIntKey under Network layer.

Steps to Reproduce

  1. Register device as LW v1.1 in ABP mode
  2. Open Overview tab
  3. Open General settings > Network layer
  4. Compare values and names of keys

Current Result

SNwkSIntKey is listed as NwkSKey

Expected Result

NwkSKey should be renamed to SNwkSIntKey

Relevant Logs

No response

URL

No response

Deployment

The Things Stack Community Edition

The Things Stack Version

3.29.1

Client Name and Version

No response

Other Information

No response

Proposed Fix

No response

Contributing

Code of Conduct

KrishnaIyer commented 3 months ago
Screenshot 2024-03-26 at 10 56 15 Screenshot 2024-03-26 at 10 46 50

NwkSKey should be renamed to SNwkSIntKey

What is the basis for that?

NwkSKey value is not defined in LW1.1.x. In LW1.0.x, the NwkSKey is responsible for both encryption and integrity (MIC checks) whereas in LW 1.1.x, these are split into three separate keys ( SNwkSIntKey, NwkSEncKey andFNwkSIntKey with the latter related to roaming).

The NwkSKey value that's being displayed on the console for LW 1.1.x is actually the FNwkSIntKey, which is also technically incorrect.

I think what we should do is to make the keys in the session information section of overview tab consistent with what's shown in the Network Layer, Application Layer and Join Settings sections of the General Settings page.

We should also update the linked documentation page to remove NwkSKey for LW1.1.x

cc: @kschiffer @johanstokking

StevenCellist commented 3 months ago

Oops, my bad - had been looking at the keys so hard trying to figure out what was up with them that I mixed up the Serving and Forwarding key.. sorry!

descartes commented 3 months ago

Ha, I knew this would happen but I've learnt not to test the Gods of Olympus LoRaWAN!

@StevenCellist's been making RadioLib LW stack soooo much better & I'm his test bunny who went snow-blind trying to configure ABP over the weekend, so I take some of the blame.

KrishnaIyer commented 2 months ago

@StevenCellist: We are going to deploy this change this week on The Things Stack Sandbox. I'll drop a comment here when done.

StevenCellist commented 2 months ago

@KrishnaIyer thank you for following up! I am closely tracking the release and already prepared the changes to match the newly correct keys 😃 (https://github.com/jgromes/RadioLib/commit/6591e983140754b129a1e34b681fc3a69d478032)