• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Cis185 bsci-lecture4-single area-ospf-review
 

Cis185 bsci-lecture4-single area-ospf-review

on

  • 658 views

 

Statistics

Views

Total Views
658
Views on SlideShare
658
Embed Views
0

Actions

Likes
0
Downloads
20
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The area area-id refers to the OSPF area . A group of OSPF routers that share link-state information . All OSPF routers in the same area must have the same link-state information in their link-state databases. This is accomplished by routers flooding their individual link states to all other routers in the area . In this chapter, we configure all the OSPF routers within a single area. This is known as single-area OSPF .
  • Before an OSPF router can flood its link states , must discover neighbors . Before two routers can form an OSPF neighbor adjacency, they must agree on three values: Hello interval Dead interval Network type Both the interfaces must be part of the same network , including having the same subnet mask . IP MTU must match
  • By default, OSPF Hello packets are sent: 10 seconds on multiaccess and point-to-point segments 30 seconds on nonbroadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM). In most cases, OSPF Hello packets are sent as multicast to an address reserved for ALLSPFRouters at 224.0.0.5 .
  • Dead interval - Period, expressed in seconds, that the router will wait to receive a Hello packet before declaring the neighbor “down .” Cisco uses a default of four times the Hello interval. 40 seconds - Multiaccess and point-to-point segments . 120 seconds - NBMA networks. Dead interval expires OSPF removes that neighbor from its link-state database . Floods the link-state information about the “down” neighbor out all OSPF-enabled interfaces. Network types are discussed later in the chapter .
  • Notice in the output that the Dead time is counting down from 40 seconds. By default, this value is refreshed every 10 seconds when R1 receives a Hello from the neighbor .
  • It might be desirable to change the OSPF timers so that routers will detect network failures in less time. Before changing any timer default values, be sure to give it careful consideration and understand the effects of making those changes .
  • OSPF Router ID is an IP address used to uniquely identify an OSPF router . Also used in the DR and BDR process. 1. Use the IP address configured with the OSPF router-id command . 2. Highest IP address of any of its loopback interfaces. 3. Highest active IP address of any of its physical interfaces.
  • Neighbor ID: The router ID of the neighboring router. Pri: The OSPF priority of the interface. ( later ) State: The OSPF state of the interface. FULL state means that the router’s interface is fully adjacent with its neighbor and they have identical OSPF link-state databases . OSPF states are discussed in CCNP . Dead Time: The amount of time remaining that the router will wait to receive an OSPF Hello packet from the neighbor before declaring the neighbor down. This value is reset when the interface receives a Hello packet. Address: The IP address of the neighbor’s interface to which this router is directly connected. Interface: The interface on which this router has formed adjacency with the neighbor.
  • Two routers may not form an OSPF adjacency if: The subnet masks do not match , causing the routers to be on separate networks. OSPF Hello or Dead timers do not match . OSPF network types do not match . There is a missing or incorrect OSPF network command . Other powerful OSPF troubleshooting commands include the following: show ip protocols show ip ospf show ip ospf interface
  • Any time a router receives new information about the topology (addition, deletion, or modification of a link), the router must: Rerun the SPF algorithm Create a new SPF tree Update the routing table More in CCNP The SPF algorithm is CPU intensive , and the time it takes for calculation depends on the size of the area .
  • Flapping link - A network that cycles between an up state and a down state . A flapping link can cause OSPF routers in an area to constantly recalculate the SPF algorithm , preventing proper convergence . SPF schedule delay . To minimize this problem, the router waits 5 seconds (5000 msec) after receiving an LSU before running the SPF algorithm. Minimum hold time: To prevent a router from constantly running the SPF algorithm , there is an additional hold time of 10 seconds (10,000 ms). The router waits 10 seconds after running the SPF algorithm before rerunning the algorithm.
  • These intervals are included in the OSPF Hello packets sent between neighbors. OSPF may have different Hello and Dead intervals on various interfaces , For OSPF routers to become neighbors, their OSPF Hello and Dead intervals must be identical. R1 is using a Hello interval of 10 and a Dead interval of 40 on the Serial 0/0/0 interface. R2 must also use the same intervals on its Serial 0/0/0 interface ; otherwise, the two routers will not form an adjacency.
  • The quickest way to verify OSPF convergence is to look at the routing table for each router. Loopback interfaces are included . Unlike RIPv2 and EIGRP, OSPF does not automatically summarize at major network boundaries.
  • The OSPF metric is called cost . The following passage is from RFC 2328: A cost is associated with the output side of each router interface. This cost is configurable by the system administrator. The lower the cost, the more likely the interface is to be used to forward data traffic. RFC 2328 does not specify which values should be used to determine the cost.
  • Cisco IOS software uses the cumulative bandwidths of the outgoing interfaces from the router to the destination network as the cost value. 10 8 is known as the reference bandwidth
  • The reference bandwidth can be modified to accommodate these faster links by using the OSPF command auto-cost reference-bandwidth . When this command is necessary, it is recommended that it is used on all routers so the OSPF routing metric remains consistent .
  • T1 cost 64 + Fast Ethernet cost 1 = 65 The “ Cost = 64 ” refers to the default cost of the serial interface , 10 8 /1,544,000 bps = 64 , and not to the actual 64-Kbps “speed” of the link.
  • On Cisco routers, the bandwidth value on many serial interfaces defaults to T1 (1.544 Mbps). Always check this with the show interface command. Rick’s tip – Always use the bandwidth command on serial interfaces. However, some serial interfaces may default to 128 Kbps.
  • The bandwidth command is used to modify the bandwidth value used by the Cisco IOS software in calculating the OSPF cost metric. Same as with EIGRP
  • An alternative method to using the bandwidth command is to use the ip ospf cost command, which allows you to directly specify the cost of an interface. This will not change the output of the show ip ospf interface command,
  • OSPF elects a Designated Router (DR) to be the collection and distribution point for LSAs sent and received . A Backup Designated Router (BDR) is also elected in case the DR fails . All other routers become DROthers .
  • DROthers only form full adjacencies with the DR and BDR in the network. send their LSAs to the DR and BDR using the multicast address 224.0.0.6 ( ALLDRouters , all DR routers). R1 sends LSAs to the DR. The BDR listens, too . The DR is responsible for forwarding the LSAs from R1 to all other routers . The DR uses the multicast address 224.0.0.5 ( AllSPFRouters , all OSPF routers). The result is that there is only one router doing all the flooding of all LSAs in the multiaccess network.
  • The following criteria are applied: 1. DR : Router with the highest OSPF interface priority . 2. BDR : Router with the second highest OSPF interface priority . 3. If OSPF interface priorities are equal , the highest router ID is used to break the tie. Default OSPF interface priority is 1 . Current configuration, the OSPF router ID is used to elect the DR and BDR.
  • The DR and BDR election process takes place as soon as the first router with an OSPF enabled interface is active on the multiaccess network.
  • When the DR is elected, it remains the DR until one of the following conditions occurs: The DR fails . The OSPF process on the DR fails . The multiaccess interface on the DR fails . If the DR fails , the BDR assumes the role of DR , and an election is held to choose a new BDR .
  • If a new router enters the network after the DR and BDR have been elected, it will not become the DR or the BDR even if it has a higher OSPF interface priority or router ID than the current DR or BDR.
  • A previous DR does not regain DR status if it returns to the network.
  • If the BDR fails, an election is held among the DROthers to see which router will be the new BDR.
  • RouterB fails. Because RouterD is the current BDR, it is promoted to DR. RouterC becomes the BDR.
  • We can change the OSPF interface priority to better control our DR/BDR elections .
  • Important for this router to have sufficient CPU and memory capacity to handle the responsibility. Control the election of these routers with the ip ospf priority interface command. Priority (Highest priority wins): 0 = Cannot become DR or BDR 1 = Default Therefore, the router ID determines the DR and BDR. Priorities are an interface-specific value, they provide better control of the OSPF multiaccess networks. They also allow a router to be the DR in one network and a DROther in another.
  • The OSPF interface priority can be viewed using the show ip ospf interface command.
  • After doing a shutdown and a no shutdown on the Fast Ethernet 0/0 interfaces of all three routers, we see the result of the change of OSPF interface priorities.
  • Hello packets are still exchanged between all routers on a multi-access segment (DR, BDR, DROthers,….) to maintain neighbor adjacencies. OSPF LSA packets (coming) are packets which are sent from the BDR/DROthers to the DR, and then from the DR to the BDR/DROthers. (The reason for a DR/BDR.) Normal routing of IP packets still takes the lowest cost route, which might be between two DROthers.
  • Like RIP, OSPF requires the use of the default-information originate command to advertise the 0.0.0.0/0 static default route to the other routers in the area. If the default-information originate command is not used, the default “quad zero” route will not be propagated to other routers in the OSPF area.
  • E2 denotes that this route is an OSPF External Type 2 route . OSPF external routes fall in one of two categories: External Type 1 (E1) External Type 2 (E2) OSPF accumulates cost for an E1 route as the route is being propagated throughout the OSPF area. This process is identical to cost calculations for normal OSPF internal routes . E2 route is always the external cost, irrespective of the interior cost to reach that route. In this topology, because the default route has an external cost of 1 on the R1 router, R2 and R3 also show a cost of 1 for the default E2 route. E2 routes at a cost of 1 are the default OSPF configuration. More later
  • 1 . Establishing router adjacencies (Routers are adjacent) Down State – No Hello received Init State – Hello received, but not with this router’s Router ID “ Hi, my name is Carlos.” “Hi, my name is Maria.” Two-way State – Hello received, and with this router’s Router ID “ Hi, Maria, my name is Carlos.” “Hi, Carlos, my name is Maria.” 2. Electing DR and BDR – Multi-access (broadcast) segments only ExStart State with DR and BDR Two-way State with all other routers 3. Discovering Routes ExStart State Exchange State Loading State Full State (Routers are “fully adjacent”) 4. Calculating the Routing Table 5. Maintaining the LSDB and Routing Table
  • ExStart State Start of LSDB (Link State Data Base) synchronization process. Routers are now ready to exchange routing information. Between routers on a point-to-point network On a multi-access network between the DRothers and the DR and BDR. But who goes first in the exchange? Purpose of ExStart is to establish a “ master/slave relationship” between the two routers decided by the higher router id . Once the roles are established they enter the Exchange state . Routers exchange one or more Type-2 DBDs (Database Description) packets, which is a summary of the link-state database send LSAcks to verify If the LSA is not in its LSDB or the LSA is a more recent version, the router adds an entry to its Link State Request list . This process ends when both routers stop have sent and received acknowledgements for all their DBD packets – that is they have successfully sent all their DBD packets to each other. If a router has entries in its Link State Request list , (needs additional or more recent information not in its LSDB), then it enters the loading state. If there are no entries in its Link State Request list , than the router’s interface can transition directly to full state . Loading State The router needing additional information sends LSR (Link State Request) packets using LSA information from its LSR list. The other routers replies by sending the requested LSAs in the Link State Update (LSU) packet. The receiving router sends LSAck to acknowledge receipt. When all LSAs on the neighbors Link State Request list have been received, the “neighbor FSM” transitions this interface to Full state. Full State Full state - after all LSRs have been updated. At this point the routers should have identical LSDBs (link-state databases). Flooding LSAs Once this interface transitions to or from Full state the router originates a new version of a Router LSA (coming) and floods it to its neighbors , distributing the new topological information – out all OSPF enabled interfaces. Broadcast networks: DR: If the LSA was received on this interface, send it out this interface so DROthers receive it (224.0.0.5 - all OSPF routers) BDR/DROther: If the LSA was received on this interface, do not send out this interface (received from DR). Calculating Routing Table The router still must calculate its routing table
  • OSPF is a link state routing protocol and does not send periodic updates like RIP. OSPF only floods link state state advertisements when there is a change in topology (this includes when a routers are first booted). OSPF uses hop-by-hop flooding of LSAs; an LSA received on one interface are flooded out other OSPF enabled interfaces. If a link state entry in the LSDB (Link State DataBase) reaches an age of 60 minutes (MaxAge) without being updated, it is removed and SPF is recalculated. Every 30 minutes (LSRefreshTime), OSPF routers flood only their link states to all other routers (in the area). This is known as a “ paranoid update” These do not trigger SPF recalculations. Special note: When a link goes down and a router wants to send a LSA to tell other routers to remove this link state, it sends this link state with a value of 60 minutes (MAXAGE).

