ospf part 6: how ospf works? ospf process & Hello content

Hey there! To learn a protocol, always asks how it works. Always remember, protocol is  a set of procedures or set of rules. In ospf, there are actually 7 process or steps to achieve neighbor adjacency. Let us first enumerate those processes.

1.) Down

2.) INIT

3) 2-way

4.) Exstart

5.) Exhange

6.) Loading

7.) Full

1.) DOWN- There will be only two reasons why an ospf network would go down

a.)When an interface is configured with an stafic ospf neighbor

  • this will be topic which is covered on CCNP – route wherein instead that a hello message is sent to a multicast address, it will be sent to just unicast address

 

b.) When hello timer expires and then dead timer takes place.

For us to easily understand, those timers and multicast address that I am telling you. We will discuss first hello message content and its timer.

Hello Message Contents:

1.) Router-ID of local router- router-id of the router which will send hello message

2.) Area-ID- area id of the interface of the local router

3.) Address & Subnet Mask – address & subnet mask of the interface

4.) Authentication type- the password or passive interface configured on the router interface

5.) Hello & Dead Interval – there dyou go!- Hello and dead interval are check alive timers. Hello interval is a message sent by local router to check if neighbor routers are still alive. If neighbor routers did not response after  the default value of 10 seconds, it will wait for 40 seconds for it to declare that the neighbor is officially down. Please take note that 40 seconds is just the default value of ospf dead timer. The values can be also configured.

6.) Router interface priority – likewise I mentioned on the previous blog, priority is used on election of master-slave router. We will further discuss this as we  go on, but just to give you a hint, priority value is used who will be the first router to send its LSDB

7.) DR  & BDR information – let us make it simple, these can be compared to the master-slave routers. DR stands for designated router and BDR stands for back-up designated router. We will dig deeper on this on the next blog pages

8.) Router-ID of the local router’s neighbor – this appears on the neighbor table of the local router

Alright so those are the contents of the hello message which will be sent by the local router to the neighbor router and also the local router should expect those information to be sent by neighbor router to him.

Always remember mate, that there can be multiple protocols which also sends information like hello message or its counterpart. So, the question is how will a router knows that the hello message  is supposed to be sent to him.

17A1

On the image above, the question is how will neighbor router will know that it is that he is the recipient of the hello message? Also how will R3 would know that since EIGRP is configured to him, he is not recipient of the hello message? The message is sent with destination address of 224.0.0.5 which is a multicast address. I mean to say that the hello message is broadcast to the network but intended only to the group of routers that run OSPF protocol.

Let us say that R3 drops the packet since he is not the recipient of the hello message and R1, the neighbor router received the hello message of R2. What will happen next?

R1 will counter check the hello sent by R2. And the following should match:

1.) Area ID – if R1 is on area 0, R2 must be also on area 0

2.) Area type – we will discuss this further but just to give you a hint these are normal, stubby, not so stubby area., sounds very complex but we will discuss this as we go on

3.)Network address & Submet mask

4.) Hello & Dead intervals

5.) Authentication information

6.)Router-ID must be unique

***********************************************************************

OSPF STAGE 2: INIT

How we will transition from DOWN state to INIT ?

 

Here’s how it goes! Let play a scenario wherein R1 and R2 is trying to establish neighbor adjacency

Step1 ospf interface of R1 got activated,  R1 will create its own LSA, remember LSA? HEHE,  R1 will send hello message to its neighbor but since no neighbor routers got ospf activated, hello timer will expire and will proceed to dead timer.

