cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
617
Views
9
Helpful
12
Replies

OSPF Confusion

mahmoodmkl
Level 7
Level 7

Hi,

Guy's.

I am little or more confused about the working ot OSPF.No matter how many times i tried to understand it but again i am left with lot of confusion and questions.

We say tht OSPF is different then RIP or IGRP or EIGRP as they are called distance vector protocols and OSPF is a link state protocol.

By the term distance vector means the routers are going to rely on the info recieved from the neighbors and forward it.

Well now we say tht OSPF is link state.

Here by link state me assume the interfaces on router which are up and OSPF is enabled on them.

So we take the example of distance vector with the below toplogy.

R1-R2-R3

assume R1 has a network 192.168.1.0 advertise to R2 then R2 will advertise it R3 this is normal to DV protocols take the same toplogy with OSPF is going to be the same process if not whats the difference.

Please explain.

Thanks

Mahmood

12 Replies 12

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Mahmood,

OSPF uses multiple data structures called LSA of different types.

Let's suppose that R1-R2-R3 are all in area 3.

R1 builds a Router LSA that describes its links in area 3 and their states.

R1 floods its own Router LSA out all interfaces in area 3.

R1's Router LSA is received by R2 and propagated unchanged to R3.

So R3 doesn't know of R1 ip prefixes in area 3 by R2 telling what R2 has learned from R1.

In an OSPF area like area 3 in steady state and healthy operation all routers have the same database:

the same number of LSA, the same version of each LSA, the same content of each LSA.

OSPF inside an area provides detailed link state information.

Suppose that R1 is connected on the left with a LAN segment where multiple routers R5, R6, R7 are connected.

One router among R1, R5,R6,R7 become DR on the segment and originates a network LSA that describes exactly what routers are connected to the segment (using their OSPF router-ids).

A distant router in the same area like R3 can build a complete picture of the lan segment by using the network LSA and all the router LSAs of attached routers.

This is not possible using a DV protocol where R3 has no idea that multiple routers are connected together in a distant lan segment.

Usually it is said that link states provide full road maps and DV provide just indications like road signals (charlotte 10 miles taking road on the left).

OSPF has some DV aspects when multiple OSPF areas are used but within an area it is totally different then link state.

Hope to help

Giuseppe

Hi

Can u please explain the below sentence.

So R3 doesn't know of R1 ip prefixes in area 3 by R2 telling what R2 has learned from R1.

I didnt get what u want to explain.

Thanks

Mahmood

Hello Mahmood,

I was meaning that R3 receives a data structure created by R1 and doesn't rely on R2 point of view about R1's IP prefixes that is called routing by rumors for DV.

In DV R3 learns IP prefixes from R2 if R2 implements a distribute-list it can hide some R1 IP prefixes.

With OSPF link state R3 receives the R1 Router LSA even if R2 tries to implement some form of route filtering.

Hope to help

Giuseppe

Hi

Thanks for the reply.

So u mean to say that the LSA is forwarded without any modification..?

So the LSA contains all the info about the link on a particular router and this is identified by the router ID am i right in thinking this..?

So what is the use of this method.

So how does the best path selection works i think it still applies the DV approach.

So in this case how will be the path calculated is the cumulative cost i.e from R3-R2-R1...?

Thanks

Mahmood

Hello Mahmood,

each router executes the SPF algorithm placing itself as the root of the tree.

The algorithm provides a method to find the shortest path to a destination.

Actually for each destination SPF finds the shortest path.

Each calculates the metrics without using the calculations of other routers it is not I add the cost of the link to may neighbor to find out the total cost to destination x.

Instead each router uses the exact and complete topology information to find out the best path to each destination subnet.

Do you still see a DV behaviuor ?

It may be useful to read RFC2328

http://www.ietf.org/rfc/rfc2328.txt

or also on google books

