01-01-2018 10:05 AM - edited 03-05-2019 09:42 AM
Hello,
I have a question regarding what does and what does not trigger an SPF calculation.
I have the topology attached in the picture below. All routers have OSPF enabled on all interfaces. All areas have default status. Routers R1,R3 are internal routers of area 0. Router R4 is an internal router of area 1. Router R2 is an ABR, with interfaces Fa0/0 and Fa0/1 belonging to area 0 and Fa1/0 belonging to area 1.
My question is the following.
Should a flap on interface Fa1/0 of R2 (simulated by a shut/no shut) trigger an SPF calculation in area 0 ?
From my understanding, the answer should be no. The SPF algorithm is run per area. R2 being an ABR keeps 2 separated databases, one for area 1 and one for area 0.
However, checking the number of SPF calculations and both R1 and R3 and analyzing debug ouput, it seems that shut / no shut on Fa1/0 of R2 triggers SPF calculations on both of them.
What is the rule here ? A flap on ABR leads to SPF calculations in all the areas to which the ABR belongs to ? From the debug output on R1, I see the SPF calculation is triggered by a change to the type 1 LSAs. I thought ABRs kept a different type 1 LSA for each area to which they belong ?
The devices are all Cisco 3745 routers running IOS 12.2 done using GNS3.
Solved! Go to Solution.
01-01-2018 11:13 AM
Hello,
Oh, right, I guess now I know what's happening :)
If you shut down f1/0 on R2, R2 stops being an ABR because it no longer has active interfaces in multiple areas. Each router advertises whether it is an ABR in its own LSA1 in the Options field using the 'B' bit. If you shut down f1/0 on R2, it stops being an ABR, and needs to both flush all LSA3 it has originated, and flood an updated LSA1 in which the 'B' bit is cleared. When you bring up f1/0 on R2 again, it becomes an ABR again, and needs to flood again an updated LSA1 with the 'B' bit set.
That would explain why you see the SPF being executed in Area 0, and the reason for the SPF being an updated LSA1 from R2.
It should be noted that there is a certain freedom in what to understand under "SPF". In a very literal sense, SPF involves recomputing the topology, so any change to LSA1 or LSA2 in the given area causes an SPF run. The calculation performed as a result of an updated LSA3, LSA4, or LSA5 is not SPF in the strict sense, but some resources use "SPF" in a (slightly imprecise) way as "any part of OSPF best path selection algorithm", even if it does not involve recomputing the whole topology.
Once again, feel welcome to ask further!
Best regards,
Peter
01-01-2018 10:29 AM
Hello,
Very good thinking!
It is true that because of an interface flap in Area 1, the topology in the Area 0 does not change, so it would seem that Area 0 does not need to reflect in any way.
However, R2 is responsible for advertising every network reachable in Area 1 using LSA3 into Area 0. If you flap f1/0 on R2, the network on R2 becomes unreachable and comes back again. Both these events cause R2 to advertise a new LSA3 for this network into Area 0. Consequently, Area 0 routers have to run their SPF to process the new LSA3 and update their routing tables.
You are very correct that as far as Area 0 is concerned, nothing inside Area 0 has changed. What has changed is a leaf node behind R2 where the topology is no longer visible. Therefore, OSPF can invoke a limited recomputation which is known in IS-IS as Partial Route Calculation (PRC) in which the entire topology does not need to be recalculated, only the placement of the leaf nodes is reexamined. This is not really mandated by the RFC 2328 where OSPF is standardized - it depends on the sophistication of the particular implementation of OSPF whether it can make use of the PRC.
The bottom line is: True, Area 0 has not changed, but an information about a network in a different area has changed, and therefore Area 0 still has to update its routing tables through SPF.
Feel welcome to ask further!
Best regards,
Peter
01-01-2018 10:55 AM - edited 01-01-2018 10:58 AM
I'm still puzzled. Quoting the CCNP OCG, page 337, Ch 8, The OSPF Link-State Database
To take the analysis a little deeper, remember that an internal router, when finding the
best interarea route for a subnet, uses the intra-area topology to calculate the cost to
reach the ABR. When each route is identified, the internal router adds the intra-area cost
to the ABR, plus the corresponding Type 3 LSA’s cost. A change to the Type 3 LSA—it
fails, comes back up, or the metric changes—does impact the choice of best route, so the
changed Type 3 LSA must be flooded. However, no matter the change, the change does
not affect the topology between a router and the ABR—and SPF focuses on processing
that topology data. So, only changes to Type 1 and 2 LSAs require an SPF calculation.
And for the record, if I shut / no shut an interface on R4 (internal to Area 1, not show in topology), this does not trigger an SPF calculation in Area 0, even though the Area database gets changed (adding and removing the type 3 LSA).
01-01-2018 11:13 AM
Hello,
Oh, right, I guess now I know what's happening :)
If you shut down f1/0 on R2, R2 stops being an ABR because it no longer has active interfaces in multiple areas. Each router advertises whether it is an ABR in its own LSA1 in the Options field using the 'B' bit. If you shut down f1/0 on R2, it stops being an ABR, and needs to both flush all LSA3 it has originated, and flood an updated LSA1 in which the 'B' bit is cleared. When you bring up f1/0 on R2 again, it becomes an ABR again, and needs to flood again an updated LSA1 with the 'B' bit set.
That would explain why you see the SPF being executed in Area 0, and the reason for the SPF being an updated LSA1 from R2.
It should be noted that there is a certain freedom in what to understand under "SPF". In a very literal sense, SPF involves recomputing the topology, so any change to LSA1 or LSA2 in the given area causes an SPF run. The calculation performed as a result of an updated LSA3, LSA4, or LSA5 is not SPF in the strict sense, but some resources use "SPF" in a (slightly imprecise) way as "any part of OSPF best path selection algorithm", even if it does not involve recomputing the whole topology.
Once again, feel welcome to ask further!
Best regards,
Peter
01-03-2018 07:55 AM
01-27-2019 12:45 PM
Confirmed with packet capture, the reason for the SPF calculation is an updated type 1 LSA with the B bit set to 0. That was the trigger for the SPF calculation.
Late reply, I know :)
01-02-2018 04:57 AM
01-02-2018 11:12 AM
Hi Joe,
Indeed, the support for incremental SPF, or iSPF, has been with IOS for quite some time. I would, however, draw a difference betwee iSPF and PRC. iSPF is still an SPF run, that is, the Dijkstra algorithm run over the link-state database; however, it is started and run only for a subset of all nodes and links. PRC, on the other hand, involves only operations on leaf nodes, not really running Dijkstra at all.
Best regards,
Peter
01-02-2018 12:41 PM
01-02-2018 02:30 PM
Joe,
As of matter of fact, lately I started supporting customers running some quite ancient versions of operating systems :)
The ispf command has been around since 12.0(24)S:
But yes, it generally isn't available in pre-12.3T releases.
Best regards,
Peter
01-03-2018 06:09 AM
01-03-2018 06:54 AM
Hi Joe,
I defer to your life experience and expertise :)
Best regards,
Peter
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide