MeshCore Path Discovery Deep Dive
A detailed look at MeshCore's flood-first / direct-route-after path discoverylearning, derived from docs/packet_format.md and routethe managementfirmware system,source. basedMeshCore ondoes verifiednot informationuse froma dedicated route-discovery protocol (there is no AODV, Route Request, or Route Error); paths are learned as a byproduct of the officialinitial MeshCore repository.flood.
The Core Mechanism
MeshCore's routing uses two phases that together eliminatereduce the channel waste of pure floodingflooding. whileNote maintainingthat only the reliability of flood-based initial contact:flood has path redundancy: once a direct path is learned, subsequent messages follow that single path with no alternate-route redundancy.
Phase 1: Flood with Path Recording
EveryAs a ROUTE_TYPE_FLOOD packet that(route travelstype through0x01) atraverses repeater has its path recorded at the destination. The destination node knows the exact sequence of repeaters the packet passed through becauserepeaters, each forwarding repeater appends its identitypath-hash to athe packet's path field, so the destination receives the full ordered path recordcarried inside the packet itself. The path is tracked in the packet.flooded packet, not recorded separately at the destination.
Phase 2: Path Return via PAYLOAD_TYPE_PATH
The destination sends a PAYLOAD_TYPE_PATH response back to the original sender. This packet contains the ordered list of repeaters from the flood path. The path packet itself uses direct routing if a reverse path is known, otherwise floods back.
Phase 3: Stored Direct Routes
The sender stores the learned path and uses it for all subsequent messages to that destination using ROUTE_TYPE_DIRECT. The path remains valid until a direct-routed message fails (no acknowledgement within timeout), at which point the sender falls back to flooding and re-learns the path. Because a direct-routed message follows a single learned path with no redundancy, if one repeater on that path fails, messages are silently lost until the timeout triggers a re-flood — only the initial flood has path redundancy.
Path Hash Modes
MeshCore supports configurable path hash modes (via the set path.hash.mode {0|1|2} CLI command),command, which selects the advert path-hash size (0 = 1 byte, 1 = 2 byte, 2 = 3 byte). The default is 0 (1-byte). This setting affects only the size of the path-hash a repeater uses in its own advert broadcasts; it does not change how path uniqueness is determined anddetermined, how aggressively the routing table is compacted.managed, Modesor 0,what 1,packet andID/hash 2size are available. This allows tuning for networks wherethis repeater positionsforwards. changeThe frequentlyfeature vs.requires stablefirmware fixed≥ infrastructure.1.14.
Flood Limits
To prevent unbounded flooding, MeshCore allows configuration of flood.max (maxthe numbermaximum ofhop repeaterscount a repeater will forward a flood packet passesto, through,related 0to -the 64)64-hop firmware ceiling) and flood.advert.interval (the flood-advert cadence in hours). These limit worst-case channel usage during path discovery.usage.
Regional Scoping
Transport route types (ROUTE_TYPE_TRANSPORT_FLOOD and ROUTE_TYPE_TRANSPORT_DIRECT) include a region/2-byte transport code that allows multi-region networks to scope traffic appropriately. This transport code is calculated from the region scope — a user-defined named scope (e.g. #Europe, #USA) hashed into the 2-byte value — not an ISO country codes are the standard region identifiers.code.
Source:Sources: route types, the path field, transport codes, and MAX_PATH_SIZE (64) are per docs/packet_format.md. CLI andreferenceparameters in(path.hash.mode, flood.*, region scopes) are per the official MeshCore repository.CLI docs. Verified 2026-05-03.