OSPF operationState of OSPF
  1. Down state: starting status, when OSPF is not enabled on an interface.
  2. Init state:The router forwards a Hello packet that contains its router ID out all OSPF-enabled interfaces. The OSPF router ID is used by the OSPF process to uniquely identify each router in the OSPF area. When a neighboring OSPF-enabled router receives a Hello packet with a router ID that is not within its neighbor list, the receiving router attempts to establish an adjacency with the initiating router. Eg, R1 send a hello packet to R2, R2 then sends a Hello packet to R1. The packet contains the R2 Router ID and the R1 Router ID in its list of neighbors on the same interface. R1 receives the Hello and adds the R2 Router ID in its list of OSPF neighbors. It also notices its own Router ID in the Hello packet’s list of neighbors. When a router receives a Hello packet with its own Router ID listed in the list of neighbors, the router transitions from the Init state to the Two-Way state.
  3. Two-way state: The action performed in Two-Way state depends on the type of inter-connection between the adjacent routers:
    • If the two adjacent neighbors are interconnected over a point-to-point link, then they immediately transition from the Two-Way state to the database synchronization phase.
    • If the routers are interconnected over a common Ethernet network, then a designated router DR and a BDR must be elected.
    • While the Hello packet was used to establish neighbor adjacencies, the other four types of OSPF packets are used during the process of exchanging and synchronizing LSDBs.
  4. ExStart state: a master and slave relationship is created between each router and its adjacent DR and BDR. The router with the higher router ID acts as the master for the Exchange state. We assume R2 become the master.
  5. Exchange state:The master and slave routers exchange one or more DBD packets. A DBD packet includes information about the LSA entry header that appears in the router’s LSDB. The entries can be about a link or about a network. Each LSA entry header includes information about the link-state type, the address of the advertising router, the link’s cost, and the sequence number. The router uses the sequence number to determine the newness of the received link-state information.R2 sends a DBD packet to R1. When R1 receives the DBD, it performs the following actions:1. It acknowledges the receipt of the DBD using the LSAck packet.2. R1 then sends DBD packets to R2.3. R2 acknowledges R1.R1 compares the information received with the information it has in its own LSDB. If the DBD packet has a more current link-state entry, the router transitions to the Loading state. Or else to full state.
  6. Loading State:R1 sends an LSR regarding the unkown network to R2. R2 responds with the complete information about 172.16.6.0 in an LSU packet. Again, when R1 receives an LSU, it sends an LSAck. R1 then adds the new link-state entries into its LSDB.After all LSRs have been satisfied for a given router, the adjacent routers are considered synchronized and in a full state. Routes are processed using SPF algorithm.
  7. Full State:After the topological databases are synchronized, updates (LSUs) are sent only to neighbors when:
    • A change is perceived (incremental updates)
    • Every 30 minutes