Bugzilla – Bug 84
[patch] Add support for non-unit cost metrics in routing
Last modified: 2008-07-01 13:32:17 UTC
This patch remedies a limitation in the previously checked in routing by allowing non-unit metrics (costs) to be set for links and properly handled by the global routing. The main change from an interface perspective is Ipv4Interface::SetMetric () and Ipv4Interface::GetMetric () which are accessor functions to the underlying uint16_t m_metric, which is a new class member. These are accessed from Ipv4's API as well. An example file simple-alternate-routing.cc is provided, where users can cause the routing to change between two disjoint paths by altering the metric on one of them.
Created attachment 73 [details] an exported hg changeset on top of changeset 1678
About the proposed interface: Ipv4Interface::SetMetric (uint16_t metric) Doesn't it make more sense to make it "int16_t metric", i.e. a signed integer? This way the default value could be set to zero, giving plenty of metric space either above or below the default value. Feels more natural, IMHO.
Signed metric doesn't work for legacy routing protocols, including the global routing which is based on OSPF. I think the issue you are raising, though, is what are the semantics of this metric? Is it meant for all routing protocols, or just the global routing? Maybe it needs to be documented that this is a default metric but other routing protocols can override this in their own interface configuration files.
applied as changeset 1776