Staex logostaexDocs
Docs/Routing Algorithm

Routing Algorithm

How Staex MCC routes traffic through its overlay network using shortest-path algorithms.

Network Structure#

Staex MCC models the network as a directed graph where edges point from child nodes to their parent nodes. Node state information propagates upward through the tree: each node reports its status to its parent, which in turn reports to its own parent, and so on. The root node (at the top of the hierarchy) maintains the most complete picture of the network.

Shortest Path Routing#

MCC uses Dijkstra's algorithm to compute the shortest path between a source and destination node. When a node cannot determine a route locally, it forwards the packet to its parent. This process continues recursively up the tree until reaching a node (potentially the root) that knows the complete path to the destination.

Topology Flexibility#

The network topology allows cycles and supports multiple parent connections per node. If a node's active parent goes offline, it automatically switches to the next available parent without manual intervention. This provides resilience against individual node failures.

Direct Connections#

When two nodes can communicate directly -- without NAT or firewall restrictions between them -- MCC establishes a direct path after the initial routed connection. This optimization removes the parent node from the data path, reducing latency and freeing parent bandwidth for other traffic.

Resilient Multi-hop#

This architecture enables networks in hard-to-reach locations: forests, mountains, and across geographic boundaries where direct connectivity is impossible. Multi-hop routing ensures that any node can reach any other node as long as a chain of connected intermediaries exists. Root node failures are handled gracefully through parent failover mechanisms.