The Database Description (DD) packet is described is RFC 2328 Section A.3.3. The packet immediately follows the 24byte header and is shown below:

Each of the fields is described below:
Interface MTU: This is the layer 3 IP MTU. Note the MTU is set to zero over a Virtual Link, also the MTU is only communicated in the DD packet.
Options:
I-bit - The Init bit. When set to 1, this packet is the first in the sequence of Database Description Packets. M-bit - The More bit. When set to 1, it indicates that more Database Description Packets are to follow. MS-bit - The Master/Slave bit. When set to 1, it indicates that the router is the master during the Database Exchange process. Otherwise, the router is the slave.
DD sequence number: Used to sequence the collection of Database Description Packets. The initial value (indicated by the Init bit being set) should be unique. The DD sequence number then increments until the complete database description has been sent.
In terms of the Cisco Neighbour establishment, the DD packets reflect the ExStart and Exchange steps. At the ExStart stage the two OSPF neighbours first establish a Master/ Slave relationship. The master is allowed to send DD packets and also set and increment the sequence numbers assigned to the DD packets. The Slave is only allowed to send DD packets in response to the Master, and must use the same sequence number in response.

To determine which router has which role, the two routers first exchange empty DD packets with random sequence numbers. They then compare their Router IDs (from the OSPF header). The router with the highest Router ID becomes the Master and its sequence number is subsequently used.
The routers then move to the Exchange phase. At this step the two routers exchange an index list of all the LSAs they know about. If the index lists do not match, the Master router will send the LSAs the Slave is missing, and the Slave will response, sending its LSAs. This process is started by setting the init (I) flag to 1 (which in subsequent packets is cleared). Each time the Master sends a DD packet, the sequence number is incremented. The same sequence number is then used by the Slave. It may be the case that not all the LSA Headers will fit into a single packet. In this case the (M) more flag is set to 1 to indicate there are further packets needed.
Eventually when the Master and Slave have both sent all their LSA headers they both set the M flag to 1, indicating the process is completed.

One thought on “OSPF Database Description Packets”