Task #1974
closedOnly multiply hyperbolic costs before registering
100%
Description
Overview:¶
Currently, the route cost of all nexthops are multiplied and registered as an integer in NFD.
e.g. Nexthop{name: /a, faceId: 1, cost: 12.34} is registered as FibEntry{name: /a, faceId: 1, cost: 1234}
Instead, only hyperbolic costs should be multiplied before being registered. Link state costs should be registered with their originally computed costs.
Proposal:¶
Add a flag to the NextHop class that marks the nexthop as hyperbolic.
When getRouteCostAsAdjustedInteger() is called, the method checks if the nexthop is hyperbolic and if so, returns static_cast<uint64_t>(m_routeCost*HYPERBOLIC_COST_ADJUSTMENT_FACTOR);
If the nexthop was calculated by link state, the method returns static_cast<uint64_t>(m_routeCost);
HYPERBOLIC_COST_ADJUSTMENT_FACTOR
was previously assigned a value of 100, but a cost of 1000 had been suggested and should be changed for this revision.