OSPF LSAs and LSDB flooding Tutorial

Hello Sir,

I’m kind of comparing routing protocols in Layman terms.
By default,
RIP sends updates every 30 seconds
EIGRP sends updates only where there is change in network
OSPF sends updates every 30 minutes.
Is that right?
I understand there are various factors when router sends updates but just for something quickly to memorize, are these information correct that I’m perceiving as?
Thanks in advance.

 

Hi Navin,

It’s a bit more complicated then this.

  • RIP updates are sent every 30 seconds but version 2 also has triggered updates, these are sent when a network is down.
  • When two EIGRP routers become neighbors, they exchange all routing information. From then on, they only exchange routing information when there are updates.
  • OSPF routers also become neighbors first and then LSAs are flooded, each router builds the LSDB. The LSAs are reflooded (refreshed) every 30 minutes. Whenever there's an update, a LSA is created.
Rene
1 Like

Hi Rene,

Just double confirm with you, LSA age timer is 30 minutes by default. And every 30 minutes the router will flood the LSA no matter there’s new update or not.

When every new route advertised/ new network connected should be involve the new LSA update to the neighbour, but why we still need the LSA age and resend every 30 minutes?

The LSA flood every 30 minutes for all LSA or certain LSA only?

Davis

Hi Davis,

That is correct. According to RFC 2328 we do this because “This guarantees periodic originations of all LSAs. This periodic updating of LSAs adds robustness to the link state algorithm.”

This makes sense, otherwise a LSA could stay in the LSDB forever even though the originating router isn’t around anymore.

There are LSAs that are not refreshed when the DNA (Do Not Age) bit has been set. This was originally created for “on demand circuits”. These are links that are active when used, like analog phone or ISDN lines where you are billed for usage. LSAs learned through a virtual link also have the DNA bit set. You can read more about this in RFC1793.

Hope this helps!

Rene

Hi Rene,

Get it. I try to shutdown the ABR which will advertised the LSA 3 to the neighbor, then the neighbor still have a valid LSA in the database although the route no longer in the RIB.

So it will auto flood after 30 minutes and and then the not valid LSA will be remove i think.

Thanks for you explanation

Davis

Hi Davis,

When a router goes down, the OSPF neighbor adjacency will be torn down so the other router will know to delete LSAs that were learned through this neighbor. Also when an interface goes down, the router will send an update to inform other routers that this network is down. Updates are also acknowledged.

The periodic reflooding can be useful in scenarios where for whatever reason the update/ack don’t make it…perhaps due to the router CPU that is at 100% and not able to keep up, maybe interfaces that are congested etc. In that case, you want routers to remove “old” LSAs that haven’t been updated for a long while. Otherwise they could be stuck in the LSDB forever.

Rene

Hi Rene,

Ok. Thanks :slight_smile:

Davis

Hi Rene,

The LSAs are sent from the source IP address to the multicast IP reserved for OSPF.
So if Router 1 gets a LSA, and adds it to the LSDB and sends this update to other routers in the area as well, does it change the source IP address or keeps the IP address same as the one from where Router 1 first received this LSA ?

Mansi,
One thing to keep in mind is that the LSA packet has fields that keep track of the originating router, but how these are used can change based on what LSA Type is being used, and what type of Area they are coming from. Let’s just imagine a simple case of multiple routers on a LAN (so a OSPF broadcast type network) that are all in Area 0. In this case, a single router, say R4, for the broadcast segment will be chosen to be the OSPF DR.

Now, let’s say that R1 wants to send out an updated LSA. The LSA that is sent will have the Link-State ID set to be the R1’s router ID. The IP source of the packet will be R1’s IP address on the LAN segment, and the destination address will be 224.0.0.6, which is the multicast address used by DRs and BDRs. Note that any router that isn’t a DR or BDR will not have received this LSA, because they are not listening to 224.0.0.6.

Upon receiving the LSA, the DR, will send this information back out, but will change the Link-State ID to be its own IP address. This LSA will have a source IP of the DR on the segment (so the Source IP and the Link-State ID will be the same), with a destination address of 224.0.0.5. Since every OSPF router in the network segment is listening to 224.0.0.5, they will all get the information.

1 Like

Hi Rene,

Why do we need MTU in OSPF.why it was required in OSPF?

Regards

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.

1 Like

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