Link State Database Synchronization
Figure 3-17 illustrates the initial synchronization of the link-state database, which occurs in five steps, as detailed in the numbered sequence in the figure.
When an 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. See Figure 3-18 for a discussion of each state. Not every pair of neighboring routers becomes adjacent. Instead, adjacencies are established with some subset of the router's neighbors. Routers connected by point-to-point networks and virtual links always become adjacent. On multiaccess networks, all routers become adjacent to both the designated router and the backup designated router (defined later in this section).
Figure 3-17 Link-State Database Synchronization
OSPF Down
OSPF Attempt
|When routers first start OSPF, it is "down" on a link. Down I means they have not discovered any neighbors yet.
OSPF will then "attempt" to contact its neighbors by sending Hello packets.
Router A starts INIT by sending Hello w/ its RID.
Step 1: INIT
Router B receives Router A's Hello packet but does not see its own RID in the packet.
Router B sends a Hello packet to Router A. Thepacket has both RIDs in it.
Router B Hello packet with Router A RID._
Router A sends Hello packet with Router B_
RID, and they will have decided on the DR and Hello timers by this point as well.
Bidirectional communication is established between OSPF routers and they are considered neighbors at this step.
f Routers become Master/Slave and agree upon Database Descriptor initial sequence number. RouterA is master.
DD's are exchanged (one packet at a time) back and forth until the LSDB are synchronized.
Step 5: Loading [ Link"slale requests and updates are sent to get more recent j y_SAs that had not yet been received in Exchange state. J
Step 6: FULL
| In this state, neighboring routers are fully adjacent. This is reflected in OSPF.
118 Chapter 3: OSPF Communication
Figure 3-18 OSPF States


- We have achieved link-state database synchronization!
The states for link-state database synchronization, as illustrated in Figure 3-17, are described in the following list:
• 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.
• Attempt—This state is valid only 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.
Alternatively in OSPF, if the routers had been neighbors (had successfully exchanged Hello packets) in the past but the neighbor relationship had been lost (possibly due to Hello timeout failure), the router restarts communication by attempting to reestablish the neighbor relationship by sending Hellos.
Init (Step 1 in Figure 3-17)—This state specifies that the router has received a Hello packet from its neighbor, but the receiving router's ID was not included in the Hello packet. When a router receives a Hello packet from a neighbor, the router should list the sender's router ID in its Hello packet as an acknowledgment that it received a valid packet.
2-Way (Step 2 in Figure 3-17)—After OSPF routers achieve this state, they are neighbors. This state designates that bidirectional communication has been established between two routers. Bidirectional means that each router has seen the other's Hello packet with its router ID in the other's Hello packet and that all Hello timers match. After the discovery of other OSPF routers and the election of a DR are complete, this state is achieved, and a router decides whether to increase the strength of its relationship by becoming adjacent with this neighbor. On broadcast media, a router becomes full only with the DR and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. Database descriptor (DD) packets are sent between neighbors to synchronization their link-state databases during this step.
Exstart (Step 3 in Figure 3-17)—This is the first state in forming an adjacency. Two neighbor routers form a master/slave relationship and agree on a starting sequence number that is incremented to ensure that LSAs are acknowledged properly and that no duplication occurs. The router with the higher router ID (RID) becomes the master and, as such, is the only router that can increment the sequence number. DD packets begin to be transmitted. The initial DD sequence number is agreed on here.
Exchange (Step 4 in Figure 3-17)—DD packets continue to flow as the slave router acknowledges the master's packets and vice versa. The DD packets are sent back and forth one packet at a time until their respective link-state databases are completely synchronized. The master/slave relationship is negotiated in state Exstart.
Loading (Step 5 in Figure 3-17)—Link-state requests are sent to neighbors asking for recent advertisements that have not yet been discovered. At this stage, the router builds several tables (see Chapter 2) to ensure that all links are up to date and have been acknowledged properly in the LSAs. Figure 3-19 shows the fields and information contained within the link-state request packet format.
120 Chapter 3: OSPF Communication
Figure 3-19 Link-State Request Packet Format
|
Version # |
3 |
Packet Length |
|
|
Router ID |
|||
|
Area ID |
|||
|
Checksum |
AuType |
||
|
Authentication |
|||
|
Authentication |
|||
|
LS Type |
|||
|
Link State ID |
|||
|
Advertising Router |
|||
• Full (Step 6 in Figure 3-17)—After OSPF routers achieve this state, they are adjacent. OSPF routers are now fully adjacent because their link-state databases are fully synchronized. Full is the normal state for DR and BDR or point-to-point links, but 2-Way is normal for non-DR or non-BDR routers.
NOTE When a router is stuck in another state, this is 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. If a router does not receive a Hello packet from a neighbor within the RouterDeadInterval time (RouterDeadInterval = 4 * HelloInterval by default), the neighbor state changes from Full to Down.
During the beginning of the link-state database synchronization process, normal LSAs are not sent. Instead, the routers exchange DD packets; these are Type 2 packets that are used when an adjacency is being initialized and the two routers in question are exchanging and synchronizing their link-state databases. These DD packets contain the contents of the linkstate database. Figure 3-20 shows the fields and information contained within each DD packet. The router first sends DDs and based on what it discovers, a router will send linkstate requests. The receiving router will respond with LSAs, to which the first router sends link state acknowledgments.
Figure 3-20 Database Descriptor Packet Format
0 12 3
0 1234567890 1234567890 1234567890 1
Version #
Packet Length
Router ID
Area ID
Checksum
AuType
Authentication
Authentication
Options
DD Sequence Number
LSA Header
Multiple packets might be needed to complete the synchronization. In that case, a poll-response procedure is used, with one router becoming the master and the other the slave, as previously discussed.
Continue reading here: Types of OSPF Packets
Was this article helpful?