summaryrefslogtreecommitdiff
path: root/isisd/fabricd.c
AgeCommit message (Collapse)Author
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-04-11Merge pull request #12698 from Orange-OpenSource/isisdRuss White
Isisd/Lib: Add new printfrr format facility for Intermediate System ID
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21isisd: Update to the new printfrr ISO formatOlivier Dugeon
This path replaces isisd_format_id, sysid_print, snpa_print, rawlspid_print and isonet_print functions by the new printfrr ISO System ID & Network Address format facilities. It also updates the isisd code to the new iso_address structure defined in lib/iso.h Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.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-04fabricd: Turn off excessive logging when peering will not come upDonald Sharp
When fabricd is configured to use an interface and there will be no peers out that interface, the log file is filling up with: Oct 04 10:50:03 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up Oct 04 10:50:03 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1 Oct 04 10:50:06 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing Oct 04 10:50:07 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f1np1 timed out! Oct 04 10:50:07 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 3333.3333.3333 on enp1s0f0np0 Oct 04 10:50:08 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing Oct 04 10:50:11 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f0np0 timed out! Oct 04 10:50:11 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up Oct 04 10:50:11 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1 Oct 04 10:50:14 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing Oct 04 10:50:15 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f1np1 timed out! Oct 04 10:50:16 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1 Oct 04 10:50:18 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up The `Threeway state change..` message is guarded by a debug, but the other 2 are not. Let's guard those with debugs since the log will be filled up rather quickly with any sort of aggressive timers. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21isisd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23isisd: Fix crash with xfrm interface typeDonald Sharp
When creating a xfrm interface FRR is crashing when configured with isis. This is because the weird pattern of not allocating list's until needed and then allowing the crash when we have a usage pattern that was not expected. Just always allocate the different lists that a circuit needs. (gdb) bt (gdb) Fixes #11432 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-08isisd: Do not explicitly set the thread pointer to NULLDonatas Abraitis
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04isisd: Do not explicitly set the thread pointer to NULLDonatas Abraitis
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-22isisd: kill isis_memory.h, use MTYPE_STATICDavid Lamparter
Convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-10-23* : update signature of thread_cancel apiMark Stapp
Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
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-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-14isisd : Transformational changes to support different VRFs.Kaushik
1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-06-24ISIS VRF: ISIS Debug structure modificationsharios
1. The "isis->debug" variable dependency on debug logs print is removed. Signed-off-by: harios <hari@niralnetworks.com>
2020-03-25*: use the current project name (FRRouting)Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2020-03-24bgpd, isisd, lib: Make key values const for skiplistDonald Sharp
Make some key values const for the skiplist code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: Rename backet to bucketTim Bray
Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
2018-12-12Minor adjustments to address CI warningsRodny Molina
2018-12-07fabricd: Disabling OpenFabric optimization to avoid considering T0 devices ↵Rodny Molina
only as DNRs Signed-off-by: Rodny Molina <rmolina@linkedin.com>
2018-12-07fabricd: Update neighbor list on adjacency state changeChristian Franke
We should update our neighbors list immediately when an adjacency changes state, not when we run SPF. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07fabricd: make triggered csnp delay configurableChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07fabricd: Improve LSP flooding logChristian Franke
Also track when we received an LSP as do not reflood, as well as the time when we last considered flooding it. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07fabricd: Add `show openfabric flooding` commandChristian Franke
Add a command to show to what neighbors an LSP has been flooded. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07fabricd: Populate NL from adjdb, not spfChristian Franke
We should really populate the neighbor list for the flooding optimization from our local adjacency database and not from a one-hop SPF. If we use SPF, we may end up never exchanging information with some neighbors since the bidirectional connection check for spf fails, since LSPs did not get exchanged. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07isisd: Provide better flooding debuggingChristian Franke
Show from where LSP flooding is triggered. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-15fabricd: Fix flooding bugChristian Franke
Due to `lsp` getting shadowed, we would send each T0 its own LSP whenever we actually wanted to flood a different LSP. Fix this and set -Wshadow=local in my build environment. m( Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-05fabricd: add support for completely unnumbered operationChristian Franke
With this commit, fabricd can run without any IPv4 addresses configured except on loopback. There are two changes to achieve this: a) If a circuit has no IPv4 address configured, fabricd will resort to advertise the routers loopback IP in the OpenFabric hellos. b) All the routes from OpenFabric are sent with ZEBRA_FLAG_ONLINK set, so that zebra will install them into the fib without checking whether the nexthop is reachable Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: trigger CSNP after flooding scope LSP has been receivedChristian Franke
Have fabricd send out a CSNP whenever a circuit scoped LSP is received, and log a warning if the CSNP showed resynchronization was necessary. 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: implement flooding optimizationChristian Franke
Regular IS-IS will flood any LSP updates out to all circuits except the one where it was received on. This is done in `lsp_flood`. Change `lsp_flood` for fabricd to use the optimized flooding algorithm instead. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: build a list of neighbors and neighbors neighborsChristian Franke
OpenFabric uses a list of neighbors and neighbors neighbors to calculate a set of designated reflooders. While the draft prescribes that these lists should be built whenever an LSP needs to be flooded, this implementation opted to build them only when we ran an spf, given that they will only change when the topology changes. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: reimplement LSP transmission logicChristian Franke
Before this commit, isisd/fabricd maintained a bitfield for each LSP to track the SRM bit for each circuit, which specifies whether an LSP needs to be sent on that circuit. Every second, it would scan over all LSPs in `lsp_tick` and queue them up for transmission accordingly. This design has two drawbacks: a) it scales poorly b) it adds unacceptable latency to the update process: each router takes a random amount of time between 0 and 1 seconds to forward an update. In a network with a diamter of 10, it might already take 10 seconds for an update to traverse the network. To mitigate this, a new design was chosen. Instead of tracking SRM in a bitfield, have one tx_queue per circuit and declare that an LSP is in that queue if and only if it would have SRM set for that circuit. This way, we can track SRM similarly as we did before, however, on insertion into the LSP queue, we can add a timer for (re)transmission, alleviating the need for a periodic scan with LSP tick and reducing the latency for forwarding of updates. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: implement fabric locality detection algorithmChristian Franke
If an OpenFabric router doesn't have its tier number configured manually, try to execute the fabric locality calculation algorithm whenever we have run spf. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05fabricd: allow to configure tier-level advertisementChristian Franke
While OpenFabric calculates most tier numbers automatically by the fabric locality calculation algorithm, that algorithm requires two systems to be manually configured as tier 0, so it has reference points. Also, completely manual configuration is possible. To support this, introduce appropriate CLI commands and flood the configured information. 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-09-05fabricd: adjacency formation optimization as per section 2.4Christian Franke
OpenFabric changes IS-IS's initial database synchronization. While regular IS-IS will simultaneuously exchange LSPs with all neighboring routers during startup, this is considered too much churn for a densely connected fabric. To mitigate this, OpenFabric prescribes that a router should only bring up an adjacency with a single neighbor and perform a full synchronization with that neighbor, before bringing up further adjacencies. This is implemented by having a field `initial_sync_state` in the fabricd datastructure which tracks whether an initial sync is still pending, currently in progress, or complete. When an initial sync is pending, the state will transition to the in-progress state when the first IIH is received. During this state, all IIHs from other routers are ignored. Any IIHs transmitted on any link other than the one to the router with which we are performing the initial sync will always report the far end as DOWN in their threeway handshake state, avoiding the formation of additional adjacencies. The state will be left if all the SRM and SSN flags on the initial-sync circuit are cleared (meaning that initial sync has completed). This is checked in `lsp_tick`. When this condition occurrs, we progress to the initial-sync-complete state, allowing other adjacencies to form. The state can also be left if the initial synchronization is taking too long to succeed, for whatever reason. In that case, we fall back to the initial-sync-pending state and will reattempt initial synchronization with a different neighbor. Signed-off-by: Christian Franke <chris@opensourcerouting.org>