Skip to main content

MeshCore Routing Architecture

MeshCore Routing Architecture

MeshCore uses a demand-drivenhybrid path-basedflood-then-direct routing protocolscheme. Unlike Meshtastic'sa floodingroute-first approach,protocol, MeshCore establishesfloods explicitthe routesfirst beforeactual sendingmessage data.to a destination; the path is recorded during that flood and returned to the sender, who then uses it for direct (path-based) routing on later messages. There is no separate route-establishment phase preceding data transmission.

pathPath discovery packetDiscovery Mechanism

RoutePath discovery workshappens inas foura steps:byproduct of the first message:

  1. When Node A wantsfirst to reachmessages Node DD, forit sends the firstmessage time, it broadcasts an path discovery packetflood-routed (ROUTE_TYPE_FLOOD); there is no dedicated Route Request)Request packet.
  2. Each intermediaterepeater nodethat rebroadcasts the pathflooded discoverymessage packet, appendingappends its identityshort path hash -(a 1-3 byte prefix of its public key), building a path record as the packet propagates.
  3. When the pathflooded discovery packetmessage reaches Node D, D (or any node that already knows a route to D), it sends a pathpath-return acknowledgmentpacket (PAYLOAD_TYPE_PATH, optionally bundling an ACK) back to A along the reverse of the recorded path.
  4. Node A receives the path acknowledgmentpath-return and now has athe completelearned route:path: A → B → C → D.

RoutePath Caching

DiscoveredLearned routespaths are cachedstored inper each node's routing table.contact. Subsequent messages to the same destination use the cachedstored routepath directly (ROUTE_TYPE_DIRECT) without re-discovery,flooding, reducing overhead on established links.

RoutePath Maintenance

IfMeshCore ahas packetno failsexplicit to reach the next hop, the forwarding node sends a Route Error (RERR) message. When a direct-routed message backis towardnot acknowledged, the source.original Thesender sourcetreats nodethe thenpath initiatesas failed and re-floods (resets the path to flood). Repeaters do not generate route-error control packets.

When a newpath routefails discovery(no cycle,ACK), ensuringthe contact's path is reset to flood; the next message re-discovers a route, letting the network self-healsheal after topology changes.

Advantages Over Pure Flooding

  • OnlyAfter packetsa path is learned, only the repeaters on the establishedstored routepath traverseforward the meshmessage - significantly less airtime consumption infor largerepeated networks.unicast traffic.
  • ScalesFor better:repeated unicast traffic in a 100-nodestable topology, MeshCore networkcan consumes faruse less channel capacity than aflooding. 100-nodeGroup/broadcast Meshtasticmessages network.still flood, and unstable topologies erode the advantage. No specific node-count guarantee should be inferred.
  • Repeater nodes can handle more traffic since they are not blindly rebroadcasting everything.everything once paths are established.

Disadvantages

  • RouteThe discoveryfirst addsmessage to a new destination floods the mesh, adding airtime and latency before first contact with a newpath destination.is learned.
  • RouteStored tablespaths require memory on each node.
  • Topology changes can invalidate cacheda routes,learned path, requiring a re-discovery.flood. A single learned path provides no redundancy, so there is a silent dead-window until the stale path triggers a re-flood.

RepeaterForwarding vs. ClientEndpoint Roles

MeshCoreMeshCore's explicitlyroles distinguishesare betweenCompanion, twoRepeater, nodeRoom types:Server, and Sensor - not a clean two-way split. Forwarding behavior differs by role:

  • Repeater nodes(and (infrastructure):Room Server) nodes: participate fully in route forwarding and carry the network's routing load of the network.load.
  • Client nodesCompanion (endpoints):client) and Sensor nodes: user devices that generate and receive messages but do not forward traffic for others. (The firmware term is "Companion"; the app/CLI labels contact type 1 "client".)

ThisBecause separationclients makesnever relay, a deployment with only client nodes provides no multi-hop coverage - it is point-to-point only. At least one repeater or room-server is required for any node-to-node relaying. Plan repeater infrastructure before relying on the protocol more efficient - only dedicated infrastructure carries the routing load, and adding more client devices does not degrade backbone performance.network.