OSPF LSAs and LSDB flooding Tutorial

Hi Pradeep,

Without the MTU check, some strange things can happen.

OSPF hello packets are very small so interfaces with a small MTU don’t have any issues receiving it. This allows routers to form an OSPF neighbor adjacency.

Updates however, can be quite large. It’s possible that an OSPF router sends a packet that exceeds the MTU of the interface of the receiving router. The two routers will be neighbors but the update never makes it to the other end.

To prevent something like this from happening, it’s better to check the MTU of two OSPF neighbors.

Rene

Hi Rene,

You can see that the LSA has been updated 2 times since the sequence number is 0x80000002.

Don’t you mean that it has been updated only once since we start at 0x80000001 ?
Correct me if I am wrong !

Hi Houari,

The 1st time you enable OSPF process on the router, it will send LSA to neighbor routers and will be flooded to all other routers in the OSPF routing network to form the LSDB then each router will chose the best route and put it in its the routing table (check lesson Introduction to OSPF). Here is the 1st LSA sequence number 0x80000001 which you can consider is as an initial update.

Based on the example of this lesson, we’ve seen that the sequence number is 0x80000002 which means that it was updated for the 2nd time and that’s what Rene meant in the lesson.

I got your point of your question, and you are also right in case you consider that the update is only after the initial state.

The most important is to understand the main idea of the sequence number and I am confident that you have understood it well.

Hope I could answer you.

Maher H

Crystal clear, thanks :slight_smile:

Hi Sir,
I have a question to understand please clarify me.

In the flow chart,if the sequence no is higher, go to “step A”.

when “sequence no” become higher ( increment)?
Up to my understanding,
1.when there is a change in OSPF network.
2.By default, each OSPF LSA will send LSU for every 30 minutes.

after 30 mins time expire, even though there is no change in the network, DRother will send LSU with “sequence no” increment to DR and BDR.
with this, DR will consider there is a change in a network by seeing the “sequence no” increment in LSU sent by DRother. Now in DR,with respective to flow chart, it has to go to “step A”.( when sequence no is higher)
my question, why it needs to go " Step A" when there is no change in the network ?

Hello Azeem!

This is a very good question and indicates that you are thinking very deeply of the reasons behind specific functionalities of OSPF. Yes, it does make sense to assume that if there is no change to the network, then at the end of the sequence you describe, it should not need to go to Step A. However, it is important to realise the purpose of the sending of the LSA every 30 minutes in order to answer this question.

When LSAs are sent because of a topology change, the sequence number is incremented. This indicates that the LSA contains newer information than the router has recieved until now and this new information must be incorporated into the LSDB. This is the very purpose of the sequence numbers.

If there is no change in topology after 1800 seconds, or 30 minutes, that is, no LSAs with a newer sequence number have been sent or received, in order to confirm that all routers are up to date, it is important to send out a new LSA just to be sure that no errors have occured over this time period. The DR and BDR don’t know which, if any routers have outdated information. Therefore, in order to make sure that all routers incorporate the most recent information into their LSDBs, an incremented sequence number is used, forcing all routers to process the information as if it is new, even if they are already up to date. In this way, if even one router is not up to date, it will be updated, since all routers are forced to process the information.

This can be seen clearly in RFC 2328 which describes OSPF v2 (https://tools.ietf.org/html/rfc2328). The following text describes the process. Notice the text in bold:

    If the LS age field of one of the router's self-originated
    LSAs reaches the value LSRefreshTime, <strong>a new instance of the LSA
    is originated, even though the contents of the LSA (apart from
    the LSA header) will be the same.</strong>  The value of LSRefreshTime is
    set to 30 minutes.

When it says a new instance of the LSA, this indicates that the sequence number will be incremented, thus requiring all routers to process the information as new information.

I hope this has been helpful!

Laz

1 Like

Thanks. Good explanation.

I got two more questions:

1.In the flow chart, " Is sequence no same" if yes ignore LSA. when will this scenario happen ?

  1. In the flow chart, " Is sequence no higher" if “No” send LSU with newer information to the source. when will this scenario happen ?

Can you please clarify me.

Hello Azeem.

Again, excellent question. Remember first that OSPF will send an LSA with an INCREMENTED sequence number under the following circumstances:

  1. when a topology change has been made
  2. when the LSA timer of 30 minutes (by default) has expired.

There are cases however, where the sequence number received will be the same (or even older) than the current sequence number of a particular router. Such a situation may occur under the following circumstances:

  1. when an OSPF router sends a Link State Request (LSR) packet to another router, the information that is sent may have the same or lower sequence number
  2. if during the process of convergence, several LSAs are recieved from various routers with the same or lower sequence numbers, they are discarded, and senders are informed of newer information

I hope this has been helpful.

Laz

19 posts were merged into an existing topic: OSPF LSAs and LSDB flooding Tutorial

19 posts were merged into an existing topic: OSPF LSAs and LSDB flooding Tutorial

Dear Rene,
Pls pls pls help me…
I have a question “How ospf avoid control plane loop within an area?”. Need your help badly. Thx

br//
zamam

Hi Zaman,

Within an area, all OSPF routers have a synchronized LSDB so they all have the exact same view of the topology of the area. Each router individually runs SPF but since they all agree on what the topology looks like, you won’t have any loops.

Rene

Hi Rene,

Can I modify the reflooding time or the max age timer of LSAs or they are fixed and not configurable ??

Hello Hussein

From my research I was unable to find any command that changes these timers in any Cisco command references. It seems that they are fixed and defined by RFC 2328 on page 216. They are set to LSRefreshTime = 30 minutes and MaxAge = 60 minutes.

I hope this has been helpful!

Laz

1 Like

Hello Rene,

Hope you are doing good,
After seeing the show ip ospf database , we conclude this like if we see one prefix or subnet continuously changing the sequence number, can we say that there is issue with the prefix in this way we can filter our troubleshooting boundary.

//BR
Waqar

Hello Mohammad

If we see one prefix in the database that is continuously changing the sequence number, then this means that for some reason, a route is flapping on the network. This is usually due to a routing loop that may occur not within an area, but via multipoint redistribution, that is, when a route is redistributed into another AS and then it is re-redistributed back into the original AS from another redistribution point. Solutions to such problems include route tagging which is explained further in this lesson:


I hope this has been helpful!

Laz

Hi laz,

Great explanation.
Thanks

//BR
Waqar

1 Like

Hello NetworkLessons team

In which case could a router receive a LSA with a sequence number that already has in its database (and finally ignore it)? From what I understand if a router has 2 neighbours that have learned about a LSA (the 2 neighbours), then they will first send a database description packet to the router,who will send a LSR if it does not have the LSA in its databases. So even if the 2 neighbors have the LSA, then the router will see that it has learned it from the one router and will not send LSR to the other router? So, isn’t it correct that the router does not flood the LSAs, but floods the LSAs to neighbors that do not have already the LSA to their database? Thank you

Regards
Markos

Hi Markos,

OSPF uses “reliable” flooding which means that when you send an LSA, you expect an ACK in return. If you don’t receive an ACK, we retransmit the LSA. Retransmissions is how you get duplicate LSAs.

If you want some examples, I found a good paper where they describe different scenarios where duplicate LSAs occur. (Look for “Causes of Duplicate-LSA Traffic”)

Rene

Hi Rene,
You mentioned:

“What do the sequence numbers look like for OSPF LSAs?
There are 4 bytes or 32-bits.
Begins with 0x80000001 and ends at 0x7FFFFFFF.”

Why does sequence number ends at a 31 bit number 0x7FFFFFFF not 32 bit number at 0xFFFFFFFF?

Thanks,
Naresh