From: Brian McGahan (bmcgahan@internetworkexpert.com)
Date: Mon Nov 24 2003 - 16:14:57 GMT-3
OSPF uses a similar calculation as how EIGRP does. There is the
concept of an advertised cost plus a local cost. Advertised cost is the
cost of the upstream neighbor to reach the destination. Local cost is
the local interface cost used to reach the upstream neighbor. Add these
costs together and you get the final cost to the destination. This also
implies that the local cost on the upstream neighbor does not affect the
downstream neighbor's calculation. This is easily illustrated as
follows:
R1----R2--2.2.2.2/32
R1 and R2 share an Ethernet segment (10Mbps, default cost of
10). R2 originates a loopback address 2.2.2.2/32 into OSPF. This
loopback has a cost of 1. When R1 sees the route, it should have a cost
of 11 (R2's cost of 1 to reach the loopback, plus R1's local Ethernet
cost of 10)
R1#sh ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.0.2, 00:00:02, Ethernet0/0
Now let's set the cost of R2's Ethernet interface to 1. This
should not affect R1:
R2(config)#int e0/0
R2(config-if)#ip ospf cost 1
R1#clear ip route 2.2.2.2
R1#sh ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.0.2, 00:00:01, Ethernet0/0
As you can see R1's cost is not affected. Now we'll change the
cost on R1:
R1(config)#int e0/0
R1(config-if)#ip ospf cost 1
R1(config-if)#end
R1#clear ip route 2.2.2.2
R1#sh ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 10.0.0.2, 00:00:01, Ethernet0/0
Changing the local cost on R1 does affect the total cost of the
router. Now if we change the 'advertised' cost on R2, this *will*
affect the total cost on R1:
R2(config)#int loopback2
R2(config-if)#ip ospf cost 1000
R1#clear ip route 2.2.2.2
R1#sh ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/1001] via 10.0.0.2, 00:00:01, Ethernet0/0
HTH,
Brian McGahan, CCIE #8593
bmcgahan@internetworkexpert.com
Internetwork Expert, Inc.
http://www.InternetworkExpert.com
Toll Free: 877-224-8987
Direct: 708-362-1418 (Outside the US and Canada)
> -----Original Message-----
> From: zzk [mailto:ccie_99@yahoo.com]
> Sent: Monday, November 24, 2003 6:05 AM
> To: Brian McGahan; ccielab@groupstudy.com
> Subject: RE: tune ospf cost in a broadcast media
>
>
> Hi
> I mean changing the cost of X interfaces on R1 or R2.
> The R3 will learn the cost from them, which affect the
> route selection.
>
> regards
>
> --- Brian McGahan <bmcgahan@internetworkexpert.com>
> wrote:
> > Cost of a directly connected link is determined by
> > your local
> > cost for that interface. Therefore in the previous
> > example changing the
> > cost on R1 or R2 would not affect R3.
> >
> >
> > HTH,
> >
> > Brian McGahan, CCIE #8593
> > bmcgahan@internetworkexpert.com
> >
> > Internetwork Expert, Inc.
> > http://www.InternetworkExpert.com
> > Toll Free: 877-224-8987
> > Direct: 708-362-1418 (Outside the US and Canada)
> >
> >
> > > -----Original Message-----
> > > From: nobody@groupstudy.com
> > [mailto:nobody@groupstudy.com] On Behalf
> > Of
> > > zzk
> > > Sent: Friday, November 21, 2003 11:29 PM
> > > To: Brian McGahan; 'Howard C. Berkowitz';
> > ccielab@groupstudy.com
> > > Subject: RE: tune ospf cost in a broadcast media
> > >
> > > Thanks. Thats a good solution.
> > > In the drawing, can we change the ip cost on the
> > r1 &
> > > r2's X interfaces instead? thus they can affect
> > r3's
> > > route selection.
> > >
> > > In a broadcast media, if change one router's cost,
> > > does this violate the OSPF principle? I feel ospf
> > is a
> > > link state, so every router should have the same
> > cost
> > > on all interfaces...
> > >
> > > regards
> > >
> > > --- Brian McGahan
> > <bmcgahan@internetworkexpert.com>
> > > wrote:
> > > > Cisco's OSPF implementation (not sure about the
> > > > standard) has a
> > > > special network type to deal with this problem.
> > > > This is this network
> > > > type 'point-to-multipoint non-broadcast'
> > Typically
> > > > it is used in a NBMA
> > > > scenario when you have one logical network that
> > has
> > > > VCs of varying
> > > > speeds, it can be applied to this problem as
> > well.
> > > >
> > > > Suppose we have the following:
> > > >
> > > > _X_
> > > > R1 R2
> > > > _|____|_
> > > > |
> > > > R3
> > > >
> > > > R1, R2, and R3 share a broadcast Ethernet
> > segment.
> > > > R1 and R3
> > > > connect to the segment with FastEthernet
> > interface,
> > > > while R2 uses a
> > > > regular 10Mbps Ethernet interface. R1 and R2
> > are
> > > > attached to
> > > > destination "X". From the perspective of R3,
> > the
> > > > cost to destination X
> > > > is equal through R1 and R2 (cost of 1 for FastE
> > on
> > > > R3). However, since
> > > > R2 only has 10Mb in actuality it's not.
> > Changing
> > > > the cost of R3's
> > > > interface isn't going to affect anything because
> > as
> > > > you mentioned
> > > > before, it connects to the same segment. With
> > > > network type P2M
> > > > non-broadcast, you can specify the cost on a per
> > > > neighbor basis:
> > > >
> > > > R3:
> > > > interface Ethernet0/0
> > > > ip ospf network point-to-multipoint
> > non-broadcast
> > > > !
> > > > router ospf 1
> > > > neighbor 10.0.0.1 cost 1
> > > > neighbor 10.0.0.2 cost 10
> > > >
> > > > This way R3 knows that prefixes learned from R2
> > > > should be offset
> > > > with a cost of 10 instead of the interface cost
> > of
> > > > 1.
> > > >
> > > >
> > > > HTH,
> > > >
> > > > Brian McGahan, CCIE #8593
> > > > bmcgahan@internetworkexpert.com
> > > >
> > > > Internetwork Expert, Inc. http://www.InternetworkExpert.com
> > > > Toll Free: 877-224-8987
> > > > Direct: 708-362-1418 (Outside the US and Canada)
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: nobody@groupstudy.com
> > > > [mailto:nobody@groupstudy.com] On Behalf
> > > > Of
> > > > > Howard C. Berkowitz
> > > > > Sent: Friday, November 21, 2003 10:33 AM
> > > > > To: ccielab@groupstudy.com
> > > > > Subject: Re: tune ospf cost in a broadcast
> > media
> > > > >
> > > > > At 7:41 AM -0800 11/21/03, zzk wrote:
> > > > > >Hi
> > > > > >I understand in a point to point link, it is
> > > > better to
> > > > > >change 'ip ospf cost' to the same value on
> > both
> > > > sides.
> > > > > >However if in a broadcast media (e.g.
> > multiple
> > > > routers
> > > > > >in a backbone vlan), if we change 'ip ospf
> > cost'
> > > > on
> > > > > >one router interface only, what will be the
> > > > impact?
> > > > > >I feel ospf is a link state protocol, and all
> > > > routers
> > > > >
> > > > > Setting different costs, as opposed to
> > different
> > > > timer values, won't
> > > > > break anything. I agree uniformity is better
> > for
> > > > troubleshooting, but
> > > > > there very well may be reasons to have
> > different
> > > > costs.
> > > > >
> > > > > Now, for your more specific example, with a
> > > > different interface cost
> > > > > on one router connected to a multiaccess link,
> > > > does the router have
> > > > > additional links that it can use to reach the
> > same
> > > > destination? In
> > > > > that case, having a higher cost on the
> > > > less-preferred link may be
> > > > > perfectly valid means of expressing an
> > intra-area
> > > > routing policy.
> > > > >
> > > > >
> > > >
> > >
> >
> ______________________________________________________________
> _________
> > > > > Please help support GroupStudy by purchasing
> > your
> > > > study materials
> > > > from:
> > > > > http://shop.groupstudy.com
> > > > >
> > > > > Subscription information may be found at:
> > > > > http://www.groupstudy.com/list/CCIELab.html
> > > >
> > > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Free Pop-Up Blocker - Get it now
> > > http://companion.yahoo.com/
> > >
> > >
> >
> ______________________________________________________________
> _________
> > > Please help support GroupStudy by purchasing your
> > study materials
> > from:
> > > http://shop.groupstudy.com
> > >
> > > Subscription information may be found at:
> >
> === message truncated ===
>
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
This archive was generated by hypermail 2.1.4 : Fri Dec 12 2003 - 12:29:16 GMT-3