(epic electronic music)
- So we're gonna leave the world of EIGRP behind us,
and at this point we're now gonna move into
another Interior Gateway Routing Protocol,
which is Open Shortest Path First,
otherwise known as OSPF.
So let's just do a quick introduction to OSPF.
First thing is, is that OSPF is and always has been
an open standard.
There actually is an RFC for it, if you wanna google
the RFC for OSPF.
But it's not owned by any company, it's not proprietary.
It's always been an open standard.
It's actually very, very old as well.
It's been around for several decades at this point.
So OSPF uses something called
the shortest path first algorithm.
What does that mean?
Well, unlike EIGRP, which is what we classify
as an advanced distance vector protocol,
OSPF falls into a different category called a link state
routing protocol.
One of the big difference between the two of them
is that a distance vector or advanced
distance vector protocol, all it knows about as far as
the topology is concerned is itself
and its directly connected neighbors and that's it.
So if you and I are running a distance vector
routing protocol, I will tell you about all the routes
I know about so you know that to get to those routes,
you go through me.
So you know those routes live back here somewhere,
but you don't know what the topology looks like back here.
You have no idea what is connected to what,
what the links look like, no idea.
Whereas in a link state routing protocol,
you actually know the entire topology,
not just you and your directly connected neighbors
but everything.
You can form like a map in your own mind as to where
all the routers are, where the subnets sit
on each one of those routers and you can piece it together.
So the shortest path first algorithm takes place
after you've built that map in your mind.
It's sort of like spanning tree, where you're like
the root of the tree and everything branches out from you.
In the shortest path first algorithm,
you build this tree and then you figure out
from your perspective as you at the center of the universe,
what the shortest path is to any given destination.
That's the SPF algorithm.
Like EIGRP, OSPF utilizes hello packets to dynamically
discover and build OSPF neighbor relationships.
In the case of OSPF, we actually call them adjacencies,
OSPF adjacencies.
So I'll use those terms interchangeably, neighborship,
adjacency meaning basically the same thing.
Like EIGRP, where the vast majority of EIGRP packets
went to a multicast address, most OSPF packets
also go to multicast addresses.
As a matter of fact, OSPF has two addresses
that are reserved just for itself,
224.0.0.5 and 224.0.0.6.
OSPF hello packets always go to 224.0.0.5.
The other packets that we're gonna talk about with OSPF
may go to .5 or they may go to .6.
When we get a little bit further into this
and I talk about this concept of something called
designated routers and backup designated routers,
the idea between these two different addresses
will make a little bit more sense.
OSPF also works based on an area hierarchy,
minimizing LSA flooding.
What does that talk about?
Because we haven't talked about areas or LSAs yet.
Let's hold off on that bullet for just a minute.
The very next slide is gonna go into a little bit
more detail of what that acronym, LSA, means.
And once I talk about LSAs, then I'll be able to give you
a better understanding of what an OSPF area is
and why you might want more than one area.
And like pretty much all the routing protocols
that utilize neighbors, OSPF has the optional capability
of supporting authentication, both clear-text
and MD5 authentication.
Okay, so the real heart and soul of OSPF
are these things called Link State Advertisements.
What is that?
Okay, first of all, remember that in OSPF,
we call this a link state routing protocol.
In other words, if I'm a router and this is what
I would normally call an interface,
interface fast Ethernet 00 or interface serial 00,
OSPF calls that a link, not an interface, a link.
Technically speaking, everything that has a subnet
would be considered a link.
So if I have a sub-interface, that's a link.
If I have a physical interface that has two or three
subnets on it, that would be categorized as two or three
separate links, even though it's on one physical interface.
So it's a link we're talking about.
The next thing is, as an OSPF router, if I'm directly
connected to this interface right here,
let's say it's fast Ethernet one,
then it's my responsibility to create a special type
of a packet called a Link State Update packet, an LSU.
I'll go ahead and write that on here.
LSU, which stands for Link State Update.
And within that Link State Update packet,
I will pack in there one or more Link State Advertisements.
So an LSU packet, think of that as being like,
in EIGRP terminology, an EIGRP update.
An EIGRP update contains one or more networks inside of it,
one or more prefixes that, that update is carrying.
Similarly, an OSPF Link State Update contains one or more
LSAs inside of it.
Now what exactly is an LSA?
Okay, so let's say I need to advertise information
about this link to all of the other OSPF routers.
Well, I'm gonna create, inside my LSU,
I'm gonna create a data structure called
a Link State Advertisement.
And that Link State Advertisement is gonna give you
everything you need to know about this link.
Now before I go into the details of that,
here's the main thing I want you to think about.
Number one, the overall goal or objective of OSPF
is to build this topology map in its mind.
It wants to build this tree of what the entire topology
looks like, who's connected to who,
who they're connected to, that's its overall objective.
So imagine, just close your eyes for a second,
imagine a whole bunch of circles and you're starting to draw
lines between those circles and you're building
a tree-like structure, interconnecting these circles,
and the circles are representing routers
and the lines are representing links connecting them.
So you're building that.
And then as you build that, imagine you start sort of
writing in the various subnets where they live
on top of the links.
That's sort of your secondary objective,
is to figure out where the subnets are.
But your primary objective is to build this tree,
build this SPF tree.
Okay, so the Link State Advertisement,
that's its main job, is to help you figure out
this topology.
So as such, when I create this Link State Advertisement
describing fast Ethernet one, I'm gonna tell you
a whole lot more than just what subnet lives here.
You see, if I was a distance vector routing protocol,
that's all you'd care about, is what subnets
I'm connected to.
You could care less about anything else.
In a Link State Advertisement, I'm gonna say
this is a broadcast link.
This link has a certain bandwidth.
Let me tell you about all the neighbors I'm connected to
on this link.
Oh, let me also tell you about the subnet
on this link as well.
I'll actually tell you all sorts of descriptive information
about this link in my LSA.
And now, here's another big difference.
In the world EIGRP, let's do some contrasting here.
Let's say that you and I are two routers connected
via EIGRP, and behind you you have another
EIGRP relationship with someone behind you.
So I send you an EIGRP update.
In my EIGRP update, I say hey, my name is Router Keith,
that's my router ID, and here's a bunch of networks
you can get through me to reach.
Okay, now what do you do?
When you turn around and send an EIGRP update
to your neighbor, do you tell your neighbor about me?
About my router ID and that these networks
you learned from me?
No, you don't.
Let's say your name is Sally.
Well, when you turn around and you send an EIGRP update
to your neighbor, all you say is you copy those networks
I gave you and you say, hey, my name's Sally, neighbor.
And I'm Sally, and here's the networks I know about.
So your neighbor knows about the networks are reachable
through you, but your neighbor has no idea
that I'm the one who actually told you about those networks.
And similarly, you have no idea about who told me
about those networks.
Well, an OSPF is just the opposite.
If I create a Link State Advertisement and I package
one or more of those inside an LSU,
a Link State Update packet, and I multicast it to you,
you take that Link State Advertisement and stick it
in a database, you store it, and then you keep
right on flooding it.
You don't change anything about it.
So even if there's nine or 10 routers behind you,
they will all know about me.
They will know about my name,
they will know that I'm the one that created this LSA,
that I'm the one who owns this link.
So they would be able to, in their mind,
as they're putting their jigsaw puzzle together,
they will know that I exist and where I sit,
and they'll know that I'm connected to you
and that you and I are neighbors and I'm neighbors
with some other people here.
So the LSA gets flooded to all these other routers
and that's how they build this topology diagram.
So an LSA is carried within a Link State Update packet,
and different types of LSAs carry different data.
So this is another important ingredient.
So at the CCNA level,
they don't really expect you to know the details
of what exactly an LSA is and that there's different kinds,
and what the names of those different kinds are
and what different purposes they serve.
But you sort of get the idea here that there are
different kinds of LSAs, and they do different things
depending on where a router sits in the topology.
And LSAs age out after one hour and are refreshed
every 30 minutes.
So what that means is that this LSA I created
describing this link, when I flooded it to you
and then it got flooded to all the other people out there,
well, you and I are exchanging hello packets
just like in EIGRP.
You and I are exchanging hello packets and that's how
you know I still exist, that I'm still a valid neighbor,
because every few seconds,
you're getting a hello packet from me.
Now if we were doing EIGRP, once I sent you an EIGRP update
with some networks in it, you might never see an update
form me ever again.
I might never tell you about those networks for an hour,
a week, six months.
Hey, as long as you and I are still exchanging
hello packets, you say hey, Keith still exists.
So that routing update that Keith sent me
about the 75 75 network three months ago
must still be there because he hasn't told me
it's not there.
OSPF takes a different approach because remember,
that LSA that I flooded to you also was flooded
to all the people behind you.
So yeah, it might be well and good for you and I
to exchange hellos and you know that I'm here,
but how do they know I'm here?
I'm not sending hello packets to the people behind you.
I don't have a neighbor relationship with them.
I have it with you.
So at some point in time, the people behind you
might be saying, uh, it's been a while since we got
some LSA from some guy out there named Keith.
Is he still alive?
Is he actually still reachable?
So in OSPF, we say well, when LSA goes out,
there's a timer associated with it.
If you don't get that LSA refreshed one hour later,
it purges from your database.
You delete it.
You say okay, it's been an hour,
haven't heard from that guy, he must be gone.
I'll delete the LSA.
So as the owner of the LSAs, the person who actually
created it, it's my responsibility every 30 minutes
to refresh that LSA.
So I will reflood it every 30 minutes.
Okay, so now let's go back to what we were just
talking about, this slide right here,
and I wanna pay some special attention to works
on an area hierarchy to minimize LSA flooding.
And this will hopefully make a little bit more sense now.
So let's look at this topology diagram right here.
There's a lot of rules that go along with OSPF,
and this is why some people don't like OSPF because
there's a lot of rules to remember about what it can do
and what it can't do and what one router's job is
versus what another router's job is.
So I'm gonna give you one of the rules right now.
So one of the rules states that
if you ever receive an LSA describing that something
in the tree has changed, right,
so imagine for a moment you're an OSPF router,
you've had some neighbor relationships going now
for several hours or several days, everything's been nice
and steady, you're exchanging hello packets
every few seconds and you've built this nice tree,
you know where everybody is, where everybody's sitting,
and you've got this nice tree in your mind.
Now, all of a sudden, boop, here comes in an LSA
from some other router out there who says,
there's a new link in the tree,
or who says an existing link has changed, has gone down.
The rule of OSPF states that when that happens,
you have to take that nice tree and rip it apart.
It's like taking your jigsaw puzzle and ripping it apart
and then build it all back together again,
accounting for that new LSA.
Now that's an important point.
Here's why.
This process of building a tree is very CPU intensive.
It takes the brain of the router a lot of power
to put all these LSAs together to see who connects with who
and to eventually build this map of that topology
in its mind.
So every time an LSA come in and says oh, man
I gotta rip apart my tree and now rebuild it
with this one new jigsaw puzzle;
or if an LSA comes in and says this branch is gone,
this link is gone,
oh, I gotta rip apart my tree and I'll rebuild it
and exclude that branch.
That takes a lot of processing power
for the router to do that.
So imagine for a moment that we're looking
at this topology right here, and let's say that
there's some link in this topology that is not very stable.
Maybe it's this link right here, okay?
So that link is flapping.
For whatever reason, it's going down and it's coming up.
Going down, coming up.
Well, every time that happens,
these two routers here, router four and Switch 3,
are creating new LSAs about a link down condition
or a new link coming up condition,
which means those LSAs are being flooded all over the place.
And so every time that happens,
all these devices are having to tear down their tree,
rebuild it, tear down their tree, rebuild it.
So in OSPF, when you configure OSPF,
you're gonna start by doing router OSPF,
and then you're gonna give it some process ID.
And I'll talk more about the process ID coming up
in another video.
And then like EIGRP, you're gonna have some sort of
network command.
And let's just take Switch 3 as an example.
I'll have a network command to cover this network,
this network and this network.
But unlike EIGRP, every link in OSPF
is considered to be part of an area.
Let's start real quickly and just say that
well, we're gonna have all these links in this entire
topology be in one giant area.
Now an area like an autonomous system number
has a number, has a value.
If I'm having my entire topology in just one area,
that area can be whatever I want.
Well, maybe we'll say Area 8.
So in Switch 3 here, I'd have network 2.3.2
in Area 8; network 3.3.3 in Area 8;
network 3.4.3 in Area 8.
And I would be enabling OSPF on these links
so we could start speaking about it.
So you can do that.
You can have every link in your entire topology
in one giant area.
Now Cisco recommends, there's actually
a design recommendation that says you should have no more
than about 40 or 50 routers total in any one given area.
So right now, this is easy, right?
So I've got one, two, three, four, five, six, seven.
I've got about seven devices, no problem.
Here's the problem though,
or the potential problem.
Within an area, everybody has to know the entire topology
of that area.
And everybody's database that's storing
the Link State Advertisements has to be the same.
And this is another rule of OSPF.
If you and I are OSPF neighbors
and we are what's called fully adjacent,
what that means is that all the LSAs I have in my database,
you have to have them.
And whatever you have in your database, I have to have them.
Our databases have to be synchronized.
They have to look identical.
So in this particular topology here,
all seven of these devices would have their own LSAs
that they've created, as well as the LSAs
of all the other devices in here.
So even in this small topologies we see here,
that'd be a fair amount of LSAs.
We've got one, two, three, four, five, six, seven.
We've got about eight links.
So we have several LSAs.
So all seven of these devices, if you looked in any
one of them, their link state database would be identical.
They'd all have exactly the same LSAs.
And this is the reason why if a new LSA comes in,
everybody's got to add it to their database
because they're synchronized, and they have to tear apart
their tree and rebuild it.
And then if another LSA comes in,
synchronizing it to the database, tear apart their tree,
rebuild it.
Well, if my topology is fairly stable,
I don't really have to worry about that.
It's that environment I talked about earlier
where I said hey, a link is flapping and now it's causing
the CPUs of my routers to get pretty high
because they have to keep having that
tear apart their topology and rebuild it
over and over again.
So OSPF, the designer, said we're gonna give you
a way to avoid unnecessary CPU computations
in that type of topology.
Here's what we're gonna do.
What you can do is you can take your topology,
and instead of putting all of it in one area,
you can divide up into multiple areas.
So for example,
I could say that all of these links here
are in Area 8,
and all of these links
are in another area.
Now the rule of OSPF, here's another rule, third rule,
the rule of OSPF says if you have two or more areas,
one of them has to be the backbone area.
The backbone area.
And that has a special number reserved.
Area 0.
Now I could've made the green area, Area 0,
and I could've made the red area, Area 8.
Doesn't really matter as long as one of these two areas
was Area 0, okay?
So now why might I divide this up into two areas?
Here's why.
A router only has to know the full map
of what the topology looks like of the areas
that it is connected to.
If there's other areas out there that this router
is not connected to, he has no links in those other areas,
he doesn't know what those areas look like.
They're just like a cloud to him.
He'll know what subnets live there, what networks
are out there, but he won't know
what that topology looks like.
So for example, router four over here,
router four knows exactly what's inside this green area.
He knows all of this.
But as far as what's in this red area,
just think of that as being like a cloud.
Router four will know that the 2.2.2 network exists,
that the 1.2.1 network exists, that the 1.1.1 network exists
and that they're all reachable via Switch 2.
But he won't have any idea of what the topology looks like
behind Switch 2.
That's sort of like a distance vector
characteristic, actually.
Now Switch 2, because he's connected to both areas,
he's actually gonna have two trees that he has to build.
He has to build a shortest path tree for Area 8
and a shortest path tree for Area 0.
And he's actually gonna have two databases,
one database for all the LSAs he's collected in Area 8
and other database for all the LSAs he's collected
in Area 0.
So he's gonna have to work a little bit harder.
As a matter of fact, when a router such as Switch 2,
I'm calling him Switch 2 but we're just treating him
as a router, when a router connects to Area 0
and one other area, when he's sitting as a border
between the backbone area and a non-backbone area,
he actually goes by the name of an area border router.
An ABR.
So why is that important?
Well, let's go back to this link right here.
So when Switch 3 came online and I activated OSPF
on this link, he created an LSA
that described that link.
And that LSA got flooded to everybody.
Now that LSA is, I'll just give you a preview of it,
I said there's different kinds of LSAs.
This LSA here in green I'm describing is called
a Type-I, Type-I router LSA.
The primary objective of a Type-I router LSA
is to help construct this tree,
help build this SPF tree.
A Type-I router LSA will get flooded within an area,
but it has to stop at the area border router.
In other words, all these devices in here,
in the green area, Area 8, they need to see
each other's Type-I router LSAs.
That's what helps them build this topology.
But those Type-I router LSAs will stop at Switch 2.
They will not be allowed to go into the backbone area,
into Area 0.
Similarly, there's gonna be Type-I router LSAs
that are generated here in Area 0 so that all the devices
in Area 0 can know what their topology looks like,
and they will stop at the area border router.
Now you might be thinking, wait a second,
if those Type-I router LSAs stop at the ABR
and go no further, then how is Area 0 ever gonna learn about
the routes over here in Area 8?
And how is Area 8 ever gonna learn about the routes
over here in Area 0?
That's one of the special things
the area border router does.
He says well, I'm not allowed to flood router LSAs
from one area into another area.
I can't do that.
So hmmm, what shall I do?
Why don't I create a different kind of an LSA,
an LSA whose purpose is not to create a tree,
not to create any kind of topology information,
an LSA whose sole purpose is just to describe networks,
just describes what subnets live in various areas?
And that's what the ABR will do.
He will actually create a special type of an LSA,
actually several of them, that will go out this way,
and these LSAs will say hey, I'm your ABR, I'm Switch 2,
and you can use me to get to the 2.3.2 network
or the 3.2.3 or the 3.3.3 or the 3.4.3.
You can get there through me.
I'm not telling you what the topology looks like,
but with this special kind of LSA,
I'm just saying there's another area you guys
don't know about, an Area of 0,
and you can reach those subnets through me.
So that's why the ABR is very special.
Once he realizes, oh, hey, I connect to the backbone area
and one or more non-backbone areas,
he says okay.
Router LSAs, stop with me, and I have to generate
a different kind of an LSA so that these two areas
can learn about the routes that live there.
So that's why we say that OSPF works on an area hierarchy,
an area hierarchy.
So just to, once again, put that into perspective,
if I have one area
that can be whatever I want.
But if I have two or more areas, like this,
and maybe like this,
then the area in the middle is gonna be my backbone area,
which is Area 0.
The other areas can be whatever I want them to be.
Maybe this is Area 20.
And maybe over here this is Area 77.
But the main idea is that everything has to flow
through the backbone.
So even theoretically, let's say I had a router here
who was like this,
say this is router X, router X has a link in Area 20,
he has a link in Area 77.
Is he an ABR?
No, he is not because he is not connected to Area 0.
So as such, router X does know what that topology
looks like in area 20 and what the topology looks like
in Area 77, but he is not allowed to send routes
from Area 77 into Area 20 and vice versa.
Anything he learns about in Area 20,
he is not allowed to send those routes into Area 77
because he is not an ABR.
So these other routers right here that are between
the backbone area and the non-backbone areas,
these are my ABRs.
So routes will always be learned from the backbone
and then into non-backbone areas.
That's the way routes will be learned.
(epic electronic music)