Document

LoRaWAN® Specification v1.0

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

Contents of this Issue

Navigation

Page 19 of 81

LoRaWAN Specification ©2015 LoRa™ Alliance Page 20 of 82 The authors reserve the right to change specifications without notice. FOpts transport MAC commands of a maximum length of 15 octets that are piggybacked 1 onto data frames; see Chapter 4.4 for a list of valid MAC commands. 2 If FOptsLen is 0, the FOpts field is absent. If FOptsLen is different from 0, i.e. if MAC 3 commands are present in the FOpts field, the port 0 cannot be used (FPort must be either 4 not present or different from 0). 5 MAC commands cannot be simultaneously present in the payload field and the frame 6 options field. 7 4.3.2 Port field (FPort) 8 If the frame payload field is not empty, the port field must be present. If present, an FPort 9 value of 0 indicates that the FRMPayload contains MAC commands only; see Chapter 4.4 10 for a list of valid MAC commands. FPort values 1..223 (0x01..0xDF) are application- 11 specific. FPort values 224..255 (0xE0..0xFF) are reserved for future standardized 12 application extensions. 13 14 Size (bytes) 7..23 0..1 0..N MACPayload FHDR FPort FRMPayload N is the number of octets of the application payload. The valid range for N is region specific 15 and is defined in Section 7 16 N should be equal or smaller than: 17 N ≤ M - 1 - (length of FHDR in octets) 18 where M is the maximum MAC payload length. 19 4.3.3 MAC Frame Payload Encryption (FRMPayload) 20 If a data frame carries a payload, FRMPayload must be encrypted before the message 21 integrity code (MIC) is calculated. 22 The encryption scheme used is based on the generic algorithm described in IEEE 23 802.15.4/2006 Annex B [IEEE802154] using AES with a key length of 128 bits. 24 As a default, the encryption/decryption is done by the LoRaWAN layer for all FPort. The 25 encryption/decryption may be done above the LoRaWAN layer for specific FPorts except 0, 26 if this is more convenient for the application. The information concerning which FPort from 27 which node is encrypted/decrypted outside of the LoRaWAN layer must be communicated to 28 the server using an out-of-band channel (see Section 19). 29 4.3.3.1 Encryption in LoRaWAN 30 The key K used depends on the FPort of the data message: 31 32 FPort K 0 NwkSKey 1..255 AppSKey Table 3: FPort list 33 The fields encrypted are: 34 pld = FRMPayload 35 For each data message, the algorithm defines a sequence of Blocks A i for i = 1..k with k = 36 ceil(len(pld) / 16): 37

Articles in this issue

view archives of Document - LoRaWAN® Specification v1.0