Skip to content

Proposal: Manual Latency Shift Tuning for Routing Preference #1270

@peigongdsd

Description

@peigongdsd

We are using Yggdrasil in a small-scale network and greatly appreciate its redundancy and multi-hop relay capabilities. To enhance robustness, we've adopted a topology with redundant peerings instead of a lean, tree-like structure.

However, we’ve observed a notable downside in the current routing behavior. Yggdrasil prioritizes low-latency paths, which is often stupid—some nodes offer better bandwidth but slightly higher latency. Currently, there is no mechanism to manually adjust or influence this routing preference.

Ideally, under heavy traffic, the latency to an overloaded node should increase, which should raise the calculated cost of paths through that node and steer new connections away. In practice, however, we’ve found that cost values often do not reflect real-time network congestion, and newly established connections still prefer that bandwidth-saturated paths. This leads to significant network jamming.

Suggested Temporary Workaround

We propose introducing an optional tuning parameter per peering:

Peers: [
    "tls://very.low.bandwidth:1999?latencyshift=xxxx"
  ]

This latencyshift should artificially inflate the latency used in routing decisions (i.e., effective_latency = real_latency + latencyshift) for a specific peering. This would discourage routing through known low-bandwidth or congested links.

Global Node-Level Option

To generalize the idea further, we suggest a node-level setting:

GlobalLatencyShift = 100  # in milliseconds

This would apply the latency shift to all peerings with the node (excluding multicast-discovered links), allowing bandwidth-constrained nodes to signal their limited capacity network-wide, reducing relay load through them.


These two parameters—LatencyShift and GlobalLatencyShift—offer a simple, manual mechanism to guide Yggdrasil’s routing decisions in small or specialized networks. We believe this should be relatively straightforward to implement and would significantly improve routing flexibility in constrained or heterogeneous environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions