- [Instructor] OSPF-speaking routers share information,
using Link-State Advertisements or LSAs.
They share information about routers, IPs, statuses
and links hence the name link-state.
The routers share this information among each other
so they can build their routing table,
based on their individual view of the network.
In fact, all routers in the same area,
area being a concept discussed later,
will have the exact same information,
in their link-state database.
The link-state database or LSDB is a storehouse,
for all the LSAs collected.
When an OSPF-speaking router sends an LSA,
it's flooded to other routers.
The idea is that it's passed to all routers within the area.
Before an LSA is sent to a neighbor however,
the sending router asks if the neighbor already has a copy
of this specific LSA.
This prevents LSAs from sending indefinitely.
LSAs are sent when there is an update
or when the aging timer for a specific LSA expires.
Once all routers have converged, the real magic happens.
The Dijkstra Shortest Path First algorithm is run.
This algorithm takes the contents of the LSDB and determines
what the best path to reach various subnets is,
installs them into the routers routing table.
The routing table is what is used
to actually forward packets
and can take in routes from multiple sources like IGP, GPS
and statically entered routes.
OSPF routers share information directly
with other routers known as neighbors.
This can be any router that is connected
to the same L3 subnet
with some specific matching parameters.
OSPF speaking routers will send Hello messages
to find new neighbors.
These Hello messages can dynamically locate new routers
as they come on the network
and can automatically start the neighbor process.
Hellos list each router's router ID or RID
which uniquely identifies each router.
RIDs are 32-bit numbers and are generally represented
as an IPv4 address.
The RID is either dynamically chosen on the router
or it can be manually specified.
Hello messages are sent via multicast address,
224.0.0.5 which is the all OSPF-speaking routers address.
When a router first hears a Hello message,
from a potential neighbor then relationship is said
to be in the init state.
This router will now send back a Hello with its RID listed
and also contain the initially seen RID.
When the original sender sees this message
with the RID listed, it will check
that all required parameters match
and then it will enter the 2-way state.
It will then return the message listing both RIDs
and if all required parameters match,
both routers will be in the 2-way state.
They are now neighbors and are ready
to begin exchanging LSAs with each other.
The first exchange between neighbors is to send a list
of all the LSAs they have.
That way the routers can request
which information they don't currently have,
from their neighbor.
The messages that actually exchange LSAs are known
as the Link State Update packets.
Think of LSUs as the envelopes
that the LSAs are contained within.
Once the routers have fully exchanged their LSDBs,
they are said to have reached a full state.
Once in the full state neighbors will continue
to exchange Hello messages
to ensure the neighbor is still alive and functioning.
While this information may seem a bit down in the weeds,
a basic understanding
of operation can really help with troubleshooting.