Step 3. OSPF full adjacency establishment and LSDB sync¶
Goals¶
The goal of this step is to examine the process of OSPF adjacency establishment and Link State Database (LSDB) synchronization between two routers.
OSPF routers go through several states when forming an adjacency: Down → Init → 2-Way → ExStart → Exchange → Loading → Full. The Exchange and Loading states involve exchanging Database Description (DBD) packets, Link State Request (LSR) packets, and Link State Update (LSU) packets to synchronize the LSDBs. Only after reaching the Full state do routers have identical LSDBs and can use each other for SPF calculations.
Configuration¶
This step uses a simple two-router topology to clearly observe the adjacency process.
The configuration in omnetpp.ini is the following:
[Config Step3]
description = "OSPF full adjacency establishment and LSDB sync"
network = Network
*.configurator.config = xml("<config> \
<interface hosts='R1' names='eth0' address='10.4.5.x' netmask='255.255.255.x'/> \
<interface hosts='R1' names='ppp0' address='10.4.6.x' netmask='255.255.255.x'/> \
<interface hosts='R2' names='eth0' address='10.4.7.x' netmask='255.255.255.x'/> \
<interface hosts='**' address='10.4.x.x' netmask='255.255.255.x'/> \
<route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
</config>")
*.visualizer.routingTableVisualizer[*].displayRoutingTables = false
# application parameters
*.host0.numApps = 1
*.host0.app[0].typename = "PingApp"
*.host0.app[0].destAddr = "host3"
*.host0.app[0].startTime = 60s
Results¶
When the simulation starts, the two OSPF routers (R1 and R2) establish an adjacency on their point-to-point link:
Init state: Each router receives a Hello packet from the other and transitions to Init.
2-Way state: When each router sees its own Router ID in the neighbor’s Hello packet, they transition to 2-Way.
ExStart state: The routers determine which one will be the master (higher Router ID) for the DBD exchange.
Exchange state: The routers exchange DBD packets describing the LSAs in their LSDBs.
Loading state: If a router finds that its neighbor has LSAs it doesn’t have (or newer versions), it sends LSR packets to request them. The neighbor responds with LSU packets containing the requested LS As.
Full state: Once the LSDBs are synchronized, the adjacency reaches the Full state.
The PCAP and OSPF module logs show the detailed packet exchange during these state transitions, demonstrating the LSDB synchronization mechanism that ensures all OSPF routers in an area have consistent topology information.
Sources:
omnetpp.ini,
Network.ned
Discussion¶
Use this page in the GitHub issue tracker for commenting on this tutorial.