Skip to content

Add original hop limit to header to determine hops used - #3321

Merged
thebentern merged 15 commits into
meshtastic:masterfrom
GUVWAF:hopStart
Mar 8, 2024
Merged

Add original hop limit to header to determine hops used#3321
thebentern merged 15 commits into
meshtastic:masterfrom
GUVWAF:hopStart

Conversation

@GUVWAF

@GUVWAF GUVWAF commented Mar 3, 2024

Copy link
Copy Markdown
Member

This adds the original hop limit of a packet (hopStart) to the unencrypted header using the three remaining bits such that we can derive with how many hops each packet was received. This will be saved in the NodeInfo as hopsAway. Also viaMQTT is now saved in the NodeInfo.

Using this, we can adapt the hopLimit of a response and real ACK to more or less hops if needed. This is implemented with RoutingModule::getHopLimitForResponse(). If the amount of hops used for the request was more than our setting, we use the amount of hops that was used for the request. When it used less than our setting, I chose a margin of 2 more hops for the response in case the path back is different.

This also allows us to determine neighbors even if others don’t have the NeighborInfo Module enabled, which is implemented as well.

Closes #3239.

@github-actions

github-actions Bot commented Mar 3, 2024

Copy link
Copy Markdown
Contributor

🤖 Pull request artifacts

empty string

file commit
firmware-2.2.25.2c59e5d.zip 2c59e5d

thebentern added a commit to meshtastic/artifacts that referenced this pull request Mar 3, 2024
Comment thread src/mesh/NodeDB.cpp
@thebentern
thebentern merged commit 585805c into meshtastic:master Mar 8, 2024
GUVWAF added a commit to GUVWAF/Meshtastic-device that referenced this pull request Mar 20, 2024
@GUVWAF
GUVWAF deleted the hopStart branch September 28, 2024 17:28
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
)

* Set `hop_start` in header to determine how many hops each packet traveled

* Set hopLimit of response according to hops used by request

* Identify neighbors based on `hopStart` and `hopLimit`

* NeighborInfo: get all packets and assume a default broadcast interval

* Add fail-safe in case node in between is running modified firmware

* Add `viaMQTT` and `hopsAway` to NodeInfo

* Replace `HOP_RELIABLE` with hopStart for repeated packet

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Range check and mesh complexity: Proposed Backwards compatible Meshtastic protocol improvement

2 participants