Skip to content

Commit

Permalink
Merge pull request #7011 from opensourcerouting/isis-ti-lfa
Browse files Browse the repository at this point in the history
isisd: add support for Topology Independent LFA (TI-LFA)
  • Loading branch information
odd22 authored Oct 16, 2020
2 parents 8df95e6 + d240e5c commit e4000bb
Show file tree
Hide file tree
Showing 209 changed files with 17,326 additions and 169 deletions.
17 changes: 15 additions & 2 deletions doc/user/isisd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ ISIS interface
Enable or disable :rfc:`5303` Three-Way Handshake for P2P adjacencies.
Three-Way Handshake is enabled by default.

.. index:: [no] isis fast-reroute ti-lfa [level-1|level-2] [node-protection]
.. clicmd:: [no] isis fast-reroute ti-lfa [level-1|level-2] [node-protection]

Enable per-prefix TI-LFA fast reroute link or node protection.

.. _showing-isis-information:

Showing ISIS information
Expand Down Expand Up @@ -418,8 +423,8 @@ Showing ISIS information
Show topology IS-IS paths to Intermediate Systems, globally, in area
(level-1) or domain (level-2).

.. index:: show isis route [level-1|level-2]
.. clicmd:: show isis route [level-1|level-2]
.. index:: show isis route [level-1|level-2] [backup]
.. clicmd:: show isis route [level-1|level-2] [backup]

Show the ISIS routing table, as determined by the most recent SPF
calculation.
Expand Down Expand Up @@ -633,6 +638,14 @@ Debugging ISIS

IS-IS Segment Routing events.

.. index:: debug isis ti-lfa
.. clicmd:: debug isis ti-lfa

.. index:: no debug isis ti-lfa
.. clicmd:: no debug isis ti-lfa

IS-IS TI-LFA events.

.. index:: show debugging isis
.. clicmd:: show debugging isis

Expand Down
2 changes: 2 additions & 0 deletions isisd/isis_circuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ struct isis_circuit {
bool disable_threeway_adj;
struct bfd_info *bfd_info;
struct ldp_sync_info *ldp_sync_info;
bool tilfa_protection[ISIS_LEVELS];
bool tilfa_node_protection[ISIS_LEVELS];
/*
* Counters as in 10589--11.2.5.9
*/
Expand Down
98 changes: 98 additions & 0 deletions isisd/isis_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,102 @@ void cli_show_ip_isis_priority(struct vty *vty, struct lyd_node *dnode,
}
}

/*
* XPath: /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/ti-lfa/enable
*/
DEFPY(isis_ti_lfa, isis_ti_lfa_cmd,
"[no] isis fast-reroute ti-lfa [level-1|level-2]$level [node-protection$node_protection]",
NO_STR
"IS-IS routing protocol\n"
"Interface IP Fast-reroute configuration\n"
"Enable TI-LFA computation\n"
"Enable TI-LFA computation for Level 1 only\n"
"Enable TI-LFA computation for Level 2 only\n"
"Protect against node failures\n")
{
if (!level || strmatch(level, "level-1")) {
if (no) {
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable",
NB_OP_MODIFY, "false");
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection",
NB_OP_MODIFY, "false");
} else {
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable",
NB_OP_MODIFY, "true");
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection",
NB_OP_MODIFY,
node_protection ? "true" : "false");
}
}
if (!level || strmatch(level, "level-2")) {
if (no) {
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable",
NB_OP_MODIFY, "false");
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection",
NB_OP_MODIFY, "false");
} else {
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable",
NB_OP_MODIFY, "true");
nb_cli_enqueue_change(
vty,
"./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection",
NB_OP_MODIFY,
node_protection ? "true" : "false");
}
}

return nb_cli_apply_changes(vty, NULL);
}

void cli_show_ip_isis_ti_lfa(struct vty *vty, struct lyd_node *dnode,
bool show_defaults)
{
bool l1_enabled, l2_enabled;
bool l1_node_protection, l2_node_protection;

l1_enabled = yang_dnode_get_bool(dnode, "./level-1/ti-lfa/enable");
l2_enabled = yang_dnode_get_bool(dnode, "./level-2/ti-lfa/enable");
l1_node_protection =
yang_dnode_get_bool(dnode, "./level-1/ti-lfa/node-protection");
l2_node_protection =
yang_dnode_get_bool(dnode, "./level-2/ti-lfa/node-protection");

if (l1_enabled == l2_enabled
&& l1_node_protection == l2_node_protection) {
vty_out(vty, " isis fast-reroute ti-lfa");
if (l1_node_protection)
vty_out(vty, " node-protection");
vty_out(vty, "\n");
} else {
if (l1_enabled) {
vty_out(vty, " isis fast-reroute ti-lfa level-1");
if (l1_node_protection)
vty_out(vty, " node-protection");
vty_out(vty, "\n");
}
if (l2_enabled) {
vty_out(vty, " isis fast-reroute ti-lfa level-2");
if (l2_node_protection)
vty_out(vty, " node-protection");
vty_out(vty, "\n");
}
}
}

/*
* XPath: /frr-isisd:isis/instance/log-adjacency-changes
*/
Expand Down Expand Up @@ -2661,6 +2757,8 @@ void isis_cli_init(void)
install_element(INTERFACE_NODE, &isis_priority_cmd);
install_element(INTERFACE_NODE, &no_isis_priority_cmd);

install_element(INTERFACE_NODE, &isis_ti_lfa_cmd);

install_element(ISIS_NODE, &log_adj_changes_cmd);

install_element(ISIS_NODE, &isis_mpls_ldp_sync_cmd);
Expand Down
8 changes: 0 additions & 8 deletions isisd/isis_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@
#include "isisd/isis_spf.h"
#include "isisd/isis_errors.h"

/* debug isis-spf spf-events
4w4d: ISIS-Spf (tlt): L2 SPF needed, new adjacency, from 0x609229F4
4w4d: ISIS-Spf (tlt): L2, 0000.0000.0042.01-00 TLV contents changed, code 0x2
4w4d: ISIS-Spf (tlt): L2, new LSP 0 DEAD.BEEF.0043.00-00
4w5d: ISIS-Spf (tlt): L1 SPF needed, periodic SPF, from 0x6091C844
4w5d: ISIS-Spf (tlt): L2 SPF needed, periodic SPF, from 0x6091C844
*/

void isis_event_circuit_state_change(struct isis_circuit *circuit,
struct isis_area *area, int up)
{
Expand Down
Loading

0 comments on commit e4000bb

Please sign in to comment.