MeshCore Path Discovery Deep Dive
A detailed look at MeshCore's path-based routing is what distinguishes it from Meshtastic's flooding approach. Understanding the path discovery mechanismand inroute detailmanagement helpssystem, youbased designon networksverified information from the official MeshCore repository.
The Core Mechanism
MeshCore's routing uses two phases that routetogether efficientlyeliminate andthe troubleshootchannel deliverywaste failures.of pure flooding while maintaining the reliability of flood-based initial contact:
RREQ
Phase and1: RREP:Flood with Path Recording
Every ROUTE_TYPE_FLOOD packet that travels through a repeater has its path recorded at the destination. The Discoverydestination Handshakenode
Whenknows Nodethe Aexact wantssequence toof sendrepeaters a message to Node B and has no known path:
Step 1: Route Request (RREQ)
Node A broadcasts an RREQthe packet containing:
Each node that receives the RREQrepeater appends its ownidentity IDto a path record in the packet.
Phase 2: Path Return via PAYLOAD_TYPE_PATH
The destination sends a PAYLOAD_TYPE_PATH response back to the pathoriginal accumulatorsender. andThis rebroadcastspacket contains the packetordered (uplist toof repeaters from the TTL/hop limit). This means when the RREQ arrives at Node B, it carries a complete record of the path it traversed: [A → C → D → B].
Step 2: Route Reply (RREP)
Node B sends an RREP back along the reverse of the discoveredflood path. The RREPpath containspacket itself uses direct routing if a reverse path is known, otherwise floods back.
Phase 3: Stored Direct Routes
The sender stores the completelearned path [B → D → C → A]. Each intermediate node receives the RREP, learns the path, and unicasts it to the next node toward A.
When Node A receives the RREP, it now knows the full path to B: [A → C → D → B]. It stores this in its route cache and uses it for all subsequent messages to Bthat (withoutdestination anotherusing RREQ)ROUTE_TYPE_DIRECT.
RouteThe Cachepath Lifetime
remains Discoveredvalid routes are cached foruntil a configurabledirect-routed time period. If no packet has been sent on a route within the cache lifetime, the route expires and a new RREQ is triggered on the next message:
MeshCore's default route cache lifetime is optimized for infrastructure nodes that move infrequently. For mobile nodes, route expiry happens faster (triggered when the route fails).
Route Failure and Recovery
When a packetmessage fails delivery(no onacknowledgement a known route (ACKwithin timeout), at which point the sender falls back to flooding and re-learns the path.
Path Hash Modes
MeshCore handlessupports itconfigurable path hash modes (set path.hash.mode CLI command), which affects how path uniqueness is determined and how aggressively the routing table is compacted. Modes 0, 1, and 2 are available. This allows tuning for networks where repeater positions change frequently vs. stable fixed infrastructure.
Flood Limits
To prevent unbounded flooding, MeshCore allows configuration of flood.max (max number of repeaters a flood packet passes through, 0–64) and flood.advert.interval. These limit worst-case channel usage during path discovery.
Regional Scoping
Transport route types (ROUTE_TYPE_TRANSPORT_FLOOD and ROUTE_TYPE_TRANSPORT_DIRECT) include a region/transport code that allows multi-region networks to scope traffic appropriately. ISO country codes are the standard region identifiers.
Source: docs/packet_format.md and CLI reference in two stages:
This means a node failure is detected and routed around within 2-5 message exchanges — much faster than waiting for the route cache to naturally expire.
Why This Scales Better Than Flooding
Consider a 30-node network where Node A sends one message to Node B:
For a 30-node network with 10 active pairs sending messages, Meshtastic generates 300 air transmissions per message round;official MeshCore generatesrepository. 30-40.Verified In a 200-node network, this difference becomes dramatic: Meshtastic floods the channel while MeshCore maintains responsive delivery.2026-05-03.