User Tools

Site Tools


wiki:lora:advanced_features

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:lora:advanced_features [2020/03/25 16:55]
dlr
wiki:lora:advanced_features [2024/04/11 12:14] (current)
ehe [DevAddr/NetID Filtering]
Line 1: Line 1:
 ====== Advanced LoRa features ====== ====== Advanced LoRa features ======
  
 +===== LoRa API =====
 +
 +The LoRa API takes place between a single server (lorad), which drives all LoRa related devices, and multiple clients (e.g. lorafwd) wanting to interact with these devices. Its main purpose is to provide an abstraction of the LoRa devices to other processes.
 +
 +{{ :​images:​cpf_big_picture_v1.0.jpg?​direct |}}
 +
 +The LoRa API allows three ways of communication:​
 +  * Receive data from lorad (**uplink**).
 +  * Send data to lorad (**downlink**).
 +  * Control lorad configuration (**control**).
 +
 +The LoRa API defines a transport layer and a data exchange format.
 +
 +{{ :​images:​cpf_channels_v1.0.jpg?​direct |}}
 +
 +
 +==== Details of the LoRa API for CPF 1.2.x ====
 +
 +  * [[wiki:​lora:​cpf_1.2.4#​sources|CPF 1.2.4: LoRa API]]
 +  * [[wiki:​lora:​cpf_1.2.1#​sources|CPF 1.2.1: LoRa API]]
 +
 +==== Details of the LoRa API for CPF 1.1.x ====
 +
 +  * [[wiki:​lora:​cpf_1.1.x:​cpf_1.1.6:​resources#​sources|CPF 1.1.6: LoRa API]]
 +
 +==== Details of the LoRa API for CPF 1.0.x ====
 +
 +  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.9:​resources_ifemtocell#​sources|CPF 1.0.9 for iFemtoCell: LoRa API]]
 +  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.9:​resources_ibts#​sources|CPF 1.0.9 for iBTS: LoRa API]]
 +  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.6:​resources_ifemtocell#​sources|CPF 1.0.6 for iFemtoCell: LoRa API]]
 +  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.6:​resources_ibts#​sources|CPF 1.0.6 for iBTS: LoRa API]]
 +===== Compilation =====
 +
 +To compile one of the daemons, refer to the [[wiki:​keros_custo:​toolchain| toolchain]] page and to the ''​README.md''​ included in the sources.
 +
 +===== lorafwdctl =====
 +
 +A tool to edit the lorafwd configuration is installed at the same time than the lorafwd. It can be used instead of editing manually the configuration file.
 +
 +Examples:
 +
 +  * To enable database:
 +    * ''​lorafwdctl database.enable true''​
 +  * To configure GWMP node and services:
 +    * ''​lorafwdctl -s gwmp.node foobar.example.com''​
 +    * ''​lorafwdctl gwmp.service.uplink 1234''​
 +    * ''​lorafwdctl gwmp.service.downlink 1234''​
 +  * To configure GWMP node and services for "​foo"​ instance:
 +    * ''​lorafwdctl -i=foo -s gwmp.node foobar.example.com''​
 +
 +
 +===== LoRaWAN frame Filtering =====
 +
 +==== DevAddr/​NetID Filtering ====
 +
 +This feature is available from Keros firmware 5.7 and above. \\
 +It allows to save data consumption by forwarding only LoRaWAN packets from a given DevAddr range. \\
 +A DevAddr is the ID used by a LoRaWAN device to communicate on a LoRaWAN network, NetID is a part of this DevAddr. \\
 +See [[https://​lora-alliance.org/​resource_hub/​netid-faqs/​|Lora Alliance NetID FAQ]] for further details.
 +See [[https://​www.thethingsnetwork.org/​docs/​lorawan/​prefix-assignments.html|NetID and DevAddr Prefix Assignments]] for the current list of NetIDs and the corresponding DevAddr range.
 +
 +In order to activate this filtering, configuration is done by a [[https://​en.wikipedia.org/​wiki/​Classless_Inter-Domain_Routing|CIDR notation]] of wanted mask in lorafwd configuration. \\
 +
 +Examples:
 +  * **Filtering on full Type-0 (/7) Kerlink NetID (12)**: <code bash>​lorafwdctl -s filter.lorawan.netid "​0x24000000/​7"</​code>​Once activated, the gateway will only forward packets from devices with DevAddr from 0x24000001 to 0x25FFFFFF.
 +  * **Filtering on Type-3 (/14) Kerlink NetID (600014)**: <code bash>​lorafwdctl -s filter.lorawan.netid "​0xE0280000/​14"</​code>​Once activated, the gateway will only forward packets from devices with DevAddr from 0xE0280000 to 0xE029FFFF.
 +  * **Filtering on a specific device (/32) with DevAddr E0501234**: <code bash>​lorafwdctl -s filter.lorawan.netid "​0xE0501234/​32"</​code>​Once activated, the gateway will only forward packets from the device E0501234.
 +
 +If buffering is used, filtering is done before archiving the message in database.
 +
 +Associated logs can then be observed in ''/​var/​log/​lora.log*''​ with a trace like this: \\
 +''​Drop message from 0x24f52627 (not in NetID range 0xE0501234/​32)''​
 +
 +==== JoinEUI Filtering ====
 +
 +This feature is available from Keros firmware 5.7 and above. \\
 +It allows to save data consumption by forwarding only LoRaWAN packets from a given JoinEUI range. \\
 +A JoinEUI is an ID used by a LoRaWAN device to join on a LoRaWAN network. \\
 +
 +In order to activate this filtering, configuration is done by a [[https://​en.wikipedia.org/​wiki/​Classless_Inter-Domain_Routing|CIDR notation]] of wanted mask in lorafwd configuration. \\
 +
 +
 +Examples:
 +  * **Filtering on JoinEUI:** <code bash>​lorafwdctl -s filter.lorawan.joineui "​0x7076FF0001000000/​40"</​code>​Once activated, the gateway will only forward join requests from devices with JoinEui from 0x7076FF0001000000 to 0x7076FF0001FFFFFF. \\
 +  * **Filtering on a specific device with JoinEUI 7076FF0001005554:​** <code bash>​lorafwdctl -s filter.lorawan.joineui "​0x7076FF0001005554/​64"</​code>​Once activated, the gateway will only forward join requests from devices with JoinEUI 7076FF0001005554. \\
 +
 +
 +==== DevEUI Filtering ====
 +
 +This feature is available from Keros firmware 5.7 and above. \\
 +It allows to save data consumption by forwarding only LoRaWAN packets from a given DevEUI range. \\
 +A DevEUI is an ID used by a LoRaWAN device to communicate on a LoRaWAN network. \\
 +
 +In order to activate this filtering, configuration is done by a [[https://​en.wikipedia.org/​wiki/​Classless_Inter-Domain_Routing|CIDR notation]] of wanted mask in lorafwd configuration. \\
 +
 +Examples:
 +  * **Filtering on DevEUI:** <code bash>​lorafwdctl -s filter.lorawan.deveui "​0x7777777700000000/​32"</​code>​Once activated, the gateway will only forward packets from devices with DevEui from 0x7777777700000000 to 0x77777777FFFFFFFF. \\
 +  * **Filtering on a specific device with DevEUI 7076FF0001005554:​** <code bash>​lorafwdctl -s filter.lorawan.deveui "​0x7076FF0001005554/​64"</​code>​Once activated, the gateway will only forward packets from devices with DevEUI 7076FF0001005554. \\
 +
 +==== Multiple range filter and reverse filter ====
 +
 +=== Multiple range filter ===
 +
 +Multiple range filter can be applied on NetID/​DevAddr,​ JoinEUI, DevEUI filters.\\
 +It is useful when several range of IDs need to be filtered in.\\
 +Examples:
 +  * **Filtering on DevAddr:** <code bash>​lorafwdctl -s filter.lorawan.netid "​0x24000000/​8"​ "​0x26000000/​8"</​code>​Once activated, the gateway will only forward packets from devices with DevAddr from 24000000 to 24FFFFFF **and** from 26000000 to 26FFFFFF.
 +
 +=== Reverse filtering ===
 +
 +Reverse filter can be applied on NetID/​DevAddr,​ JoinEUI, DevEUI filters.\\
 +It is useful when several range of IDs need to be filtered out.\\
 +In this case, filter has to start with "​!"​. \\
 +Examples:
 +  * **Filtering on DevAddr:** <code bash>​lorafwdctl -s filter.lorawan.netid "​!0x24000000/​7"</​code>​Once activated, the gateway will reject packets from devices with DevAddr from 0x24000001 to 0x25FFFFFF and will forward any other packets.
 +
 +
 +<​note>​It is possible to combine multiple and reverse filter\\
 +For example : ''​lorafwdctl -s filter.lorawan.netid "​!0x11111100/​24"​ "​0x11111110/​28"''​
 +</​note>​
 +<note warning>​Be careful at the order of filter when you use simple and reverse filter \\ 
 +Filter [ "​!0x24000000/​7",​ "​0x24000000/​7"​ ] is different from filter [ "​0x24000000/​7",​ "​!0x24000000/​7"​ ] \\
 +See the [[#​filter_cheat_sheet|Filter cheat sheet]] for a better understanding.
 +</​note>​
 +
 +=== Filter cheat sheet ===
 +
 +{{ :​wiki:​lora:​filter-cheat-sheet.png?​nolink |}}
 +
 +==== Proprietary frame ====
 +
 +It is possible to filter proprietary LoRaWAN frame.\\
 +To do so : <code bash>​lorafwdctl -s filter.lorawan.proprietary true</​code>​
 ===== Fine timestamp ===== ===== Fine timestamp =====
  
 ==== General information ==== ==== General information ====
  
-This feature is only available on Wirnet iBTS gateways.+This feature is only available on Wirnet iBTS and iStation ​gateways.
  
-Fine timestamps are the nanosecond accurate dates at which a packet ​are received by the gateway.+Fine timestamps are the nanosecond accurate dates at which a packet ​is received by the gateway.
 Fine timestamps are generally used for Geolocalization algorithms.\\ Fine timestamps are generally used for Geolocalization algorithms.\\
  
Line 76: Line 209:
 For __debug purposes__, fine timestamps can be directly deciphered from the gateway. Please note it should not be used in production environments. For __debug purposes__, fine timestamps can be directly deciphered from the gateway. Please note it should not be used in production environments.
  
-To activate deciphering from the gateway, edit the frequency plan (in ''​/user/​etc/​lorad/''​):​+To activate deciphering from the gateway, edit the frequency plan (in ''/​etc/​lorad/''​):​
  
   * ''"​aes_key":​ "​00112233445566778899AABBCCDDEEFF",''​   * ''"​aes_key":​ "​00112233445566778899AABBCCDDEEFF",''​
Line 146: Line 279:
  
 The ''​etime field''​ is an hexadecimal value which has been 64 base encoded. The ''​etime field''​ is an hexadecimal value which has been 64 base encoded.
-To retrieve the actual number of nanosecond ​from the ''​etime''​ value, the value needs to be divided by 32.+To retrieve the actual number of nanoseconds ​from the ''​etime''​ value, the value needs to be divided by 32.
  
 <file bash etime_dec.sh>​ <file bash etime_dec.sh>​
Line 184: Line 317:
  
 <note important>​Note that ''​etime''​ value is always inferior to 1. If not Your AES key is probably wrong.</​note>​ <note important>​Note that ''​etime''​ value is always inferior to 1. If not Your AES key is probably wrong.</​note>​
- 
-===== LoRa API ===== 
- 
-The LoRa API takes place between a single server (lorad), which drives all LoRa related devices, and multiple clients (e.g. lorafwd) wanting to interact with these devices. Its main purpose is to provide abstraction of the LoRa devices to other processes. 
- 
-{{ :​images:​cpf_big_picture_v1.0.jpg?​direct |}} 
- 
-The LoRa API allows three ways of communication:​ 
-  * Receive data from lorad (**uplink**). 
-  * Send data to lorad (**downlink**). 
-  * Control lorad configuration (**control**). 
- 
-The LoRa API defines a transport layer and a data exchange format. 
- 
-{{ :​images:​cpf_channels_v1.0.jpg?​direct |}} 
- 
- 
-==== Details of the LoRa API for CPF 1.2.x ==== 
- 
-  * [[wiki:​lora:​cpf_1.2.4#​sources|CPF 1.2.4: LoRa API]] 
-  * [[wiki:​lora:​cpf_1.2.1#​sources|CPF 1.2.1: LoRa API]] 
- 
-==== Details of the LoRa API for CPF 1.1.x ==== 
- 
-  * [[wiki:​lora:​cpf_1.1.x:​cpf_1.1.6:​resources#​sources|CPF 1.1.6: LoRa API]] 
- 
-==== Details of the LoRa API for CPF 1.0.x ==== 
- 
-  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.9:​resources_ifemtocell#​sources|CPF 1.0.9 for iFemtoCell: LoRa API]] 
-  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.9:​resources_ibts#​sources|CPF 1.0.9 for iBTS: LoRa API]] 
-  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.6:​resources_ifemtocell#​sources|CPF 1.0.6 for iFemtoCell: LoRa API]] 
-  * [[wiki:​lora:​cpf_1.0.x:​cpf_1.0.6:​resources_ibts#​sources|CPF 1.0.6 for iBTS: LoRa API]] 
-===== Compilation ===== 
- 
-To compile one of the daemons, refer to the [[wiki:​keros_custo:​toolchain| toolchain]] page and to the ''​README.md''​ included in the sources. 
- 
-===== lorafwdctl ===== 
- 
-A tool to edit the lorafwd configuration is installed at the same time than the lorafwd. It can be used instead of editing manually the configuration file. 
- 
-Examples: 
- 
-  * To enable database: 
-    * ''​lorafwdctl database.enable true''​ 
-  * To configure GWMP node and services: 
-    * ''​lorafwdctl -s gwmp.node foobar.example.com''​ 
-    * ''​lorafwdctl gwmp.service.uplink 1234''​ 
-    * ''​lorafwdctl gwmp.service.downlink 1234''​ 
wiki/lora/advanced_features.1585151709.txt.gz · Last modified: 2020/03/25 16:55 by dlr