# Joining

When OTAA is used, the DevEUI, AppEUI and AppKey are needed to register the device on the network. The NwkSKey and AppSKey are derived when joining the network. The advice for the frequency of periodically rejoining depends on the number of messages sent by the end device and the level of security required.

A device should re-join:&#x20;

* Every time it has lost the session context information.
* Every x days
* Every y messages

The x and y values may differ depending on the level of security required; appropriate values could be once a month or maybe once every 2-3 months. The security risk depends on the application: metering applications sending a low amount of values typically do not need very frequent re-keying, while critical applications (e.g. alarms) would require more frequent re-keying. Currently KPN has no precise defined time or number of messages when a rejoin will be forced. Customers should make sure their device and application can still work and build a connection when a rejoin is required.

During the OTAA join, the network:&#x20;

* Generates a NwkSKey and AppSKey and stores them as long as there is no new join procedure initiated.
* Forms a Join response payload that will allow the end device to compute a NwkSKey and AppSKey.
* As part of the Join procedure, the network also allocates a DevAddr to the end device.

**Note:** ABP configurations are not allowed on the network as this provisioning method does not meet KPN's security standards.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kpnthings.com/kpn-things/kpn-lora/technical-information/joining.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
