Thursday, December 10, 2009

More Than You May Have Wanted To Know on . . .


The Real Scoop on the OSPF Reference Bandwidth by Jeff Suggs:

I think I figured out something about the OSPF cost calculation when the reference bandwidth is changed. I have not completely tested this out yet, but this is what I am thinking.

It actually is not completely related to changing the reference bandwidth, but that is where we see the problem show up from the examples we are using.

The cost formula is given by the following:

cost=reference bandwidth/bandwidth = 10^8/bw in Kbps

There is however a limitation on the size of cost, and that is 16 bits, which calculates to

When we were trying this out tonight in lab, it appeared maybe our limit was somewhere between 256k and 300k, but the calculation shows 152588 bps, so I am not entirely sure.

With the bandwidths we were configuring (128kbps and 256kbps) we did not see an issue with the default bandwidth. However, when we changed to 1010 = 10000, this is now going to be an issue. I suspect if we dropped our bandwidths to 1280 bps and 2560 bps we would see the same issue with the default ref bw.

When calculating the different costs as we travel through the routing table, if any one cost is over this value of 65535, then it will use 65535 as the value for that portion of the cost.

Using slide 92 (see above), 93, and 100 from Rick's Chapter 11 presentation, I have figured out the calculation

Slide 93 with the default bandwidth of 108

R1# show ip route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

192.168.10.0/30 is subnetted, 3 subnets
C 192.168.10.0 is directly connected, Serial0/0/0
C 192.168.10.4 is directly connected, Serial0/0/1
O 192.168.10.8 [110/1171] via 192.168.10.6, 00:00:58, Serial0/0/1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.16.1.32/29 [110/391] via 192.168.10.6, 00:00:58, Serial0/0/1
C 172.16.1.16/28 is directly connected, FastEthernet0/0
172.30.0.0/30 is subnetted, 1 subnets
C 172.30.1.0 is directly connected, Loopback1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.10.10.0/24 [110/1172] via 192.168.10.6, 00:00:58, Serial0/0/1
C 10.1.1.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Loopback1

For the 192.168.10.8 with a cost of 1171 the calculation would be:

cost = 10^8/256000 + 10^8/128000 = 390 + 781 = 1171

For the 172.16.1.32 with a cost of 391 the calculation would be:

cost = 10^8/256000 + 10^8/1000000 = 390 + 1 = 391

For the 10.10.10.0 with a cost of 1172 the calculation would be:

cost = 10^8/256000 + 10^8/128000 + 10^8/100000000 = 390 + 781 + 1 = 1172

Now we change our default reference bandwidth to “10000” or 1010.

The new routing table for R1 is given from slide 100
R1# show ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

192.168.10.0/30 is subnetted, 3 subnets
C 192.168.10.0 is directly connected, Serial0/0/0
C 192.168.10.4 is directly connected, Serial0/0/1
O 192.168.10.8 [110/104597] via 192.168.10.6, 00:01:33, S0/0/1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.16.1.32/29 [110/39162] via 192.168.10.6, 00:01:33, S0/0/1
C 172.16.1.16/28 is directly connected, FastEthernet0/0
172.30.0.0/30 is subnetted, 1 subnets
C 172.30.1.0 is directly connected, Loopback1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.10.10.0/24 [110/65635] via 192.168.10.2, 00:01:33, S0/0/0
C 10.1.1.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Loopback1


So the new calculations are as follows:
For the 192.168.10.8 with a cost of 104597 the calculation would be

cost = 10^10/256000 + 10^10/128000 = 39062 + 78125 = 117187

but this is not what the route shows. Since the cost of 78125 is larger than 65535 (2^16 - 1 = 65535) we need to reduce that portion of the route to 65535 as follows:

New cost = 10^10/256000 + 10^10/128000 = 39062 + 65535 = 104597

which NOW MATCHES our routing table.

For the 172.16.1.32 with a cost of 39162 the calculation would be:

cost = 10^10/256000 + 10^10/1000000 = 39062 + 100 = 39162

There is no problems with this one, as we are under the 16 bit requirement for cost.


For the 10.10.10.0 with a cost of 65635 the calculation would be:

cost = 10^10/64000 + 10^10/100000000 = 156250 + 100

which we change to 65535 + 100 = 65635


Notice on this route, that it now goes out the s0/0/0 interface on R1 when it should have really gone out the s0/0/1 interface, but due to the rounding down of the 64k link, it appears to be a much lower cost.

OK, that is what I think it is…..I am afraid to now admit this, but John might be right…I might be a nerd.

No comments:

Post a Comment