From e2daf8d914070d7b67e152e1656e737b5fc15938 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Mon, 19 Jan 2026 13:39:55 -0800 Subject: [PATCH 01/11] Add module traffic_management protobufs --- meshtastic/admin.proto | 5 +++ meshtastic/localonly.proto | 5 +++ meshtastic/module_config.proto | 57 ++++++++++++++++++++++++++++++++++ meshtastic/telemetry.proto | 19 ++++++++++++ 4 files changed, 86 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index d622e0e..ed373a5 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -157,6 +157,11 @@ message AdminMessage { * TODO: REPLACE */ STATUSMESSAGE_CONFIG = 13; + + /* + * Traffic management module config + */ + TRAFFICMANAGEMENT_CONFIG = 14; } enum BackupLocation { diff --git a/meshtastic/localonly.proto b/meshtastic/localonly.proto index 6da79a3..50b74f7 100644 --- a/meshtastic/localonly.proto +++ b/meshtastic/localonly.proto @@ -136,6 +136,11 @@ message LocalModuleConfig { */ ModuleConfig.StatusMessageConfig statusmessage = 15; + /* + * The part of the config that is specific to the Traffic Management module + */ + ModuleConfig.TrafficManagementConfig traffic_management = 16; + /* * A version integer used to invalidate old save files when we make * incompatible changes This integer is set at build time and is private to diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index ac13a56..80a2b44 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -295,6 +295,58 @@ message ModuleConfig { int32 ble_threshold = 4; } + /* + * Config for the Traffic Management module + */ + message TrafficManagementConfig { + /* + * Master enable for traffic management + */ + bool enabled = 1; + + /* + * Dry-run mode: log actions but don't drop/modify packets + */ + bool dry_run = 2; + + /* + * Position deduplication settings + */ + bool position_dedup_enabled = 3; + uint32 position_precision_bits = 4; + uint32 position_min_interval_secs = 5; + + /* + * NodeInfo direct response settings + */ + bool nodeinfo_direct_response = 6; + uint32 nodeinfo_direct_response_min_hops = 7; + + /* + * Rate limiting settings + */ + bool rate_limit_enabled = 8; + uint32 rate_limit_window_secs = 9; + uint32 rate_limit_max_packets = 10; + + /* + * Unknown/undecryptable packet handling + */ + bool drop_unknown_enabled = 11; + uint32 unknown_packet_threshold = 12; + + /* + * Hop exhaustion for local telemetry/position + */ + bool local_only_telemetry = 13; + bool local_only_position = 14; + + /* + * Router hop preservation + */ + bool router_preserve_hops = 15; + } + /* * Serial Config */ @@ -852,6 +904,11 @@ message ModuleConfig { * TODO: REPLACE */ StatusMessageConfig statusmessage = 14; + + /* + * TODO: REPLACE + */ + TrafficManagementConfig traffic_management = 15; } } diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index 8b70ade..efcc4a4 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -450,6 +450,20 @@ message LocalStats { int32 noise_floor = 15; } +/* + * Traffic management statistics + */ +message TrafficManagementStats { + uint32 packets_inspected = 1; + uint32 position_dedup_drops = 2; + uint32 nodeinfo_cache_hits = 3; + uint32 rate_limit_drops = 4; + uint32 unknown_packet_drops = 5; + uint32 hop_exhausted_packets = 6; + uint32 dry_run_would_drop = 7; + uint32 router_hops_preserved = 8; +} + /* * Health telemetry metrics */ @@ -565,6 +579,11 @@ message Telemetry { * Linux host metrics */ HostMetrics host_metrics = 8; + + /* + * Traffic management statistics + */ + TrafficManagementStats traffic_management_stats = 9; } } From 4fbac7db2bb41253269c1712214575cb6a64e08b Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Mon, 19 Jan 2026 15:12:50 -0800 Subject: [PATCH 02/11] Updated probufs with more comments per submit requirement. --- meshtastic/admin.proto | 2 +- meshtastic/module_config.proto | 2 +- meshtastic/telemetry.proto | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index ed373a5..643e418 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -154,7 +154,7 @@ message AdminMessage { PAXCOUNTER_CONFIG = 12; /* - * TODO: REPLACE + * Traffic Management module config */ STATUSMESSAGE_CONFIG = 13; diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 80a2b44..feb8481 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -906,7 +906,7 @@ message ModuleConfig { StatusMessageConfig statusmessage = 14; /* - * TODO: REPLACE + * Traffic management module config for mesh network optimization */ TrafficManagementConfig traffic_management = 15; } diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index efcc4a4..5dd23c1 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -451,16 +451,47 @@ message LocalStats { } /* - * Traffic management statistics + * Traffic management statistics for mesh network optimization */ message TrafficManagementStats { + /* + * Total number of packets inspected by traffic management + */ uint32 packets_inspected = 1; + + /* + * Number of position packets dropped due to deduplication + */ uint32 position_dedup_drops = 2; + + /* + * Number of NodeInfo requests answered from cache + */ uint32 nodeinfo_cache_hits = 3; + + /* + * Number of packets dropped due to rate limiting + */ uint32 rate_limit_drops = 4; + + /* + * Number of unknown/undecryptable packets dropped + */ uint32 unknown_packet_drops = 5; + + /* + * Number of packets with hop_limit exhausted for local-only broadcast + */ uint32 hop_exhausted_packets = 6; + + /* + * Number of packets that would have been dropped in dry-run mode + */ uint32 dry_run_would_drop = 7; + + /* + * Number of times router hop preservation was applied + */ uint32 router_hops_preserved = 8; } From 542285b5d0d591d8e51b2203c8dc1602f9960338 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Mon, 19 Jan 2026 15:14:50 -0800 Subject: [PATCH 03/11] More comments --- meshtastic/module_config.proto | 47 +++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index feb8481..440ef9d 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -296,53 +296,82 @@ message ModuleConfig { } /* - * Config for the Traffic Management module + * Config for the Traffic Management module. + * Provides packet inspection and traffic shaping for mesh network optimization. */ message TrafficManagementConfig { /* - * Master enable for traffic management + * Master enable for traffic management module */ bool enabled = 1; /* - * Dry-run mode: log actions but don't drop/modify packets + * Dry-run mode: log actions but don't actually drop or modify packets */ bool dry_run = 2; /* - * Position deduplication settings + * Enable position deduplication to drop redundant position broadcasts */ bool position_dedup_enabled = 3; + + /* + * Number of bits of precision for position deduplication (0-32) + */ uint32 position_precision_bits = 4; + + /* + * Minimum interval in seconds between position updates from the same node + */ uint32 position_min_interval_secs = 5; /* - * NodeInfo direct response settings + * Enable direct response to NodeInfo requests from local cache */ bool nodeinfo_direct_response = 6; + + /* + * Minimum hop distance from requestor before responding to NodeInfo requests + */ uint32 nodeinfo_direct_response_min_hops = 7; /* - * Rate limiting settings + * Enable per-node rate limiting to throttle chatty nodes */ bool rate_limit_enabled = 8; + + /* + * Time window in seconds for rate limiting calculations + */ uint32 rate_limit_window_secs = 9; + + /* + * Maximum packets allowed per node within the rate limit window + */ uint32 rate_limit_max_packets = 10; /* - * Unknown/undecryptable packet handling + * Enable dropping of unknown/undecryptable packets from repeat offenders */ bool drop_unknown_enabled = 11; + + /* + * Number of unknown packets before dropping from a node + */ uint32 unknown_packet_threshold = 12; /* - * Hop exhaustion for local telemetry/position + * Set hop_limit to 0 for locally-originated telemetry broadcasts */ bool local_only_telemetry = 13; + + /* + * Set hop_limit to 0 for locally-originated position broadcasts + */ bool local_only_position = 14; /* - * Router hop preservation + * Preserve hop_limit for router-to-router traffic */ bool router_preserve_hops = 15; } From 84a26030379bb6e202c95b0b8c21f2784de84316 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Mon, 19 Jan 2026 15:19:18 -0800 Subject: [PATCH 04/11] Minor wording updates --- meshtastic/module_config.proto | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 440ef9d..be56f42 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -297,7 +297,7 @@ message ModuleConfig { /* * Config for the Traffic Management module. - * Provides packet inspection and traffic shaping for mesh network optimization. + * Provides packet inspection and traffic shaping to help reduce channel utilization */ message TrafficManagementConfig { /* @@ -351,7 +351,8 @@ message ModuleConfig { uint32 rate_limit_max_packets = 10; /* - * Enable dropping of unknown/undecryptable packets from repeat offenders + * Enable dropping of unknown/undecryptable packets per rate_limit_window_secs + */ bool drop_unknown_enabled = 11; @@ -361,12 +362,12 @@ message ModuleConfig { uint32 unknown_packet_threshold = 12; /* - * Set hop_limit to 0 for locally-originated telemetry broadcasts + * Set hop_limit to 0 for telemetry broadcasts */ bool local_only_telemetry = 13; /* - * Set hop_limit to 0 for locally-originated position broadcasts + * Set hop_limit to 0 for position broadcasts */ bool local_only_position = 14; From 693aaa395b1bae4fa8423d8f9278c96c8b31d64c Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Tue, 20 Jan 2026 23:48:48 -0800 Subject: [PATCH 05/11] Update zero_hop_telemetry / zero_hop_position --- meshtastic/module_config.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index be56f42..2a593e4 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -362,14 +362,14 @@ message ModuleConfig { uint32 unknown_packet_threshold = 12; /* - * Set hop_limit to 0 for telemetry broadcasts + * Set hop_limit to 0 for relayed telemetry broadcasts (own packets unaffected) */ - bool local_only_telemetry = 13; + bool zero_hop_telemetry = 13; /* - * Set hop_limit to 0 for position broadcasts + * Set hop_limit to 0 for relayed position broadcasts (own packets unaffected) */ - bool local_only_position = 14; + bool zero_hop_position = 14; /* * Preserve hop_limit for router-to-router traffic From 7a1b5b683d291c950f077e67182ac12c61ffe747 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Wed, 21 Jan 2026 19:45:11 -0800 Subject: [PATCH 06/11] Hopefully last name change --- meshtastic/module_config.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 2a593e4..a7cd4e1 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -364,12 +364,12 @@ message ModuleConfig { /* * Set hop_limit to 0 for relayed telemetry broadcasts (own packets unaffected) */ - bool zero_hop_telemetry = 13; + bool exhaust_hop_telemetry = 13; /* * Set hop_limit to 0 for relayed position broadcasts (own packets unaffected) */ - bool zero_hop_position = 14; + bool exhaust_hop_position = 14; /* * Preserve hop_limit for router-to-router traffic From 8b0cdd20f35c6e6367ed68b05362164d7879f867 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Thu, 22 Jan 2026 22:44:47 -0800 Subject: [PATCH 07/11] Fixing naming for traffic_management.nodeinfo_direct_response_min_hops to traffic_management.nodeinfo_direct_response_max_hops --- meshtastic/module_config.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index a7cd4e1..292f01e 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -333,7 +333,7 @@ message ModuleConfig { /* * Minimum hop distance from requestor before responding to NodeInfo requests */ - uint32 nodeinfo_direct_response_min_hops = 7; + uint32 nodeinfo_direct_response_max_hops = 7; /* * Enable per-node rate limiting to throttle chatty nodes From 780863b1ed78c8c70c281840429d5b91e6a00084 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Sat, 31 Jan 2026 09:14:13 -0800 Subject: [PATCH 08/11] Removed dry_run before potential release. There was no easy way to get these metrics. --- meshtastic/module_config.proto | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 292f01e..9405099 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -305,76 +305,71 @@ message ModuleConfig { */ bool enabled = 1; - /* - * Dry-run mode: log actions but don't actually drop or modify packets - */ - bool dry_run = 2; - /* * Enable position deduplication to drop redundant position broadcasts */ - bool position_dedup_enabled = 3; + bool position_dedup_enabled = 2; /* * Number of bits of precision for position deduplication (0-32) */ - uint32 position_precision_bits = 4; + uint32 position_precision_bits = 3; /* * Minimum interval in seconds between position updates from the same node */ - uint32 position_min_interval_secs = 5; + uint32 position_min_interval_secs = 4; /* * Enable direct response to NodeInfo requests from local cache */ - bool nodeinfo_direct_response = 6; + bool nodeinfo_direct_response = 5; /* * Minimum hop distance from requestor before responding to NodeInfo requests */ - uint32 nodeinfo_direct_response_max_hops = 7; + uint32 nodeinfo_direct_response_max_hops = 6; /* * Enable per-node rate limiting to throttle chatty nodes */ - bool rate_limit_enabled = 8; + bool rate_limit_enabled = 7; /* * Time window in seconds for rate limiting calculations */ - uint32 rate_limit_window_secs = 9; + uint32 rate_limit_window_secs = 8; /* * Maximum packets allowed per node within the rate limit window */ - uint32 rate_limit_max_packets = 10; + uint32 rate_limit_max_packets = 9; /* * Enable dropping of unknown/undecryptable packets per rate_limit_window_secs */ - bool drop_unknown_enabled = 11; + bool drop_unknown_enabled = 10; /* * Number of unknown packets before dropping from a node */ - uint32 unknown_packet_threshold = 12; + uint32 unknown_packet_threshold = 11; /* * Set hop_limit to 0 for relayed telemetry broadcasts (own packets unaffected) */ - bool exhaust_hop_telemetry = 13; + bool exhaust_hop_telemetry = 12; /* * Set hop_limit to 0 for relayed position broadcasts (own packets unaffected) */ - bool exhaust_hop_position = 14; + bool exhaust_hop_position = 13; /* * Preserve hop_limit for router-to-router traffic */ - bool router_preserve_hops = 15; + bool router_preserve_hops = 14; } /* From 55a3604fac23ebed8312f6f63fcf3e10639d41b8 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Sat, 31 Jan 2026 09:14:43 -0800 Subject: [PATCH 09/11] Same here --- meshtastic/telemetry.proto | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index 5dd23c1..bdf505f 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -484,15 +484,10 @@ message TrafficManagementStats { */ uint32 hop_exhausted_packets = 6; - /* - * Number of packets that would have been dropped in dry-run mode - */ - uint32 dry_run_would_drop = 7; - /* * Number of times router hop preservation was applied */ - uint32 router_hops_preserved = 8; + uint32 router_hops_preserved = 7; } /* From 2fe13dbe06771b4449c3bcd13f6120faf78c8b7e Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Sat, 31 Jan 2026 09:22:19 -0800 Subject: [PATCH 10/11] Fixed misplaced comment after merge --- meshtastic/admin.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 643e418..ed373a5 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -154,7 +154,7 @@ message AdminMessage { PAXCOUNTER_CONFIG = 12; /* - * Traffic Management module config + * TODO: REPLACE */ STATUSMESSAGE_CONFIG = 13; From 4eca1c78a8f863a5fdd2a26377fcab6a345c9a43 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Tue, 10 Feb 2026 11:49:22 -0800 Subject: [PATCH 11/11] buf format updates. --- meshtastic/module_config.proto | 1 - meshtastic/telemetry.proto | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 9405099..a8a4307 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -347,7 +347,6 @@ message ModuleConfig { /* * Enable dropping of unknown/undecryptable packets per rate_limit_window_secs - */ bool drop_unknown_enabled = 10; diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index bdf505f..fe4cc44 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -439,9 +439,9 @@ message LocalStats { */ uint32 heap_free_bytes = 13; - /* - * Number of packets that were dropped because the transmit queue was full. - */ + /* + * Number of packets that were dropped because the transmit queue was full. + */ uint32 num_tx_dropped = 14; /*