Bug 84 - [patch] Add support for non-unit cost metrics in routing
: [patch] Add support for non-unit cost metrics in routing
Status: RESOLVED FIXED
: ns-3
routing
: pre-release
: All All
: P3 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-10-08 00:40 EDT by
Modified: 2008-07-01 13:32 EDT (History)


Attachments
an exported hg changeset on top of changeset 1678 (27.03 KB, patch)
2007-10-08 00:41 EDT, Tom Henderson
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-10-08 00:40:43 EDT
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.
------- Comment #1 From 2007-10-08 00:41:43 EDT -------
Created an attachment (id=73) [details]
an exported hg changeset on top of changeset 1678
------- Comment #2 From 2007-10-08 06:10:19 EDT -------
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.
------- Comment #3 From 2007-10-08 13:04:22 EDT -------
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.
------- Comment #4 From 2007-10-13 00:33:36 EDT -------
applied as changeset 1776