Getting Started with Open Shortest Path First (OSPF)

Tech Guru Admin
10 min readFeb 11, 2022
Getting Started with Open Shortest Path First (OSPF)

OSPF is amazing and funzional in enterprise networks. The OSPF interior routing protocol is very common. OSPF performs an excellent job of estimating cost values in order to choose the shortest path to its destinations first. The three types of Open Shortest Path First activities are as follows:

- Neighbor and adjacency initialization

- LSA flooding

- SPF tree calculation

We’ll go through the fundamentals of Open Shortest Path First, as well as its functionality and setup, in this report.

Initialization of neighbours and adjacencies

This is the very first step in the Open Shortest Path First method. This role, as well as the maintenance of both the neighbour and topology tables, will be allocated memory by the router at this stage. If the router has determined which interfaces are equipped with Open Shortest Path First it can start sending hello packets through the interface in the hopes of detecting other routers.

Let’s take a peek at an illustration:

Getting Started with Open Shortest Path First (OSPF)

Remember that this is a broadcast between the routers, so the election to select DR and BDR must take place.

00:03:06: OSPF: DR/BDR election on FastEthernet0/0

00:03:06: OSPF: Elect BDR 10.1.1.5

00:03:06: OSPF: Elect DR 10.1.1.6

00:03:06: OSPF: Elect BDR 10.1.1.5

00:03:06: OSPF: Elect DR 10.1.1.6

00:03:06: DR: 10.1.1.6 (Id) BDR: 10.1.1.5 (Id)

One thing to bear in mind is that the hello packet timer is set to 10 seconds if you’re using Ethernet, like we are. The hello packet timer would be set to 30 seconds if the link is not Ethernet. What is the significance of knowing this? Since the hello packet timer on each router must be same, they can never become neighbours.

Flooding and State Advertisements

Let’s define this concept before moving on to LSA flooding and how it uses LSUs to construct the Open Shortest Path First routing chart.

There is no such thing as a single form of LSA. Let’s have a peek at the table below:

Getting Started with Open Shortest Path First (OSPF)

These are by no way the only LSAs accessible. There are 11 LSAs, so you must know about the ones I highlighted for the CCNA; do not ignore the others.

Multicast addresses are used to submit LSA alerts. The multicast address is used depending on the kind of network topology you have.

The multicast address for point-to-point networks is 224.0.0.5. 224.0.0.6 is used in a transmitted environment. However, when we progress across OSPF and begin talking about DR/BDR routers in a broadcast environment, the DR will use 224.0.0.5 and the BDR will use 224.0.0.6. In either case, keep in mind that Open Shortest Path Firstuses these two multicast addresses.

LSAs updates are used to build the network topology, and the information is obtained through LSUs (link state updates). As a result, once Open Shortest Path Firstrouters have converged, they send hellos through LSAs. If a new shift occurs, the LSU is responsible for updating the routers’ LSA in order to maintain routing tables updated.

The fundamentals of Open Shortest Path First configuration

You’ve already had a glimpse of Open Shortest Path Firstsetup, so let’s go through the basics again. The topology is shown in the diagram below:

Getting Started with Open Shortest Path First (OSPF)

Yes, this is the fundamental topology, but we’ll use a dual stack like this:

Configuration of R1:

Getting Started with Open Shortest Path First (OSPF)

Configuration of R2:

Getting Started with Open Shortest Path First (OSPF)

Configuration of R3:

Getting Started with Open Shortest Path First (OSPF)

So, how did we go about it? We allocate IP addresses to each interface, and because we are using serial cables, we must use the clock rate command to assign the clock rate for synchronisation and encapsulation on the DCE side of the cable.

Then we installed Open Shortest Path First with simple setup, which meant that all we did was announce the networks to which we were connected using the router’s process ID number. We are partly using a wildcard mask for the full network ID address, and because this is the first region, we must use field 0.

The ping command can be used in a variety of ways. Use the sh ip protocols or the sh ip path, but first consider how this could appear.

If you start with R1, you’ll get the following:

Getting Started with Open Shortest Path First (OSPF)

There are three basic commands we can use to make sure our Open Shortest Path First setup is right. Wild card masking is something you should be really familiar with, so here are a couple of examples:

Getting Started with Open Shortest Path First (OSPF)

Before we get started, let me show you how to do wildcard masking in a really easy way. What you have to do is subtract the subnet mask from the constant number 255.255.255:

Getting Started with Open Shortest Path First (OSPF)

