So for this module, we want to take a closer look at OSPF Neighbor States.
There are a number of different neighbor states that are used with OSPF.
Understanding what happens at each one of these steps is important
when determining if everything is working correctly,
so let's move through them individually.
First, we have the down state.
As the name suggests,
this is the default state of an OSPF interface before any communications begin.
Next is the attempt state.
The attempt state is only used on interfaces configured with
the NBMA network type and indicates that no information has
been recently seen from a neighbor.
The init state indicates that a device has received a message from a neighbor,
but the neighbor has not yet received any messages from the local device.
This is determined by whether the received message advertises
the local router ID. The two‑way stay indicates that a device
has received a message from a neighbor that has also seen a
message from the local device.
At this point,
the message that was received does show record of receiving messages
from the local device, if required by the configured network type. Once
the 2‑way stay is reached on each neighbor,
the DR and BDRs are then elected. Devices that are not
elected to be DR or BDR will not transition past the 2‑way
state with other non‑DR or BDR devices.
This is because they do not directly exchange link‑state information with them.
Next, we have the exstart state.
The only thing that happens in this state is the election of a
master and slave. The master is responsible for receiving and
re‑transmitting link‑state database information between neighbors.
Unlike the DR and BDR election process,
the master and slave election process always uses the highest router
ID and doesn't utilize any configured priority.
This is another reason why it may be best to ensure that both the highest
priority and the highest router ID exist on the preferred,
more powerful devices on a link.
Once the master and slaves have been selected,
the state moves to exchange. During this state, information about each of
the device's link‑state databases is exchanged using database descriptor
packets and compared. If there are any differences between these devices,
then the state moves to loading.
If the databases are the same, then the state moves
to full. During the loading state,
any missing link‑state information is synchronized between the neighbors,
ensuring matching link‑state databases.
This is done using different link‑state advertisement packets. Both
database and the different link‑state advertisement packets will be
covered in more detail in the next section.
Once all information has been exchanged between neighbors,
the state moves to full.
Once a neighborship has reached the full state,
all of the device's link‑state databases have been completely
synchronized, and normal routing operations will commence.
So now that we have covered these different states,
let's take a look at neighborships as they form in the lab.
Okay,
so let's move into the lab for a minute, and the first thing I want to do is
I want to show what we're going to be doing in this lab.
So in this topology that we show on this slide, where again we're going to work
with the neighborship and the link between Core 1 and Core 2, and what I'm
going to do is I've already disabled the interface on Core 1 on this side, for
Core 1, this is gigabit 01. And what we're going to do is we're going to enable
some debugs on this device,
and then we're going to un‑shut it and/or enable it, and show the messages,
the debug messages as they go between these two,
and it'll show the different states as it moves through them.
So first, let's get into Core 1.
And we'll see from a show that the neighborship between
Core 1 and Core 3 is still up, but the neighborship
between Core 1 and Core 2 is down.
If we look from the interfaces, I shut down this interface right here,
which goes between Core 1 and Core 2. On Cisco devices, this is the
adjacency debug on a Cisco device, and just to be thorough,
we'll also put packet debugging on here,
which will show the packets as they go, and since
there's a neighborship that exists here,
we're also going to see the traffic that goes out the interface between
Core 1 and Core 3. Now let's enable this interface. (Working) I want to
see all this stuff listed, and as it talks through when they exchange our
information, they elect their stuff,
the DR and the BDR have been elected, and once this settles down
for a second here, now they're backup. Now let's turn off the
debugging and back up for a second here.
New mistake here, this is the other interface, so this is this one.
Then Gi0/1 interface came up, this is OSPF saying it came up.
This is me sending out a message on that interface to that multicast
address at to 224.0.0.5, now it skips over the attempt state because this
is not an NBMA network, 2‑way Communications to 2Way, those are 2‑way, so
it jumped completely over the init state.
Sometimes, let's see, it goes to waiting, sometimes this sort of misses
some of these states, but you'll see most of them.
You'll see the 2‑way state, the init state was right before here,
but that happened so fast that it sort of jumped right over that state.
But here's the 2‑way, which means that Core 2 has seen traffic come from Core 1,
and it has responded, and it has included the router
ID for Core 1 in that response.
So it jumps into 2‑way state. In the 2‑way state, it will
go through the DR/BDR election process,
this is it talking about who's DR and BDR.
The election happens in this really short span of time here.
They elect, this is Core 2's router ID, so Core 2 becomes the DR, Core 1
becomes the BDR. Core 2 initiates the database exchange.
So this is saying okay,
send a, this is the database descriptor packets that we were talking about,
that Core 1 will send out the Core 2, and there's some packets being sent here
in the middle, adjacency send it, retrained, sending it out again, received a
database descriptor packet from Core 2, which has their information, neighbor
negotiations, so right in here, there it goes, it goes into an exstart. The
master/slave election is right in between here. We are the slave because in
this case, Core 2 has a higher router ID, so I become the slave.
If I looked at the same debug on the other side, it would say we are the master.
And everybody's happy, sending out another one, received another DBD, they
got all their database descriptor list completely sync up, and it goes into
exchange because I know about, in this case,
received goes to exchange.
So I received a DBD packet, I see information that I need, I need some links
to that information from Core 2, so we go into exchange.
And then between there and there, the exchange is done.
In this case, the network isn't very large,
so there's not a lot of reachability information, and
all the interfaces are pretty fast.
So in that amount of time,
it goes in and says I need to exchange link‑state database
packets, or sorry, link‑state advertisement packets.
And then in that amount of time,
it's exchanged all those packets, and the exchange is done.
It goes from the exchange state right into the full state.
And then this is the main message that we see if debugging isn't
turned on, where the neighborship comes up from loading to full. In
between here and here was the loading,
then it sometimes these, sometimes it says loading on this debug
and sometimes it doesn't, but in this case,
it went into exchange, went into loading. and then it's synchronized.
So actually,
between here in that amount of time between the, well actually, in that, well,
even though it's time marked the same, in those two, it went from
exchange, to loading, to full. Loading done,
it's happy. Then all the rest of this is just normal back and forth.
So for now, that's all we're going to cover.
So in the next section here,
what we're going to be doing is we're going to be taking a closer look at
this packet, and specifically we're going to be taking look more at the
OSPF header. And then in the next module,
we are going to get much more into what the different packet
types are, and what they are used for, and how you can read them, and what the contents are.