alexloh.wordpress.com Open Shortest Path First (OSPF) Version: 1.0 Last Update: March 26, 2013 Author(s): LOH CHING FEI The information contained in this document is subject to change and update without prior notice. The content of articles is for informational purposes only and does not constitute professional advice. You are free to Share, Copy, Distribute, Remix, Modify, and transmit the document, but we are not responsible or liable for any damage or Losses. Please contact us if your copyrighted work is being uploaded, posted, copied, or otherwise provided to this site in violation of your rights under copyright law. Table of Contents 1. Open Shortest Path First (OSPF) .............................................................................................................. 3 2. Forming OSPF Adjacencies....................................................................................................................... 4 3. OSPF Network Types ................................................................................................................................ 5 4. OSPF DR & BDR ........................................................................................................................................ 6 5. OSPF DR & BDR Election .......................................................................................................................... 7 6. Sending OSPF Updates ............................................................................................................................. 8 7. OSPF LSA Types ........................................................................................................................................ 9 8. OSPF Path Selection ............................................................................................................................... 11 9. OSPF Route Filtering .............................................................................................................................. 12 10. OSPF Stub Area ...................................................................................................................................... 13 11. OSPF Virtual Links .................................................................................................................................. 14 12. OSPF Reconvergence Tuning ................................................................................................................. 15 1. OPEN SHORTEST PATH FIRST (OSPF) - - - - - Open Standards Based Interior Gateway Routing Protocol (IGP) RFC 2328 “OSPF Version 2” OSPF is a Link-State Protocol; meaning all the device in the same area are going to have the same Link-State Database (LSDB) The device take the Link-State Database and uses Dijkstra’s SPF algorithm to find out the shortest path to the destination OSPF is a Classless Protocol that support VLSM and Summarization OSPF guarantees loop-free topology as all routers agree on overall topology and uses calculate the SPF using Dijkstra’s SPF algorithm Inter-Operability between different vendors is possible because OSPF is an Open Standard based Routing Protocol OSPF uses its own transport protocol of IP Protocol 89 (OSPF) OSPF uses unicast or multicasts to 224.0.0.5 (All OSPF Router) and 224.0.0.6 (DR and BDR) Large scalability Hierarchy through “Areas” Topology summarization – Inter Area Routing Information was summarized by ABR Fast Convergence Actively Tracks Neighbor Adjacencies Event Driven Incremental Updates Efficient Updating Uses reliable multicast and unicast update Non-OSPF Devices do not need to process the update Bandwidth based Cost Metric More flexible than static hop count Based on hop by hop basic Control Plan Security Support clear-text and MD5 based adjacencies authentication Extensible for future application through “opaque” 2. FORMING OSPF ADJACENCIES - - Uses “Hello” packets to discover neighbors on OSPF enabled attached links Hello packets contain attributes that neighbors must agree on to form “adjacency” but not all OSPF neighbors actually form adjacency and that this depend OSPF network type or the attribute the neighbor are exchanging To form adjacency neighbors must agree on… Unique Router ID Unique IP Address Interface Area ID Hello Interval & Dead Interval Interface network address Interface MTU Network Type Authentication Stub Flags Other optional capabilities 3. OSPF NETWORK TYPES - - Network type used to deal with different media characteristics OSPF network types control… How updates are sent Who forms adjacency How next-hop value is calculated OSPF Network Types are… Broadcast Ethernet or Token Ring Send update through Multicast 224.0.0.5 & 224.0.0.6 Support Designated Router and Backup Designated Router election Non-Broadcast Multipoint frame relay or ATM Support Designated Router and Backup Designated Router election Send update through unicast instead of multicast Designated Router need to specify neighbor Point-to-Point Point-to-Point Serial or Point-to-Point Ethernet No require Designated Router and Backup Designated Router Send update through Multicast 224.0.0.5 Point-to-Multipoint Collection of point-to-point adjacency and typically use for partial mesh NBMA network e.g. Frame Relay hub and spoke topology OSPF process understands there are different between layer 3 IP network and underlying Layer 2 circuits. Partial mesh in layer 2 network, but the router are in the same layer 3 subnet so Point-to-multipoint will be the best design choice so the OSPF process understand which device has directly layer 2 connectivity to each other No Support Designated Router and Backup Designated Router election Send update through Multicast 224.0.0.5 Point-to-Multipoint Non-Broadcast Similar to Point-to-Multipoint except that update through Unicast Loopback Use for Software loopback on any types of hardware loopback interface When interface in the loopback state it will going to advertise the IP as /32 host route 4. OSPF DR & BDR - - Designated Router (DR) used on broadcast and non-broadcast network types to … Minimize adjacencies Minimize LSA replication Backup Designated Router (BDR) Used for redundancy for DR DROthers All other routers on link Form full adjacency with DR and BDR Form 2-way adjacency with others (DROthers) 5. OSPF DR & BDR ELECTION - - Election based on interface priority and Router ID Priority Priority from 0 – 255, the higher the better Priority 0 will not participate into the DR and BDR election Router ID Highest Loopback / Interface IP Can be statically set The higher the better DR and BDR don’t support preemption. The DR and BDR election only happen when the device is down 6. SENDING OSPF UPDATES - OSPF “flooding procedure” is used to synchronize the database between routers. Routers in the same area share the same database and the database is used as an input to SPF algorithm to calculate SPT. How the flooding occurs is depends on LSA type, different LSA used to describe different types of routes Intra Area Inter Area External NSSA External 7. OSPF LSA TYPES - - Type 1 – Router LSA Generate by every router in the OSPF network The router announces its presence and lists the links to other routers or networks in the same area Type 2 – Network LSA Generate by designated router Type 3 – Network Summary LSA Generate by Area Border Router Type 4 – ASBD Summary LSA Generate by ASBR to tell the devices how to reach the ASBR Router Type 5 – External LSA Generate by ASBR to import the external route to OSPF Type 7 – NSSA External LSA Others Types… Type 6 – Multicast LSA Type 8 – Inter-AS OSPF Type 9, 10, 11 – Opaque LSA Area 0 Area 1 Type 1 LSA Type 1 LSA “O” Route ABR “O” Route Area 0 DROthers Designated Router Type 1 LSA “O” Route Type 2 LSA Type 1 LSA Ethernet Area 0 Type 3 LSA Area 1 “OIA” Route ABR “OIA” Route Type 3 LSA Type 4 LSA To tell the devices in Area 1 how to reach the ASBR Router Area 0 Area 1 EIGRP ABR ASBR Type 5 LSA Import External Route into OSPF e.g. E1 & E2 Route 8. OSPF PATH SELECTION - - OSPF path selection order is fixed as… (O) Intra Area (O IA) Inter-Area (E1) External Type 1 (E2) External Type 2 (N1) NSSA External Type 1 (N2) NSSA External Type 2 Example; Even the E1 cost value is lowest than “O” or “O IA” route, OSPF will always follow the path selection order e.g. “O” route and this cannot be modify either by changing of cost value or administrative distance 9. OSPF ROUTE FILTERING - Routers in the same OSPF area must have the same database Limits filtering capabilities of routing advertisements Filtering can be accomplished… Distribute-list in - Locally from the database to the routing table. Cannot apply distributelist out. On the ABR Summarization Stub Areas Inter Area (Type 3 LSA) filter 10. OSPF STUB AREA - Used to filter routes on ABR based on LSA type Reduces database size without impacting reachability Four types of stub areas… Stub Area Remove the ASBR Summary (Type 4 LSA) and External (Type 5 LSA) Route moving from Area 0 to Stub Area Replace the routes with default route to reduce the size of database Totally Stubby Remove the ASBR Summary (Type 4 LSA) and External (Type 5 LSA) and InterArea (Type 3 LSA) Route moving from Area 0 to Totally Stubby Area Replace the routes with default route to reduce the size of database Not-So-Stubby Area (NSSA) Totally Not-So-Stubby Area (NSSA) 11. OSPF VIRTUAL LINKS - OSPF area 0 must be contiguous otherwise we may breaks in Area 0 result in failure of SPF calculation Virtual link can be used to fix these breaks Virtual links are… Used to connect area 0 over a non-transit area A virtual area 0 adjacency between two ABR over a non-transit area In order to establish Virtual link, the non-transit area must have full routing information and cannot be a stub area and should not have filtering Area 0 ABR Area 1 Area 0 (Multi hop unicast adjacency) Via Virtual Link Area 1 ABR Area 0 12. OSPF RECONVERGENCE TUNING - - OSPF database calculation and lookup times a function of hardware e.g. CPU, memory Resource needs can be lowered through… Areas for flowing domain segmentation Summarization Stub Areas Further optimization through timers Hello & Dead Timers Faster neighbor down detection e.g. Bi-directional Forwarding Detection (BFD) Pacing timers – How long do I wait between updates, retransmits, etc Throttling timers – How often do I generate LSA, Run SPF, etc