sudomesh / LoRaLayer2

Layer 2 routing protocol for LoRa connected devices
86 stars 29 forks source link

Remove dropped node from routing table? #22

Closed Grabt234 closed 3 years ago

Grabt234 commented 3 years ago

Hello

I have been working with this library and looking through the C++ files. I am not sure if I am missing something or if it not a feature included in this library. Does LoRaLayer2 include support for automatically removing addresses from the routing table that are no longer transmitting/ been switched off/ etc...?

( I am still relatively new to using Github, C++, etc... so I am not quite sure if this is is the correct place to post this )

paidforby commented 3 years ago

You are correct (and this is the perfect place to post this question). I have not gotten around to adding a way of removing routes from the routing table either automatically or manually. I haven't done this yet because there is no obvious way of deciding whether or not to drop a route, since there is no requirement for nodes to transmit at any set interval, there is no way for one node to know if it has missed packets from another node or if that other node is just being quiet.

The solution that comes it mind is to implement a timeout associated with each route that is reset whenever a packet (or routing information) is received from the node that is the destination of that route , but once the timeout expires the route is removed from the table. We would likely want the timeout to be configurable per-node. This would be fairly easy to implement and could be checked once each time through the loop (in the daemon function probably). Another option would be to allow for the manual removal of a route, could likely reuse the removeRoute() function that will need to be created for the timeout solution.

Grabt234 commented 3 years ago

Thank you!