Document

LoRaWAN® Specification v1.0

Issue link: https://read.uberflip.com/i/1428377

Contents of this Issue

Navigation

Page 31 of 81

LoRaWAN Specification ©2015 LoRa™ Alliance Page 32 of 82 The authors reserve the right to change specifications without notice. Note: This mechanism prevents replay attacks by sending previously 1 recorded join-request messages with the intention of disconnecting the 2 respective end-device from the network. 3 The message integrity code (MIC) value (see Chapter 4 for MAC message description) for a 4 join-request message is calculated as follows: 1 5 6 cmac = aes128_cmac(AppKey, MHDR | AppEUI | DevEUI | DevNonce) 7 MIC = cmac[0..3] 8 The join-request message is not encrypted. 9 6.2.5 Join-accept message 10 The network server will respond to the join-request message with a join-accept message if 11 the end-device is permitted to join a network. The join-accept message is sent like a normal 12 downlink but uses delays JOIN_ACCEPT_DELAY1 or JOIN_ACCEPT_DELAY2 (instead of 13 RECEIVE_DELAY1 and RECEIVE_DELAY2, respectively). The channel frequency and data 14 rate used for these two receive windows are identical to the one used for the RX1 and RX2 15 receive windows described in the ―receive windows‖ section of the ―Physical Layer‖ chapter 16 No response is given to the end-device if the join request is not accepted. 17 The join-accept message contains an application nonce (AppNonce) of 3 octets, a network 18 identifier (NetID), an end-device address (DevAddr), a delay between TX and RX 19 (RxDelay) and an optional list of channel frequencies (CFList) for the network the end- 20 device is joining. The CFList option is region specific and is defined in Section 7. 21 22 Size (bytes) 3 3 4 1 1 (16) Optional Join Accept AppNonce NetID DevAddr DLSettings RxDelay CFList The AppNonce is a random value or some form of unique ID provided by the network server 23 and used by the end-device to derive the two session keys NwkSKey and AppSKey as 24 follows: 3 25 NwkSKey = aes128_encrypt(AppKey, 0x01 | AppNonce | NetID | DevNonce | pad 16 ) 26 AppSKey = aes128_encrypt(AppKey, 0x02 | AppNonce | NetID | DevNonce | pad 16 ) 27 The MIC value for a join-accept message is calculated as follows: 4 28 cmac = aes128_cmac(AppKey, 29 MHDR | AppNonce | NetID | DevAddr | RFU | RxDelay | CFList) 30 MIC = cmac[0..3] 31 The join-accept message itself is encrypted with the AppKey as follows: 32 aes128_decrypt(AppKey, AppNonce | NetID | DevAddr | RFU | RxDelay | CFList | MIC) 33 Note: The network server uses an AES decrypt operation in ECB 34 mode to encrypt the join-accept message so that the end-device can 35 use an AES encrypt operation to decrypt the message. This way an 36 end-device only has to implement AES encrypt but not AES decrypt. 37 38 1 [RFC4493] 3 The pad 16 function appends zero octets so that the length of the data is a multiple of 16. 4 [RFC4493]

Articles in this issue

view archives of Document - LoRaWAN® Specification v1.0