OSPF is a link-state routing protocol and it’s one of the routing protocols you need to understand if you want to do the Cisco CCNA, CCNP or CCIE R&S exam(s). In this lesson I’ll explain the basics of OSPF to you and you will learn how and why it works.
How exactly does OSPF fill the LSDB? Let’s zoom in on the operation of how OSPF keeps its link-state database up-to-date:
All routing protocols can be protected by using authentication and OSPF is no exception. There are two options for authentication:
- Plain text authentication
- MD5 authentication
In a previous blog I demonstrated how to configure plain text authentication for OSPF. This time we’ll look at MD5 authentication. The idea is the same but some of the
OSPF uses a LSDB (link state database) and fills this with LSAs (link state advertisement). Instead of using 1 LSA packet OSPF has many different types of LSAs and in this tutorial I’m going to show all of them to you. Let’s start with an overview:
In this blog I’m going to show you the different packets OSPF uses and how neighbor discovery works.
Each OSPF router selects a router ID (RID) that has to be unique on your network. OSPF stores the topology of the network in its LSDB (Link State Database) and each router is identified with its unique router ID , if you have duplicate router IDs then you will run into reachability issues.
When you use the network command in OSPF, two things will happen:
- All interfaces that have a network that falls within the range of the network command will be advertised in OSPF.
- OSPF hello packets are sent on these interfaces.
OSPF uses a DR (Designated Router) and BDR (Backup Designated Router) on each multi-access network.
OSPF uses a simple formula to calculate the OSPF cost for an interface with this formula:
cost = reference bandwidth / interface bandwidth
With OSPF, it is easy to configure a default route. Here’s an example:
The different OSPF network types are difficult to understand for most CCNP students. In this blog, we’ll take a look at the OSPF non-broadcast network type. We will be using a point-to-multipoint frame-relay network for the demonstration:
In the previous blog we discuss the OSPF Non-Broadcast Network Type. Now it’s time for the broadcast network type. If you understand non-broadcast then this one is easy. It’s the EXACT same thing except we don’t have to configure neighbors. OSPF will use multicast and discover OSPF neighbors automatically. The broadcast network type is the default for Ethernet interfaces.
In a previous blog we discussed how to configure the OSPF point-to-multipoint network type. This time we’ll look at the OSPF point-to-multipoint non-broadcast network type. It’s the exact same thing but we’ll have to specify OSPF neighbors ourselves. Here is the topology that we’ll use:
This blog will cover the OSPF Point-to-Point Network Type. I will be using a frame-relay point-to-point topology to demonstrate it, here it is:
OSPF will use different IP addresses for the next hop depending on the network type that you use. This can be confusing when you try to configure OSPF on top of a frame-relay network. In this short lesson I want to show you the difference between the next hop IP address and the OSPF network type that we use.
OSPF uses hello packets and two timers to check if a neighbor is still alive or not:
- Hello interval: this defines how often we send the hello packet.
- Dead interval: this defines how long we should wait for hello packets before we declare the neighbor dead.
If you are studying OSPF you will learn that OSPF uses LSA type 3 for inter-area routers and LSA type 5 for external prefixes that are redistributed into OSPF.
OSPF can do summarization but it’s impossible to summarize within an area. This means we have to configure summarization on an ABR or ASBR. OSPF can only summarize our LSA type 3 and 5.
OSPF has special area types called stub areas. Make sure you understand the different OSPF LSA types before you continue reading.
This is the network topology that we will use:
We will use The following the topology:
Now it’s time to demonstrate the totally NSSA area. Here is the topology we will use:
If you studied Cisco’s CCNA you have learned that when you use OSPF all the areas have to be directly connected to the backbone area. Is this really true? Areas have to be connected to the backbone area but if they aren’t we can fix it with a virtual link.Look at the following example:
OSPF uses LSA type 3 for inter-area prefixes and if you want, you can filter these between OSPF areas. Since you can only filter between areas you’ll have to configure this on the ABR. Filtering is possible inbound or outbound an area by using the area filter-list command.
In previous blogs we discussed how we can filter routes within the OSPF area and how we can filter type 3 LSAs. This time we’ll take a look how we can filter type 5 LSAs using three different methods.
As you might have learned in CCNA or CCNP, OSPF will use cost as the metric to choose the shortest path for each destination, this is true but it’s not entirely correct. OSPF will first look at the “type of path” to make a decision and secondly look at the metric. This is the prefered path list that OSPF uses:
OSPF supports a number of methods to filter routes but it is more restrictive compared to distance vector routing protocols like RIP or EIGRP.
As a link-state routing protocol OSPF uses LSAs to build its LSDB (Link State Database). Routers will run the SPF algorithm to find the shortest path to each destination, the topology in the LSDB has to be the same on all routers or SPF will fail.
OSPF has seen quite some changes since it was introduced somewhere in the 1980s.
The first time it was documented was in 1989 in RFC 1131. Some improvements were made in OSPF version 2, first announced in RFC 1247, updated by RFC 1583, 2178 and 2328.