1 Intro to OSPF © 1998, Cisco Systems, Inc.
2 © 2005 Cisco Systems, Inc. All rights reserved. Session Number Presentation_ID CISCO CONFIDENTIAL Introduction to OSPF Presented by: Andrew Short
333 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Agenda Distance Vector vs Link State Routing protocols OSPF basics OSPF issues
444 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF – Open Shortest Path First “Open” “Shortest Path First”
555 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Distance Vector Routing Protocols Learn about network from neighbors only Keep a table entry for all destinations Contains the distance and first gateway Periodically send routing table updates to neighbors
666 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Link State Routing Protocols Flood Link State Advertisements (LSA) within Autonomous System (AS). LSA is state of each link from current router LSA must reach all routers in AS Run Shortest Path First (SPF) algorithm to create an SPF tree for the complete AS. SPF tree is rooted at the current router. Use Next-Hop entries from SPF tree to populate routing table. Triggered LSAs when a link goes up or down, the attached router sends updated LSAs out all remaining interfaces.
777 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF vs RIP ( link-state vs distance vector ) RIP Does not scale (15 hop count limit) Flat networks, no hierarchy Slow convergence (RIP 1) Does not support VLSM (variable length subnet mask) Periodic broadcast of route table leads to waste of bandwidth (periodic offload of routing table to the network, re: ISDN links!) No concept of link-delay or cost
888 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF vs RIP ( link-state vs distance vector ) OSPF No hop count limitation Scalable - hierarchical network design “Areas” limit route information flooding, short convergence time supports VLSM link bandwidth determines metric
999 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF – Design, Design, Design A healthy OSPF implementation is the product of a well thought out…. DESIGN.
10 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Terminology Area Backbone Area Area To Another AS Internal Router Area Border Router (ABR) Backbone Router Autonomous System Boundary Router (ASBR)
11 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Terminology contd. Router ID (RID) Must be unique Highest loopback address or Highest interface address if no loopback LSA (Link State Advertisement) LSA describes state of all the routers links OSPF routers flood LSAs to create a picture of the network Each router uses these LSAs to create shortest-path tree rooted at itself
12 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Terminology contd. Area Logical group of routers which have complete picture of network within grouping. If multiple areas exist in the network, there must be an ‘area 0’, which is the backbone area. All routing information is disseminated from one area to another through area 0. Network A single broadcast domain within the OSPF Autonomous System Frame-Relay PVC Ethernet VLAN Point to Point T1
13 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Areas Area Backbone Area Area To Another AS Internal Router Area Border Router (ABR) Backbone Router Autonomous System Boundary Router (ASBR)
14 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Terminology contd. Neighbors OSPF routers connected to the same network Must agree on: Area ID Authentication Network Mask Hello Interval RouterDeadInterval Options Adjacencies Neighboring OSPF routers that proceed to the database exchange process
15 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Configuring OSPF Router(config)#router ospf 1 Router(config-router)#net area 1 - enable OSPF on router and specifies interfaces in OSPF domain
16 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Forming adjacencies OSPF has several network types - Broadcast - Non-broadcast Multi-access (NBMA) - Point-to-multipoint - Point-to-point DR/BDR election only performed on broadcast and NBMA networks Hellos sent to AllSPFRouters address ( ). DR/BDR listen to AllDRRouters address ( ) On broadcast and NBMA networks, routers only become fully adjacent with DR and BDR. On a NBMA network the DR/BDR need to have a static list of all OSPF routers in that network segment.
17 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Forming adjacencies contd. OSPF neighbors progress through the following stages: Down: No information has been received from anybody on the segment. Attempt: no recent information has been received. Attempt to contact neighbor.
18 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Forming adjacencies contd. Init: The interface has detected a Hello packet from a neighbor. Two-way: Router sees itself in neighbors Hello packet Exstart: Negotiating parameters before exchanging LSA information Exchange: Routers will describe their entire link-state database by sending database description packets.
19 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Forming adjacencies contd. Loading: Finalizing information exchange. Full: LSA exchange complete. Both routers now have identical link-state databases
20 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Stub Areas Stub Area Totally Stubby Area Not So Stubby Area (NSSA)
21 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF – Stub Area External LSAs are NOT flooded into stub areas No type 4 or type 5 LSAs in this area. No virtual links “area 1 stub” on ALL area 1 routers Route lookups Intra-area routes Inter-area routes Default route
22 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF – Totally Stub Area Type 1 and Type 2 internally Only the single ABR produces a single Type 3 Network to advertise the default route. “area 1 stub no-summary” (at the abr of a stub area)
23 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF – Not So Stubby Area Basically, an ospf stub area with an ASBR “area 1 nssa”
24 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types TypeLSA 1 1 Router 2 2 Network 3 3 Summary Network 4 4 Summary ASBR 5 5 External 7 7 NSSA
25 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types contd. Router LSA (Type 1) Produced by every SPF Router Describes the state and cost of the router’s links to the area All of the router’s links in an area must be described in a single LSA Flooded throughout the particular area and no more Router indicates whether it is an ASBR, ABR, or end point of virtual link “show ip ospf network database router”
26 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types contd. Network LSA (Type 2) Sent by DRs Generated for every transit broadcast and NBMA network Describes all the routers attached to the network Only the designated router originates this LSA Flooded throughout the area and no more “show ip ospf network database network”
27 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types contd. Summary Network LSA (Type 3) and ASBR Summary LSA (Type 4) –Both are originated by an ABR Flooded throughout a single area –3 - Describes networks (including default routes) external to the area but still in the AS “show ip ospf database summary” –4 - Describes ASBRs external to the area. “show ip ospf database asbr-summary”
28 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types contd. External LSA (Type 5) Originated by ASBRs Defines routes to destination external to the AS Default route is also sent as external Flooded to all non-stub areas Two types of external LSA: E1: (E bit = 0) Consider the total cost up to the external destination E2: (E bit = 1) Considers only the cost of the outgoing interface to the external destination
29 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL LSA Types contd. NSSA External LSA (Type 7) Originated by ASBRs in NSSA (not-so-stubby-area) area Flooded only within NSSA area ABR to NSSA area converts it to a Type 5 LSA Information DOES leave the Area, but not as a Type 7, because type 7 MUST remain in the area. Outside the area, it is seen as a Type 5
30 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Show commands show ip ospf show ip ospf neighbors show ip ospf interface
31 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Sample Network for Each LSA Area R7 Router id External Route Area 1 R3 R4R1 R NSSA Different Types of LSAs
32 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL External LSA External Type 1 Network N1 Network N1 Type Type Next Hop R1 R2 Next Hop R1 R2 Cost = 10 To N1 External Cost = 1 To N1 External Cost = 2 R1 R2 R3 Cost = 8 Selected Route
33 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL External LSA External Type 2 Network N1 Network N1 Type Type Next Hop R1 R2 Next Hop R1 R2 Cost = 10 To N1 External Cost = 1 To N1 External Cost = 2 R1 R2 R3 Cost = 8 Selected Route
34 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF Is Enabled on this Interface Rest of the OSPF Network RIP Between the Routers router ospf 1 redistribute rip subnetsASBR Type 5 Details Forwarding address Must be known via intra or inter area route
35 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL GSR-3#sh ip ospf Routing Process "ospf 100" with ID Supports only single TOS(TOS0) routes Supports opaque LSA It is an area border router SPF schedule delay 5 secs, Hold time between two SPFs 10 secs Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs Number of external LSA 0. Checksum Sum 0x0 Number of opaque AS LSA 0. Checksum Sum 0x0 Number of DCbitless external and opaque AS LSA 0 Number of DoNotAge external and opaque AS LSA 0 Number of areas in this router is 2. 2 normal 0 stub 0 nssa External flood list length 0 Area BACKBONE(0) Number of interfaces in this area is 5 Area has no authentication SPF algorithm executed 2773 times Area ranges are Number of LSA 97. Checksum Sum 0x2B19E3 Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0 Show IP OSPF
36 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL Area 8 Number of interfaces in this area is 2 It is a stub area, no summary LSA in this area Area has no authentication SPF algorithm executed 11 times Area ranges are Number of LSA 5. Checksum Sum 0x22812 Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0 Show IP OSPF (Cont.)
37 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL 3600-g1#sh ip ospf data OSPF Router with ID ( ) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count x800001D0 0xA180 0 Router Link States (Area 8) Link ID ADV Router Age Seq# Checksum Link count x F 0xC x800003D1 0x x800002B8 0xE52B 1 Net Link States (Area 8) Link ID ADV Router Age Seq# Checksum x x x A 0x10AB OSPF Database
38 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL GSR-3#show ip ospf database database-summary OSPF Router with ID ( ) (Process ID 100) Area 0 database summary LSA Type Count Delete Maxage Router Network Summary Net Summary ASBR Type-7 Ext Opaque Link Opaque Area Subtotal OSPF Database
39 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL GSR-3#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface FULL/DR 00:00: GigabitEthernet3/ WAY/DROTHER 00:00: Ethernet 6/ FULL/BDR 00:00: Ethernet 6/ FULL/DR 00:00: Ethernet 6/0 GSR-3# OSPF Neighbor
40 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL r4-1# router ospf 1 ospf log-adjacency-changes ospf log-adjacency-changes %OSPF-5-ADJCHG: Process 1, Nbr on Serial0.1 from FULL to DOWN, Neighbor Down %OSPF-5-ADJCHG: Process 1, Nbr on Serial0.1 from DOWN to ATTEMPT, NBMA Start OSPF Adjacency Changes
41 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL r4-1#sh ip ospf nei det Neighbor , interface address In the area 0 via interface Ethernet0 Neighbor priority is 1, State is FULL, 6 state changes DR is BDR is Options is 0x2 Dead timer due in 00:00:37 Neighbor is up for 00:01:24 Index 2/2, retransmission queue length 0, number of retransmission 1 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0) Last retransmission scan length is 1, maximum is 1 Last retransmission scan time is 4 msec, maximum is 4 msec Neighbor , interface address In the area 0 via interface Ethernet0 Neighbor priority is 1, State is FULL, 6 state changes DR is BDR is Options is 0x2 Dead timer due in 00:00:31 Neighbor is up for 00:01:58 Index 1/1, retransmission queue length 0, number of retransmission 2 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0) Last retransmission scan length is 1, maximum is 1 Last retransmission scan time is 0 msec, maximum is 0 msec Neighbor Details
42 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL r4-1#show ip ospf int Serial0.1 is up, line protocol is up Internet Address /24, Area 0 Process ID 1, Router ID , Network Type NON_BROADCAST, Cost: 64 Transmit Delay is 1 sec, State DR, Priority 100 Designated Router (ID) , Interface address No backup designated router on this network Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 Hello due in 00:00:12 Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor Adjacent with neighbor Suppress hello for 0 neighbor(s) Serial0.2 is up, line protocol is up Internet Address /24, Area 33 Process ID 1, Router ID , Network Type NON_BROADCAST, Cost: 64 Transmit Delay is 1 sec, State DR, Priority 100 Designated Router (ID) , Interface address No backup designated router on this network Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 Hello due in 00:00:11 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor Suppress hello for 0 neighbor(s) Show IP OSPF Interface
43 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL R6-2500#sh ip ospf database self-originate R6-2500#sh ip ospf database self-originate ( shows the LSAs this router is generating) OSPF Router with ID ( ) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count x B 0xC608 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum x x4D14 Router Link States (Area 5) Link ID ADV Router Age Seq# Checksum Link count x xC745 0 Summary Net Link States (Area 5) Link ID ADV Router Age Seq# Checksum x C 0xDDFC Summary ASB Link States (Area 5) Link ID ADV Router Age Seq# Checksum x B 0x681B Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag x C 0x31D0 0 Other show Commands
44 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL R6-2500#sh ip ospf database adv-router R6-2500#sh ip ospf database adv-router (shows the LSAs neighbor is generating) OSPF Router with ID ( ) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count x xA52A 1 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag x xACCB x x204E x xB33B 0 R6-2500# Other show Commands
45 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL r4-1#sh ip ospf stat Area 0: SPF algorithm executed 16 times Area 33: SPF algorithm executed 8 times SPF calculation time Delta T Intra D-Intra Summ D-Summ Ext D-Ext Total Reason 3d18h R, SN, 3d18h R, N, SN, 3d18h N, 3d18h N, SN, 3d18h R, N, 3d18h R, SN, 3d17h R, N, SN, SA, X 00:04: N, SN, 00:02: R, N, 00:02: R, SN, Show IP OSPF stat
46 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF issues Number of routes in area Number of adjacencies per router Size of link-state database Managed with summarization and use of areas Route summarization Pros and Cons Reference bandwidth Ospf auto-cost Reference-bandwidth [#] SPF calculation frequency and duration Partitioned areas Virtual links Transistional only!
47 © 2005 Cisco Systems, Inc. All rights reserved. Presentation_ID CISCO CONFIDENTIAL OSPF resources RFCs 2328: OSPF Version : The OSPF NSSA Option 2370: Opaque LSA Books CCIE Professional Development: Routing TCP/IP Vol 1 by Jeff Doyle Cisco online OSPF resources OSPF Design Guide OSPF: Frequently Asked Questions html Dijkstra Algorithm Applet:
Intro to OSPF © 2001, Cisco Systems, Inc.