Routing Protocol

MeshCore Routing Algorithms

Every message traversing the RegionMesh network makes autonomous routing decisions. Understanding these algorithms helps you deploy more effective nodes and troubleshoot coverage gaps.

How Does A Message Find Its Way Through The Mesh Network?

Traditional networks rely on routers with preconfigured paths. A mesh network has no such luxury. When a hiker in Rocky Mountain National Park sends a message, no central authority exists to direct it toward Denver.

Instead, MeshCore uses a hybrid model: discovery flood through repeaters when needed, then more targeted forwarding over learned paths.

This guide explains precisely how MeshCore routing functions, which optimizations conserve airtime and battery, and how you can tune routing behavior for your specific deployment across America. For the infrastructure layer behind those paths, see the topology guide.

Basic Routing Protocol Mechanisms

Four fundamental mechanisms underpin MeshCore routing:

Discovery Flood + Learned Paths

First delivery can use discovery flood through repeaters. After delivery reports, MeshCore can send follow-up traffic over a known path instead of flooding every attempt.

Broadcast -> All neighbors -> Re-broadcast -> Target

Duplicate Detection

Every message carries a unique identifier. Nodes maintain a cache of recently-seen IDs, discarding duplicates that arrive via alternative paths.

Message ID: 0x4A3F2B -> Already seen -> Drop

Hop Count Limiting

Hop handling limits uncontrolled propagation. MeshCore supports high protocol hop ceilings (up to 64), while practical propagation is tuned on repeaters (for example via flood limits).

Repeater-Scoped Forwarding

Forwarding is a repeater/relay function, not a universal client behavior. This keeps traffic predictable and reduces unnecessary airtime load.

How Discovery Flood Works In MeshCore

Discovery flood is used to find a route when no path is known yet. After that, MeshCore can shift to targeted forwarding:

Step 1: Message Is Sent

A user in Boulder sends a message to a destination without a known path. The packet is prepared and emitted over LoRa.

Step 2: Nearby Repeaters Handle Forwarding

Repeaters in range process the message and apply deduplication. Clients can receive traffic, but they are not the generic forwarding layer.

Step 3: Route Learns From Delivery

When delivery succeeds, MeshCore can learn repeater path information from the return flow. Future unicast messages can follow that path.

Step 4: Targeted Follow-Up Traffic

Subsequent messages can use the learned route, reducing network-wide propagation and conserving airtime on busy deployments.

Traffic Control In Practice

MeshCore keeps discovery and forwarding efficient with practical controls:

  • Message deduplication: Identical messages arriving via different paths are forwarded only once, preventing exponential traffic growth.
  • Path learning: Successful delivery can produce route information for later direct forwarding.
  • Repeater flood controls: Operators can tune propagation limits (such as flood.max) to keep airtime use in check.
  • Role separation: Clients focus on end-user messaging while repeaters handle network forwarding.

Hop Limiting Mechanism

64

Protocol Hop Ceiling

MeshCore documents an internal maximum of 64 hops at protocol level.

flood.max

Operational Limit Tuning

Real-world propagation is usually tuned at repeater level (for example via flood.max) to match local density and airtime budget.

~3km

Range Depends On Deployment

Per-hop distance depends on terrain, antenna quality, noise floor, and repeater placement. Plan with measurements instead of fixed hop assumptions.

How Hop Counting Works

Hop controls exist to stop uncontrolled circulation, while repeater policies define practical forwarding behavior:

Discovery attempt:   uses repeater flood path
Delivery success:    route info can be learned
Follow-up unicast:   forwarded over learned repeater path
Flood control:       tuned on repeaters (e.g. flood.max)

This mechanism prevents messages from circulating indefinitely, conserving precious battery power and leaving airtime available for new communications.

Advantages Of MeshCore Routing

🔄

Self-Organizing

No network administrator configures routing tables. Nodes discover each other automatically, adapting to additions and failures without intervention.

Energy-Efficient

Optimizations ensure only necessary transmissions occur. Battery-powered nodes can run for days while still contributing to network coverage.

🛡️

Robust Against Failure

If a repeater fails in the Rockies, messages automatically route via alternative paths. The network heals without anyone noticing.

📡

Scalable Range

Adding nodes extends coverage proportionally. A repeater on a mountaintop might bridge entire counties with no configuration changes.

🔧

Simple Protocol

Hybrid discovery + path forwarding avoids full routing-table overhead while still reducing unnecessary propagation in active networks.

🌐

No Single Point Of Failure

With no central router, no single component can bring down the network. Even losing half the nodes leaves remaining devices communicating.

Routing Configuration Examples

Adjust routing behavior through the MeshCore CLI or Python API:

CLI: Tune Repeater Flood Behavior

Adjust propagation boundaries on repeater nodes for your topology:

set flood.max 6
set repeat on
save

Python API: Routing Configuration

Automate deployment configuration across multiple nodes:

import MeshCore

interface = MeshCore.SerialInterface()
node = interface.getNode("^local")

# Example: apply forwarding policy on repeater profile
node.config["flood.max"] = 6
node.config["repeat"] = "on"
node.writeConfig()

Advanced: Limit Discovery Scope

For dense areas, keep discovery constrained to reduce airtime pressure:

set flood.max 4
save
# Increase only if delivery fails across your intended area

Frequently Asked Questions About Routing

Does MeshCore only use flooding?

No. Initial discovery can use flood behavior, but MeshCore can learn repeater paths for subsequent unicast forwarding.

What happens if two nodes forward a message simultaneously?

Random backoff delays make simultaneous transmission unlikely. When collisions do occur, other network nodes typically receive at least one copy successfully, maintaining message delivery.

Can I set different hop limits per message type?

Operational behavior is usually tuned by node role and repeater policy. Keep routine traffic constrained and reserve broader propagation for priority use cases.

How does MeshCore prevent route loops?

Duplicate detection combined with hop counting eliminates loops. A message cannot revisit a node (duplicate detection) and eventually expires (hop limit) regardless of network topology.

What latency should I expect?

Latency depends on RF conditions, spreading factor, queue depth, and repeater policy. Validate with field tests in your own deployment area.

Can I disable routing for my node?

Yes. Setting rebroadcast_mode to "NONE" creates a leaf node that receives messages but never forwards. Useful for battery-critical portable devices.

Start With MeshCore Routing Development

The MeshCore routing protocol enables resilient, self-healing communication across America without dependence on internet infrastructure. Understanding these mechanisms helps you deploy more effective networks.