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.  FWD Filter Mechanism

Support Devices:

  • Firmware Version >  dragino-lgw--v5.4.1699325460
  • LG308, DLOS8, LPS8, LIG16, LG308N, DLOS8N, LPS8N

Filtering rules:

Fport FiltersDevAddr FilterNwkID Filter
Level 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 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 database

image-20240517094256-2.png

Check if the filter is running

image-20240517094552-3.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=0 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  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

2.5 Check results

After the configuration is complete, you can enable Logread Debug level on System-->General, return to LoRaWAN-->Semtech UDP, and click "Save&Apply".

image-20240517100303-7.png

3.  PKT_FWD Filter Mechanism

Support Devices:

  • LG308, DLOS8
  • LPS8

Fport & DevAddr Filter

image-20220527150138-1.png

Check if the filter is running

image-20220527150222-2.png

3.1  Filter By Fport

The Gateway FPort filter will check all the below LoRaWAN message: Unconfirmed Data Up & Confirmed Data Up. If the packet's FPort doesn't match the FPort setting, it will be dropped.

By default , this value is 0 means can upstream all packets with any FPort. We can set to other FPort so specify only one FPort works.

image-20220527150303-3.png

In case we set the FPort filter to 45, and the End Node send a packet with Fport other than 45, it will be dropped.

3.2  Filter By DevAddr

Gateway will use a DevAddr mask to check if the Unconfirmed Data Up & Confirmed Data Up packets match the mask . If not, gateway will drop it.

image-20220527150404-4.png

This screenshot shows packets is dropped if DevAddr mask doesn't match.

 

Tags:
    
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0