Cis185 bsci-lecture4-single area-ospf-review Cis185 bsci-lecture4-single area-ospf-review Presentation Transcript

  • Single Area OSPF - Review CIS 185 Advanced Routing Rick Graziani Cabrillo College graziani@cabrillo.edu Last Updated: Fall 2009
  • Note My web site is www.cabrillo.edu/~rgraziani. For access to these PowerPoint presentations and other materials, please email me at graziani@cabrillo.edu. 2
  • For further information This presentation is an overview of what is covered in the curriculum/book. For further explanation and details, please read the chapter/curriculum. Book:  Routing Protocols and Concepts  By Rick Graziani and Allan Johnson  ISBN: 1-58713-206-0  ISBN-13: 978-58713- 206-3 3
  • Introduction to OSPF
  • Introduction to OSPF OSPF is:  Classless  Link-state routing protocol  Uses the concept of areas for scalability RFC 2328 defines the OSPF metric as an arbitrary value called cost. Cisco IOS software uses bandwidth to calculate the OSPF cost metric. 5
  • The network CommandRouter(config-router)# network network-address wildcard-mask area area-id  The area area-id refers to the OSPF area.  A group of OSPF routers that share link-state information.  All OSPF routers in the same area must have the same link- state information in their link-state databases.  This is accomplished by routers flooding their individual link states to all other routers in the area. 6
  • Link State Concepts 1 – Flooding of link-state information 5 – Routing Table 3 – SPF Algorithm 2 – Building a Topological 4 – SPF Tree Database 7
  • Neighbors andAdjacencies Before two routers can form an OSPF neighbor adjacency, they must agree on three values:  Hello interval  Dead interval  Network type  Both the interfaces must be part of the same network, including having the same subnet mask.  IP MTU must match 8
  • Hello Intervals By default, OSPF Hello packets are sent:  10 seconds on multiaccess and point-to-point segments  30 seconds on nonbroadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM). In most cases, use multicast address ALLSPFRouters at 224.0.0.5. 9
  • Dead Intervals Cisco uses a default of four times the Hello interval.  40 seconds - Multiaccess and point-to-point segments.  120 seconds - NBMA networks. Dead interval expires  OSPF removes that neighbor from its link-state database.  Floods the link-state information about the “down” neighbor out all OSPF-enabled interfaces. 10
  • Modifying OSPF IntervalsR1# show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface10.3.3.3 0 FULL/ - 00:00:35 192.168.10.6 Serial0/0/110.2.2.2 0 FULL/ - 00:00:36 192.168.10.2 Serial0/0/0 Dead time is counting down from 40 seconds. Refreshed every 10 seconds when R1 receives a Hello from the neighbor. 11
  • Modifying OSPF IntervalsRouter(config-if)# ip ospf hello-interval secondsRouter(config-if)# ip ospf dead-interval seconds 12
  • Basic OSPF Configuration  Lab Topology  The router ospf command  The network command  OSPF Router ID  Verifying OSPF  Examining the Routing Table
  • Router ID?OSPF Router ID Router ID? Router ID? OSPF Router ID is an IP address used to uniquely identify an OSPF router.  Also used in the DR and BDR process.1. Use the IP address configured with the OSPF router-id command.2. Highest IP address of any of its loopback interfaces.3. Highest active IP address of any of its physical interfaces. 14
  • Verifying New Router IDs (Loopbacks)R1# show ip protocolsRouting Protocol is “ospf 1” Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 10.1.1.1<output omitted>R2# show ip protocolsRouting Protocol is “ospf 1” Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 10.2.2.2<output omitted>R3# show ip protocolsRouting Protocol is “ospf 1” Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 10.3.3.3<output omitted> 15
  • Verifying OSPFR1# show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface10.3.3.3 1 FULL/ - 00:00:30 192.168.10.6 Serial0/0/110.2.2.2 1 FULL/ - 00:00:33 192.168.10.2 Serial0/0/0 Neighbor ID: The router ID of the neighboring router. Pri: The OSPF priority of the interface. State: The OSPF state of the interface. Dead Time: Address: The IP address of the neighbor’s interface Interface: Local interface 16
  • Verifying OSPFR1# show ip ospf interface serial 0/0/0Serial0/0/0 is up, line protocol is up Internet Address 192.168.10.1/30, Area 0 Process ID 1, Router ID 10.1.1.1, 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 <output omitted> 17
  • Verifying OSPFR1# show ip protocolsRouting Protocol is “ospf 1” OSPF Process ID Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 10.1.1.1 OSPF Router ID Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 172.16.1.16 0.0.0.15 area 0 Networks OSPF is 192.168.10.0 0.0.0.3 area 0 advertising that are 192.168.10.4 0.0.0.3 area 0 originating from this router Reference bandwidth unit is 100 mbps Routing Information Sources: Gateway Distance Last Update 10.2.2.2 110 11:29:29 OSPF Neighbors 10.3.3.3 110 11:29:29 Distance: (default is 110) Administrative Distance 18
  • Verifying OSPFR1# show ip ospf <some output omitted> Routing Process “ospf 1” with ID 10.1.1.1 Start time: 00:00:19.540, Time elapsed: 11:31:15.776 Supports only single TOS(TOS0) routes Supports opaque LSA Supports Link-local Signaling (LLS) Supports area transit capability Router is not originating router-LSAs with maximum metric Initial SPF schedule delay 5000 msecs Minimum hold time between two consecutive SPFs 10000 msecs Maximum wait time between two consecutive SPFs 10000 msecs Incremental-SPF disabled Minimum LSA interval 5 secs Minimum LSA arrival 1000 msecs Area BACKBONE(0) Number of interfaces in this area is 3 Area has no authentication SPF algorithm last executed 11:30:31.628 ago SPF algorithm executed 5 times 19
  • Verifying OSPFR1# show ip ospf <some output omitted>Initial SPF schedule delay 5000 msecs Minimum hold time between two consecutive SPFs 10000 msecs Maximum wait time between two consecutive SPFs 10000 msecs Any time a router receives new information about the topology (addition, deletion, or modification of a link), the router must:  Rerun the SPF algorithm  Create a new SPF tree  Update the routing table The SPF algorithm is CPU intensive, and the time it takes for calculation depends on the size of the area. 20
  • Verifying OSPFR1# show ip ospf <some output omitted>Initial SPF schedule delay 5000 msecs Minimum hold time between two consecutive SPFs 10000 msecs A flapping link can cause OSPF routers in an area to constantly recalculate the SPF algorithm, preventing proper convergence. SPF schedule delay.  To minimize this problem, the router waits 5 seconds (5000 msec) after receiving an LSU before running the SPF algorithm. Minimum hold time:  To prevent a router from constantly running the SPF algorithm, there is an additional hold time of 10 seconds (10,000 ms).  The router waits 10 seconds after running the SPF algorithm before rerunning the algorithm. 21
  • Verifying OSPFR1# show ip ospf interface serial 0/0/0Serial0/0/0 is up, line protocol is up Internet Address 192.168.10.1/30, Area 0 Process ID 1, Router ID 10.1.1.1, 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 <output omitted> 22
  • Examining the Routing TableR1# show ip routeCodes: <some code output omitted> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 192.168.10.0/30 is subnetted, 3 subnetsC 192.168.10.0 is directly connected, Serial0/0/0C 192.168.10.4 is directly connected, Serial0/0/1O 192.168.10.8 [110/128] via 192.168.10.2, 14:27:57, Serial0/0/0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masksO 172.16.1.32/29 [110/65] via 192.168.10.6, 14:27:57, Serial0/0/1C 172.16.1.16/28 is directly connected, FastEthernet0/0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksO 10.10.10.0/24 [110/65] via 192.168.10.2, 14:27:57, Serial0/0/0C 10.1.1.1/32 is directly connected, Loopback0  Unlike RIPv2 and EIGRP, OSPF does not automatically summarize at major network boundaries. 23
  • The OSPF Metric  OSPF Metric  Modifying the Cost of the Link
  • OSPF Metric The OSPF metric is called cost. The following passage is from RFC 2328:  A cost is associated with the output side of each router interface. This cost is configurable by the system administrator. The lower the cost, the more likely the interface is to be used to forward data traffic. RFC 2328 does not specify which values should be used to determine the cost. 25
  • OSPF Metric Cisco IOS Cost for OSPF = 108/bandwidth in bps Cisco IOS software uses the cumulative bandwidths of the outgoing interfaces from the router to the destination network as the cost value. 108 is known as the reference bandwidth 26
  • Reference BandwidthR1(config-router)# auto-cost reference-bandwidth ?1-4294967 The reference bandwidth in terms of Mbits per second.R1(config-router)# auto-cost reference-bandwidth 10000To increase it to 10GigE (10 Gbps Ethernet) speeds, you need to change the referencebandwidth to 10,000. When this command is necessary, it is recommended that it is used on all routers so the OSPF routing metric remains consistent. 27
  • OSPFAccumulates Cost Serial interfaces bandwidth value defaults to T1 or 1544 Kbps.R1# show ip routeO 10.10.10.0/24 [110/65] via 192.168.10.2, 14:27:57, Serial0/0/0 T1 cost 64 + Fast Ethernet cost 1 = 65 The “Cost = 64” refers to the default cost of the serial interface, 108/1,544,000 bps = 64, and not to the actual 64-Kbps “speed” of the link. 28
  • Default Bandwidth on Serial InterfacesR1# show interface serial 0/0/0Serial0/0/0 is up, line protocol is up Hardware is GT96K Serial Description: Link to R2 Internet address is 192.168.10.1/30 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255 On Cisco routers, the bandwidth value on many serial interfaces defaults to T1 (1.544 Mbps). 29
  • Modifying the Cost of the Link Router(config-if)# bandwidth bandwidth-kbpsR1(config)# inter serial 0/0/0R1(config-if)# bandwidth 64R1(config-if)# inter serial 0/0/1R1(config-if)# bandwidth 256 100,000,000/64,000 = 1562R1(config-if)# endR1# show ip ospf interface serial 0/0/0Serial0/0 is up, line protocol is upInternet Address 192.168.10.1/30, Area 0Process ID 1, Router ID 10.1.1.1, Network Type POINT_TO_POINT, Cost: 1562Transmit Delay is 1 sec, State POINT_TO_POINT,<output omitted>  The bandwidth command is used to modify the bandwidth value used by the Cisco IOS software in calculating the OSPF cost metric.  Same as with EIGRP 30
  • The ip ospf cost CommandR1(config)# inter serial 0/0/0R1(config-if)# bandwidth 64R1(config-if)# endR1# show ip ospf interface serial 0/0/0 100,000,000/64,000 = 1562Serial0/0 is up, line protocol is upInternet Address 192.168.10.1/30, Area 0Process ID 1, Router ID 10.1.1.1, Network Type POINT_TO_POINT, Cost: 1562<output omitted> R1(config)# interface serial 0/0/0 R1(config-if)# ip ospf cost 1562  An alternative method to using the bandwidth command is to use the ip ospf cost command, which allows you to directly specify the cost of an interface.  This will not change the output of the show ip ospf interface command, 31
  • OSPF and MultiaccessNetworks  Challenges in Multiaccess Networks  DR/BDR Election Process  OSPF Interface Priority
  • Solution: Designated Router OSPF elects a Designated Router (DR) to be the collection and distribution point for LSAs sent and received. A Backup Designated Router (BDR) is also elected in case the DR fails. All other routers become DROthers. 33
  • 224.0.0.5 224.0.0.6DROther DROther DROther DROther DROther DROther  DROthers only form full adjacencies with the DR and BDR in the network.  send their LSAs to the DR and BDR  using the multicast address 224.0.0.6 (ALLDRouters, all DR routers).  R1 sends LSAs to the DR.  The BDR listens, too.  The DR is responsible for forwarding the LSAs from R1 to all other routers.  DR uses the multicast address 224.0.0.5 (AllSPFRouters, all OSPF routers).  Only one router doing all the flooding. 34
  • DR/BDR Election BDR DROther DR The following criteria are applied: 1. DR: Router with the highest OSPF interface priority. 2. BDR: Router with the second highest OSPF interface priority. 3. If OSPF interface priorities are equal, the highest router ID is used to break the tie. Default OSPF interface priority is 1. Current configuration, the OSPF router ID is used to elect the DR and BDR. 35
  • Verifying Router StatesRouterA# show ip ospf interface fastethernet 0/0FastEthernet0/0 is up, line protocol is up Internet Address 192.168.1.1/24, Area 0 Process ID 1, Router ID 192.168.31.11, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DROTHER, Priority 1 Designated Router (ID) 192.168.31.33, Interface address 192.168.1.3 Backup Designated router (ID) 192.168.31.22, Interface address 192.168.1.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5<output omitted> 36
  • Timing of DR/BDR ElectionIf I booted first and startedthe election before theothers were ready, I wouldbe the DR! 37
  • Timing of DR/BDR Election DR failed! I am now the DR! Elections will now happened for BDR DR I am now the BDR!BDR When the DR is elected, it remains the DR until one of the following conditions occurs:  The DR fails.  The OSPF process on the DR fails.  The multiaccess interface on the DR fails. If the DR fails, the BDR assumes the role of DR, and an election is held to choose a new BDR. 38
  • DRTiming ofDR/BDRElection BDR I am a new router with the highest Router ID. I cannot force a new DR or BDR election, so I am a DROther. DROther If a new router enters the network after the DR and BDR have been elected, it will not become the DR or the BDR even if it has a higher OSPF interface priority or router ID than the current DR or BDR. 39
  • I’m back but I don’t DR get to become DRTiming of again. I am now just aDR/BDR DROther.Election BDR DROther DROther A previous DR does not regain DR status if it returns to the network. 40
  • DRTiming ofDR/BDRElection BDRAmongst the DROtherDROthers I have thehighest Router ID, soI am the new BDR! BDR If the BDR fails, an election is held among the DROthers to see which router will be the new BDR. 41
  • DRTiming of I am now the new BDR!DR/BDRElection BDR DROther I am now the new DR! BDR RouterB fails. Because RouterD is the current BDR, it is promoted to DR. RouterC becomes the BDR. 42
  • To simplify our discussion, weTiming of DR/BDR Election removed RouterD from the topology.How can we make sureRouterB is the DR and Want to be DRRouterA is the BDR,regarless of RouterIDvalues? Highest Router ID Want to be BDR We can change the OSPF interface priority to better control our DR/BDR elections. 43
  • OSPF Interface PriorityRouter(config-if)# ip ospf priority {0 - 255} Control the election of these routers with the ip ospf priority interface command. Priority (Highest priority wins):  0 = Cannot become DR or BDR  1 = Default  Therefore, the router ID determines the DR and BDR. Priorities are an interface-specific value, they provide better control of the OSPF multiaccess networks. They also allow a router to be the DR in one network and a DROther in another. 44
  • OSPF Interface PriorityRouterA# show ip ospf interface fastethernet 0/0FastEthernet0/0 is up, line protocol is up Internet Address 192.168.1.1/24, Area 0 Process ID 1, Router ID 192.168.31.11, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DROTHER, Priority 1 Designated Router (ID) 192.168.31.33, Interface address 192.168.1.3 Backup Designated router (ID) 192.168.31.22, Interface address 192.168.1.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 <output omitted>  The OSPF interface priority can be viewed using the show ip ospf interface command. 45
  • Highest priority wins Pri = 100 Pri = 200 RouterA(config)# interface fastethernet 0/0 RouterA(config-if)# ip ospf priority 200 RouterB(config)# interface fastethernet 0/0 RouterB(config-if)# ip ospf priority 100 After doing a shutdown and a no shutdown on the Fast Ethernet 0/0 interfaces of all three routers, we see the result of the change of OSPF interface priorities. 46
  • Clarifications regarding DR/BDR Hello packets are still exchanged between all routers on a multi- access segment (DR, BDR, DROthers,….) to maintain neighbor adjacencies. OSPF LSA packets (coming) are packets which are sent from the BDR/DROthers to the DR, and then from the DR to the BDR/DROthers. (The reason for a DR/BDR.) Normal routing of IP packets still takes the lowest cost route, which might be between two DROthers. 47
  • More OSPF Configuration  Redistributing an OSPF Default Route  Fine-tuning OSPF
  • Redistributing an OSPF Default RouteThe static default route is using theloopback as an exit interfacebecause the ISP router in thistopology does not physically exist. R1(config)# interface loopback 1 R1(config-if)# ip add 172.30.1.1 255.255.255.252 R1(config-if)# exit R1(config)# ip route 0.0.0.0 0.0.0.0 loopback 1 R1(config)# router ospf 1 R1(config-router)# default-information originate  If the default-information originate command is not used, the default “quad zero” route will not be propagated to other routers in the OSPF area. 49
  • R3’s Routing TableR3# show ip routeGateway of last resort is 192.168.10.5 to network 0.0.0.0 192.168.10.0/30 is subnetted, 3 subnetsO 192.168.10.0 [110/1952] via 192.168.10.5, 00:00:38, S0/0/0C 192.168.10.4 is directly connected, Serial0/0/0C 192.168.10.8 is directly connected, Serial0/0/1 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masksC 172.16.1.32/29 is directly connected, FastEthernet0/0O 172.16.1.16/28 [110/391] via 192.168.10.5, 00:00:38, S0/0/0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.3.3.3/32 is directly connected, Loopback0O 10.10.10.0/24 [110/782] via 192.168.10.9, 00:00:38, S0/0/1O*E2 0.0.0.0/0 [110/1] via 192.168.10.5, 00:00:27, Serial0/0/0 50
  • External Type 2 RouteR3# show ip routeO*E2 0.0.0.0/0 [110/1] via 192.168.10.5, 00:00:27, Serial0/0/0 E2 denotes that this route is an OSPF External Type 2 route. OSPF external routes fall in one of two categories:  External Type 1 (E1)  External Type 2 (E2) OSPF accumulates cost for an E1 route as the route is being propagated throughout the OSPF area.  This process is identical to cost calculations for normal OSPF internal routes. E2 route is always the external cost, irrespective of the interior cost to reach that route.  In this topology, because the default route has an external cost of 1 on the R1 router, R2 and R3 also show a cost of 1 for the default E2 route.  E2 routes at a cost of 1 are the default OSPF configuration.  More later 51
  • Steps to OSPF Operation with States 1. Establishing router adjacencies (Routers are adjacent) Down State – No Hello received Init State – Hello received, but not with this router’s Router ID “Hi, my name is Carlos.” “Hi, my name is Maria.” Two-way State – Hello received, and with this router’s Router ID “Hi, Maria, my name is Carlos.” “Hi, Carlos, my name is Maria.” 2. Electing DR and BDR – Multi-access (broadcast) segments only ExStart State with DR and BDR Two-way State with all other routers 3. Discovering Routes 4. Calculating the Routing Table ExStart State Exchange State 5. Maintaining the LSDB and Routing Table Loading State Full State (Routers are “fully adjacent”)
  • 1. Establishing Adjacencies Hello 10.6.0.1 10.5.0.1 Hello 10.6.0.1 Down Init 2-way Down Init 2-way Hello 10.5.0.1 Hello 10.5.0.1 10.6.0.1 Down State - Init State – Two Way State  Down State - OSPF routers send Hello packets at regular intervals (10 sec.) to establish neighbors.  When a router (sends or) receives its first Hello packet, it enters the init state.  When the router sends a Hello packet to the neighbor with its RouterID and the neighbor sends a Hello packet packet back with that Router ID, the router’s interface will transition to the two-way state.  Now, the router is ready to take the relationship to the next level. 53
  • Steps to OSPF Operation with States (cont)Explanations in Notes Section 54
  • Couple of notes on link state flooding… OSPF is a link state routing protocol and does not send periodic updates like RIP. OSPF only floods link state state advertisements when there is a change in topology (this includes when a routers are first booted). OSPF uses hop-by-hop flooding of LSAs; an LSA received on one interface are flooded out other OSPF enabled interfaces. If a link state entry in the LSDB (Link State DataBase) reaches an age of 60 minutes (MaxAge) without being updated, it is removed and SPF is recalculated. Every 30 minutes (LSRefreshTime), OSPF routers flood only their link states to all other routers (in the area).  This is known as a “paranoid update”  These do not trigger SPF recalculations. Special note: When a link goes down and a router wants to send a LSA to tell other routers to remove this link state, it sends this link state with a value of 60 minutes (MAXAGE).
  • Single Area OSPF - Review CIS 185 Advanced Routing Rick Graziani Cabrillo College graziani@cabrillo.edu Last Updated: Fall 2009