http://books.google.it/books?id=JjdF2yWqJAwC&pg=PA156&lpg=PA156&dq=SPF+algorithm+description&source=bl&ots=CdWDrj9zse&sig=ph07nimQp0al3sfq4ipx_ZswJa8&hl=it&ei=mNg0StfPOMOvsAbtoZWsCQ&sa=X&oi=book_result&ct=result&resnum=1#PPA156,M1

Hope to help

Giuseppe

Hi,

I didnt understand this sentence

nstead each router uses the exact and complete topology information to find out the best path to each destination subnet.

If we take the example in my first post.

R1-R2-R3 how will R3 calculate the cost from the LSA recieved.

Is it not like adding the cost to reach R2 and then R1..?

Thanks

Mahmood

Mahmood:

Giuseppe has given you very informative answers, but maybe hitting it from a different angle might help, so let me take a crack at it.

Here's the deal:

In OSPF, a router does NOT depend on other routers to tell it that they know how to get to a network. Routers are not advertising reachability, per se.

So, R1 does not tell R3 (R2 is still in the middle of your topology example), "I know how to get to network so and so, and this is my next hop, so put this in your routing table and just believe me."

What R1 DOES say is "This interface of mine is operating on this network. Do whatever you want with this info."

That is called an LSA. Within an area, it is referred to as a "router LSA." These LSAs are flooded throughout the area so that each router in the area will have the same database. They should have the same database, after all, right? They are all connected to the same area and each router is receiving the same LSAs from the advertising router.

R1, R2 and R3 will use these LSAs to map the network. Using all the LSAs it has stored in its OSPF database (sho ip ospf database

At this point the router still has NO OSPF routes in its routing table. It has not been accepting routes from one router's RIB table and importing it into its own. It has, instead, been importing LSAs, placng them in a database. It will then intuitively draw a picture of the network.

Once the map is created, it uses the SPF algorithim to create a topologcal "tree" of the routed network and then figure out which is the'shortest path" to the destination network.

So, OSPF has the bird's eye view of the entire routed network.

With a DV protocol, like RIP, it knows nothing about the networks that sit behind its directly connected "neighbor." The RIP "neighbor" announced that it knows how to get to certain networks, and thats it. So, R2 would have to take R1's word for it, and R3 would have to take R2's word for it. This is why they call DV routing, "routing by rumor."

I hope this has provided some clarification.

Victor

Mahmood

Like Victor I will take a slightly different perspective to explain differences between DV and Link State protocols. Let us create an example where R1 and R2 are connected to R3 and R3 is connected to R4. Let us also assume that there is network X which can be reached through both R1 and R2.

In a DV protocol R1 and R2 both advertise network X to R3. R3 chooses the best route (assuming that the metric is not equal from both routers) and puts that preferred route into its routing table. And that preferred route is the only route that R3 advertises to R4. So R4 only receives advertisement of a single path to network X.

In a Link State protocol both R1 and R2 send LSAs to R3. R3 chooses the best path and puts that route into its routing table. But R3 advertises both LSAs to R4. So R4 receives both LSAs about network X, R4 knows that it could reach network X through R1 or through R2, puts both LSAs into its Link State Data Base and uses the Shortest Path First algorithm to choose its best path to network X.

So this is one of the important differences between DV and Link State Protocols: does a router forward information about all paths or just advertise the path that it believes is best.

HTH

Rick

HTH

Rick

Hi

Guys,

thanks for all u r replies.

This might be my last question i wish.

I understand that the router recieves all the LSA's from the router and from the LSA the router can figure out the router ID and the links associated with the router ID.

If u look in to my toplogy earlier now i want to know how does the router figure out the next hop as there are no redundant paths between the routers.

And as the metric is cost is it going to be the cumulative cost i.e from R3-R2-R1..?

Please explain.

Thanks

Mahmood

Hi

Please explain.

Thanks

Mahmood

Hello Mahmood,

yes the metric is the cumulative cost via R1-R2-R3, but this is not the result of summing the R1-R2 link cost to the metric advertised by R2 as it would be with RIP.

Hope to help

Giuseppe

Hi

Can u please explain in detail and what abt the next hop.

Thanks

Mahmood

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card