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

Hello Naresh

If you put these numbers into a Hex to Decimal converter, you’ll see that you end up with
0x80000001 = 2147483649
0x7FFFFFFF = 2147483647

This looks strange. Actually, it looks completely incorrect!! The reason these numbers are used is because the LSA sequence numbers are signed. That is, they include a negative or positive sign which is indicated by the very first of the 32 bits. The LSA sequence numbers will start with 0x80000001 which is compared to binary below:

Hex       0x8  0    0    0    0    0    0    1
Binary    1000 0000 0000 0000 0000 0000 0000 0001

Note the 1 in the leftmost position. This indicates a negative sign, and that digit is not used to denote the number. So 0x80000001 is equal to -1 in decimal. Now as the numbers increment, they actually decrement. What I mean is you start with -1, then -2, -3 etc until you get to -2147483648. Then it goes to 0 and then the numbers increment up to +2147483648 which is 0x7FFFFFFF. Here is this number compared to its binary representation as well:

Hex       0x7  F    F    F    F    F    F    F
Binary    0111 1111 1111 1111 1111 1111 1111 1111

Note the 0 on the left most bit. This indicates a positive ‘+’ number. Once this number is reached, then it goes back to -1 or 0x80000001 and the process continues.

Now all of this is really academic, because increments occur every 30 minutes in a stable network. Never in all the history of networking have these increments wrapped around to the initial sequence number because it will take over 600 years to do so, and OSPF has been around only several decades. :stuck_out_tongue:

I hope this has been helpful!

Laz

1 Like

What happen if OSPF neighbors do not get LSA after 30 Minutes?

Hello Kunal

OSPF has various constants. One of these is the LSRefreshTime which is 30 minutes. A neighbor will send out a new LSA every 30 minutes if there is no change in the network topology. Now this is a timer that a router will use to retransmit LSAs. There is another timer called MaxAge which is set to 1 hour. If an LSA is in the database and no new refreshes of this same LSA have come in for an hour, then the LSA is no longer used in the routing table calculation, and is essentially disregarded. More about this mechanism can be found in the RFC 2328 of OSPF here.

So to answer your question, after 30 minutes if an LSA is not received, nothing happens. OSPF routers continue to function until the 1 hour mark is hit, at which time, the LSA is flushed from the link state database and is no longer used for routing calculations.

I hope this has been helpful!

Laz

1 Like

Hi together,

I know that under normal circumstances this shouldn’t happen but what exactly happens when a LSA goes back to 0x80000001.

If I understand that correct the neighbor holding the “old” information has a higher sequence number so it will inform the originating router that has the “newer” information that his “old” information is “new”.
How is this handled in OSPF.
Is there any description within the RFC ?

Best regards,
Marcel

Hello @marcel.hofheinz,

You can go through this
–> https://tools.ietf.org/html/rfc2328

1 Like

Hello Marcel

If this occurs, then OSPF will consider the new information as older than the old information. In other words, it will look at the 0x80000001 value and consider it old and will not replace the current information. As you said, there is no way that this can take place. An OSPF topology would have to be functioning for over 600 years in order for this to happen. Take a look at the following post for more information.

I hope this has been helpful!

Laz

1 Like

Hi Rene,

When the LSA will be incremented with 1 after 30 minutes and there is no change at that point who router will know about it and is router will have to go with step A? what the router will do in this situation, can you please help to clear this?

Hello Navraj

If an OSPF router has an LSA, and since then 30 minutes have elapsed without any newer LSAs being exchanged, then this router will resend its current LSA with an incremented sequence number. This new incremented LSA will be sent to all OSPF neighbors. Specifically, if we use the flow chart in the lesson, it will go like this:

  1. 30 minutes elapsed, new LSA
  2. Entry in LSDB? Yes
  3. Sequence Number different? Yes
  4. Sequence Number higher? Yes
  5. Send LSU with newer information to source

Note here that the information is the same, but it is considered newer because the sequence number is newer.

I hope this has been helpful!

Laz

Hi, Laz.

Does this mean that each router will do recalculation every 30 minutes?

John

Hello John

If the router has not detected any changes to the topology, either on its own interfaces or from notifications coming from other routers, then no recalculation is done. The currently valid LSA is sent with an increased sequence number. The receiving router will look at this, see the increased sequence number, and will compare it to the information it already has. If nothing has changed, recalculation of the SPF algorithm does not take place.

The SPF algorithm will only be rerun if a change has been detected.

I hope this has been helpful!

Laz