10. Explain how OSPF discovers, chooses, and maintains routes
Steps of OSPF Operation
- Establish router adjacencies
- Elect a designated router and a backup designated router
- Discover routes
- Select appropriate routes to use
- Maintain routing information
When OSPF adjacency is formed, a router goes through several state
changes before it becomes fully adjacent with its neighbor. Those states
are defined in the OSPF RFC
2328,
section 10.1. Following is an explanation of each state.
- Down
This is the first OSPF neighbor state. It means that no information
has been received from this neighbor, but Hello packets can still be
sent to the neighbor in this state. If a router doesn't receive a
hello packet from a neighbor within the RouterDeadInterval time (RouterDeadInterval
= 4*HelloInterval by default), then the neighbor state changes from
Full to Down.
- Attempt
This state is only valid for neighbors in an NBMA environment. Attempt
means that the router is sending hello packets to the neighbor, but has
not yet received any information.
- Init
This state specifies that the router has received a hello packet from
its neighbor, but the receiving router's ID
wasn't included in the hello packet. When a router receives a hello packet
from a neighbor, it should list the sender's
router ID in its hello packet as an acknowledgment that it received a
valid packet.
- 2-Way
This state designates that bi-directional communication has been
established between two routers. Bi-directional means that each router has
seen the other's hello packet. At this state, a router decides whether to
become adjacent with this neighbor. On broadcast media, a router becomes full
only with the designated router (DR) and the backup designated router (BDR);
it stays in the 2-way state with all other neighbors.
- Exstart
This is the first state in forming adjacency. It is used to elect the
master and slave, and to choose the initial sequence number for adjacency
formation. The router with the higher router
ID becomes the master, and as such, is the only router that can increment
the sequence number.
- Exchange
In the exchange state, OSPF routers exchange link-state advertisement
(LSA)
information. Each database description (DBD) packet includes LSA entries
from the OSPF master router's link-state database and has a sequence number
that is explicitly acknowledged. Routers also send link-state request
packets and link-state update packets (which contain the entire LSA) in
this state.
- Loading
In the loading state, routers send link-state request packets. During
the adjacency, if a router receives an outdated or missing LSA, it
requests that LSA by sending a link-state request packet.
- Full
In this state, routers are fully adjacent with each other. All the
router and network LSAs are exchanged and the routers' databases are fully
synchronized.
Full is the normal state for an OSPF router. If a router is stuck in
another state, it's an indication that there are problems in forming
adjacencies. The only exception to this is the 2-way state, which is
normal in a broadcast network. Routers achieve the full state with their
DR and BDR only. Neighbors always see each other as 2-way.
OSPF will send summary-update if it doesn't received any updates within
30 minutes.
OSPF maintains these databases
- Adjacencies database
- Routing table
- Topology database
These parameters mush match to form adjacencies
- Area ID
- Authentication type and password
- Hello and dead intervals
- Stub area flag if available
|