OSPF DBD Packet
Topics This Part
Always we have adjacency between point-to-point networks or point-to-multipoint networks if they match in their Hello packetds. But in other network types same as Broadcast and NBMA they choose DR and BDR for the establishment of adjacency with their neighbors.
One of the reasons that we choose DR is that we want to limit the flooding of unnecessary LSAs between our routers in the multiaccess network. If you want to know that how many adjacencies you have in your networks without using Dr, you can use this formula : N(N-1)/2 (N is the number of your routers on a multiaccess network.) Each router floods n-1 LSAs for an adjacency with their neighbors.
Database Description Packets are an important section in establish adjacency-building.
This packet carries a little information about LSAs, it's not complete information but it’s enough for neighbors to understand that they have the latest copy of LSAs or not.
Let's go and see the DBD packets in Wireshark. (I’m in love with Wireshark. it's amazing tools)
I used basic topology.
The function of the Hello packet was to discover the neighbors and establish adjacency with them. when they find a neighbor, they start to send the Type-2 DBD packet. You can see it in the Wireshark.
Let’s open packet 15, the first DBD packet sent from R1 to R2.
The Message Type in the OSPF header is DB Description Type 2.
In the OSPF DB Description, you can see the first line which is interface MTU . One of the parameters that must be matched for adjacency is MTU, if the neighbors have different MTU they cannot establish adjacency together.
The options field is the same as the Hello packet.
The next field is DB Description bits that include: R-bit, I-bit, M-bit, and MS-bit
R-bit: is uses for Out-of-Band resynchronization in OSPF and is supported by Cisco routers.
I-bit: is an initial bit, which means this is the first DD packet sent by the router. After this packet, the other DD packets have an I-bit value of 0. Look at the I-bit in the first DBD packet sent by R1.
In this packet, the value for I-bits is 1, but the value for the next DD packets from R1 to R2 is 0 and Not Set.
M-bit: is another Flag in the DBD packet which known as More bit, when this value is 1, it means it isn’t the last packet of DB Description, but when it has the value 0 means this is the last packet of DBD.
But before that I want to show you the M-bits in Wireshark, let’s go and continue for other flags in DBD packets then we will see the M-bits value will be changed in the process of building adjacency.
MS-bit: is the latest bit in the DBD packet, (MS) M means Master and S means Slave. In this part, they start to select Master between routers.
At the first , all of the routers think they are Master and when they send their DBD packets to other neighbors, they say: "hey my friend, you know I’m Master" and put a special sequence number with this packet to their neighbors.
Now let’s check step by step with the Wireshark that what happens with DBD packets.
In both of the routers R1 and R2, they think they are Master and their I-bit, M-bit, and MS-bit of them is 1 and they send their sequence number.
R1 to R2
R2 to R1
But after they sent their DBD Packets to each other, R1 recognized that R2 is Master because it has a higher Router-ID and unfortunately it said to R2 “okay I’m not Master”, then in the next DD packets, it changes the value of Master to 0, and the most important section is that it uses the sequence number of R2 (7827) instead of itself. this is the same as the LSA ack sent by R1 to R3. LSAck does not use DBD packets, but DBD packets have ack in themself with the change of the sequence number
R1 to R2
When they choose Master, we are in the state of ExStart in the OSPF process.
The next step is they sync their LSAs headers together. R2 sends another DD packet to R1 with LSAs headers. R2 increment sequence number to 7828. Don’t forget that the only Master router can increment the sequence number for DBD packets.
Then R1 sends another DBD packet to R2 that it receives, with sequence 7828 and because it has not any LSAs header, the M-bit has 0 value .
If you want to see all of these steps in the router, you can use command
#debug IP OSPF adjacency
The next packet is the LS Request packet that sends by R1, we can continue in OSPF LSR Packet.