Step2  ospf interface of R2 once got activated,R2 will create its own LSA, R2 will send hello to R1. (

Step3 R1 will counter check the hello message sent of R2

Step 4 once all the parameters are achieved, R1 will add R2 as its neighbor and then the OSPF  process will transition from DOWN to INIT, so let us define INIT stage

INIT STAGE – is when all hello parameters are and then the neighbor router is added on neighbor table of R1, it will remain on INIT stage until it received a hello with its own router-ID. Sound confusing? we will explain that further as we transition to 2-way

Step 5 – Since R1 already added R2 as its own neighbor, R1 will send hello message once again to R2 with hello message wherein the neighbor is R2. Since the hello message has R2’s router-id which will be sent to R2, therefore it is now the time to transition to 2-WAY

***********************************************************************

2-WAY –>  If a router received a hello from a neighbor and sees its own router-id

is included in the list of neighbor

Step 6

18a.png

Let us have a recap from step 5, since R1 is on INIT state and sent hello to R2 with its neighbor router-id as hello content, R2 will add R1 as its neighbor router and will skip to 2-way, Step 6  would be R2 will send hello to R1 with its R1’s router-id as hello content then  R1 will transition to 2-WAY. Once both routers are on 2-way state, it will transition to EXSTART

***********************************************************************

EXSTART – the process of election on routers who will send its DBD

DBD – database descriptor – summary of router-ids of all LSAs inside LSDB

Step 7 Election will be on master-slave process

Master- highest router -id

Slave – lowest router-id

***********************************************************************

EXCHANGE – when we already figured out the master and the slave among routers.

Step 8 On our case, R2 will be the one who will send DBDs. R1 will just confirm that R1 & R2 share the same DBD as a reply ro R2

***********************************************************************

LOADING – it is the process of checking the LSDB of those routers involved to verify that they share the same LSDB

Step 9 After exchange of DBDs , if there are some neighbor information that they missed, master router will send a link state request which will lead to link state update and link state acknowledgment. Here’s how it goes!

Let’s say:

R2 ( master) : hi R1 here  is my ospf database

R1 ( slave) : Got it master!  I will try to counter-check and double check it!

Let’s say R2 has a new network configured to its interface and that network will be 10.0.21.0/24

R1 ( slave): R2 ( master ) , it seems like I don’t have yet the new network 10.0.21.0/24 configured to your interface, can I request to have that one . – THIS IS WHAT WE CALL LINK STATE REQUEST

R2( master) : Ohh oaah! I missed to inform you that, ok  no worries, I will provide you that network as LINK STATE UPDATE

R1( slave): Thank you so much master, I hope that you consider this one as LINK STATE ACKNOWLEGMENT to inform you that I already received the new neighbor information that you got.

***********************************************************************

FULL- we are now done with the final OSPF process wherein we have full neighbor adjacency. Loading state will be finished if all the routers have the same LSDB

***********************************************************************

Just a quick summary of OSPF process!

18b

Oh yeah! Apologies if it is very lengthy  and boring but I hope that I was able to educate you today!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ospf 5: OSPF tables

Hi mate! We’re back again and we’re getting more serious. We have to grasp more on OSPF operation and hopefully I will be able to explain it on the simplest manner. Title above focus on OSPF tables. There are just three tables that we have to remember on OSPF namely: neighbor table, ip routing table and lastly Link State Database LSDB table.

A.) Neighbor table

Verifying command: show ip ospf neighbor

Do you happen to remember this ?

14a

Yup, we have already encountered already the neighbor table. So we can conclude that the OSPF table includes the router-id of the neighbor routers, priority set on each neighbor which we will deal further as we go on, the OSPF stage which we will discuss as well  later and interface of the neighbor router where the local router is connected and the ip address itself. Too wordy right? Lemme discuss the OSPF neighbor content one by one.

1.) Neighbor router’s Router-id – the identifier of the neighbor router that also sends OSPF updates

2.) Neighbor router’s priority – this is used on the election of DR and BDR routers. We will go further on the classification of  ospf routers, it seems like there will be slave and master routers somewhat like that but I cannot provide more details about this without getting unto the basic of OSPF operation.

3.) OSPF stage – the word ” FULL” is the final stage on the OSPF stages on establishing neighbor adjacency. We will have a separate discussion about that

4.) The IP address of the neighbor router exiting interface. We just used the same network topology we used on the previous OSPF topic and as you can see below:

14b

