Custom LinkWeigher

86 views
Skip to first unread message

Sergio Vera Martínez

unread,
Nov 21, 2020, 3:16:02 PM11/21/20
to ONOS Developers
Hi everyone,

I know there are some past conversations trying to answer why I am going to ask but I still do not understand how it works. By default, link metric is set to 1 unless custom LinkWeigher is past. As far as I know, the LinkWeigher Interface is empty and the LinkWeigherAdapter class has three methods. In my case, I want to set the metric of a given set of links but I do not understand how to set this. Neither in Link nor Edge Interfaces there is method to set the metric (not even to get it). I do not know what is the exact meaning of "Sets the specified link-weight function to be used as a default" in PathAdminService. Thanks in advance.

Best regards

Pier Luigi Ventre

unread,
Nov 23, 2020, 2:45:34 AM11/23/20
to Sergio Vera Martínez, ONOS Developers
Hi Sergio,
You have to provide your implementation of LinkWeigher interface which will set the metric value according to your logic, see an example here:

Finally, you have to pass the instance of your LinkWeigher to the TopologyService to ask a path computation using that LinkWeigher:

In this way, you will override the default path computation.

Hope - this helps
Pier

--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/524838c1-ed5c-4f1a-ac2e-20f03c79b1f1n%40onosproject.org.

Sergio Vera Martínez

unread,
Nov 23, 2020, 6:44:20 AM11/23/20
to ONOS Developers, pi...@opennetworking.org
Hi,

Thank you so much for your help. Now I have a clear vision of how to do it.

Best regards

El dia dilluns, 23 de novembre de 2020 a les 8:45:34 UTC+1, pi...@opennetworking.org va escriure:
Reply all
Reply to author
Forward
0 new messages