반응형

https://www.thethingsnetwork.org/docs/lorawan/end-device-activation/

 

End Device Activation

Every end device must be registered with a network before sending and receiving messages. This procedure is known as activation. There are two activation methods available: Over-The-Air-Activation (OTAA) - the most secure activation method for end devices.

www.thethingsnetwork.org

  • Over-The-Air-Activation (OTAA) - the most secure activation method for end devices. Devices perform a join procedure with the network, during which a dynamic device address is assigned and security keys are negotiated with the device.
  • Activation By Personalization (ABP) - requires hardcoding the device address as well as the security keys in the device. ABP is less secure than OTAA and also has the downside that devices can not switch network providers without manually changing keys in the device.

OTAA와 ABP의 차이는 인증방식이다.

 

ABP는 사전에 Application_Key, Network_Key를 가지고, 하나의 채널을 Default로 고정하여 사용한다. 그러므로 Join_Request, Join_Accept 과정이 필요하지 않는다.

 

반면 OTAA는 ABP와 달리 네트워크 첫 진입 시  Join_Request, Join_Accept 를 주고 받으며, 인증을 받는다. 아래 그림은 OTAA 메세지 흐름을 설명한다. 

OTAA Message Flow

 

End_Device가 Join_Request 메세지를 업링크(Up_Link)한다. Application_Server가 Join_Request에 대한 세션 키를 생성하면 Join_Accept 메세지를 End_Device로 다운링크(Down_Link)한다. (이는 기본적으로 Class_A로, End_Device 주도방식이다.)

 

여기서 Join_Accept 메세지 안의 CFList가 중요하다. 

CFList(16bytes) – contains the optional list of channel frequencies to be used for the end device 

 

Join_Accept 메세지 안에는 End_Device가 Channel_Frequency를 사용할  CFList가 들어 있다. 여기서 ABP와 큰 차이점을 가진다. ABP는 하나의 Channel_Frequency를 사용한다면, OTAA는 CFList를 통해 Channel_Frequency가 바뀐다.

 


MBED 구현 부분이다. 

https://github.com/ARMmbed/mbed-os-example-lorawan

 

GitHub - ARMmbed/mbed-os-example-lorawan: Simple LoRaWAN example application for mbed OS

Simple LoRaWAN example application for mbed OS. Contribute to ARMmbed/mbed-os-example-lorawan development by creating an account on GitHub.

github.com

 

mbed_app.json 파일 안에 OTAA와 ABP 설정 관련된 부분을 설명한다.

 

  • For OTAA
"lora.device-eui": "{ YOUR_DEVICE_EUI }",
"lora.application-eui": "{ YOUR_APPLICATION_EUI }",
"lora.application-key": "{ YOUR_APPLICATION_KEY }"​
  • For ABP
"lora.over-the-air-activation": false,

"lora.appskey": "{ YOUR_APPLICATION_SESSION_KEY }",
"lora.nwkskey": "{ YOUR_NETWORK_SESSION_KEY }",
"lora.device-address": " YOUR_DEVICE_ADDRESS_IN_HEX  "

ABP를 사용하기 위해선 OTAA를 꺼야 한다. 

 

 

728x90
반응형

+ Recent posts