Closed rgillan closed 2 years ago
I'd better get a copy of the v1.1 spec, then!
Hi @anthonykirby, The LW 1.1 spec is now available for anyone (no need to ask the LoRa Alliance): LW 1.1: https://lora-alliance.org/sites/default/files/2018-04/lorawantm_specification_-v1.1.pdf LW 1.1 Regional Parameters v1.1b : https://lora-alliance.org/sites/default/files/2018-04/lorawantm_regional_parameters_v1.1rb_-_final.pdf
(note to self) diff at https://draftable.com/compare/JkgbdCSXLgwt
Hi @anthonykirby
Support for LoRaWAN v1.1.x?
I've got the spec, but what I really need to implement v1.1 is some example data / packet captures (ideally with keys), so that there's some confidence that the decoding is correct
I've got the spec, but what I really need to implement v1.1 is some example data / packet captures (ideally with keys), so that there's some confidence that the decoding is correct
@anthonykirby @rgillan If you need LoRaWAN 1.1 Join Accept data/packet so i will provide you?
I've identified some basic changes in OTAA:
-cmac = aes128_cmac(AppKey, MHDR | AppEUI | DevEUI | DevNonce)
-MIC = cmac[0..3]
+cmac = aes128_cmac(NwkKey, MHDR | JoinEUI | DevEUI | DevNonce)
+MIC = cmac[0..3]
AppNonce renamed to JoinNonce
JoinNonce is a device specific counter (that never repeats itself). It is incremented with every Join-accept message
JoinReqType is a single byte field encoding the type of Join-request or Rejoin-request that triggered the Join-accept response:
MIC:
-cmac = aes128_cmac(AppKey, MHDR | AppNonce | NetID | DevAddr | DLSettings | RxDelay | CFList)
-MIC = cmac[0..3]
+cmac = aes128_cmac(JSIntKey, JoinReqType | JoinEUI | DevNonce | MHDR | JoinNonce | NetID | DevAddr | DLSettings | RxDelay | CFList )
+MIC = cmac[0..3]
DLSettings:
-| Bits | 7 | 6:4 | 3:0 |
-| DLsettings | RFU | RX1DRoffset | RX2 Data rate |
+| Bits | 7 | 6:4 | 3:0 |
+| DLsettings | OptNeg | RX1DRoffset | RX2 Data rate |
NwkSKey and AppSKey (1.0.2) derived from AppKey vs FNwkSIntKey, SNwkSIntKey, NwkSEncKey and AppSKey derived from AppKey and NwKey(1.1):
-NwkSKey = aes128_encrypt(AppKey, 0x01 | AppNonce | NetID | DevNonce | pad16)
-AppSKey = aes128_encrypt(AppKey, 0x02 | AppNonce | NetID | DevNonce | pad16)
+AppSKey = aes128_encrypt(AppKey, 0x02 | JoinNonce | JoinEUI | DevNonce | pad16)
+FNwkSIntKey = aes128_encrypt(NwkKey, 0x01 | JoinNonce | JoinEUI | DevNonce | pad16 )
+SNwkSIntKey = aes128_encrypt(NwkKey, 0x03 | JoinNonce | JoinEUI | DevNonce | pad16)
+NwkSEncKey = aes128_encrypt(NwkKey, 0x04 | JoinNonce | JoinEUI | DevNonce | pad16)
Encryption join request:
-aes128_decrypt(AppKey, AppNonce | NetID | DevAddr | DLSettings | RxDelay | CFList | MIC)
+aes128_decrypt(NwkKey, JoinNonce | NetID | DevAddr | DLSettings | RxDelay | CFList | MIC).
Encryption re-join request:
-aes128_decrypt(AppKey, AppNonce | NetID | DevAddr | DLSettings | RxDelay | CFList | MIC)
+aes128_decrypt(JSEncKey, JoinNonce | NetID | DevAddr | DLSettings | RxDelay | CFList | MIC).
Note: if the server does not set OptNeg
in DLsettings
, it means that it does not support 1.1, so the device should work with 1.0 protocol...
Thank you @miqmago
i will try with your code
any news on this topic? I would like to test some 1.1 devices using this library, and i'd like to join (pun intended) someone to develop this feature. Anyone interested?
1.1 now supported
Mostly changes to the join process but be good to detect