If you will see, the wildcard mask is determined by the mask. Even if the network ID is the same, you’ll have three separate wildcard masks. That’s a lot of separate hosts all pointing to the same interface.

Finally, consider the following example of a subnetted Class A address:

Getting Started with Open Shortest Path First (OSPF)

It’s incredibly basic and doesn’t need any mechanics.

But that was a simple OSPF setup, but Open Shortest Path First can be configured in a variety of ways. I just explained wildcard masking, but keep in mind that zeros must fit exactly, so how about the following setup, which uses a different topology?

Getting Started with Open Shortest Path First (OSPF)

R1(config)#router ospf 1

R1(config-router)#net 0.0.0.0 0.0.0.0 area 0



R2(config)#router ospf 2

R2(config-router)#net 10.1.1.6 0.0.0.0 area 0

R2(config-router)#net 10.1.1.9 0.0.0.0 area 0

R2(config-router)#net 2.2.2.2 0.0.0.0 area 0



R3(config)#router ospf 3

R3(config-router)#net 10.1.1.0 0.0.0.255 area 0

R3(config-router)#net 3.3.3.0 0.0.0.255 area 0

Let’s go about how we configured Open Shortest Path First in three separate ways.

https://www.youtube.com/watch?v=RfwxV4VnOqI

ICND2 CCNA (Open Shortest Path First) explanation

We’re experimenting with the wildcard mask in this modern topology. When we build the network declaration in the first setup, we use all zeros, 0.0.0.0 0.0.0.0, and then we bring in the region number.

Using all zeros ensures Open Shortest Path First can fit all interfaces, resulting in every IP address on the router being matched, located in area 0, and marketed to neighbour routers.

In the second case, we placed the real IP address of the interface in the network statement and then use a wildcard mask of all zeros, 192.168.1.254 0.0.0.0. Since we are matching each octet, Open Shortest Path First will realise precisely which interface will engage in the OSPF loop in this situation.

In the previous case, the network state was generated by matching the first three octets and then using 255 on the last octet, which specifies whatever amount.

As a result, Open Shortest Path First has a lot of setup flexibility to suit the network needs. What you need to remember is what those requirements are.

By the way, I hope you noticed that each router has a different process ID number. Keep in mind that the process ID number is only relevant locally for the CCNA and also most “real-world” networks. Since the other routers are unconcerned, this amount will be anything you like.

Here are the routers’ outputs to see that the three latest methods of configuring Open Shortest Path First work:

R1#sh ip route



Gateway of last resort is not set



1.0.0.0/32 is subnetted, 1 subnets

C 1.1.1.1 is directly connected, Loopback1

2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 via 10.1.1.6, 18:41:09, FastEthernet0/0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 via 10.1.1.6, 18:41:09, FastEthernet0/0

10.0.0.0/30 is subnetted, 2 subnets

O 10.1.1.8 via 10.1.1.6, 18:41:09, FastEthernet0/0

C 10.1.1.4 is directly connected, FastEthernet0/0



R1#sh ip protocols

Routing Protocol is “ospf 1”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 1.1.1.1

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

0.0.0.0 255.255.255.255 area 0


Reference bandwidth unit is 100 mbps

Routing Information Sources:

Gateway Distance Last Update

3.3.3.3 110 18:41:42

2.2.2.2 110 18:41:42

Distance: (default is 110)



R1#ping 2.2.2.2



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms

R1#ping 3.3.3.3



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/52/72 ms

If you can see, I have full connectivity, and I am learning about all of the routes by looking at my routing chart. But, using the sh ip protocols instruction, I’d like to demonstrate the variations in the network statement configuration for the three routers:

R2#sh ip protocols

Routing Protocol is “ospf 2”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 2.2.2.2

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

2.2.2.2 0.0.0.0 area 0

10.1.1.6 0.0.0.0 area 0

10.1.1.9 0.0.0.0 area 0


Reference bandwidth unit is 100 mbps

Routing Information Sources:

Gateway Distance Last Update

3.3.3.3 110 18:31:18

1.1.1.1 110 18:31:18

Distance: (default is 110)

R3#sh ip protocols

Routing Protocol is “ospf 3”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 3.3.3.3

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

3.3.3.0 0.0.0.255 area 0

10.1.1.0 0.0.0.255 area 0


Reference bandwidth unit is 100 mbps

Routing Information Sources:

Gateway Distance Last Update

