Replies: 4 comments 1 reply
-
|
The preserving hops ideas is really interesting to me since I have a well positioned client base that seems to see a lot more nodes and get a lot more public messages than my favorited handheld - I assume this would fix that by ensuring my handheld gets all of the same info as the base? And if I understand correctly that would also allow you to not incur a 1 hop penalty when sending out messages through the client base as well? |
Beta Was this translation helpful? Give feedback.
-
|
Hello h3lix1! I have some nodes in prime locations in big city. We are still on MEDIUM_FAST, and with a reason - on SHORT_FAST we started to loose a lot of range and reliability. In few places ChUtil is up to 50%, but normally it's 25-35%. We have some spammers. So... I'm VERY interested in traffic management and grateful that someone did this. However, as it stands it's hard to implement something that I don't understand and the information is... sparse, and for a person that didn't write the code and didn't do any reverse engineering... it's almost black magic ;-) Let's start from the beginning. To simplify things; node A = my node with traffic management enabled, node B = some random client node. Turn on module. Nodeinfo Direct Response. Set: Do I understand correctly that; if my A node will hear that B node that's 1 hop away wants NodeInfo of some far away node, my A node will step in and spoof the packet and send requested NodeInfo by itself? Position Deduplication. Set: Do I understand correctly that; if node B sends position every 45 seconds and/or position within 15 bit range compared to the last recorded position, my A node will ignore and drop this packet? Exhausting Hops (Telemetry and Position). Set: Do I understand correctly that; with this setting my A node just forwards a packet with 0 hop set, regardless of everything else? Rate Limiting. Set: Do I understand correctly that; if node B sends 13 packets in 60 seconds window, my A node will ignore and drop 4 last packets? Meaning that my A node will accept packet traffic up to 9 packets per 60 seconds? Preserving Hops. Set: Uff... I know that's a lot of questions... Best regards, Doman. PS: I'm on FW 2.7.20 Alpha |
Beta Was this translation helpful? Give feedback.
-
|
HI @TheDomanNow - thank you checking this out. :) The documentation is pending a human to re-write it, but the MR for that is here.. It should explain everything.. https://github.com/meshtastic/meshtastic/pull/2295/changes Your intuition is really good at this without having documentation. Well done. |
Beta Was this translation helpful? Give feedback.
-
|
Thre was a blog post for this, too https://github.com/meshtastic/meshtastic/pull/2297/changes |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
As meshes get larger, including 0-hop cost routing, the amount of broadcast traffic a mesh needs to handle increases a lot. While the mesh I'm apart of (bayme.sh) has migrated to faster presets, we are likely to stay on MediumFast for the forseeable furture.
As an alternative to faster presets, I propose a few changes to the code that will implement a "Traffic Management" module. This module will give router owners (and to a degree client owners) the ability to reduce the hops for certain traffic types, and reduce traffic utilization in the process.
The features..
Creation of a node 'cache' entry
Given the heavy weight of the nodedb, increasing the size is not easilly possible without causing problems with the client or other services. The module, when enabled, will create an entry for nodes it hears as a cache, with slight differences between ESP32 and NRF52 that will be discussed later.
For esp32, it looks like this
For nrf52 it looks like...
The expectation is to move from 20 bytes per node in the cache to 12 for memory constrained devices. This is accomplished saving positions as 8 bit hashes. As for the different fields, those are spoilers for later.
Position Deduplication
This is fairly straightforward. If a position for a node hasn't changed a configurable distance since the last time it has sent a posiion, don't repeat it.
This is implemented for both esp32 and nrf52 nodes, but with subtle differences for both. ESP32 will save the full position data in PSRAM but nrf52 will save a hash of the data in DRAM. This allows for the module to store 1024 nodes with about 12KB of memory for nrf52 and 20KB of memory for esp32.
The hash is only 256 entries, so there is a chance of a hash collisions for nrf52, but given the number of solar routers in the wild, this seems an acceiptable compromise, and the chance is really low. (0.4%)
The configs for this would be
Nodeinfo Direct Response
If a node exists in the router's nodeinfo database, spoof a response to the requestor with nodeinfo.
This is meant for roof nodes or local nodes that may have a full nodedb table, but someone local (between 0-3 hops away for routers, only 0 hops away for clients) will respond back with the information (with 0 max_hops). The expectation is that the message will not need to traverse the network to get this information from the remote node.
The configs for this would be
Rate Limiting
This is about as direct as one can expect. It rate limits how much a node can send at one time with multiple types of rate limiting.
First is rate limit packets in general for a timeframe. Any packets.
Second is to limit packets for unknown traffic (encrypted, unknown) traffic for a timeframe.
The expectation here is to make it fair for everyone to have a share of airtime. If a node is making too many requests, don't forward it.
The configs for this would be
Both unknown and known packets use the same
rate_limit_window_secsvalue to determine time.Exhausting Hops (Telemetry and Position)
The protocol leaves the number of hops open for modification as part of the protobuf. This code uses that to help exhaust the hops on the packet for telemetry and position data when it re-sends the message.
The expectation is to send the message with
hop_limit = 0for these packets.When local nodes receive the packets, it is added to recentPackets, and nodes will not re-send the packet even if another packet comes in with
hop_limit >= 1. This effectively stops other nodes from repeating this packet fruther.The configs for this would be
Preserving Hops
Last, but not least, the feature to preserve hops for messages. While many of the above optoins are to reduce traffic, this one allows all traffic to pass without decreasing hop_limit, allowing for packets to go further. This was a very popular feature for meshes covering long distgances, but it required manually adding each node individually. There was also discussion about routers accidentally favoriting other nodes, allowing packets to travel further than the network operators would like them to travel. This is a single switch to turn on or off this feature.
A router in this instance is either
ROUTER,ROUTER_LATE, orCLIENT_BASE. It has many of the same rules as the 0-cost hop route feature, but it allows for CLIENT_BASE to not decrement hops for incoming traffic as well.The config for this would be
Finally...
For all the above, I'm interested in keeping all the changes necessary within the module code itself. If something breaks or does not work as intended, it is easy to turn off the module.
There is still work to be done for this. For example, it might be best to treat esp32 and nrf52 noders similiarly to keep the behavior consistent between the two platforms. This will also cut down on the amount of code needed to treat each one differently.
Some default timeouts need to be set with reasonable values. Right now, they're placeholders.
This needs testing. I have the code running on a couple routers today with expected results, but not all meshes are the same.
PRs
the code PRs to support this change are still in draft (except for the protobufs - need to get that one in first)
#9358
meshtastic/protobufs#849
meshtastic/python#890
Beta Was this translation helpful? Give feedback.
All reactions