Open Shortest Path First (OSPF)

ccnp-routing
Covers OSPF LSA types, areas and area types, DR and BDR election, network and packet types, neighbor states, and authentication.
Published

Dec 7, 2017

DR, BDR, DROTHER in multi access networks

  • For fast convergence
  • When a router senses a change in topology, it sends the change (Type-1 LSA) to 224.0.0.6 (DR and BDR listening to)
  • Then DR sends the LSU (containing Type-2 LSA) to all OSPF routers (224.0.0.5)
    • show ip ospf database network to see Type-2 LSA
    • In type-2 LSA: \(\mathrm{LSID} = \mathrm{IP}_{\mathrm{DR}}\)
  • The routers which are not DR nor BDR are DROTHERS
  • DR and BDR is chosen by:
    1. bigger OSPF interface priority is DR: (config-if)#ip ospf priority [0-255] #show ip ospf neighbor
    2. Router ID (RID): bigger is DR router-id
    3. Biggest loopback interface IP (whether participating in OSPF or not)
    4. Biggest physical up/up interface IP address no matter if it participates in OSPF or not
  • If any of these changes and we want to apply the change, we have to use #clear ip ospf process
  • Type-1 and Type-2 LSAs stay within the area

OSPF Metric

  • \(\text{metric} = \mathrm{BW}_{\text{reference}} / \mathrm{BW}_{\text{interface}}\)
  • To change the reference bandwidth: (config-router)#auto-cost reference-bandwidth 1000

OSPF Area Types

  • Normal area: Contain LSA types 1, 2, 3, 4, and 5
  • Stub area: Contains type 1 and 2 and receives type-3 summary LSA from other areas
    • has a default route for external prefixes
    • (config-router)#area 23 stub
  • Totally stubby area
    • Like Stub area but does not receive type 3 LSAs
    • Only has a default route
    • (config-router)#area 23 stub no-summary
  • Not-so-stubby area (NSSA)
    • Generally used to inject external prefixes into OSPF routing domain
    • No need for a default route
    • type 1, 2, 3, and 7
    • (config-router)#area 23 nssa
  • Totally not-so-stubby area
    • Like NSSA but has a default route

Note

  • Intra-area routes (routes within an area) are always preferred over inter-area routes
  • Inter-area routes (routes outside the area) are always preferred over external routes

Type-3 LSA (Network Summary LSA)

  • Is made by ABR
  • Carries subnets listed by Type-1 and Type-2 LSA from one area to another along with their costs
    • Does NOT carry topology information
  • Is not flooded to Totally stubby and totally NSSA as these areas are Cisco proprietary
  • show ip ospf database summary
  • LSID = Summary Network Number
  • \(\text{Cost} = \text{Cost}_{\text{LSA-1 or LSA-2}} + \text{Cost}_{\text{LSA-3}}\)

Type-5 LSA (AS External LSA)

  • Generated by ASBR
    • ASBR: Redistributes from another IGP into OSPF
  • Describes the external prefix and the gateway to reach it
  • Flooded to all normal areas
  • show ip ospf database external
  • LSID = External Network Number

Type-4 LSA (ASBR Summary)

  • Similar to type-3 LSA
  • Generated by an ABR bordering an area containing an ASBR
    • Tells all OSPF routers about ASBR
  • The ABR converts the ASBR’s type-1 LSA into a type 4 ASBR summary LSA
  • show ip ospf database asbr-summary
  • \(\mathrm{LSID} = \mathrm{ID}_{\mathrm{ASBR}}\)

Type-7 LSA (NSSA External)

  • Appears in NSSA
  • ASBR creates a type 7 external stub LSA
  • ABR converts type-7 to type-5 AS external LSA and floods it to the rest of OSPF areas
  • Why do we not use type-5 LSA? Because type-5 LSAs are not allowed into NSSA

Network Types in OSPF

  • Broadcast: This is the default value for ethernet interfaces
  • Point-to-Point: This is the default value of serial interfaces
  • Loopback:
  • Non-Broadcast MultiAccess (NBMA)
    • We do not have dynamic discovery of neighbors since hellos cannot be sent to multicast address, we have to use unicast address of the neighbor using neighbor ospf router subcommand
  • Point to multipoint
  • Point to multipoint nonbroadcast

Packet types in OSPF

  • debug ip ospf packet
  • t1 or Hello: Neighbor discovery
    • In Broadcast and point-to-point is sent every 10 seconds
    • In all other network types is sent every 30 seconds
    • Dead timer is 4x the hello interval
    • debug ip ospf hello
  • t2 or Database Description (DD or DBD): To check if the LSDBs between 2 routers are identical or not
  • t3 or Link-state request (LSR): to request a particular LSA from the neighbor
  • t4 or Link-state update (LSU): In response to LSR. LSU contains LSAs
  • t5 or LSACK: This is an ack to LSU

OSPF neighbor states

  • All OSPF routers start off with the down state. In this state routers send hello
  • In init state, the router received hello but cannot see its RID in the hello received
  • In 2-way state, the routers have ack in the hello message they received. (Now they can see their RID)
    • Now, DR and BDR are elected
    • This is the state between a pair of routers if both are DROTHERS in broadcast networks
  • ExStart: the goal is to identify the master router and sequence number
  • Exchange: to exchange the DD which contains LSA headers (not the full LSAs)
  • Loading: to exchange full LSA
  • Full: Fully adjacent. Normal state for most OSPF routers

Type-6 LSA (Multicast LSA)

  • Not supported and not used

OSPF Authentication

  • Area authentication
    • Requires OSPF router to authenticate before joining an area
  • Interface authentication
    • Requires authentication for adjacent routers
    • In below example, we only need to configure the same as what we configured for area authentication but at the interface level
  • MD5
      (config-router)#area 12 authentication message-digest
      (config-if)#ip ospf message-digest-key 89 md5 cisco
  • Plain text
      (config-router)#area 12 authentication
      (config-if)#ip ospf authentication-key cisco
Back to top