Closed mozartatplay closed 6 months ago
The identified hooks look good. Please clarify the function. It states b as an offset rather than a coefficient.
Note that for bmx you need a function that calculates an end2end metric value where a greater value presents a more favorable path. This function gets the metric value of the previous hop as input. The function proposed by you seems to give smaller values for more favorable links (not paths).
Am 18. Juni 2018 23:04:42 MESZ schrieb David Johnson notifications@github.com:
I need a basic set of pointers to help me get into adding my own routing metric.
What I want to do is build a routing metric which calculates a Price weighted ETT metric (PWETT) being the sum of the ETT of the link between the current node and neighbour node and a coefficient (b) multiplied by the minimum possible ETT (ETT_min) in the network and the price per megabyte offered by the neighbour node (Ps) read from the /var/run/bmx7/sms/rcvdSms directory
PWETT=ETT+b . (ETT_min) x Ps
From reading through the code over past few days I assume I would need to
- Add some definitions to metric.h (BIT_METRIC_ALGO_PE being the new Price Weighted ETT definition)
define BIT_METRIC_ALGO_MIN 0x00
define BIT_METRIC_ALGO_CP 0x00 // -> 0
define BIT_METRIC_ALGO_PE 0x07 // ->
define BIT_METRIC_ALGO_MP 0x08 // -> 256
define BIT_METRIC_ALGO_EP 0x09 // ->
define BIT_METRIC_ALGO_MB 0x0A // ->
define BIT_METRIC_ALGO_EB 0x0B // ->
define BIT_METRIC_ALGO_VB 0x0C // ->
define BIT_METRIC_ALGO_MAX 0x0C
define BIT_METRIC_ALGO_ARRSZ ((9*sizeof(ALGO_T)))
define TYP_METRIC_ALGO_CP (0x01 << BIT_METRIC_ALGO_CP)
define TYP_METRIC_ALGO_PE (0x01 << BIT_METRIC_ALGO_PE)
define TYP_METRIC_ALGO_MP (0x01 << BIT_METRIC_ALGO_MP)
define TYP_METRIC_ALGO_EP (0x01 << BIT_METRIC_ALGO_EP)
define TYP_METRIC_ALGO_MB (0x01 << BIT_METRIC_ALGO_MB)
define TYP_METRIC_ALGO_EB (0x01 << BIT_METRIC_ALGO_EB)
define TYP_METRIC_ALGO_VB (0x01 << BIT_METRIC_ALGO_VB)
- Adding new metric function to metrics.c
STATIC_FUNC void path_metricalgo_PriceWeightedETT(struct NeighPath np, struct NeighRef_node ref, struct host_metricalgo *algo) { UMETRIC_T NeighbourPrice = get_price(np->link) < New code here> }
Add new metric function to register_path_metricalgo In the initialize function
int32_t init_metrics(void) { .... .... register_path_metricalgo(BIT_METRIC_ALGO_PE, path_metricalgo_PriceWeightedETT); ...
Any further advice, tips will be much appreciated
Thanks
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/bmx-routing/bmx7/issues/33
-- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
I need a basic set of pointers to help me get into adding my own routing metric.
What I want to do is build a routing metric which calculates a Price weighted ETT metric (PWETT) being the sum of the ETT of the link between the current node and neighbour node and a coefficient (b) multiplied by the minimum possible ETT (ETT_min) in the network and the price per megabyte offered by the neighbour node (Ps) read from the /var/run/bmx7/sms/rcvdSms directory
PWETT=ETT+b . (ETT_min) x Ps
From reading through the code over past few days I assume I would need to
define BIT_METRIC_ALGO_MIN 0x00
define BIT_METRIC_ALGO_CP 0x00 // -> 0
define BIT_METRIC_ALGO_PE 0x07 // ->
define BIT_METRIC_ALGO_MP 0x08 // -> 256
define BIT_METRIC_ALGO_EP 0x09 // ->
define BIT_METRIC_ALGO_MB 0x0A // ->
define BIT_METRIC_ALGO_EB 0x0B // ->
define BIT_METRIC_ALGO_VB 0x0C // ->
define BIT_METRIC_ALGO_MAX 0x0C
define BIT_METRIC_ALGO_ARRSZ ((9*sizeof(ALGO_T)))
define TYP_METRIC_ALGO_CP (0x01 << BIT_METRIC_ALGO_CP)
define TYP_METRIC_ALGO_PE (0x01 << BIT_METRIC_ALGO_PE)
define TYP_METRIC_ALGO_MP (0x01 << BIT_METRIC_ALGO_MP)
define TYP_METRIC_ALGO_EP (0x01 << BIT_METRIC_ALGO_EP)
define TYP_METRIC_ALGO_MB (0x01 << BIT_METRIC_ALGO_MB)
define TYP_METRIC_ALGO_EB (0x01 << BIT_METRIC_ALGO_EB)
define TYP_METRIC_ALGO_VB (0x01 << BIT_METRIC_ALGO_VB)
STATIC_FUNC void path_metricalgo_PriceWeightedETT(struct NeighPath np, struct NeighRef_node ref, struct host_metricalgo *algo) { UMETRIC_T NeighbourPrice = get_price(np->link) < New code here> }
Add new metric function to register_path_metricalgo In the initialize function
int32_t init_metrics(void) { .... .... register_path_metricalgo(BIT_METRIC_ALGO_PE, path_metricalgo_PriceWeightedETT); ...
Any further advice, tips will be much appreciated
Thanks