Skip to content

Commit e1a6b3a

Browse files
authored
Merge pull request #849 from h3lix1/traffic_management
Add protobufs for a in-development traffic management module.
2 parents 27591d9 + 4eca1c7 commit e1a6b3a

File tree

4 files changed

+136
-0
lines changed

4 files changed

+136
-0
lines changed

meshtastic/admin.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ message AdminMessage {
157157
* TODO: REPLACE
158158
*/
159159
STATUSMESSAGE_CONFIG = 13;
160+
161+
/*
162+
* Traffic management module config
163+
*/
164+
TRAFFICMANAGEMENT_CONFIG = 14;
160165
}
161166

162167
enum BackupLocation {

meshtastic/localonly.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ message LocalModuleConfig {
136136
*/
137137
ModuleConfig.StatusMessageConfig statusmessage = 15;
138138

139+
/*
140+
* The part of the config that is specific to the Traffic Management module
141+
*/
142+
ModuleConfig.TrafficManagementConfig traffic_management = 16;
143+
139144
/*
140145
* A version integer used to invalidate old save files when we make
141146
* incompatible changes This integer is set at build time and is private to

meshtastic/module_config.proto

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,82 @@ message ModuleConfig {
295295
int32 ble_threshold = 4;
296296
}
297297

298+
/*
299+
* Config for the Traffic Management module.
300+
* Provides packet inspection and traffic shaping to help reduce channel utilization
301+
*/
302+
message TrafficManagementConfig {
303+
/*
304+
* Master enable for traffic management module
305+
*/
306+
bool enabled = 1;
307+
308+
/*
309+
* Enable position deduplication to drop redundant position broadcasts
310+
*/
311+
bool position_dedup_enabled = 2;
312+
313+
/*
314+
* Number of bits of precision for position deduplication (0-32)
315+
*/
316+
uint32 position_precision_bits = 3;
317+
318+
/*
319+
* Minimum interval in seconds between position updates from the same node
320+
*/
321+
uint32 position_min_interval_secs = 4;
322+
323+
/*
324+
* Enable direct response to NodeInfo requests from local cache
325+
*/
326+
bool nodeinfo_direct_response = 5;
327+
328+
/*
329+
* Minimum hop distance from requestor before responding to NodeInfo requests
330+
*/
331+
uint32 nodeinfo_direct_response_max_hops = 6;
332+
333+
/*
334+
* Enable per-node rate limiting to throttle chatty nodes
335+
*/
336+
bool rate_limit_enabled = 7;
337+
338+
/*
339+
* Time window in seconds for rate limiting calculations
340+
*/
341+
uint32 rate_limit_window_secs = 8;
342+
343+
/*
344+
* Maximum packets allowed per node within the rate limit window
345+
*/
346+
uint32 rate_limit_max_packets = 9;
347+
348+
/*
349+
* Enable dropping of unknown/undecryptable packets per rate_limit_window_secs
350+
*/
351+
bool drop_unknown_enabled = 10;
352+
353+
/*
354+
* Number of unknown packets before dropping from a node
355+
*/
356+
uint32 unknown_packet_threshold = 11;
357+
358+
/*
359+
* Set hop_limit to 0 for relayed telemetry broadcasts (own packets unaffected)
360+
*/
361+
bool exhaust_hop_telemetry = 12;
362+
363+
/*
364+
* Set hop_limit to 0 for relayed position broadcasts (own packets unaffected)
365+
*/
366+
bool exhaust_hop_position = 13;
367+
368+
/*
369+
* Preserve hop_limit for router-to-router traffic
370+
*/
371+
bool router_preserve_hops = 14;
372+
}
373+
298374
/*
299375
* Serial Config
300376
*/
@@ -852,6 +928,11 @@ message ModuleConfig {
852928
* TODO: REPLACE
853929
*/
854930
StatusMessageConfig statusmessage = 14;
931+
932+
/*
933+
* Traffic management module config for mesh network optimization
934+
*/
935+
TrafficManagementConfig traffic_management = 15;
855936
}
856937
}
857938

meshtastic/telemetry.proto

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,46 @@ message LocalStats {
450450
int32 noise_floor = 15;
451451
}
452452

453+
/*
454+
* Traffic management statistics for mesh network optimization
455+
*/
456+
message TrafficManagementStats {
457+
/*
458+
* Total number of packets inspected by traffic management
459+
*/
460+
uint32 packets_inspected = 1;
461+
462+
/*
463+
* Number of position packets dropped due to deduplication
464+
*/
465+
uint32 position_dedup_drops = 2;
466+
467+
/*
468+
* Number of NodeInfo requests answered from cache
469+
*/
470+
uint32 nodeinfo_cache_hits = 3;
471+
472+
/*
473+
* Number of packets dropped due to rate limiting
474+
*/
475+
uint32 rate_limit_drops = 4;
476+
477+
/*
478+
* Number of unknown/undecryptable packets dropped
479+
*/
480+
uint32 unknown_packet_drops = 5;
481+
482+
/*
483+
* Number of packets with hop_limit exhausted for local-only broadcast
484+
*/
485+
uint32 hop_exhausted_packets = 6;
486+
487+
/*
488+
* Number of times router hop preservation was applied
489+
*/
490+
uint32 router_hops_preserved = 7;
491+
}
492+
453493
/*
454494
* Health telemetry metrics
455495
*/
@@ -565,6 +605,11 @@ message Telemetry {
565605
* Linux host metrics
566606
*/
567607
HostMetrics host_metrics = 8;
608+
609+
/*
610+
* Traffic management statistics
611+
*/
612+
TrafficManagementStats traffic_management_stats = 9;
568613
}
569614
}
570615

0 commit comments

Comments
 (0)