< Free Open Study > |
3-1 auto-cost reference-bandwidth bandwidthSyntax Description:
Purpose: By default, OSPF calculates the cost of an interface by dividing the bandwidth of the interface into 100,000,000. Table 3-1 lists the costs for various interface types. Using the default value when your network has interfaces with a bandwidth greater than 100,000,000 is not recommended. OSPF will not be able to differentiate between a 100-Mbps interface and any interface with a bandwidth greater than 100 Mbps. This command allows you to change the OSPF reference value globally so the calculated cost for every interface is updated. The cost for individual interfaces can be adjusted using the interface command ip ospf cost (see Section 19-5). The use of the ip ospf cost interface command is not recommended. Table 3-1. Default OSPF Cost for Selected Interfaces
Initial Cisco IOS Software Release: 11.2 Configuration Example: Globally Modifying OSPF Interface CostsConfigure the routers in Figure 3-1 using the default reference value of 100,000,000 to investigate the costs of the various interfaces. Figure 3-1. OSPF Cost Is Based on the Interface Bandwidth
Router A interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Ethernet0/0 ip address 172.16.1.1 255.255.255.0 ! router ospf 1 network 1.1.1.1 0.0.0.0 area 0 network 172.16.1.0 0.0.0.255 area 0 ________________________________________________________________________________ Router B interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Ethernet0 ip address 172.16.1.2 255.255.255.0 ! interface Serial1 ip address 10.1.1.5 255.255.255.252 clockrate 64000 ! router ospf 1 network 2.2.2.2 0.0.0.0 area 0 network 10.1.1.4 0.0.0.3 area 1 network 172.16.1.0 0.0.0.255 area 0 ________________________________________________________________________________ Router C interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface Serial0 ip address 10.1.1.6 255.255.255.252 ! router ospf 1 network 3.3.3.3 0.0.0.0 area 1 network 10.1.1.4 0.0.0.3 area 1 Verify that Routers A, B, and C have established OSPF neighbor relationships. rtrA# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/BDR 00:00:30 172.16.1.2 Ethernet0/0 ________________________________________________________________________________ rtrB# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/DR 00:00:38 172.16.1.1 Ethernet0 3.3.3.3 1 FULL/ - 00:00:38 10.1.1.6 Serial1 ________________________________________________________________________________ rtrC# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/ - 00:00:34 10.1.1.5 Serial0 Now inspect the routing tables on Routers A, B, and C to determine the OSPF cost of the routes. rtrA# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/ 11 ] via 172.16.1.2, 00:49:20, Ethernet0/0 3.0.0.0/32 is subnetted, 1 subnets O IA 3.3.3.3 [110/ 75 ] via 172.16.1.2, 00:49:20, Ethernet0/0 172.16.0.0/24 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Ethernet0/0 10.0.0.0/30 is subnetted, 1 subnets O IA 10.1.1.4 [110/ 74 ] via 172.16.1.2, 00:49:20, Ethernet0/0 ________________________________________________________________________________ rtrB# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets O 1.1.1.1 [110/ 11 ] via 172.16.1.1, 01:06:18, Ethernet0 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/ 65 ] via 10.1.1.6, 01:06:48, Serial1 172.16.0.0/24 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Ethernet0 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.4 is directly connected, Serial1 ________________________________________________________________________________ rtrC# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/ 75 ] via 10.1.1.5, 01:07:11, Serial0 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/ 65 ] via 10.1.1.5, 01:07:22, Serial0 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 172.16.0.0/24 is subnetted, 1 subnets O IA 172.16.1.0 [110/ 74 ] via 10.1.1.5, 01:07:41, Serial0 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.4 is directly connected, Serial0 For each OSPF route in the IP routing tables, there are two numbers that represent the cost of the route. For example, in the IP routing table on Router C the entry for network 1.1.1.1 is: O IA 1.1.1.1 [ 110/75 ] via 10.1.1.5, 01:07:11, Serial0. The first number, 110, represents the administrative distance for an OSPF route. The administrative distance is used if the router is learning about the same route from more than one IP routing protocol. The route with the lowest administrative distance will be considered the best route. The second number, 75, is the cost for Router C to reach network 1.1.1.1 on Router A. This figure consists of the cost to traverse the serial link between Routers B and C plus the cost to traverse the Ethernet link between Routers A and B plus the cost of the loopback interface on Router A. You can determine these individual costs by examining the interfaces on each router. First, view the cost associated with the serial interface between Routers B and C, as shown here: rtrC# show ip ospf interface serial 0 Serial0 is up, line protocol is up Internet Address 10.1.1.6/30, Area 1 Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:00 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 Suppress hello for 0 neighbor(s) The cost of the first link is 64. Now view the cost associated with the Ethernet network between Routers A and B. rtrB# show ip ospf interface e0 Ethernet0 is up, line protocol is up Internet Address 172.16.1.2/24, Area 0 Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 1.1.1.1, Interface address 172.16.1.1 Backup Designated router (ID) 2.2.2.2, Interface address 172.16.1.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:07 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 1.1.1.1 (Designated Router) Suppress hello for 0 neighbor(s) Finally, view the cost of the loopback interface on Router A. rtrA# show ip ospf interface loopback0 Loopback0 is up, line protocol is up Internet Address 1.1.1.1/32, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1 Loopback interface is treated as a stub Host The three costs are 64, 10, and 1, for a total cost of 75. Because the default reference is 100,000,000, the cost of the Ethernet link is 100,000,000/10,000,000 = 10. By definition, the cost of a loopback interface is 1. The question is, why is the cost of the Serial interface 64? The clock rate on the Serial link is 64,000, so shouldn't the cost be 100,000,000/64,000 = 1562? Even though we have set a clock rate on the interface, the bandwidth is not 64,000, as can be seen by inspecting the interface properties. rtrB# show interfaces serial 1 Serial1 is up, line protocol is up Hardware is HD64570 Internet address is 10.1.1.5/30 MTU 1500 bytes, BW 1544 Kbit , DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input 00:00:07, output 00:00:08, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 2559 packets input, 168890 bytes, 0 no buffer Received 1338 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 2589 packets output, 173462 bytes, 0 underruns 0 output errors, 0 collisions, 1 interface resets 0 output buffer failures, 0 output buffers swapped out 2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up The bandwidth is T1 or 1,544,000 bps. Therefore, the OSPF cost is 100,000,000/1,544,000 = 64. We can modify the cost of the serial interface by using the bandwidth command on Routers B and C. Router B interface Serial1 bandwidth 64 ip address 10.1.1.5 255.255.255.252 clockrate 64000 ________________________________________________________________________________ Router C interface Serial0 bandwidth 64 ip address 10.1.1.6 255.255.255.252 no ip directed-broadcast Re-examine the bandwidth of the serial link on Router B. rtrB# show interfaces serial 1 Serial1 is up, line protocol is up Hardware is HD64570 Internet address is 10.1.1.5/30 MTU 1500 bytes, BW 64 Kbit , DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input 00:00:08, output 00:00:09, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 2599 packets input, 171490 bytes, 0 no buffer Received 1359 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 2630 packets output, 176116 bytes, 0 underruns 0 output errors, 0 collisions, 1 interface resets 0 output buffer failures, 0 output buffers swapped out 2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up Inspect the routing table on Router C to see if the OSPF costs have been updated. rtrC# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/ 1573 ] via 10.1.1.5, 00:02:04, Serial0 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/ 1563 ] via 10.1.1.5, 00:02:05, Serial0 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 172.16.0.0/24 is subnetted, 1 subnets O IA 172.16.1.0 [110/ 1572 ] via 10.1.1.5, 00:02:05, Serial0 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.4 is directly connected, Serial0 Now change the default OSPF cost reference so that an Ethernet network has a cost of 50. The cost equation is:
Rearranging, we get this equation:
So we want to change the OSPF cost reference to 500 Mbps. Router A router ospf 1 auto-cost reference-bandwidth 500 network 1.1.1.1 0.0.0.0 area 0 network 172.16.1.0 0.0.0.255 area 0 ________________________________________________________________________________ Router B router ospf 1 auto-cost reference-bandwidth 500 network 2.2.2.2 0.0.0.0 area 0 network 10.1.1.4 0.0.0.3 area 1 network 172.16.1.0 0.0.0.255 area 0 ________________________________________________________________________________ Router C router ospf 1 auto-cost reference-bandwidth 500 network 3.3.3.3 0.0.0.0 area 1 network 10.1.1.4 0.0.0.3 area 1 When you configure the new cost reference, the router will give you a friendly reminder, as shown here: rtrC(config-router)# auto-cost reference-bandwidth 500 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. VerificationVerify that the new cost reference is being used to calculate OSPF costs. rtrA# show ip ospf interface ethernet 0/0 Ethernet0/0 is up, line protocol is up Internet Address 172.16.1.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 50 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 1.1.1.1, Interface address 172.16.1.1 Backup Designated router (ID) 2.2.2.2, Interface address 172.16.1.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:03 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 (Backup Designated Router) Suppress hello for 0 neighbor(s) rtrA# show ip ospf interface loopback 0 Loopback0 is up, line protocol is up Internet Address 1.1.1.1/32, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1 Loopback interface is treated as a stub Host ______________________________________________________________________________________ rtrC# show ip ospf interface serial 0 Serial0 is up, line protocol is up Internet Address 10.1.1.6/30, Area 1 Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 7812 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:01 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 Suppress hello for 0 neighbor(s) Notice that the cost of the loopback interfaces remains 1. |
< Free Open Study > |