LoRaWAN Device Activation Explained: OTAA vs ABP

Before a LoRaWAN device can send or receive any data, it must complete a process called activation — the step where the device obtains its network address and session keys. The activation method you choose affects security, deployment complexity, and day-to-day operations.

The LoRaWAN specification defines two activation methods: OTAA (Over-The-Air Activation) and ABP (Activation By Personalization). This article breaks down how each works, compares them side by side, and gives practical selection guidance.


OTAA: Over-The-Air Activation

OTAA is the recommended activation method. Devices ship without session keys and complete authentication over the air after the first power-up.

How It Works

OTAA activation happens in three steps:

1. The device sends a Join Request

The device transmits a Join Request carrying:

FieldDescription
JoinEUI / AppEUIApplication identifier (64-bit) that selects the application or network server to join
DevEUIGlobally unique device identifier (64-bit), typically derived from the hardware MAC or programmed at manufacture
DevNonceA random number (16-bit) that increments on every Join Request, preventing replay attacks

The Join Request is authenticated with a MIC (Message Integrity Code) computed using the AppKey, ensuring the message was not tampered with.

2. The network server validates and sends a Join Accept

On receiving the Join Request, the network server:

  1. Looks up the device’s AppKey (and NwkKey on LoRaWAN 1.1) by JoinEUI/AppEUI
  2. Verifies the MIC to confirm message integrity
  3. Checks the DevNonce to prevent replay (each DevNonce can only be used once)
  4. On success, assigns a DevAddr (32-bit device network address)
  5. Generates a Join Nonce (network-server-side random value)
  6. Builds and encrypts a Join Accept message with the AppKey

The Join Accept carries:

FieldDescription
JoinNonceRandom value (24-bit) generated by the network server, used for key derivation
NetIDNetwork identifier (24-bit)
DevAddrThe assigned network address (32-bit)
DLSettingsDownlink settings (RX2 data rate, RX1 offset, etc.)
RxDelayReceive window delay
CFListOptional list of channel frequencies

3. The device derives its session keys

The device decrypts the Join Accept with its AppKey, then derives session keys from the AppKey, JoinNonce, DevNonce, and NetID.

LoRaWAN 1.0.x (1.0.2 / 1.0.3 / 1.0.4) derives two keys:

  • NwkSKey (Network Session Key): MIC computation for MAC-layer messages and MAC command encryption
  • AppSKey (Application Session Key): application payload encryption

Simplified derivation:

LoRaWAN 1.1 introduces key separation, deriving four keys:

  • FNwkSIntKey: Forward Network Session Integrity Key
  • SNwkSIntKey: Serving Network Session Integrity Key
  • NwkSEncKey: Network Session Encryption Key
  • AppSKey: Application Session Key

LoRaWAN 1.1 renames AppEUI to JoinEUI and separates the NwkKey from the AppKey, enabling network-level and application-level key separation — the foundation for secure roaming.

OTAA Security Properties

  • Keys never travel over the air: AppKey/NwkKey are provisioned on the device and network server; session keys are derived independently on both sides. Only the encrypted Join Accept crosses the air interface.
  • DevNonce replay protection: each DevNonce can be used exactly once; servers track used values.
  • Key rotation: a device can re-join at any time to obtain fresh session keys.
  • Roaming support: LoRaWAN 1.1’s key separation design enables cross-network roaming.

ABP: Activation By Personalization

ABP skips the join procedure entirely. Devices are pre-provisioned with all communication parameters at manufacture and start sending immediately after power-up.

What Is Pre-Provisioned

The following must be written to the device before shipping and registered on the network server in advance:

ParameterDescription
DevAddrDevice network address (32-bit), must be unique within the server’s allocation
NwkSKeyNetwork session key (128-bit AES)
AppSKeyApplication session key (128-bit AES)

ABP devices do not need a DevEUI, JoinEUI, or AppKey (unless you plan to migrate to OTAA later).

How It Works

An ABP device goes straight to work after power-up:

  1. Uses the pre-configured DevAddr as its source address
  2. Computes MICs with NwkSKey and encrypts MAC commands with NwkSKey
  3. Encrypts/decrypts application data with AppSKey
  4. Starts transmitting on default channels

There is no Join Request / Join Accept handshake.

The Frame Counter Problem

ABP devices must manage their uplink (FCntUp) and downlink (FCntDown) frame counters. Network servers track these counters to prevent replay attacks — if a device reboots and its counter resets below the value the server last recorded, its frames will be rejected.

