summaryrefslogtreecommitdiff
path: root/isisd/isis_spf.h
AgeCommit message (Collapse)Author
2024-06-21isisd: add json support to display spf paths in 'show isis route'Philippe Guibert
The 'show isis route json' command never displays the list of paths. Add the json support for this sub-part. > # show isis route json > [..] > "ipv6-paths":[ > { > "Vertex":"rt1", > "Type":"", > "Metric":0, > "Next-Hop":"", > "Interface":"", > "Parent":"" > }, > { > "Vertex":"2001:db8:1000::1\/128", > "Type":"IP6 internal", > "Metric":0, > "Next-Hop":"", > "Interface":"", > "Parent":"rt1(4)" > }, Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-18isisd: add option to display isis routes as jsonEric Kinzie
Append an optional parameter to "show isis route [prefix-sid]" that formats the output as a JSON array. Signed-off-by: Eric Kinzie <ekinzie@labn.net> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18isisd: merge algorithm tablesHiroki Shirokura
Create a temporary "merge" route table that contains the routing information from all algorithms and install the merge route table into the FIB. Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-17isisd: update struct isis_spftree with algorithm idHiroki Shirokura
The spftree has a new property called algorithm which is id used to identify the algorithm that separates it in the same IGP network. This is used in Flex-Algo. In other cases than Flex-Algo, the algorithm id is always zero. Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-24isisd: apply fast-reroute on an adjacency failureLouis Scalbert
When a adjacency falls down, the primary routes are not deleted on the dataplane until the SPF is recomputed. Even the backup routes are pre-installed on the dataplane, there is no fast-route optimization. Reasons for an adjacency to come down are: - BFD down - Hello timer timeout - User adjacency clear Apply the backup route switchover for fast-reroute as soon an IS-IS adjacency falls down before the first SPF re-computation. Pre-computed backup routes are applied sooner. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-07-10Revert "isisd: apply fast-reroute on an adjacency failure"Donatas Abraitis
This reverts commit 71252973234e70ffa3cb5eec43d4efc1be3d3331.
2022-05-23isisd: apply fast-reroute on an adjacency failureLouis Scalbert
When a adjacency falls down, the primary routes are not deleted on the dataplane until the SPF is recomputed. Even the backup routes are pre-installed on the dataplane, there is no fast-route optimization. Reasons for an adjacency to come down are: - BFD down - Hello timer timeout - User adjacency clear Apply the backup route switchover for fast-reroute as soon an IS-IS adjacency falls down before the first SPF re-computation. Pre-computed backup routes are applied sooner. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-02-25isisd. Add json to show summary command.Javier Garcia
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2021-01-08isisd: implement Remote LFARenato Westphal
Remote LFA (RFC 7490) is an extension to the base LFA mechanism that uses dynamically determined tunnels to extend the IP-FRR protection coverage. RLFA is similar to TI-LFA in that it computes a post-convergence SPT (with the protected interface pruned from the network topology) and the P/Q spaces based on that SPT. There are a few differences however: * RLFAs can push at most one label, so the P/Q spaces need to intersect otherwise the destination can't be protected (the protection coverage is topology dependent). * isisd needs to interface with ldpd to obtain the labels it needs to create a tunnel to the PQ node. That interaction needs to be done asynchronously to prevent blocking the daemon for too long. With TI-LFA all required labels are already available in the LSPDB. RLFA and TI-LFA have more similarities than differences though, and thanks to that both features share a lot of code. Limitations: * Only RLFA link protection is implemented. The algorithm used to find node-protecting RLFAs (RFC 8102) is too CPU intensive and doesn't always work. Most vendors implement RLFA link protection only. * RFC 7490 says it should be a local matter whether the repair path selection policy favors LFA repairs over RLFA repairs. It might be desirable, for instance, to prefer RLFAs that satisfy the downstream condition over LFAs that don't. In this implementation, however, RLFAs are only computed for destinations that can't be protected by local LFAs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-24isisd: add support for classic LFA (RFC 5286)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-24isisd: store LSPs associated to all SPF adjacenciesRenato Westphal
Instead of storing the LSP associated to pseudonodes only, store the LSP associated to all SPF adjacencies instead. The upcoming LFA work will need to have that piece of information for all SPF adjacencies in order to know which ones have the overload bit set or not. Other use cases might arise in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-14isisd: On shutdown leaking spf_timer thread dataDonald Sharp
When isis is being shutdown the area->spf_timer thread has special data assigned to that was never being freed. Free this data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04isisd: detect Prefix-SID collisions and handle them appropriatelyRenato Westphal
isisd relies on its YANG module to prevent the same SID index from being configured multiple times for different prefixes. It's possible, however, to have different routers assigning the same SID index for different prefixes. When that happens, we say we have a Prefix-SID collision, which is ultimately a misconfiguration issue. The problem with Prefix-SID collisions is that the Prefix-SID that is processed later overwrites the previous ones. Then, once the Prefix-SID collision is fixed in the configuration, the overwritten Prefix-SID isn't reinstalled since it's already marked as installed and it didn't change. To prevent such inconsistency from happening, add a safeguard in the SPF code to detect Prefix-SID collisions and handle them appropriately (i.e. log a warning + ignore the Prefix-SID Sub-TLV since it's already in use by another prefix). That way, once the configuration is fixed, no Prefix-SID label entry will be missing in the LFIB. Reported-by: Emanuele Di Pascale <emanuele@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23isisd: refactor handling of SR Prefix-SIDsRenato Westphal
Embed Prefix-SID information inside SPF data structures so that Prefix-SIDs can be installed together with their associated routes at the end of the SPF algorithm. This is different from the current implementation where Prefix-SIDs are parsed and processed separately, which is vastly suboptimal. Advantages of the new code: * No need to parse the LSPDB an additional time to detect and process SR-related changes; * Routes are installed with their Prefix-SID labels in the same ZAPI message. This can prevent packet dropping for a few milliseconds after each SPF run if there are BGP-labeled routes (e.g. L3VPN) that recurse on IGP labeled routes; * Much easier to support Anycast-SIDs, as the SPF code will naturally figure out the best nexthops and use only them (that can't be done in any reasonable way if the Prefix-SID Sub-TVLs are processed separately); * Less code to maintain and reduced memory footprint; The "show isis segment-routing prefix-sids" command was removed as it doesn't make sense anymore now that "show isis route" exists. Prefix-SIDs are a property of routes, so what was done was to extend the "show isis route" command with a new "prefix-sid" option that changes the output table to show the Prefix-SID information associated to each route. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-14isisd: add support for Topology Independent LFA (TI-LFA)Renato Westphal
TI-LFA is a modern fast-reroute (FRR) solution that leverages Segment Routing to pre-compute backup nexthops for all destinations in the network, helping to reduce traffic restoration times whenever a failure occurs. The backup nexthops are expected to be installed in the FIB so that they can be activated as soon as a failure is detected, making sub-50ms recovery possible (assuming an hierarchical FIB). TI-LFA is a huge step forward compared to prior IP-FRR solutions, like classic LFA and Remote LFA, as it guarantees 100% coverage for all destinations. This is possible thanks to the source routing capabilities of SR, which allows the backup nexthops to steer traffic around the failures (using as many SIDs as necessary). In addition to that, the repair paths always follow the post-convergence SPF tree, which prevents transient congestions and suboptimal routing from happening. Deploying TI-LFA is very simple as it only requires a single configuration command for each interface that needs to be protected (both link protection and node protection are available). In addition to IPv4 and IPv6 routes, SR Prefix-SIDs and Adj-SIDs are also protected by the backup nexthops computed by the TI-LFA algorithms. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26isisd: add abiliy to compute the reverse shortest path treeRenato Westphal
RFC 7490 says: "The reverse SPF computes the cost from each remote node to root. This is achieved by running the normal SPF algorithm but using the link cost in the direction from the next hop back towards root in place of the link cost in the direction away from root towards the next hop". Support for reverse SPF will be necessary later as it's one of the algorithms used to compute R-LFA/TI-LFA repair paths. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26tests, isisd: add IS-IS SPF unit testsRenato Westphal
Now that the IS-IS SPF code is more modular, write some unit tests for it. This commit includes a new test program called "test_isis_spf" which can load any test topology (there are 13 different ones available) and run SPF on any desired node. In the future this same test program and topologies will also be used to test reverse SPF and TI-LFA. The "test_common.c" file contains helper functions used to parse the topology descriptions from "test_topologies.c" into LSP databases that can be used as an input to the SPF code. This commit also introduces the F_ISIS_UNIT_TEST flag which is used to prevent the IS-IS code from scheduling any event when running under the context of an unit test. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26isisd: make the SPF code more modularRenato Westphal
The goal of modularizing the SPF code is to make it possible for isisd to run SPF in the behalf of other nodes in the network, which is going to be necessary later when implementing the R-LFA/TI-LFA solutions. On top of that, a modularized SPF opens the door for much needed unit testing. Summary of the changes: * Change the isis_spf_preload_tent() function to use the local LSP as an input (as per the ISO specification) instead of populating the TENT based on the list of local interfaces; * Introduce the "isis_spf_adj" structure to represent an SPF adjacency. SPF adjacencies are inferred from the LSPDB, different from normal adjacencies formed using IIH messages; * Introduce the F_SPFTREE_NO_ROUTES flag to control whether the SPT should create routes or not; * Introduce the F_SPFTREE_NO_ADJACENCIES flag to specify whether IS-IS adjacency information is available or not. When running SPF in the behalf of other nodes, or under the context of an unit test, no adjacency information will be present. * On isis_area_create(), move some code around so that the area's isis backpointer is set as early as possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26isisd: reuse adjacency state change hook in the SPF codeRenato Westphal
This is mostly a cosmetic change to make the code more modular, more elegant and easier to understand. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-24isisd: Log SPF trigger source when debuggingChristian Franke
For debugging the scheduling of SPF, it is useful to see from where an SPF run is scheduled. So add this information to the log. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: add flooding algorithm debuggingChristian Franke
Add a command `debug openfabric flooding` to allow verification of correct operation of the OpenFabric flooding optimization algorithm. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: run a hop-by-hop spfChristian Franke
OpenFabric uses an spf with the metric for all links set to one, both for flooding optimization and for fabric locality detection. So extend isisd's spf code to allow running it with such a metric and have it run whenever normal spf runs. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-03isisd: move route_table into spftreeChristian Franke
As isisd's route_tables are directly related to spf trees, move the route tables into the spftree instead of maintaining them alongside of the spftrees. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03isisd: make isis_spftree non-publicChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-28isisd: make spf MT awareChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-04-28isisd: do some cleanup on the spf implementationChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-02-22isisd: cleanup SPF schedulingStephane Litkowski
- SPF is now per level only (no more per family) - t_spf and pending removed from struct spftree and moved to spf_timer field in struct isis_area - show isis summary output changed to accomodate the per level SPF - isis_spf_schedule6 and isis_run_spf6_lx functions are removed, isis_run_spf_lx now calls isis_run_spf for both INET and INET6 - lsp related functions now call isis_spf_schedule only
2017-01-13frr: Remove HAVE_IPV6 from code baseDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2012-04-07isisd: couple of bug fixesSubbaiah Venkata
2012-04-07isisd: add Google's changes to IS-ISJosh Bailey
2005-09-26 * isis_spf.[ch]: Added TE TLVs to the SPF process. It seems to workhasso
mostly, but needs certainly much more testing, especially transition situation.
2004-09-19Rework of SPF threads schedule logic. I'm not 100% sure whether it's righthasso
thing to do to have completely separate threads for IPv4 and IPv6 SPF though. But it works and it's now possible to have both IPv4 and IPv6 enabled in interface. One bug fixed in LSP regeneration scheduling as well.
2004-09-10Indentation only. No any functional changes.hasso
2003-12-23Initial revisionjardin