Traceroute data correlation #17
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#16 Traceroute log details pretty rendering
skobkin/meshmap-lite
#15 Traceroute logs details
skobkin/meshmap-lite
Reference
skobkin/meshmap-lite#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add bounded ingest-side traceroute correlation with timeout synthesis
Summary
Implement bounded ingest-side traceroute correlation so the app can combine:
into one logical traceroute run, with explicit lifecycle status such as
requested,partial,completed,failed, ortimed_out.Problem
The current codebase now decodes individual
TRACEROUTE_APPandROUTING_APPpackets with much richer semantics, but it still treats them as packet-local events.That means:
This is especially important because MQTT often exposes only part of the real traceroute exchange. The app should preserve partial evidence while still producing a useful traceroute-level outcome.
Goal
Add a short-lived ingest-side correlator that tracks traceroute requests by
request_id, merges later reply or routing-failure packets into the same logical run, and synthesizes a timeout when no terminal packet arrives within a bounded window.The intent is to improve operator visibility without fabricating data that MQTT never exposed.
Non-goals
internal/meshtastic; parsing should stay packet-local and stateless.Why ingest is the right layer
Correlation is transport-observation policy, not packet parsing.
The parser should continue to answer questions like:
The ingest layer should answer questions like:
That makes
internal/ingestthe appropriate ownership boundary.Likely implementation area
internal/ingest/service.gointernal/ingest/traceroute_tracker.goProposed tracked state
Track active traceroute requests in an in-memory bounded map keyed by
request_id.Each tracked entry should include at least:
request_idSuggested statuses
requestedpartialcompletedfailedtimed_outCorrelation rules
1. Request packet
Packet shape:
TRACEROUTE_APPwant_response = trueBehavior:
request_idrequestedrequested2. Reply packet
Packet shape:
TRACEROUTE_APPwant_response = falserequest_idreply_idonly as fallback if neededBehavior:
completedif the reply provides a usable resultpartial3. Routing error packet
Packet shape:
ROUTING_APPrequest_idpresenterror_reason != NONEBehavior:
failederror_reasonerror_reason = NONEas failure4. Timeout
Behavior:
timed_outBounded-memory requirements
This feature must remain bounded and safe for long-running processes.
Suggested controls:
If the tracker is full:
Dedup requirements
There are two separate dedup concerns.
1. Packet-level dedup
The existing packet dedup logic already suppresses exact duplicate MQTT packet IDs.
That should remain in place.
2. Lifecycle-level dedup
The new tracker must additionally ensure it does not emit duplicate final lifecycle records when:
Each tracked entry should remember whether a final lifecycle event has already been emitted.
Merging policy
When updating a tracked traceroute state:
Suggested output strategy
Two designs are possible.
Option A: lifecycle rows plus packet rows
Pros:
Cons:
Option B: lifecycle rows only for traceroute
Pros:
Cons:
Recommended first step: implement Option A.
Suggested lifecycle log details
Correlated traceroute lifecycle rows should include at least:
statusrequest_idfromtochannelforward_pathreturn_pathforward_snrreturn_snrerror_reasonstarted_atupdated_atcompleted_ator timeout timestamp when relevantinferred_*fields where applicablesource_packetscontaining request, reply, and routing packet ids when knownTimeout policy
The issue should require a clear timeout policy:
status = timed_outConcurrency and ownership
If ingest processing can run concurrently, the tracker must be synchronized.
A simple design is sufficient:
Ownership should remain local to ingest.
Expected tests
Add regression coverage for at least:
NO_ROUTE-> one correlated failureNONE-> not failedAcceptance criteria
Implementation is complete when all of the following are true:
request_idNONEerror reason fail the matching tracked requestImplementation notes
internal/meshtasticunchanged except where new fields are needed.The safest first implementation is to keep unmatched reply evidence visible rather than dropping it silently.