[Xorp-users] wanted: OSPF metrics per neighbor. can vif help?

Atanu Ghosh atanu@ICSI.Berkeley.EDU
Wed, 09 Nov 2005 15:58:13 -0800


Hi,

The interface-cost is a per interface setting and it was a mistake in
the template file to require it to be set at the address level. It
should be set at the interface level with the link-type.

In the OSPF implementation the interface and vif are combined to form a
PeerOut (which is the equivalent of an OSPF interface). The PeerOut is
where the interface-cost is stored.

At the moment the FEA enforces that the interface and vif name are the
same. Which is why you haven't been able to change the vif name. There
have been some discussions on this issue over the last few days on
xorp-hackers.

If you can create a separate tap device per neighbour then you will be
able to set the interface cost with the current code.

The other option is add code to take the interface cost per neigbour in
a similar manor to the way that the neighbour router-id is
configured. If you make a bugzilla entry requesting the enhancement and
upload the patch that would be useful.

>From my reading of the specification all links from a particular
interface should all have the same link cost.

---------------------------------------- RFC 2328
		o   For each fully adjacent neighbor associated with the
		    interface, add an additional Type 1 link (point-to-
		    point) with Link ID set to the Router ID of the
		    neighboring router, Link Data set to the IP
		    interface address and cost equal to the interface's
		    configured output cost.
----------------------------------------

We would be slightly concerned about adding code that may violate the
standard, however, this seems like a useful feature.

	  Atanu.

>>>>> "Nick" == Nick Feamster <feamster@lcs.mit.edu> writes:

    Nick> Hey guys, 
    Nick> The OSPF implementation is really great.  Thanks!

    Nick> I have a question/feature request.  I have an interface that is on a /8
    Nick> subnet, with multiple other hosts on that subnet.  I'd like to set the
    Nick> OSPF link metric *per neighbor* on that subnet, rather than per
    Nick> interface.  Currently, interface aliases are not an option; I am
    Nick> wondering if XORP's "vif" functionality can come to the rescue.

    Nick> Perhaps the above functionality is already possible, or perhaps it
    Nick> requires modification to the code.  Can you help me understand vifs and
    Nick> how this might be possible?

    Nick> Currently, the interface-cost can be set in the vif stanza, so I thought
    Nick> it might be possible to give multiple vifs to an interface and then set
    Nick> different interface costs per vif.  However, I've run into a few
    Nick> roadblocks when trying this.

    Nick> 1.) How do I assign different vif names to a single interface?

    Nick> I have an interface called "tap0".  Assigning a vif with the name
    Nick> "tap0" is definitely possible.  However, configuring another vif
    Nick> with a different name inside interface "tap0" (e.g. interface named
    Nick> "tap0", vif named "tap1") appears to be illegal.

    Nick> What's the proper way to assign multiple vifs to an interface?

    Nick> Is this even what I want to solve my OSPF problem?


    Nick> 2.) How do I get a separate interface-cost per vif/neighbor?  Inside my
    Nick> OSPF stanza, I have something that looks as follows:

    Nick> area 0.0.0.0 {
    Nick> interface tap0 {
    Nick> link-type: "p2m"
    Nick> vif tap0 {
    Nick> address 10.13.79.1 {
    Nick> interface-cost: 5
    Nick> /* planetlab02.cs.washington.edu */
    Nick> neighbour 10.0.35.1 {
    Nick> router-id: 128.208.4.198
    Nick> }

    Nick> }
    Nick> }

    Nick> vif tap0 {
    Nick> address 10.13.79.1 {
    Nick> interface-cost: 1
    Nick> /* planetlab2.arizona-gigapop.net */
    Nick> neighbour 10.0.10.1 {
    Nick> router-id: 206.207.248.35
    Nick> }

    Nick> }
    Nick> }

    Nick> }


    Nick> Note that I am trying to set a different interface cost per neighbor. 
    Nick> Now, when I look at "show ospf4 database detail", it looks like both  
    Nick> of these LSAs are getting a metric of 1, indicating
    Nick> that perhaps there is just a single data structure for the
    Nick> interface-cost per interface.  (I've attached this configuration file
    Nick> for reference.)

    Nick> It seems that there are two possible solutions:
    Nick> - If the data structure is per-vif name (e.g. "vif tap0"), I
    Nick> need to figure out the answer to Question #1 above.

    Nick> - If the data structure is per-interface (e.g. "interface
    Nick> tap0"), I guess some changes to the code are needed, yes?  If
    Nick> this is the case, can I put in a feature request? :)  If you
    Nick> like the idea but don't have time to implement, we can also
    Nick> work on a patch, if you'd be willing to add it into the source
    Nick> tree.

    Nick> Thanks,
    Nick> Nick
    Nick> /* XORP configuration automatically generated by build_ospf_configs.pl */

    Nick> /* XORP configuration automatically generated by build_configs.pl */

    Nick> interfaces {
    Nick> interface lo {
    Nick> description: "loopback interface";
    Nick> disable: false
    Nick> mac: 00:00:00:00:00:00
    Nick> default-system-config
    Nick> }
    Nick> interface tap0 {
    Nick> description: "virtual overlay interface";
    Nick> disable: false
    Nick> default-system-config
    Nick> }
    Nick> interface eth0 {
    Nick> description: "ethernet adapter"
    Nick> disable: false
    Nick> default-system-config
    Nick> }
    Nick> }

    Nick> fea {
    Nick> unicast-forwarding4 {
    Nick> disable: true
    Nick> }

    Nick> click {
    Nick> disable: false

    Nick> user-click {
    Nick> disable: false
    Nick> command-file: "/home/mit_rcp/demo/click"
    Nick> command-extra-arguments: "-R"
    Nick> command-execute-on-startup: true
    Nick> control-address: 127.0.0.1
    Nick> control-socket-port: 13654
    Nick> startup-config-file: "/home/mit_rcp/demo/planetlab2.info.ucl.ac.be.click"
    Nick> }
    Nick> }
    Nick> }

    Nick> protocols {
    Nick> ospf4 {
    Nick> router-id:  130.104.72.201
    Nick> area 0.0.0.0 {
    Nick> interface tap0 {
    Nick> link-type: "p2m"
    Nick> vif tap0 {
    Nick> address 10.13.79.1 {
    Nick> interface-cost: 5
    Nick> /* planetlab02.cs.washington.edu */
    Nick> neighbour 10.0.35.1 {
    Nick> router-id: 128.208.4.198
    Nick> }

    Nick> }
    Nick> }

    Nick> vif tap0 {
    Nick> address 10.13.79.1 {
    Nick> interface-cost: 1
    Nick> /* planetlab2.arizona-gigapop.net */
    Nick> neighbour 10.0.10.1 {
    Nick> router-id: 206.207.248.35
    Nick> }

    Nick> }
    Nick> }

    Nick> }


    Nick> interface eth0 {
    Nick> vif eth0 {
    Nick> address 130.104.72.201 {
    Nick> }
    Nick> }
    Nick> }
    Nick> }

    Nick> traceoptions {
    Nick> flag {
    Nick> all {
    Nick> disable: false
    Nick> }
    Nick> }
    Nick> }
    Nick> }
    Nick> }