Two common approaches:

  • Server-side reset: reset the device’s frame counters manually on the platform (fine for debugging)
  • Device-side persistence: store counters in non-volatile storage and resume from the last value after reboot (required for production)

OTAA vs ABP: Side-by-Side

DimensionOTAAABP
SecurityHigh — keys derived over the join procedure, never transmittedLow — keys must be written at manufacture and registered server-side; exposure risk
Key rotationYes — re-join to obtain fresh keysNo — keys are fixed; changing them requires reflashing devices
DevAddr assignmentDynamically assigned by network serverFixed at manufacture; uniqueness must be managed manually
Deployment complexityDevice only needs root keys; server handles the restBoth device and server need full pre-configuration
Time to first packetJoin procedure first (typically 5–15 seconds)Instant — works right after power-up
Frame counter managementStarts from zero after join; no conflict issuesMust be managed carefully; reboot may cause rejected frames
RoamingSupported (LoRaWAN 1.1 key separation)Not supported
LoRaWAN 1.1Fully supported — 1.1 relies on OTAANot recommended under 1.1
Deployment scaleSuitable for production fleetsSuitable for small tests
Network switchingChange JoinEUI to join another networkRequires reflashing all parameters

Which One Should You Use?

Use OTAA when

  • Production deployments — any fleet beyond a handful of devices should be OTAA
  • Security matters — sensitive data or compliance requirements
  • Large scale — DevAddr is dynamically assigned, avoiding conflicts
  • Roaming is needed — cross-network or multi-region deployments
  • LoRaWAN 1.1 networks — 1.1’s security features depend on OTAA

ABP is acceptable when

  • Development and debugging — validate device communication quickly without the join handshake
  • Teaching and demos — simplify the flow so students focus on data exchange
  • Very small, fixed deployments — one or two devices in a controlled environment with low security requirements
  • Uplink-only scenarios — devices only transmit, with minimal key-management needs (still weigh the security trade-off)

A Common Misconception

“ABP saves power because there’s no join procedure.”

Not really. The join procedure costs very little — one Join Request and one Join Accept, typically completed in a few seconds. Compared to a device’s multi-year battery life, the energy of the join phase is negligible. What ABP actually saves is development-time configuration effort — and in production that convenience comes at the cost of lower security and higher operational overhead.


Practical Notes

OTAA in Practice

  1. DevEUI must be globally unique: use an IEEE EUI-64 derived from the device MAC; never hardcode a default value
  2. Store AppKey securely: it’s the root key — compromise means the device’s entire communication can be decrypted. Prefer a secure element, or at least the MCU’s flash encryption
  3. Persist DevNonce: it must live in non-volatile storage and keep incrementing across reboots. A rollback causes the network server to reject Join Requests
  4. Implement join retry with backoff: avoid hammering the channel if the network is temporarily unreachable
  5. Listen in the join windows: Join Accept arrives in RX1 (default 5 s) and RX2 after the Join Request; the device must be listening

ABP in Practice

  1. Persist frame counters: store FCntUp and FCntDown in non-volatile storage (RTC backup registers, flash, or EEPROM)
  2. Plan DevAddr carefully: the 7-bit NwkID must match the network server’s NetID; the 25-bit address must be unique within the network
  3. Protect keys in manufacturing: ABP keys are written at manufacture — keep them out of production logs and test records
  4. Never commit keys to public repos: if you share code on GitHub or similar, don’t hardcode NwkSKey and AppSKey

On ThinkLink:

  • OTAA devices: register DevEUI and AppKey on the platform; the device joins automatically after power-up
  • ABP devices: register DevAddr, NwkSKey, and AppSKey; the device communicates immediately
  • The platform shows join status and frame counters for every device
  • If a frame counter conflict occurs, reset it from the device management page

Summary

OTAAABP
One-linerLike joining Wi-Fi — automatic authentication, automatic addressLike a landline — number and line pre-configured at the factory
SecurityHighLow
Recommended for productionYesNo (debugging/teaching only)
LoRaWAN 1.1RequiredNot recommended

Bottom line: use OTAA in production, ABP only for debugging and teaching. If you have more than ten devices, or if devices sit in environments you can’t physically control, OTAA is the only sensible choice.


Written against the LoRaWAN 1.0.4 and 1.1 specifications. Protocol details follow the LoRa Alliance specification documents; operational advice draws from ThinkLink platform experience.

ThinkLink is the IoT platform product from ManThink, providing LoRaWAN network management, device operations, and data services.

Review My Order

0

Subtotal