Pages

4.02.2013

OSPF Part 1 - The Basics

OSPF is the topic for discussion up now, and this one is going to be a multi-parter! I've always thought I had a good understanding of OSPF network types, but running through my CCIE studies I quickly found out I only have a basic understanding of each. So with these post I hope to dig deep into each area and expose the inter-workings.

First up is a quick overview of the basics. If you have worked with OSPF or made it through your CCNP or even CCNA this information will not be new (I hope...). I'm not going deep with these subjects but just giving a refresher.

Now let's quit the yapping and get started!



Adjacency and Neighbors

Unlike crazy NPR reporters, OSPF routers will not just broadcast out their network information to anyone who listens. This information is only shared with neighbors who have formed an adjacency.

HELLO packets are used to discover neighbors and negotiate adjacencies. OSPF routers start sending HELLOs out all OSPF enabled interfaces once OSPF is enabled.. If two OSPF routers agree on the parameters set in the exchanged HELLO packets, they will form an adjacency. 

Note - Depending on the network type used, not all neighbors will form a full adjacency. More on this later...

Once neighbor discovery is established all neighbors are logged in the OSPF neighbor table along with pertinent information about the connection.

Once neighbors are discovered and adjacencies are formed, routes (or LSAs) can start spewing across the network!

OSPF Database and LSAs

Unlike distance vector protocols (RIP/EIGRP), OSPF is considered a link-state protocol and uses Dijkstra's Shortest Path First (SPF) algorithm. Each OSPF router sends and receives routes in the form of Link State Advertisements (LSAs) over all adjacencies. Each LSA learned is then placed in the OSPF database and also forwarded to all other neighbors. The router then populates its routing table by running the SPF calculations on the OSPF database.

LSAs are broken down into multiple types. LSAs are a huge topic in itself, so for now I'm just giving you a simple breakdown. Check out the deep dives done by jdsilva and Jon Langemak. They are great!

(LSA) Types:
  • Type 1 - Router LSA - sent by all routers
  • Type 2 - Network LSA - sent by DR
  • Type 3 - Network Summary LSA - sent by ABR
  • Type 4 - ASBR Summary LSA - sent by ABR (not the ASBR)
  • Type 5 - AS External LSA - sent by ASBR
  • Type 7 - NSSA External LSA - sent by ASBR
  • Type 9-11 - Opaque LSAs  

DR and BDR Roles and Election

Designated Routers (DR) and Backup DR's (BDR) are used only with multiaccess network types (Broadcast and Nonbroadcast (NBMA)) .All the Point-to-Point and Multipoint network types do not use DR's.

With multiaccess networks all OSPF routers share the same network segment. For the SPF process to work properly on each router all OSPF routers would need to form adjacencies with all other OSPF routers on the network segment. This setup can cause a lot of noise (via LSAs) on the segment. This is why DR's are elected.

Once an OSPF router is elected DR, it centralizes all LSAs and limits communication between all other OSPF routers on the segment. Instead of forming adjacencies between all routers on the segment each router only forms an adjacency with the DR and BDR. The DR is then responsible for representing the network segment to the rest of the OSPF area via Type 2 LSAs. This is like the primes of a talking stick. Only the person with the talking stick can speak. Oh and the DR is an ass and will not share the talking stick.

So how are DR's and BDR's elected??

DR and BDR election process:
  1. Examines all HELLO packets to determine eligibility for DR or BDR election
  2. BDR is elected from all eligible BDR candidates. Highest priority first,  Tiebreaker is the highest RID 
  3. DR is elected from all eligible DR candidates. Highest priority first, Tiebreaker is the highest RID. If there are no DR candidates then the newly elected BDR takes DR
Once a DR or BDR is elected then a newly introduced router cannot take over (preempt) the DR or BDR role.

If a router is not elected either DR or BDR it is classified as a DRother. As mentioned above DRothers only form adjacencies with the DR and BDR. DRothers will neighbor with other DRothers but they will not form a full adjacency and will stop at the 2-WAY state.  


Areas and Router Roles

Area 0 is considered the backbone area of OSPF. All Inter-Area LSAs must travel through Area-0. All other areas must connect to Area 0 if they expect to communicate with other areas.

Backbone Routers are routers with at least one interface attached to Area 0. Backbone routers can be completely in Area-0 or be an ABR with only one interface in Area-0.

Area Border Router (ABR) Routers are used to connect one or more areas to Area-0. ABRs act as a gateway between the rest of the OSPF network and the area they represent.

ASBR Routers are injection points into the OSPF network for external routes such as redistributed internet routes via BGP or from EIGRP in a hybrid design. ASBRs can reside in any area including Area-0.
 
Internal Routers have all interfaces members of the same area. This could be any area including Area-0


Now that you have the basics fresh in your head let's move on to the Network Types!! First up will be Point-to-Point and Loopback.