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:
- When Node A
wantsfirstto reachmessages NodeDD,forit sends thefirstmessagetime, it broadcasts anpath discovery packetflood-routed (ROUTE_TYPE_FLOOD); there is no dedicated RouteRequest)Request packet. - Each
intermediaterepeaternodethat rebroadcasts thepathfloodeddiscoverymessagepacket,appendingappends itsidentityshort path hash-(a 1-3 byte prefix of its public key), building a path record as the packet propagates. - When the
pathfloodeddiscovery packetmessage reaches Node D, D(or any node that already knows a route to D), itsends apathpath-returnacknowledgmentpacket (PAYLOAD_TYPE_PATH, optionally bundling an ACK) back to A along the reverse of the recorded path. - Node A receives the
path acknowledgmentpath-return and now hasathecompletelearnedroute: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
OnlyAfterpacketsa path is learned, only the repeaters on theestablishedstoredroutepathtraverseforward themeshmessage - significantly less airtime consumptioninforlargerepeatednetworks.unicast traffic.ScalesForbetter:repeated unicast traffic in a100-nodestable topology, MeshCorenetworkcanconsumes faruse less channel capacity thanaflooding.100-nodeGroup/broadcastMeshtasticmessagesnetwork.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
RouteThediscoveryfirstaddsmessage to a new destination floods the mesh, adding airtime and latency beforefirst contact withanewpathdestination.is learned.RouteStoredtablespaths require memory on each node.- Topology changes can invalidate
cachedaroutes,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: participatefullyinrouteforwarding and carry the network's routingload of the network.load. Client nodesCompanion (endpoints):client) and Sensor nodes:user devices thatgenerate 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.