bmx-routing / bmx7

BMX7 / SEMTOR Securely Entrusted Mesh Routing Protocol
GNU General Public License v2.0
63 stars 15 forks source link

routing metric calculation #26

Closed aparcar closed 5 years ago

aparcar commented 6 years ago

How exactly is the routing path calculated? Is the load of all nodes accounted as well?

axn commented 6 years ago

Nodes' load is not accounted with any of the yet implemented path metrics!

The established routing path should converge to the path with the best path metric value (greater value is better) towards the destination node. The path metric is re-calculated by each hop considering links among trusted nodes and the path-metric function(s) defined by the destination. A destination node can choose among (one or several) of a set of pre-implemented path-metric functions. In the simplest case link-qualities (being values of [0..1]) are just multiplied, decreasing the end-to-end path metric value with every additional hop: https://github.com/bmx-routing/bmx7/blob/422eeaaf3e6815c2f3358e401c6a3e0dcf3ac5b0/metrics.c#L399

With the .._ExpectedQuality() functions (such as https://github.com/bmx-routing/bmx7/blob/422eeaaf3e6815c2f3358e401c6a3e0dcf3ac5b0/metrics.c#L406 ) ETX, ETT, or hop-count like behavior can be achieved.

However, the default function currently is path-capacity awareness ( https://github.com/bmx-routing/bmx7/blob/422eeaaf3e6815c2f3358e401c6a3e0dcf3ac5b0/metrics.c#L406 ) combined with https://github.com/bmx-routing/bmx7/blob/422eeaaf3e6815c2f3358e401c6a3e0dcf3ac5b0/metrics.c#L436 . It is a bit more complex and considers the assumed link-capacity of the last hops, interference depending on channel-frequency proximity of nearby hops, and broadcast link-losses along the paths...

A user can configure the function for path-selection towards himself with --metricAlgo and other parameters. Check: 'bmx7 H /r=1 | grep -A 87 "metric options" | less' metric options (order=9): --metricAlgo, -M def: 4097 range: [ 0 ... 8191 ] set metric algo for routing towards myself: 0 :HopCount 1:CP 256:MP (M=1 /R=0 /T=1 /t=1 <=> TQ) 512:EP 1024:MB 2048:EB (M=8 /R=1 /r=1 /T=1 /t=1 <=> ETT) 4096:VB ...

Please close issue if it satisfies your question.