- Let's consider OSPF neighbor
formation in this video.
First of all,
consider this topology
where we got a couple of routers
and if they exchange hello messages,
then their neighbors,
they reside on the same network link
so they've got interfaces on the same sub-net
and they exchange hello messages.
Well that makes them neighbors,
but they don't just as neighbors
necessarily exchange
LSA, link-state advertisement information.
Remember the metaphor we gave in our
prior video about OSPF
having a link-state database,
which is a map of the topology
and we compared it to building a puzzle
and we said those puzzle pieces
that get exchanged to build
the puzzle to build a map.
Those are LSAs, link-state advertisements.
Neighbors don't necessarily exchange
link-state advertisement information.
I compare it to a couple of neighbors
that we have at our house.
We have two neighbors
that are even remotely close to us.
Now one neighbor,
we're very close to.
We know the family really well.
The lady that lives there is my wife's best friend.
They talk in texts all the time.
We're very close,
we exchange lots of information.
The other neighbor that we have,
I honestly don't really know them.
I may have spoken to them once or twice,
when they pass on the road,
I throw up my hand to wave hello.
I know what they drive
but that's really about it.
We just say hello.
We don't exchange any other information
and that's exactly what it was PF neighbors do,
they just say hello.
If we take it a step further,
if we have a more in depth relationship
like we do with that one neighbor,
where the lady and my wife are best friends,
that would be equivalent to an adjacency
and adjacency is when we have a couple of routers
that are neighbors.
We've got to be neighbors.
We have exchanged hello messages,
but we go beyond that.
We exchange link-state updates,
which are the packets
that contain link-state advertisements.
We have exchanged information to build
this link-state database.
That's the distinction between being
just a neighbor and being an adjacency.
Which kind of begs the question,
why wouldn't we want everybody to be
adjacent to one another on a network?
It seems like it's better.
We're exchanging more information.
Well, the reason is scalability.
Consider this.
Here I've only got six routers,
but just to make the point,
let's say that every router onscreen,
they all have an interface on the same sub-net.
If they were adjacent with one another,
how many total adjacencies would have to be formed?
Well, here's the formula.
The number of adjacencies can be calculated
with the formula of N times N minus one.
We take that quantity
and we divide by two
and in this case N is the number of routers.
So if we had six routers,
N six times N minus one,
six minus one is five
so six times five is 30 divided by two is 15.
It would take 15 adjacencies for everybody
to be adjacent to everybody else.
And that doesn't scale well at all.
Consider 10 routers.
If we had 10 routers,
that will be 10 times nine divided by two
that will be 45.
There'll be 45 adjacencies.
So what can we do instead?
What we can do is say that maybe one or two routers,
they're high powered,
they can handle some extra load.
Let's have everybody form an adjacency with them
and then they can be responsible for propagating
all this information out to everybody else.
That way everybody doesn't have to be
adjacent with everybody else.
We call those routers designated routers.
Let's say that we're going to make our one,
our designated router,
and in case our one were to go down,
we'll have a backup.
We'll say our two is our BDR,
our backup designated router,
and with these designated routers,
we only have to form adjacencies
with the DR and the BDR.
So now we dramatically reduce
the number of adjacencies that have to be formed.
You might wonder how we're communicating
with just the DR or the BDR.
It's using multicast.
If we're using a OSPF version two,
which is going to be routing for IP version four,
we're going to go to a multicast address
of two twenty four dot zero dot zero dot five
to get to all OSPF speaking routers
or
we could go to two twenty four dot zero dot zero dot six,
to go to the designated routers,
which includes both the DR and the BDR.
If we were running OSPF version three
and doing IP version six,
we would use the IP version six multicast addresses
of FF zero two colon colon five,
for all OSPF routers
and FF zero two colon colon six,
for the DR in the BDR.
Now that begs the question,
how does the DR get elected?
Well let's talk about the DR and the BDR election.
This election is going to be based by default
on the router priority.
We can go in to OSPF router configuration mode
and we can set the priority of that router
and we're communicating that inside of a hello packet
with our neighbors
and sometimes we might not want
a router to participate in that election.
Maybe it's a lower powered router.
We don't want it to be accidentally elected
as the DR or the BDR,
so we could set a priority of zero.
That's going to prevent a router
from participating in the election,
and whoever has the highest priority,
they win.
They're the DR
and the next highest priority
is going to be the BDR,
the backup designated router.
But what if it's a tie?
By default,
everybody has a priority of a one.
What if we didn't bother to change that?
How do we elect to DR into BDR?
Well,
the tiebreaker is the highest router ID.
OSPF keeps track of a router ID,
we can see it in some of the show commands
and the router ID can be configured
explicitly in the OSPF router configuration mode
by saying router hyphen ID
and then we give a dotted decimal IP address.
Essentially it looks like an IP version four address.
We could say something like,
router hyphen ID one dot one dot one dot one.
Now just because we say that,
we're not advertising that network,
we're just using that as our identification.
If we haven't configured a router ID though,
it's going to be the highest IP address assigned
to a loopback interface on a router.
That's going to be our router ID.
What if we don't have a loopback interface?
Well,
if we don't have a loopback interface,
it's going to be the highest IP address
on an interface that's currently up.
That's going to win the election.
And if you don't have that,
you're going to get an error
when you try to configure OSPF.
It's going to say,
yeah you got to have an interface that's up
in order for us to do this.
So you'll not even be able to configure OSPF
if you don't have at least one interface that's up.
But that's a look at how OSPF speaking routers
can form neighborships.