The squared ones are those the interface of the neighbor routers of R2 and also covers the IP addresses 201.52.30.1 and 192.168.14.1

5. Interface of the neighbor routers- these are source of the OSPF updates

B.) IP routing table

Verifying commands: show ip route, show ip route ospf

I hope that I was able to help you to read routing table. It’s just very easy as there was a legend to follow what protocols appearing below. “O” on the ip routing table represents the OSPF protocol. Below is a  sample of routing table of R2 on the network topology.

14d.PNG

To show only OSPF on the routing table, use show ip route ospf

14e

C.) Link State Database (LSDB) table

First, let us define Link- State, link-state is just one of the routing protocol according to algorithm. Algorithms that I am telling you are those like distance vector, link state and hybrid protocols. The reference to define its metrics is the cost. Cost has computation equivalent to reference bandwidth over point to point bandwidth. The usual reference bandwidth is 100 kbps. So cost = 100 kbps / link bandwidth.

Anyway, we forgot our goal which is to define link state. Link refers to the interface and so link state refers to the status of the interface. Therefore we conclude that LSDB is a database of the status of the interfaces. However, that is just the layman’s term explanation to define LSDB.

Below is an image that shows the content of LSDB.

14f

Alright, another term rise that makes the study confusing but you don’t  have to worry about that.Lemme define them one by one.

LSDB – technically is a database of LSA’s or link state advertisement.

LSA – contains the information of the interface like network  address, metric, type of network address etc. These are the information advertised by the interface once the network command was activated.

14g

So let us discuss the content of LSA. I indicate on the the white image above that there is option A and B. Those  are actually categories of link state. Link state categories are A.) what’s with the interface — network address, metrics, type of network address and B.) is there router connected? –> ip address of neighbor router and router-id of neighbor router.

Let us try to check these LSAs by examining our original network topology.

14h

Let us check the LSA of R2

Category A for interface from R2 to R1 ( what’s with the interface)

Network address:201.52.30.0 /24

Metric:since we don’t know the metric, let us check the speed of the link, by running command ” sh interfaces se 1/0″ since it is interface se 1/0

14i

We can see that is 1544 kbps so definitely the cost or the metric is 100/1.544 = 64.766 and we can round it down to 64

Metric:64

Type of Network address:

There area two types of network address that we have to define;

a.Stub network- these are loopback address network, network of which interface has only one or no router connected on the other end

b. Transit network- network which interface has two or more routers connected

Since the interface that we are talking about is serial 1/0  and since it is only connected with one router which is connected to a  switch, we conclude that it is a stub network.

Type of Network address:Stub network

Let us try to verify the LSA on LSDB using this commands:

show ip ospf database

14a1

Highlighted on the above image is link id 2.2.2.2 because on area 0 on router 2, we got three LSA’s namely 1.1.1.1, 2.2.2.2 and 3.3.3.3. Since we would like to check the interface of router 2, we need to further check the content of LSA of link-id 2.2.2.2 by verifying command: show ip ospf database router 2.2.2.2

14a2

Honestly, there should be 7 links  but I only highlighted above the interface that we checked its LSA content. So let us try to check ” what’s with the interface?”

We got type of network as stub network, network address of 201.52.30.0 255.255.255.0 and metric of 64. There dyou go! we are able to check one of link state categories which asks what’s with the interface?

Let us try to check the 2nd link state category which asks ” is there a router connected?”

Yes, there is a router connected, and let us check the interface of router 1 that links to router 2 and it is the serial 1/0 of R1. So I just would like to clarify here that on a certain LSA of a router, we will see as well the state of the interface of neighbor router that provides OSPF update.

14a3

14a4.png

We need to define the IP address of local interface , local interface means the interface of the original router that we are working with, which is R2. so it must be 201.52.30.2

IP add of local interface: 201.52.30.2 

Also, we need to verify the router-id of the neighbor router, in our case, it must be R1. So,

Router-id of neighbor router:1.1.1.1

Let us try to verify:

14a5

Oh yeah! That’s all for now for the OSPF tables. Talk to you later!