Table of Contents:

1.  Introduction

This feature is to filter the unwanted LoRaWAN packets. Purpose is to save the upstream traffic especially for a 4G cellular connection. If configured, gateway will process filter for below two types of message:

  • Unconfirmed Data Up
  • Confirmed Data Up

2.  LoRaWAN Filter Mechanism

Support Devices:

  • All existing models of Gateways

Support Server Type:

  • LoRaWAN Semtech UDP & Basic Station

Filtering rules:

Fport FiltersDevAddr FilterNwkID FilterDev EUI Filter
Level 0Do nothingLevel 0Do nothingLevel 0Do nothingLevel 0Do nothing
Level 1Filter only the Fport in the listLevel 1Filter only the DevAddr in the listLevel 1Filter only the NwkID in the listLevel 1Filter only the Dev EUI in the list
Level 2Filter Fport that are not in the databaseLevel 2Filter DevAddr that are not in the databaseLevel 2Filter NWkID that are not in the databaseLevel 2Filter Dev EUI that are not in the database

 

LoRaWAN Semtech UDP Page:

image-20250303153917-1.png

Basic Station Page:

image-20250303160903-6.png

Check if the filter is running

image-20250303154226-2.png

2.1  Filter By Fport

The Gateway FPort filter will check all the below LoRaWAN messages: Unconfirmed Data Up & Confirmed Data Up.

Important Notice:

  • By default, Fport Filter Level=0. which means do nothing
  • Fport Filter configured to Level=1. If the Fport in the list matches the Fport received by the gateway, it will be dropped.
  • Fport Filter configured to Level=2. If the Fport in the list does not match the Fport received by the gateway, it will be dropped.

If you want to forward only a certain Fport, use level=2 and add the desired fport in the Filter value textbox. Add Filter Value 0 to forward Join requests

image-20240517094721-4.png

2.2  Filter By DevAddr

The Gateway DevAddr filter will check all the below LoRaWAN messages: Unconfirmed Data Up & Confirmed Data Up.

Important Notice:

  • By default, DevAddr Filter Level=0. which means do nothing
  • DevAddr Filter configured to Level=1. If the DevAddr in the list matches the DevAddr received by the gateway, it will be dropped.
  • DevAddr Filter configured to Level=2. If the DevAddr in the list does not match the DevAddr received by the gateway, it will be dropped.

In this case, we set DevAddr Filter Level=1 and add the filter (server | DevAddr | 12664787 ), when the gateway receives a Lorawan packet with DevAddr=12664787, it will be dropped.

image-20240517095315-5.png

2.3  Filter By NwkID

The Gateway NwkID filter will check all the below LoRaWAN messages: Unconfirmed Data Up & Confirmed Data Up.

Important Notice:

  • By default, NwkID Filter Level=0. which means do nothing
  • NwkID Filter configured to Level=1. If the NwkID in the list matches the NwkID received by the gateway, it will be dropped.
  • NwkID Filter configured to Level=2. If the NwkID in the list does not match the NwkID received by the gateway, it will be dropped.

In this case, we set NwkID Filter Level=2 and add the filter (server | NwkID | 13 ), when the gateway receives a packet that is not NwkID=00000013, it will be dropped.

NwkID is calculated as follows: DevAddr counts shifted right by 25 bits

For example, Devaddr=01CC1907,NwkID= 01CC1907 >> 25 = 0

                      Devaddr=260B748A,NwkID= 260B748A >> 25 = 13

image-20240517095458-6.png

If user need to set the Secondary LoRaWAN Server Packet Filter, the configuration is similar to that above.

2.4  Filter By Dev EUI

The Gateway Dev EUI filter will check all the below LoRaWAN messages: Unconfirmed Data Up & Confirmed Data Up.

Important Notice:

  • By default, Dev EUI Filter Level=0. which means do nothing
  • Dev EUI Filter configured to Level=1. If the Dev EUI in the list matches the Dev EUI received by the gateway, it will be dropped.
  • Dev EUI Filter configured to Level=2. If the Dev EUI in the list does not match the Dev EUI received by the gateway, it will be dropped.

In this case, we set Dev EUI Filter Level=1 and add the filter (server |  deveui  |  11FF1111FF112255  ), when the gateway receives the join request packet with deveui=11FF1111FF112255, it will be dropped.

image-20250303155342-4.png

2.5  Add Filter rules via Linux Command.

$ sqlite3 /etc/lora/devskey "INSERT INTO filter (name, type, value ) VALUES  ('$filter_name', '$filter_type', '$filter_value');"

name: server name. eg: server1/server2

type: filter type. eg: fport/devaddr

value: 0,1,2,3/000000

eg:

sqlite3 /etc/lora/devskey "INSERT INTO filter (name, type, value ) VALUES  ('server1', 'fport', '1');"

sqlite3 /etc/lora/devskey "INSERT INTO filter (name, type, value ) VALUES  ('server1', 'devaddr', '00000000');"

sqlite3 /etc/lora/devskey "SELECT *from filter"

image-20230519104800-2.png

3.  FAQ

3.1 How to configure OTAA sensor device filtering

When the OTAA sensor device is registered on the lorawan server, it will rejoin the network every time the sensor device restarts. The server will assign a new Devaddr to the sensor device, so the whitelist that only allows DEVEUI to pass can be configured to deny other devices from joining the network from this gateway,which is used to solve the problem that Devaddr changes cannot be filtered due to sensor device restarts.

If the customer has multiple lorawan gateway devices, all gateways need to synchronize the filtering configuration.

For example, the following configuration allows the sensor device with DEVEUI=1111111111111111 to join the network:

image-20250425114155-1.png

 

Tags:
Created by Xiaoling on 2022/05/12 17:14
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0