2.2.2.2 110 18:47:13

1.1.1.1 110 18:47:13

Distance: (default is 110)

We’ll glance at the passive-interface command and see what other functionality Open Shortest Path First has to offer. This comes in handy when it comes to stopping alerts from getting sent out. However, be aware that this command behaves differently depending on the routing protocol. If you setup it on EIGRP, for example, it would not submit or accept notifications. It actually stops notifications from being sent out in OSPF, however it can receive updates for neighbour routers. It can not change its routing table, so the gui is effectively unavailable.

Let’s have a peek at it from R2’s point of view:

R2(config-router)#passive-interface f1/0

*Oct 3 04:47:01.763: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on FastEthernet1/0 from FULL to DOWN, Neighbor Down: Interface down or detached

It brought down the F1/0 interface almost instantly. The router isn’t transmitting any hellos, which is what’s going on. Let’s look into it further with the debug ip ospf hello command:

R2#debug ip ospf hello

OSPF hello events debugging is on

R2#

*Oct 3 04:49:40.319: OSPF: Rcv hello from 3.3.3.3 area 0 from FastEthernet1/1 10.1.1.10

*Oct 3 04:49:40.319: OSPF: End of hello processing

R2#

*Oct 3 04:49:43.723: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet1/1 from 10.1.1.9

R2#

*Oct 3 04:49:50.319: OSPF: Rcv hello from 3.3.3.3 area 0 from FastEthernet1/1 10.1.1.10

*Oct 3 04:49:50.323: OSPF: End of hello processing

R2#

*Oct 3 04:49:53.723: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet1/1 from 10.1.1.9

R2#

*Oct 3 04:50:00.327: OSPF: Rcv hello from 3.3.3.3 area 0 from FastEthernet1/1 10.1.1.10

*Oct 3 04:50:00.331: OSPF: End of hello processing

It’s not sending notifications to the F1/0 interface anymore, but let’s have a peek at the routing table to see what networks we talk about:

R2#sh ip route



Gateway of last resort is not set



2.0.0.0/32 is subnetted, 1 subnets

C 2.2.2.2 is directly connected, Loopback2

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 via 10.1.1.10, 00:05:12, FastEthernet1/1

10.0.0.0/30 is subnetted, 2 subnets

C 10.1.1.8 is directly connected, FastEthernet1/1

C 10.1.1.4 is directly connected, FastEthernet1/0



R2#ping 2.2.2.2



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

R2#ping 3.3.3.3



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/40 ms

So, what exactly are we looking at here? We’re only getting started with the 3.3.3.3 network, which is R3’s loopback address. We’ve given up on knowing about the 1.1.1.1 network, because we no longer have access to it. Obviously, we will ping both our own loopback and the loopback on R3.

Let’s take out the passive user order to see what happens:

R2(config)#router ospf 2

R2(config-router)#no passive-interface f1/0

R2(config-router)#

*Oct 3 04:57:34.343: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on FastEthernet1/0 from LOADING to FULL, Loading Done

We’ve re-established our neighbourly friendship with R1. Let’s try debugging again:

R2#debug ip ospf hello

OSPF hello events debugging is on

R2#

*Oct 3 05:03:48.527: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet1/0 from 10.1.1.6

R2#

*Oct 3 05:03:50.303: OSPF: Rcv hello from 3.3.3.3 area 0 from FastEthernet1/1 10.1.1.10

*Oct 3 05:03:50.303: OSPF: End of hello processing

R2#

*Oct 3 05:03:52.143: OSPF: Rcv hello from 1.1.1.1 area 0 from FastEthernet1/0 10.1.1.5

*Oct 3 05:03:52.143: OSPF: End of hello processing

R2#

*Oct 3 05:03:53.723: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet1/1 from 10.1.1.9

We’re sending and receiving hellos from R1, so let’s ping R1’s loopback, but also have a peek at the routing table:

R2#sh ip route



Gateway of last resort is not set



1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 via 10.1.1.5, 00:06:50, FastEthernet1/0

2.0.0.0/32 is subnetted, 1 subnets

C 2.2.2.2 is directly connected, Loopback2

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 via 10.1.1.10, 00:06:50, FastEthernet1/1

10.0.0.0/30 is subnetted, 2 subnets

C 10.1.1.8

--

--

Tech Guru Admin

Your #1 Tech Website Resource for your IT Certification! Daily Technology News, Tutorial, Lesson, material, dumps and More! https://www.techguruhub.net/