Neighbors

Making sure that routers successfully become OSPF neighbors is the main task in configuring and troubleshooting OSPF.

Once routers become neighbors, they automatically do the work of sharing network information, calculating routes, etc.

When OSPF is activated on an interface, the router starts sending OSPF hello messages out of the interface at regular intervals (determined by the hello timer). These are used to introduce the router to potential OSPF neighbors.

The default hello timer is 10 seconds on an Ethernet connection.

Hello messages are multicast 224.0.0.5 (multicast address for all OSPF routers).

OSPF messages are encapsulated in an IP header, with a value of 89 in the Protocol field.

OSF is activated on R1's G0/0 interface.

It sends an OSPF hello message to 224.0.0.5.

It doesn't know about any OSPF neighbors yet, so the current neighbor state is Down.

When R2 receives the Hello packet, it will add an entry for R1 to its OSPF neighbor table.

In R2's neighbor table, the relationship with R1 is now in the Init state.

Init state = Hello packet received, but own router ID is not in the Hello packet.

2-way State

R2 will send a Hello packet containing the RID of both routers. R1 will insert R2 into its OSPF neighbor table in the 2-way state.

R1 will send another Hello message, this time containing R2's RID. Now both routers are in the 2-way state.

The 2-way state means the router has received a Hello packet with its own RID.

If both routers reach the 2-way state, all of the conditions have been met for them to become OSPF neighbors. They are now ready to share LSAs to build a common LSDB.

In some network types, a DR (Designated Router) and BDR (Backup Designated Router) will be elected at this point.

Exstart State

The two routers ill now prepare to exchange information about their LSDB.

Before that, they have to choose which one will start the exchange.

They do this in the Exstart state.

The router with the higher RID will become the Master and initiate the exchange. The router with the lower RID will become the Slave.

To decide the Master and Slave, they exchange DBD (Database Description) packets.

Exchange State

In the Exchange state, the routers exchange DBDs which contain a list of the LSAs in their LSDB.

These DBDs do not include detailed information about the LSAs, just basic information.

Ther routers compare the information in the DBD they received to the information in their own LSDB to determine which LSAs they must receive from their neighbor.

Loading State

In the Loading state, routers send Link State Request (LSR) messages to request that their neighbors send them any LSAs they don't have.

LSAs are sent in Link State Update (LSU) messages.

The routers send LSAck messages to acknowledge that they received the LSAs.

Full State

In the Full state, the routers have a full OSPF adjacency and identical LSDBs.

They continue to send and listen for Hello packets (every 10 seconds by default) to maintain the neighbor adjacency.

Every time a Hello packet is received, the 'Dead' timer (40 seconds by default) is reset.

If the Dead timer counts down to 0 and no Hello message is received, the neighbor is removed.

The routers will continue to share LSAs as the network changes to make sure each router has a complete and accurate map of the network (LSDB).

State Overview

TypeNamePurpose

1

Hello

Neighbor discovery and maintenance.

2

Database Description (DBD)

Summary of the LSDB of the router. Used to check if the LSDB of each router is the same.

3

Link-State Request (LSR)

Requests specific LSAs from the neighbor.

4

Link-State Update (LSU)

Sends specific LSAs to the neighbor.

5

Link-State Acknowledgement (LASck)

Used to acknowledge that the router received a message.

Last updated