Wednesday, May 9, 2012

OSPF Basics

OSPF is a link state routing protocol that is just as good as EIGRP but is a open standard, meaning it can be used between different vendors. OSPF uses a shortest path first approach called Dijkstra algorithm where the metric is cost (bandwidth). OSPF is mainly used for larger network in a hierarchical design. In a hierarchical design, autonomous systems are broken up into areas to benefit the network.

OSPF Hierarchical benefits:

  • Speed up convergence
  • Decrease routing overhead
  • Confined troubled network areas


OSPF must have an area 0 or backbone where different areas are apart of it. There is an area border router that connects into area 0 and there is a autonomous system border router that connects multiple AS together.


OSPF terminology must be understood before I get deeper into how OSPF works .

Routing ID (RID)-  IP address that is used to identity a router. Normally it's the highest configured loopback IP address, if no lookback addresses are configured it uses the highest IP from the active interfaces. RID is also used doing the designated router election if interface priorities are all set to default.

Hello protocol- Used to dynamically discover and maintain neighbor relationships. Hello packets use the multicast address 224.0.0.5 

Link state Advertisement-  OSPF data packets that are exchange between adjacent routers that carry link-state and routing information.

Designated Router (DR)- An elected router in a multi-access network (broadcast) that collects routing information so that all routers within the broadcast network will have synchronized routing information. All routers must have adjacencies with the DR and BR . DR is elected having the highest priority and uses the RID to break a tie. DR uses 224.0.0.6 multicast address. 

Backup Designed Router (BDR)- In standby if the DR ever goes down, it does receive OSPF information from all other routers in the broadcast network but doesn't flood LSA updates.

Area- Grouping of related networks and routers that share the same Area ID. Areas are configured at the interface level because a router can be a part of multiple areas. Routers within the same area have the same topology table.

Broadcast (multi-access) network- Multiple devices allowed onto a network, for example Ethernet. A DR and BDR is needed for each  broadcast network.

Non-Broadcast Multi-Access (NBMA)- These networks do not allow broadcast, examples would be Frame Relay and ATM. No DR or BDR is needed but additional configurations can allow routing updates to pass across NBMA links.

Point-to-Point Network- A network topology where there is a single interface connected to another single interface (two serial links) DR and a BR are not needed because there aren't any other routers that need to to send updates.

Point-to Multi point Network- A topology where there is a single interface going to multiple interfaces. DR and BR aren't needed because all links belong to the same subnet.


OSPF is easy to configured when the network is small but once the network expands throughout the enterprise it can get very complex. A greater understanding of how OSPF works is needed to build complex networks.

LSA Sequence numbers are used to keep routing information up to date. When a OSPF enable router receives an LSA it will first compare the information to it's OSPF database, if the information isn't in the database it will make a copy of the LSA and sent it out all OSPF enabled interfaces expect the one it was received on. If the LSA has the same sequence number as a previous LSA the message will be ignored . If the sequence number is older (lower) it will be ignored but the router will send an updated LSA to the sender of the old LSA. If the LSA sequence number is higher it will replace the old information , send an LSAcknowledgement and flood the new LSA.

OSPF is a link-state routing protocol so it only sends routing updates when a network change has been made. It does send a summary LSA every thirty mins. OSPF is a fast converging routing protocol by design, it uses the concept of DR and BDR to keep information exchange precise and quick.  A designated router collects all routing updates from DROTHER routers (routers that aren't DR or BDR ) by listening to the multicast address 224.0.0.6 and pushes the update down to the other routers using the multicast address 224.0.0.5. The BDR receives the same information as the DR in case it goes offline. The DR must be a powerful device to handle the load of OSPF exchanges.

The DR and BDR are selected through an election process;


  1. Router with the highest OSPF interface priority , a priority of 0 will remove an interface from the election
  2.  A tie breaker is the router with the highest RID
  3. The RID can be manually configured or is chosen automatically using the highest loopback interface and if none are configured , the RID becomes the interface with the highest IP address
An interface doesn't have to be OSPF enabled to be consider an RID, so best practice is to manually configuring the RID. 

If a DR isn't reachable the BDR will take the place of the DR and another election will start for a new BDR. If the old DR comes online after the election process it will just be a DROTHER until the n Neew DR is unreachable.



Depending on the OSPF network type , setup can vary greatly and might not even have a DR or BDR

OSPF Broadcast Network Type

An example of this would be OSPF configured over Ethernet, this network type is configure the traditional way with  a DR and BDR using the hello and dead timers of  10 and 40.

OSPF Non-Broadcast Network Type

An example of this would be OSPF configured over frame relay in a hub and spoke topology. The hub being the central point of data exchange requires rigging the election so that the spokes can never become the DR or BDR. Setting the priority to zero on the interface will accomplish this task.  The non-broadcast nature will require manually defining the neighbors. The hello and dead timers are 30 and 120 for NMBA networks.










No comments:

Post a Comment