TrafficManagement: exempt traceroute from per-source rate limiting#10228
Closed
nightjoker7 wants to merge 1 commit into
Closed
TrafficManagement: exempt traceroute from per-source rate limiting#10228nightjoker7 wants to merge 1 commit into
nightjoker7 wants to merge 1 commit into
Conversation
Add TRACEROUTE_APP to the list of portnums that bypass the rate limiter in TrafficManagementModule::handleReceived(), alongside the existing ROUTING_APP and ADMIN_APP exemptions. Traceroute responses travel as ordinary DM-class packets from the source being probed, so when rate_limit_enabled is true on a router and the source has just sent any other traffic (position, telemetry, NodeInfo broadcast), the traceroute reply is silently dropped via ignoreRequest=true/STOP. The initiator cannot distinguish this from a genuine routing failure, which is exactly the case traceroute is meant to diagnose. Refactor the portnum check into a named rateLimitExempt boolean for clarity and update the adjacent comment to reflect the new membership.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates TrafficManagementModule so traceroute traffic isn’t dropped by the per-source rate limiter, improving reliability of operator-initiated diagnostics on congested meshes.
Changes:
- Exempts
TRACEROUTE_APPfrom the per-source rate limiter (joining existingROUTING_APPandADMIN_APPexemptions). - Refactors the exemption logic into a named boolean for readability.
- Updates the adjacent comment to reflect the expanded exemption list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
TRACEROUTE_APPto the list of portnums exempt fromTrafficManagementModule's rate limiter, alongside the existingROUTING_APPandADMIN_APPexemptions.Problem
In
TrafficManagementModule::handleReceived():Traceroute packets (
TRACEROUTE_APP) flow on the same node→node DM channels as user traffic and are therefore subject to the same per-source rate limit. When a router node hasrate_limit_enabled = true(the intended behavior for congested deployments), traceroute responses get silently dropped whenever the originating node happens to be slightly chatty, and the initiator sees incomplete or missing paths.The failure mode is particularly bad because:
ignoreRequest = true; return STOP;path suppresses the NAK, so the initiator cannot distinguish "no route" from "route was discovered but the reply was rate-limited on an intermediate hop."Fix
Add
TRACEROUTE_APPto the exempt list and refactor the check into a named boolean for readability:Also update the adjacent comment.
Testing
rate_limit_enabled = true,rate_limit_window_secs = 60,rate_limit_max_packets = 8. Traceroute from neighboring nodes now reliably returns a complete path even when the source node is simultaneously sending position/telemetry.develop.Risk
Minimal. Moves one portnum from "subject to rate limit" to "exempt from rate limit." No path change for any other traffic class. Traceroute is already rate-limited elsewhere in the stack by its intrinsic once-per-operator-command cadence.