Replace Path Hashing in Packets with Repeater-Side Hashtables for Scalable Flood Routing #3247
Thevandermeij
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
RFC: Efficient Flood Routing with Repeater-Side Hashtables for MeshCore
Title: Replace Path Hashing in Packets with Repeater-Side Hashtables for Scalable Flood Routing
Date: August 19, 2026
Status: Draft (Open for Community Feedback)
Target Version: MeshCore Firmware v1.18.0+
1. Abstract
This proposal suggests replacing path hashing in packets with a repeater-side hashtable for flood routing in MeshCore. This change aims to reduce:
The proposal maintains backward compatibility through a dual-mode implementation and introduces configuration options for network administrators.
2. Motivation
2.1 Current Issues
MeshCore’s current path hashing in packets has the following limitations:
pathfield.2.2 Goals
3. Proposed Solution
3.1 Core Idea
Replace path hashing in packets with a local hashtable in each repeater that tracks:
Packet ID).Previous Node Hash).3.2 New Packet Structure
Current (Path Hashing)
Proposed (Hashtable)
Header Changes
Add a
routing_modebit to the header to indicate whether the packet uses path hashing or hashtable:3.3 Repeater Hashtable Structure
Each repeater maintains a local hashtable as follows:
3.4 Packet ID Generation
The
Packet IDis generated as:Packet ID.4. Protocol Changes
4.1 Packet Transmission (Sender Side)
Current (Path Hashing)
pathfield.Proposed (Hashtable)
Packet ID(viageneratePacketID).Previous Node Hash = hash(A).routing_mode = 1).4.2 Packet Processing (Repeater Side)
Current (Path Hashing)
pathfield:pathand forward.Proposed (Hashtable)
Packet ID:prev_node_hash == hash(B): Ignore (loop prevention).prev_node_hash != hash(B): Ignore (already processed via another path).packet_cache[packet_id] = {packet_id, hash(A), millis()};4.3 Loop Prevention
Packet ID + Previous Node Hashin cache.4.4 Flood Routing vs. Direct Routing
5. Firmware Changes
5.1 New Data Structures
5.2 New Functions
A. Cache Management
B. Packet Processing
C. Packet Generation (Sender Side)
6. Backward Compatibility
6.1 Dual-Mode Support
routing_modebit in the header:0: Path hashing (old method).1: Hashtable (new method).routing_mode = 1(or attempt to use path hashing, which will fail).6.2 Transition Period
7. Configuration Options
Add new CLI commands to configure the cache:
Example Output:
8. Performance Analysis
8.1 Packet Size Comparison
8.2 Network Load Comparison
8.3 Memory Usage
9. Testing Plan
9.1 Test Phases
9.2 Test Scenarios
9.3 Test Tools
10. Implementation Roadmap
10.1 Phase 1: Design and Simulation (2 weeks)
10.2 Phase 2: Firmware Implementation (4 weeks)
10.3 Phase 3: Lab Tests (4 weeks)
10.4 Phase 4: Field Tests (8 weeks)
10.5 Phase 5: Rollout (12 weeks)
11. Expected Impact
11.1 Performance Improvements
11.2 Community Impact
Benefits for Users:
Benefits for Developers:
12. Open Questions & Community Feedback
12.1 Open Questions
What is the optimal cache size?
What is the optimal TTL?
How to handle memory constraints?
How to test backward compatibility?
12.2 Community Feedback
We invite the MeshCore community to provide feedback on:
Discussion: MeshCore GitHub Discussions
Pull Request: MeshCore GitHub PR
13. References
14. Appendix: Code Examples
14.1 Complete Packet Format (Hex)
Current (Path Hashing):
Total: 1 + 1 + 3 + 5 = 10 bytes.
Proposed (Hashtable):
Total: 1 + 4 + 4 + 5 = 14 bytes (for 1 hop).
14.2 Example: Cache Management in C++
14.3 Example: Packet Processing in Repeater
15. Call to Action
This proposal is ready for community feedback and implementation. We invite the MeshCore community to:
Goal: A more efficient, scalable MeshCore protocol that improves large networks, battery life, and network load.
End of RFC 🚀
All reactions