Lora-net / SWL2001

LoRa Basics Modem LoRaWAN stack
BSD 3-Clause Clear License
88 stars 52 forks source link

Relay join request forwarding table limitations #21

Closed adriansmares closed 7 months ago

adriansmares commented 9 months ago

The implementation of the FilterListReq MAC command rejects rules that have length greater than zero for the rule index 0:

https://github.com/Lora-net/SWL2001/blob/c4f386ac54b3e35f45b8ba7502207faa6f634921/smtc_modem_core/lr1mac/src/relay/relay_rx/relay_rx_mac_parser.c#L363-L367

However, the specification is more nuanced than this, specifically:

image

The way I interpret these rules is that:

  1. It is legal to actually use index 0 to filter a prefix (i.e. length > 0) - this is due to the third point.
  2. There is a special meaning for using index 0 and length 0 - it alters the default forwarding behavior (such that it could become filter instead of forward when nothing matches), but it is not a rule change in itself.

Section 8.6 also hints at this possibility:

image

My interpretation is that for index 0 and length 0 a 'default action' slot is updated via a request, while a length > 0 request updates the 16 entries table. I would argue that this interpretation allows for all 16 slots to be used with /16 prefixes, but I am open to alternative interpretations.

adriansmares commented 7 months ago

This interpretation is wrong, due to rule 2.