2007 Cisco Systems, Inc. All rights reserved. Cisco Public Objectives OSPF Routing Protocols and Concepts Chapter 11 Identify and apply the basic OSPF configuration commands Describe, modify and calculate the metric used by OSPF Describe the Designated Router/Backup Designated Router (DR/BDR) election process in multiaccess networks Describe the uses of additional configuration commands in OSPF ITE PC v4.0 Chapter 1 1 2 Routing Protocols Characteristics of OSPF Internet standard, runs only on IP Classless, link-state routing protocol Cisco s implementation uses accumulated bandwidth for metric (called path cost) Algorithm is SPF, fast convergence Scalable hierarchical areas Requires more router resources than dist. vector OSPFv2 is the current version for IPv4 OSPFv3 is for IPv6 networks 3 memory, CPU cycles Supports authentication 4 OSPF Message Encapsulation The Hello Protocol OSPF message is encapsulated in an IP packet Uses destination multicast addresses: 224.0.0.5 and 224.0.0.6. There are five packet types (LSPs): Hello Database description (DBD) Link state request (LSR) Link state update (LSU) Link state acknowledgement (LSAck) By default, Hello packets are sent every 10 seconds on multi-access and P2P segments and every 30 seconds on NBMA segments (Frame Relay, X.25, ATM). Initially, Hello packets are sent to discover neighbors and establish adjacencies Then to monitor the link to the neighbor Dead interval is 4 times the hello interval Hello packets are multicast on 224.0.0.5 (ALLSPFRouters) 5 6
Forming Neighbor Adjacencies Unlike EIGRP, two OSPF routers can form a neighbor adjacency only if they agree on three values: Hello interval Dead interval Network type Each OSPF router maintains an Adjacency database Display neighbor adjacencies with the command: show ip ospf neighbors 7 Router ID Router ID is used to uniquely identify a router in the OSPF domain. Determined by: 1. IP address configured with the OSPF routerid command. This is a relatively new command, not supported by older IOS versions 2. Else highest IP address of any of its loopback interfaces. Using a loopback address for the router ID provides stability to the OSPF process 3. Else highest IP address of any of its active physical interfaces. (Interface does not need to be enabled for OSPF). 8 OSPF Link State Packets (LSPs) DBD is an abbreviated list of the sending router's link-state database. Receiver can then make LSR LSU packets are used to reply to LSRs as well as to announce new information. LSUs are used to deliver Link-State Advertisements (LSA) LSAck acknowledges that an LSU has been received. An LSA contains information about a single link (neighbors, cost, etc). Stored in the LSDB 9 10 The OSPF Algorithm OSPF routers build & maintain link-state database containing LSAs received from other routers When a router receives a new LSA from a neighbor (a link is down, or a new link comes up) it is stored in it s LSDB and is immediately flooded to it s other neighbors The OSPF algorithm is then run on the updated LSDB, possibly changing the routing table The LSA is propagated quickly through the network resulting in very fast convergence 11 12
Routing Table Entries OSPF default administrative distance is 110 Route source code is O Lab 11.6.1 Discontiguous addressing scheme OSPF does not automatically summarize routes O 192.168.10.8 [110/3124] via 192.168.10.2, 00:00:02, Serial0/0 13 14 Basic OSPF Configuration hostname R1 interface Serial0/1 bandwidth 64 ip address 192.168.10.5 255.255.255.252 router ospf 1 router-id 10.4.4.4 network 172.16.1.16 0.0.0.15 area 0 network 192.168.10.0 0.0.0.3 area 0 network 192.168.10.4 0.0.0.3 area 0 Basic OSPF Configuration Commands R(config)# router ospf process-id The process-id is locally significant, 1 to 65,535 R(config-router)# network network-addr wildcard-mask area area-id OSPF requires the wildcard mask. Wildcard mask is the inverse of a subnet mask. Use an area-id of 0 with single-area OSPF. 15 16 Verifying OSPF Important commands to verify OSPF: show ip protocols show ip ospf show ip ospf interface show ip ospf neighbors clear ip ospf process 17 OSPF Metric OSPF uses cost as the metric for determining the best route Lowest cost is best Cost is based on bandwidth of an interface 10 8 / bandwidth Reference bandwidth Defaults to 100 Mbps (i.e. 10 8 Mbps) Can be modified for links faster than 100 Mbps using the command: auto-cost reference-bandwidth { 1-4294967 Mbps } 18
Calculation of the OSPF link cost Usually the actual speed of a link is different than the default bandwidth Serial link defaults to 1.544Mbps With any routing protocol using bandwidth as metric (i.e. EIGRP, OSPF), use the bandwidth command on serial links: R1(config-if)# bandwidth 64 (Note: Accumulated Cost should be 1563) Is the accumulated value from one router to the next 19 Alternatively, calculate the OSPF metric yourself: R1(config-if)# ip ospf cost 1562 20 Types of Network OSPF and Multiaccess Networks Multiaccess because there can be more than two devices on the same shared media. Broadcast because all devices on the network see all frames. Point-to-point network there can only be two devices on OSPF defines five network types: Point-to-point Broadcast Multiaccess Nonbroadcast Multiaccess (NBMA) Point-to-multipoint Virtual links 2 challenges presented by multiaccess networks Multiple adjacencies increases exponentially Extensive LSA flooding consumes bandwidth the network 21 22 Broadcast Multiaccess Solution to LSA flooding issues 23 24
OSPF and Multiaccess Networks Sending & Receiving LSAs DR designated router All LSA s are sent and received through the DR BDR backup designated router Monitors the DR and takes over if the DR goes down DROther a router which is not a DR or BDR A DR and BDR is elected on OSPF multiaccess network (e.g. Ethernet) There is no DR/BDR election on point-to-point networks (e.g. serial interface links) 25 DROthers send LSAs via multicast 224.0.0.6 to DR & BDR DR forwards LSA via multicast address 224.0.0.5 to all other routers 26 DR/BDR Election Process DR/BDR elections will take place on multiaccess networks as shown below Criteria for getting elected DR/BDR DR: Router with the highest OSPF interface priority BDR: Router with the second highest OSPF interface priority If OSPF interface priorities are equal, the highest Router ID breaks the tie 27 28 OSPF Interface Priority Timing of DR/BDR Election An admin can influence the election of DR/BDR by setting the OSPF interface priority: Occurs as soon as the first router has its interface enabled on multiaccess network int fa0/0 ip ospf priority {0 255} The default priority is 1 A priority of 0 prevents a router becoming DR or BDR A router connected to more than one multiaccess network can take part in more than one DR/BDR election 29 When a DR is elected it remains as the DR until it goes down. Then the BDR becomes the DR and a new BDR is elected. The order in which interfaces come up influences the DR/BDR election In order to get the result you expect, you may have to shutdown/bring up interfaces or restart the OSPF process: R1# clear ip ospf process 30
Redistributing an OSPF Default Route Propagate a default route with OSPF interface Loopback1 description To ISP ip address 172.30.1.1 255.255.255.252 router ospf 1 network 172.16.1.16 0.0.0.15 area 0 network 192.168.10.0 0.0.0.3 area 0 network 192.168.10.4 0.0.0.3 area 0 default-information originate ip route 0.0.0.0 0.0.0.0 Loopback1 31 Note: this is the same method as used with RIP, but not with EIGRP 32 Fine-Tuning OSPF Modifying OSPF timers for faster detection of network failures Hello & Dead intervals must be the same between neighbors 33 interface Serial0/0 bandwidth 64 ip address 192.168.10.1 255.255.255.252 ip ospf hello-interval 5 ip ospf dead-interval 20 clock rate 64000 interface Serial0/1 bandwidth 64 ip address 192.168.10.5 255.255.255.252 interface Loopback1 description To ISP ip address 172.30.1.1 255.255.255.252 router ospf 1 router-id 10.4.4.4 network 172.16.1.16 0.0.0.15 area 0 network 192.168.10.0 0.0.0.3 area 0 network 192.168.10.4 0.0.0.3 area 0 auto-cost reference-bandwidth 10000 default-information originate ip route 0.0.0.0 0.0.0.0 Loopback1 end Partial config of R1 34 Summary Multicast group addresses 224.0.0.5 All OSPF routers, Hello packets 224.0.0.6 All OSPF DR/BDR routers 224.0.0.9 RIPv2 routers 224.0.0.10 EIGRP routers 35 Comparison of OSPF and EIGRP OSPF EIGRP Internet standard Cisco proprietary Network statement requires wildcard mask No automatic summ. Neighbors must have same hello and dead intervals Process ID has only local significance Wildcard mask is optional in network statement Default auto-summary Adjacencies between routers with different hello and dead intervals Process ID must be same on all routers in EIGRP domain 36