Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uisp integration enhancements: Topology #328

Merged
merged 4 commits into from
Apr 11, 2023
Merged

Conversation

thebracket
Copy link
Collaborator

Replace the UISP network.json generator that previously used UISP's "parent" nodes to determine tree position with a full cost-based spanning tree (Dijkstra). This makes multi-homed networks easier to manage, by specifying a root position other than the "natural" route and regenerating the entire tree relative to this node location. So flipping A->B->C->D to be D->C->B->A works well, as does B->A, B->C->D.

The second half adds a file named integrationUISProutes.csv. It contains "from", "to" and "cost" fields. When the tree builder finds a route "from->to", it uses the cost specified in this file. This allows you to override behavior, for example if you have A->B->C and also have A->C but don't want A->C to be the default - you can specify a high cost (say 100) for A->C.

For example, given the following topology:

graph LR
    A-->B
    B-->C
    C-->D
Loading

You could change the root to be D and have:

graph LR
    D-->C
    C-->B
    B-->A
Loading

Given a more complex hierarchy:

graph LR
    D-->C
    C-->B
    B-->A
    D-->A
Loading

One could enter a row in integrationUISProutes.csv:

D, A, 100

And the shorter D->A route would be ignored:

graph LR
    D-->C
    C-->B
    B-->A
    D--Ignored-->A
Loading

Rather than obeying the "parent" field, which leads to wrong-way up
graphs when building from a non-root site - instead build a complete
cost-based spanning tree from the specified root node. Then use
the generated tree - falling back on parent if nothing is found -
to populate the tree in order.

Tested on Herbert's network, correctly generates topology from several
different locations.

Still to come: adding a mechanism for providing parenting overloads
to allow for cases where a long path is actually optimal, but we
have no way of knowing that.
…te determination.

Requested by D. Denson.

Now that the UISP network tree is built as a spanning tree, with 10
cost per hop we can reliably flip the tree from A->B->C to C->B->A
depending upon root positioning.

This addition allows you to specify additional routes (that MUST
exist!) e.g. A->C and specify a cost to use instead of the default
10. This allows for topologies in which A-B-C is actually faster
than a direct A-C route (for example, becuase of short 60ghz
hops).
@syadnom
Copy link

syadnom commented Apr 11, 2023

is each 'hop' a cost of 1? for example, A>B>C>D is cost 3. So A<>D cost 4 would be sufficient to keep it out of the chain?

@thebracket
Copy link
Collaborator Author

thebracket commented Apr 11, 2023 via email

@rchac
Copy link
Member

rchac commented Apr 11, 2023

This made it to where I can finally let the UISP integration dynamically update the network.json file. Saves me lots of time previously spent on adjustments to network.json Thank you @thebracket !

@thebracket
Copy link
Collaborator Author

thebracket commented Apr 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants