Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /homepages/36/d681171600/htdocs/stalinbabu/wp-includes/plugin.php on line 601
OSPF Cheat Sheet – StalinBabu.com – My Personal Blog
Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given in /homepages/36/d681171600/htdocs/stalinbabu/wp-includes/plugin.php on line 601

OSPF Cheat Sheet

OSPF stands for Open Shortest Path First and it is a Interior Gateway Routing Protocol (IGP). RFC 2328 defines the standard for OSPF Version 2.

The following are few facts about OSPF – Interior Gateway Routing Protocol (IGP)

  • OSPF is link state protocol and uses Dijkstra Shortest Path First (SPF)Algorithm
  • OSPF uses “hello” packets to discover neighbors and it is transported using IP protocol 89 and send as multicast to or or unicast
  • OSPF exchanges link attributes with the neighbor in the form of Link State Advertisements (LSA) and Link State Packets (LSP) with neighbors
  • OSPF uses LSA to create Link State Database (LSDB) to form a graph of the network
  • All routers in the same OSPF area has the same Link State Database (LSDB) and so the Shortest Path First (SPF) calculations are loop-free
  • OSPF is a class less protocol and supports VLSM and Summarization
  • OSPF uses area to form hierarchy
  • Actively tracks neighbor and uses reliable multicast and unicast updates

Hello Packet Contains:

  • Local router ID unique to the router
  • IP address and subnet mask of the interface
  • area-id
  • Hello interval and dead interval
  • Router Priority
  • MTU size
  • Type of network
  • Authentication
  • Stub flags
  • All other neighbors
  • Other optional capabilities

DR / BDR Election Process:

In a multi-access area, DR/BDR election takes place to avoid flooding of OSPF packets. The following is the election process

  • Router with the highest priority will become DR
  • Router with second highest priority will become BDR
  • If priority of all the routers in the network segment is same – Router ID is used. The router with highest router ID will be the DR
  • DR/BDR election is not preemptive . If you change the priority of a router only with reset of ospf process, the DR/BDR status will change
  • Routers that are not DR/BDR will show up as DROTHER

OSPF Metrics and Load balancing:

OSPF cost formula is as below:


OSPF assigns a cost of 1 for speeds faster than 100Mbps.

External Routes:

E1 – metrics increases as it pass through the network.
E2 – Metrics does not increase (Default)

OSPF Load balancing

  • Cost of the paths should be equal
  • Four equal cost path will be placed in routing table
  • There can be maximum of 16 paths
  • To make a path equal cost , configure the cost of the link to be equal

OSPF area types:

  • Backbone area – this is area 0. This area will be attached to other areas
  • Regular area –It will have database of internal and external routes
  • Stub area – The routers in this area will have database of internal routes and a default route. The ABR in the stub area will block all type 5 external LSA’s. Any prefixes that redistributed into OSPF from other routing protocols are allowed to enter the stub area – Filters type 5 LSA

 Stub area configured using –  area 1 stub

  • Not-so-stubby-area (NSSA) – This work same as stub area with one exception. This area is allowed to have a ASBR within the area.  Since NSSA cannot have Type 5 LSA, Type 7 LSA comes into play
  • Totally Stubby area – the external or inter area summarized routes are not advertised to this area. The routes from this area will be routed via default route. Filters type 3 LSA

Totally Stub area configured using –  area 1 stub no-summary

  • Totally NSSA – Same as totally stubby area

LSA Types:

Type 1 – Router LSA – This generated by a router within a area. This type of LSA stays within the area and within the same subnet.
Type 2 – Network LSA – This type of LSA is generated by the Designated Router (DR) in the broadcast segment. This type of LSA stays within the same area.
Type 3 – Summary LSA – This type of LSA is generated by the Area Border Router(ABR). ABR summarizes the routes known within a area and send it to the other area.
Type 4 – Autonomous System Border Router (ASBR) Summary LSA – This type of LSA carry routes to the ASBR.ABR will generate a summary ASBR LSA which will include the router ID of the ASBR in the link-state ID field
Type 5 – External LSA – This type of LSA is generated by ASBR and it contains routes that are external to the AS. Type 5 LSA are not flooded into any stub area.
Type 6 – Multicast LSA – this is used for multicast applications
Type 7 – NSSA External LSA –This type of LSA is generated by ASBR in a Not-So-Stubby-Area and advertises routes from another routing domain.

Neighbor Establishment States:

Down State: No Hello Messages sent yet
INIT State: Router has sent the HELLO message through all interfaces participating in OSPF
Two-Way State: The hello message received from another router has the own router ID. This means the neighbor router knows about my own router ID
Exstart State: Determines which router should start the LSA advertisement process
Exchange State: Routers exchange DBD
Loading State: Routers review the DBD and compares with LSDB and sent LSR to receive information about missing / outdated routes or LSA’s
Full State: The LSDB is synchronized with the adjacent router.

OSPF packet Types:

Hello: This serves as a keep alive mechanism
Link State Request (LSR): This message is used by a router to request the neighbor for updates about routes. LSR contains the type of Link State Update (LSU) and router ID of the requesting router
Database Description (DBD): This packet type contains the summary of the Link-state database (LSDB). It includes Router ID and sequence number of each LSA in LSDB. LSDB is the database of Link State Advertisements (LSA)
Link State Update (LSU): This packet type contains a full LSA entry about a route. A LSU can have multiple LSA
Link State Advertisement (LSAck)This message type is send acknowledging other OSPF packets except for the Hello message type.

OSPF Network Types:

t ospf1