Notes on OSPF Fundamentals…

I covered EIGRP in 3 posts.  OSPF will probably be twice that.  I will also update flash cards once I finish reading the material and composing the study notes.

This post will cover most the fundamental stuff and slightly more (by fundamental I mean CCNA level).  As I get in to the more advanced topics I will probably try to keep the posts smaller so they are easier to chew.  This post will probably be long though.

Links State Qualities

OSPF is a link state routing protocol.  This means that it exchanges link state updates (LSUs) rather than full routing tables.  These updates contain link state advertisements (LSAs).  The LSAs contain subnet mask information, which allows OSPF to support variable length subnet masks (VLSM).  The LSAs are placed in to a link state database (sometimes called the topology database/table).  An algorithm is used to create the routing table, based on the LSAs contained in the link state database (topology database).  This algorithm is the Dijkstra Algorithm (also referred to as the Shortest Path First Algorithm).  This algorithm will create a “shortest path tree”.  From that shortest path tree a a routing table is created.  The databases between routers should be synchronized.

It is important to note that similar to EIGRP OSPF has a topology table (the link state database), a neighbor table, and a routing table.

Distance vector protocols (such as RIP) exchange protocol information over a given set of time, regardless if an update is required.  Link state protocols will only send an update when one is necessary (a topology change).  Although, there is a summary LSA sent every 30 minutes.

Multicast Addresses

OSPF uses 2 addresses for communication

  1. 224.0.0.5 to communicate to all OSPF routers.  Updates by the DR and BDR are sent, and also hello packets, etc.
  2. 224.0.0.6 to update the DR and BDR upon topology change.  The DR/BDR listen on this address, but they do not broadcast on it.

Verify OSPF Database

show ip ospf database will verify the contents of the link state database.  In the output of this command you will find

  • Link ID
  • Advertising Router
  • Age
  • Sequence Number
  • Checksum

LSA Sequence Numbers

LSAs are assigned sequence numbers to ensure consistency / timeliness (basically, the most current information).  The sequence number is used by the router to verify whether a received LSA is older or more current than one it already has in the link state database.  In the event that the LSA does not already exist in the database, the router will add it, and flood the LSA out every OSPF enabled interface interface (except the one it was received on).

When there is an LSA entry already in the database one of three things will happen.

  • If the sequence number is lower the router ignores the update and sends a link state update (LSU) to the router that sent it.
  • If the sequence number is unchanged the LSU is ignored
  • If the sequence number is higher the LSA is added to the database and an LSAcknowledgement is sent.  The updated LSA will be flooded, while also updating its own database.

Adjacency Requirements

In order to exchange LSAs routers must form an adjacency first.  There are some requirements in order for an adjacency to be successful.  The following must be agreed upon between the routers:

  • Area number
  • Hello and Dead Timer settings
  • Whether the area is a stub area
  • If configured, authentication (kinda obvious…)
  • IP addresses must be in the same subnet
  • Unique router IDs
  • IP MTU must match

It is important to note that an MTU mismatch between neighbors will prevent successful exchanging of topology data.  The neighbor will be listed under show ip ospf neighbors, but state will become DOWN.

To verify adjacency:

  • show ip ospf neighbor: will show show status of the database loading
  • show ip ospf interface

OSPF Router Roles

Within OSPF there are 3 types of routers.

  1. DR (Designated Router): the router that received topology change notifications from other OSPF routers.  It listens on multicast address 224.0.0.6, but it sends the updates it receives to 224.0.0.5.
  2. BDR (Backup Designated Router): the backup to the DR.  As the BDR it will never send updated, but it does listen for updates on 224.0.0.6
  3. DROther: any router that is not a DR or BDR on a segment is considered a DROther.

Verifying Roles

show ip ospf neighbor will identify which routers are assigned which roles are assigned to which routers

DR Election Process

Typically, the router with the highest priority value will become the DR.  The default priority is 1.  A priority of 0 will disqualify a router from being able to take place in election.  Therefore, 1 is the minimum value.  This priority value can be configured using the command ip ospf priority.  If all routers are configured with default values then the tie breaker comes down to the RID.  The router with the highest RID will win.  This same process is used for BDR election.  Obviously, this makes the RID critical in the election process.  The RID is determined  according to the following rules:

  • The RID will be the highest IP address assigned to a loopback interface.  The interface does not need to be OSPF enabled, and this interface network is not automatically advertised by OSPF.
  • If there is not loopback interface, then the highest IP address assigned to a physical interface will be used.  Again, regardless whether or not it is OSPF enabled.
  • The RID can be set manually with the router-id command.  Note that the router must be reloaded, or the OSPF process cleared before the command will take effect.

With this information in hand, you should know that there are 3 ways to manually manipulate DR/BDR election

  1. Change the priority using ip ospf priority command
  2. Configure RID manually with router-id command
  3. Configure a loopback interface with the appropriate value

Hello and Dead Timers

OSPF uses 2 times to monitor neighbors.  The first is hello time, and the second is dead time.  They are used much like the hello and hold timers for EIGRP, only their default values are different depending on the network.

  • Hello Timer: used to notify a neighbor that the router is still alive.  As long as a router received hellos from the neighbor the adjacency should stay up.  In a default LAN setting the hello is 10.
  • Dead Timer: used to monitor whether a neighbor is alive.  If a hello is not received from a neighbor within the dead timer value then it is assumed that the neighbor is down, and adjacency is torn down.  In a default LAN setting the dead timer is 40.

If a routers interface goes down the router will assume all adjacencies attached to it are down too.  It will not wait for the dead timer (this is kind of a no brainer).

Adjacency States

More might be said of this later, but for now (fundamental) – when issuing the command show ip ospf neighbors you will find the following common states for neighbors (this list is not exhaustive):

  • 2WAY: normal, stable, working state for neighbor with which topology data was not exchanged directly
  • FULL: fully adjacent neighbor; topology has been fully exchange with that neighbor

I think I am going to stop here and move in to more advanced stuff.  The next post will cover OSPF authentication.