Useful Articles


OSPF Important Points

OSPF Important Points

Open Short Path First is an open-standard protocol based on RFC 2328. OSPF one of the most commonly used IGP in IP networking. Understanding OSPF is a bit complex because of its various packet types, database advertisements, LSA types, Area Types, and most importantly OSPF's diverse behavior corresponding to various network types. This blog summarizes some of the OSPF Important Points.
OSPF Important Points
  • OSPF IP Protocol number is 89 and it operates on top of IP, i.e. at Transport Layer.
  • OSPF LSAs report the state of routers and the links between routers—hence the term link-state protocol.
  • Each OSPF packet contains a fixed header. Few common fields of OSPF packets header are OSPF version, Packet Type, Packet Length, Area ID, Router ID.
  • Similarly, each OSPF LSA has a 20-byte fixed header. Few fields are LSA Type, LSA Age, Advertising router, Link State ID, Options, Checksum, and Length.
  • LSAs are reliable; there is a method for acknowledging their delivery. LSAs are flooded throughout the area (or throughout the domain if there is only one area).LSAs have a sequence number and a set lifetime, so each router recognizes that it has the most current version of the LSA. LSAs are periodically refreshed to confirm topology information before they age out of the LSDB.

  • OSPF follows a two-level hierarchy. There should always be an Area 0 in the network(Transit area or backbone area) and all other regular areas should be directly connected to it. In case a regular area cannot be directly connected to Area 0, we can use the virtual-link mechanism to connect a remote area to Area 0.
  • Areas are created in OSPF to minimize routing table entries, localize the impact of topology change within an area and to stop details LSA flooding at the area boundary.
  • The ABR in the OSPF domain separates LSA flooding zones and becomes the primary point for area address summarization. It functions regularly as the source of default routes and also maintains the LSDB for each area with which it is connected.

  • OSPF adjacency cannot form on secondary networks (Secondary IP on the interface) because the secondary address is considered as stub networks and therefore, cannot form an adjacency.

  • OSPF has its own reliability mechanism. It uses Sequence Number and Acknowledgement fields in the LSA for reliable delivery.
  • The order of the OSPF Path Selection Process is given below. The below sequence is preferred regardless of metric or administrative distance.
            Intra-Area (O)
            Inter-Area (O IA)
            External Type 1 (E1)
            External Type 2 (E2)
            NSSA Type 1 (N1)
            NSSA Type 2 (N2

  • DR/BDR is elected per shared network in an Area. Therefore, more than 1 DR/BDR can exist in an Area.

  • OSPF has 5 packet types namely, Hello, Data Base Description(DBD), Link State Request(LSR), Link State Update(LSU), Link State Ack. There no such packet type name Link State Advertisement (LSA). LSA are advertised in LSU packets.

  • Difference between DBD and LSU packets is that DBD packets only contain LSA headers and LSU packet contains LSA header (20byte) along with other information about the link for example LSA1 contain V, E, B bits, Metric, etc as extra fields apart from LSA header.

  • Default seed metric while redistributing any IGP prefix in OSPF is 20 while redistributing a BGP prefix in OSPF is 1.
  • Filtering OSPF prefixes using distribute-list (along with route-maps) and distance command only blocks the prefix from entering into the local RIB, but cannot stop LSAs propagation into the OSPF database.
  • OSPF filtering using filter-list, ‘area range not-adv’ command, ‘summary-address not-adv’ command, ‘ip ospf database-filter all out’ command and ‘neighbor database-filter all out’ command can filter LSAs from OSPF database.
  • In an NSSA, “default-information originate” command cannot be used to generate a default route, since it generates Type-5 LSA, which is not permitted in an NSSA area.
  • In an NSSA, ABR with the highest router-id does the LSA 7 to 5 conversion.
  • The internal OSPF prefixes can only be summarized on ABRs whereas the external (redistributed) routes can only be summarized on ASBRs.
  • The only time that OSPF will form an adjacency between neighbors that are not on the same subnet is when the neighbors are connected through point-to-point links using “ip unnumbered” command.
  • To establish OSPF neighbor adjacency, Hello/Dead timers, MTU (otherwise use ‘ip ospf mtu-ignore’) must match, and also a unique Router-ID is required.
  • The default route in OSPF can only be advertised using “default-information originate [always]” command. we cannot redistribute a static default route (ip route…) into OSPF database. The same is true for ISIS also.
  • Default-information originate command makes a router an ASBR, therefore, it should be put only on a specific enterprise router that is connected to the WAN else it could lead to routing issues.
  • OSPF's Link state property only works within a specific area. As the area changes, the Link state property disappears and changes to Distance Vector as ABR becomes the advertising-router of the LSA.
  • OSPF cost formula can be changed using "auto-cost reference-bandwidth bandwidth [ Gbps | Mbps ]" router configuration command.
  • OSPF link cost (metric) can be changed using "ip ospf cost cost-value" interface configuration command.
  • If a router is set with priority zero, it doesn't participate in DR/BDR election. This is used when configuring OSPF (Non Broadcast Multi Access) in Hub/Spoke setup and zero priority is generally set on Spokes to deny them to be DR/BDR.
  • Options field is contained in OSPF packet types Hello, DBD and LSA Header.
  • Hello and Holddown timers for NBMA, Point to Multipoint Broadcast and Point to Multipoint Non-Broadcast OSPF networks are 30 and 120 Seconds respectively.
  • In order to establish OSPF neighbor adjacency, hello/dead timers, MTU (use "ip ospf mtu-ignore" otherwise) must match. Unique router-id is also required. 
  • Various Types of OSPF Routes are as below:
          O*  -   OSPF Default Route
          O    -   OSPF Intra Area Route
          OIA -  OSPF Inter Area Route
          O*IA - OSPF Intra Area Default Route
          OE1 -   OSPF External Type 1 Route
          O*E1 - OSPF External Type 1 Default Route
          OE2 -   OSPF External Type 2 Route
          O*E2  - OSPF External Type 2 Default Route
          ON1   - OSPF NSSA Type 1 Route
          O*N1 - OSPF NSSA Type 1 Default Route
          ON2  -  OSPF NSSA Type 2 Default Route
          O*N2 - OSPF NSSA Type 2 Default Route