(lightning crackling jingle)
- In this video, I'm going to go into
the OSPF designated route and backup designated router
in theory and in practice
and talk about why these things were developed for OSPF.
So, to begin with, let's go ahead
and go to the whiteboard first,
before we go into our slides, to talk about this concept.
Like I frequently like to do, I like to contrast
OSPF and EIGRP so you can see some of their similarities
and some of their differences.
Here, we have four routers,
and all four routers are connected to the same switch,
and they're all in the same broadcast domain,
as you can see from their IP address.
If we were talking about EIGRP, as an example,
router one would list R2, R3,
and R4 as neighbors.
Now, let's say that R1 had an EIGRP update
that it needed to send.
We know that EIGRP updates go out as multicast packets.
What do switches do with multicasts?
They flood them, just like they flood broadcasts,
so that multicast packet would be flooded to R2, R3, and R4.
Now, because R1 is neighbors
with all three of those routers,
he would wait and he'd say,
"Well, I need to get an EIGRP acknowledgement
"from R2, R3, and R4."
All of a sudden, here's R2, sends in EIGRP hello packet
with the sequence number saying, "I acknowledge."
He says, "Okay, R2, you're good to go.
"Thank you for acknowledging."
Here comes R3 sending a hello packet,
and we check that off.
Hopefully, eventually, R4 would send his own hello packet
with that same sequence number in it.
R1 would say, "Okay, all three of my neighbors
"have acknowledged this update."
In the event that something went wrong
and one of these routers did not send an acknowledgment,
then R1 would resend his EIGRP update
as a unicast packet directly to that neighbor.
What does that have to do with OSPF?
Now, remember that with OSPF,
we saw that when we were talking about the process
of building a neighbor relationship that it was important
that all the OSPF routers who were neighbors
had a common database, that their LSAs were the same.
So, there were about six different steps
we had to go through to get to that point.
We had to go to init, 2-way, exstart, exchange,
loading, and then finally full to do all that.
In this type of an environment,
in this type of a network where a router says,
"Okay, there could be more than one router on this network."
For example, think about Ethernet.
The nature of Ethernet is that
you can put one frame on the wire,
and you don't know how many people are going to see that.
You don't know how many people are on
that same Ethernet cable as you.
The nature of Ethernet is that it could be two,
three, four, 44, you don't know.
Ethernet is what we call a multi-access medium.
The desires of OSPF, they said,
"Well, we could, on a multi-access medium like Ethernet,
"where there's a potential of lots of different routers
"out there on this wire,
"we could do like EIGRP does.
"We could have all the routers go through
"all five or six steps with each other.
"All the routers become fully adjacent."
They said, "Then, when an OSPF router
"sends out a link-state update,
"we could do like EIGRP does
"and all the other routers have to acknowledge it back."
But the designers of OSPF took a different approach.
They said, "Here's what we're gonna do.
"On a multi-access network segment like Ethernet,
"we're gonna have one router elected
"as a very special position, which is gonna be called
"the designated router."
Let's just say it's R4, as an example.
During the exchange of hello packets
is when this election takes process.
As these four routers are exchanging hellos,
remember, their hellos are going out as multicasts.
What's the multicast address that OSPF hellos go out to?
224.0.0.5.
Hellos always go to that address.
Inside that multicast hello, there are some fields
that help these routers to figure out
who this designated router is going to be.
What's the significance of the designated router?
Well, once we know who the designated router is,
router one will go through all six steps with router four.
Init, 2-way, exstart, exchange, loading, full.
Router two will become fully adjacent with router four,
and router three will become fully adjacent
with router four.
Notice, R1,
R2, and R3,
they're not becoming fully adjacent with each other.
They see each other.
They're still seeing each other's hellos,
because those hello packets are multicast,
so they're seeing that.
But when R1 looks at R2 and says,
"Oh, neither one of us is a designated router,
"we don't need to go beyond the 2-way state.
"I see you and you see me.
"Good, we're in the 2-way state,
"but that's as far as we need to go.
"We can stop there."
With the DR, everybody becomes fully adjacent.
What's the purpose of that?
Well, now if R1, let's just take R1 as an example.
Let's say that R1 has a link-state update
that it needs to send
containing one or more new LSAs inside of it.
R1 is gonna say, "I can only send my link-state updates
"to OSPF neighbors that I'm fully adjacent with,
"that I'm in the full state,
"I went through those five or six steps with."
Which, in this case, is the designated router.
He says, "Hm, I know there's other routers
"here on this segment besides R4, the DR.
"How do I get this link-state update just to him?
"Ah, here's what I know I'll do.
"I'll send my link-state update
"to a special, reserved OSPF address of 224.0.0.6."
Only the designated router is listening to that address.
So now, when this link-state update packet goes in,
it is a multicast, so it will be flooded.
R2, R3, and R4 will see it,
but R2 and R3 will discard it.
They'll say, "Oh, I'm not a designated router.
"This is not for me."
Now, that link-state update will only be
seen and processed by R4.
Now, R4 gets it.
Here it comes in.
Now, R4 says, "Great.
"My link-state database is synchronized with R1.
"R1 and I are in sync.
"I got his link state.
"Oh, by the way, let me acknowledge that back."
So R4 will do that.
He'll send a link-state acknowledgement packet back.
Now R4 will say, "But I have two other neighbors
"on this wire, R2 and R3."
Now what R4 will do is he'll turn around
and he'll send a link-state update
to R2 and R3, link-state update.
He'll reflect that link-state update right back,
going to 224.0.0.5.
Now, you might be thinking wait a second,
if R4 does that, isn't R1
gonna see his very own
link-state update packet coming back to him?
As a matter of fact, yes he will.
Remember, that link-state update has an LSA inside of it,
maybe more than one LSA.
Remember, every LSA has a field that says
who does this LSA belong to?
Who created it?
Who's the originator of the LSA?
In this particular case,
when R1 gets that link-state update
and he looks inside of it, he'll say,
"Oh, here's an LSA that was advertised by R1.
"Oh, that's me.
"Okay, I can ignore that.
"Here's another one that was advertised by R1.
"Oh, okay, that's me.
"I can ignore that."
In this regard, all these routers
will become fully synchronized.
Once again, just to repeat the process,
the DR is elected.
All these routers exchange hello packets,
and within the hello packets are some fields,
which I haven't talked about yet,
which will help them to figure out
who the designated router should be.
Once that takes place, all of the routers
become fully adjacent with the designated router.
They go through all five or six of those steps with him.
After that point,
if anybody needs to send a link-state update,
they will send it to the DR,
and they'll send it to 224.0.0.6.
That is an address that only the DR is listening to.
The DR, in turn, will reflect that link-state update
right back again
so that all the other routers can get it,
including the originator, who will say, "No."
That will go to 224.0.0.5.
The idea being here is that if I have an Ethernet switch
that, let's say, has 20 routers on it,
they don't all have to become fully adjacent
with each other.
They only have to become fully adjacent
with the designated router.
They send their updates to him,
and then they don't have to worry about it.
He's the one that's going to turn around
and reflect it to everybody else.
The designated router's job is to make sure
that everybody is synchronized with everybody else.
That is his job.
By the way, there's one other router here
who is also elected as
a backup designated router, or a BDR.
Just like the DR is listening to 224.0.0.6,
the BDR is also listening to 224.0.0.6.
When R1 sent his initial link-state update
to 224.0.0.6,
both R3 and R4 got it.
But it was only R4's job, as the designated router,
to turn around and reflect that back so that,
in this case, R2 could get it.
R3 is sort of just sitting there silently.
He is taking stuff in, because he's listening to .6,
but it's not his job to turn around and reflect stuff back.
Only if the designated router fails will R3 take up the job
as the new designated router.
Now that we know that,
let's go into these slides.
A DR and a BDR are elected in broadcast
and non-broadcast multi-access networks.
Now, we haven't really talked about
those two terms yet.
That's coming up in a little bit in a different video.
Just think about it this way.
We know that at layer 2,
at the data link layer of the OSI model,
there are several different encapsulation types:
Ethernet, PPP,
HDLC, frame relay.
You could probably think of one or two or three more
in addition to that.
What's one thing that makes them different from each other?
Some of those encapsulation types
were built around the assumption
that I could put one frame on the wire
and multiple devices could see that one frame,
like Ethernet.
That's the nature of Ethernet.
That's the nature of,
well, let's just stick with Ethernet.
That's Ethernet, you can put one frame on there,
and everybody will see it.
Other layer 2 encapsulation types say,
"Well, if I put one frame on the wire,
"it's only going to go one place,"
like the point-to-point protocol or HDLC.
Those are layer 2 protocols that say,
"This was designed for a cable that's just got two devices.
"Put something on the cable, it only goes over here.
"This guy puts something on the cable,
"it only goes over here."
So, there's really no need for an address,
because there's just the two of us.
PPP and HDLC are like that.
Then, there's other types of encapsulation types,
like frame relay, that say,
"Well, this particular cable could go multiple places."
For example, think about your connection to the Internet.
You're sitting at home.
You have a connection to the Internet.
That one cable you have leading out of your house
can reach billions of remote destinations.
It's sort of like Ethernet in that way.
You could put one thing on there,
one cable that gets you multiple places.
But is it possible for you to put something on that cable
that all those remote destinations are going to see?
No, it's not.
In the case of your Internet connection,
you have to address everything you put on that cable
to who you want to send it to.
It doesn't support broadcast.
You can't put a broadcast on your cable modem
or your DSL connection to Time Warner Cable or Comcast
and expect that all the billions of devices in the Internet
are gonna see it.
It doesn't work that way.
That's what we consider
a non-broadcast multi-access network.
In all these networks where I can out something on a cable
and I can say to myself,
"Well, there could be more than one device
"reachable on this cable."
In that particular case, a designated router
and a backup designated router will be elected.
We've talked about these last two bullet points right here.
How do we determine which router that will be?
Well, by default, the very first router
that comes online on a cable will be the designated router.
That's pretty much it.
Now, if two routers come online at the same time,
if they start exchanging hellos at the same time,
then the router with the highest interface priority
will become the designated router.
This is the first time I've talked about this.
In OSPF, when you use the network command under OSPF,
and OSPF says, "Oh, here's an interface right here
"that falls in line with that network.
"I'll start speaking, I'll start sending out hello packets."
On this interface, he gives it an OSPF priority value.
It's actually the value of one by default.
In my hello packets I send out,
that's one of the things I put in there is
what my interface priority is.
If I'm sending hello packets to you
and you're sending hello packets to me,
if one of us has a higher interface priority than the other,
we're done.
The highest interface priority will win,
and that will become the designated router.
When you do the command show ip ospf neighbor
to view your neighbors,
you will see, on an Ethernet segment,
you'll see at least one neighbor shown as DR,
for designated router, possibly another one that says BDR,
and then others that will say DROTHERS.
DROTHERS mean routers that currently
are not the DR,
not the BDR,
but they could be in the future.
If the DR and BDR fail, these other routers
could potentially become designated routers.
Now, let's say that you have not
manually configured the interface priority.
Remember, it's interface priority.
It's not a global priority.
On a router, if he's got five interfaces,
if you wanted to, you could have each interface
have a different priority value.
By default, they'll all be the same.
They'll be the value of one.
If you and I exchange OSPF hello packets
over an Ethernet segment
and we both have the exact same interface priority,
then we're going to compare each other's names,
our router-ids, our OSPF router-ids.
Whoever has the highest router-id will be the winner.
That will become the designated router,
and the second highest will become
the backup designated router.
A lot of times, people don't really necessarily care
which router will be the DR or the BDR.
They just let OSPF take care of that by itself.
Let's say you wanted to have some control over that.
As the network administrator, you wanted to be
in control over which router was going to become the DR
and the BDR.
The easiest way to do that would be to go the interface
and change the OSPF interface priority.
In a video coming up
where we actually go over the configuration commands,
I'll show you how to do that.
The second way you could do it
is by manipulating the OSPF router-id itself.
As soon as you type
router OSPF and then some process ID and hit enter,
it elects a router-id for itself.
It looks at all of its interfaces and says,
"I need to pull an IP address here
"and use that as my name, as my router-id."
What's the order?
How's it going to do that?
Number one, first thing OSPF is going to say is,
"All right, under my configuration,
"under my router OSPF configuration,
"did some human being actually type the router-id command?
"If they did, that's what I'll use as my router-id."
What if you did not type the router-id command?
Well, then the router will look to see
if you have any loopback interfaces.
If you do, whatever the highest IP address is
of all of your loopbacks,
that will be your router-id.
Lastly, if there are no loopbacks
and there's no OSPF router-id that was manually configured,
it'll just look around at your interfaces
and select an IP address from your interface,
the highest IP address from among your physical interfaces,
and use that as its router-id.
Now, interesting little factoid here.
A lot of times, people think only interfaces
that are actually up/up are candidates
for the router-id.
That's not actually true.
Even an interface that is up/down or down/down
is a candidate for router-id.
The only time there's an IP address on an interface
and OSPF says, "I can't use that.
"I can't even consider that,"
is if the interface is administratively disabled,
if it is shut down.
Other than that, the IP address could potentially be used
as the router-id depending on if it's not a loopback
and if it's the highest IP address on the box.
So, that ends this video on the OSPF designated router
and backup designated router process.
(lightning crackling jingle)