13
3

I’m trying to understand the three magic LoRaWAN IDs from the?LoRaWAN 1.2 specification. My understanding is:

  • DevEUI?is like a MAC address
  • AppKey?is like a public key (roughly…)
  • AppEUI?is like a port number

Now I’m having problem understanding?who?is responsible for creating these IDs:

  • DevEUI?can be generated from the LoRa chip internal ID registers (I’m using Murata’s type ABZ chip)
  • AppKey: should it be unique for each end node? Should I choose a random one or ask one from the LoRaWAN provider (e.g.?Objenious)?
  • AppEUI: should be common to each end node (I guess it should)? Should I choose a random one or ask one from the LoRaWAN provider?

2 Answers #

10

The DevEUI is an ID in the IEEE EUI64 address space used to identify a device. It is supplied by the device manufacturer. A deprecated algorithm exists to convert 48bit MAC addresses to EUI64. For MAC addresses with 6 bytes (e.g. 01 02 03 04 05 06) put ff fe or ff fe in the middle (e.g. 01 02 03 ff fe 04 05 06). This algorithm has been deprecated as it may lead to?collisions?with other DevEUIs. During over the air activation a DevAddr is assigned to the device. This DevAddr is used in the LoRaWAN protocol afterwards. The DevEUI is sent unencrypted.

The JoinEUI (formerly called AppEUI) is a global application ID in the IEEE EUI64 address space identifying the join server during the over the air activation. For non-private networks it corresponds to a subdomain of joineuis.lora-alliance.org. This server name is used to find the IP address of the join server via DNS. This is described in?LoRaWAN? Back-End Interfaces v1.0.

AppKey is the encryption key used for messages during every over the air activation. After the activation the AppSKey is used. A listener knowing the AppKey can derive the AppSKey. So you want to keep the AppKey secret. Which side of the communication channel creates it is not important. You simply want to be sure that it is random.

  • Thanks. Who is generating the JoinEUI/AppEUI? Is it me or the LoRaWAN network provider? I heard I should ask for a kind of OUI range to IEEE for that…

    Jan 9 ’19 at 22:52

  • 1

    As the JoinEUI identifies the join server it can only be provided by the owner of the join server.

    –?Xypron

    Jan 10 ’19 at 0:15

  • Ok, that’s clear. So I should register to IEEE for the DevEUI or use the ID from the LoRa chip manufacturer?

    Jan 10 ’19 at 8:24

  • 1

    As the DevEui is not relevant for encryption and the one supplied by the manufacturer is globally unique I would stay with that one.

    –?Xypron

    Jan 11 ’19 at 18:41

  • thanks for confirming that. As I now have enough rep to upvote, +1 from me :)

    Jan 14 ’19 at 10:03

7

The?DevEUI?is a global end device ID in IEEE EUI64 address space that uniquely identifies the end device.

The user can derive their own DevEUI

The?AppKey?is an?AES128?root key specific to the end device. Whenever an end device joins a network via over the air activation(OAT), the?AppKey?is used to derive the session keys?NwkSKeyand?AppSKey?specific for that end device to encrypt and verify network communication and application data.

The AppKey should be unique for each device.The user can derive their own AppKey

The?AppEUI?is a global application ID in IEEE EUI64 address space that uniquely identifies the entity able to process the JoinReq frame. The?AppEUI?is stored in the end-device before the activation procedure is executed

The AppEUI can be different for each device or it can also be same for all device. It also depends on what kind of application server you are using.
For example in?loraserver.io?you can have unique AppKey,AppEUI and DevEUI but in?TheThingsNetwork?you can register many devices for one application or AppEUI. But note that AppKey and DevEUI should always be unique for each end node.

screenshot of Device overview in TheThingNetwork

  • I understand that the join server provides the AppEUI and that the end node device includes this in the join request. But if I buy a off the shelf LoRa device, how do I get the AppEUI into that device?

    Oct 17 ’19 at 8:59