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..a8a4307 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -295,6 +295,82 @@ message ModuleConfig { int32 ble_threshold = 4; } + /* + * Config for the Traffic Management module. + * Provides packet inspection and traffic shaping to help reduce channel utilization + */ + message TrafficManagementConfig { + /* + * Master enable for traffic management module + */ + bool enabled = 1; + + /* + * Enable position deduplication to drop redundant position broadcasts + */ + bool position_dedup_enabled = 2; + + /* + * Number of bits of precision for position deduplication (0-32) + */ + uint32 position_precision_bits = 3; + + /* + * Minimum interval in seconds between position updates from the same node + */ + uint32 position_min_interval_secs = 4; + + /* + * Enable direct response to NodeInfo requests from local cache + */ + bool nodeinfo_direct_response = 5; + + /* + * Minimum hop distance from requestor before responding to NodeInfo requests + */ + uint32 nodeinfo_direct_response_max_hops = 6; + + /* + * Enable per-node rate limiting to throttle chatty nodes + */ + bool rate_limit_enabled = 7; + + /* + * Time window in seconds for rate limiting calculations + */ + uint32 rate_limit_window_secs = 8; + + /* + * Maximum packets allowed per node within the rate limit window + */ + uint32 rate_limit_max_packets = 9; + + /* + * Enable dropping of unknown/undecryptable packets per rate_limit_window_secs + */ + bool drop_unknown_enabled = 10; + + /* + * Number of unknown packets before dropping from a node + */ + uint32 unknown_packet_threshold = 11; + + /* + * Set hop_limit to 0 for relayed telemetry broadcasts (own packets unaffected) + */ + bool exhaust_hop_telemetry = 12; + + /* + * Set hop_limit to 0 for relayed position broadcasts (own packets unaffected) + */ + bool exhaust_hop_position = 13; + + /* + * Preserve hop_limit for router-to-router traffic + */ + bool router_preserve_hops = 14; + } + /* * Serial Config */ @@ -852,6 +928,11 @@ message ModuleConfig { * TODO: REPLACE */ StatusMessageConfig statusmessage = 14; + + /* + * Traffic management module config for mesh network optimization + */ + TrafficManagementConfig traffic_management = 15; } } diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index 498cecd..b5e418e 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -450,6 +450,46 @@ message LocalStats { int32 noise_floor = 15; } +/* + * 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 times router hop preservation was applied + */ + uint32 router_hops_preserved = 7; +} + /* * Health telemetry metrics */ @@ -565,6 +605,11 @@ message Telemetry { * Linux host metrics */ HostMetrics host_metrics = 8; + + /* + * Traffic management statistics + */ + TrafficManagementStats traffic_management_stats = 9; } }