Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TraceRouteModule #2026

Merged
merged 1 commit into from
Dec 6, 2022
Merged

TraceRouteModule #2026

merged 1 commit into from
Dec 6, 2022

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Dec 5, 2022

As per an idea of @mc-hamster, this adds a TraceRouteModule that traces the route a packet to a certain destination would follow. I will submit a PR to the CLI to add the necessary functionality. It works like this:

meshtastic --traceroute ‘!bff18ce4’
Connected to radio
Sending traceroute request to !bff18ce4 (this could take a while)
Route traced:
!25048234 --> !ba4bf9d0 --> !bff18ce4

Only nodes that know the encryption key will be traced. Also note that a message may arrive via multiple routes due to duplication because of rebroadcasting. This will only show the route of the first packet containing the traceroute request that arrived at the destination.

I repurposed the existing RouteDiscovery message for it. It does not completely fit into the concept of a module though, because a device needs to alter the payload of a received packet even if it is not destined for you. Therefore I let the FloodingRouter call the module to update the route.

Here is a log of the destination node:

??:??:?? 3 [Router] Module 'traceroute' wantsPacket=1
??:??:?? 3 [Router] Received traceroute from=0x25048234, id=0xccab248c, portnum=70, payloadlen=6
??:??:?? 3 [Router] Route traced:
??:??:?? 3 [Router] 0x25048234 --> 0xba4bf9d0 --> 0xbff18ce4
??:??:?? 3 [Router] Initial packet id 218905366, numPacketId 4294967295
??:??:?? 3 [Router] Module 'traceroute' sent a response

I also tested this up till 7 hops in the interactive simulator and that works fine.

Needs the TRACEROUTE_APP portnum to build successfully.

@caveman99 caveman99 merged commit a42a9bf into meshtastic:develop Dec 6, 2022
caveman99 added a commit that referenced this pull request Dec 21, 2022
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.

2 participants