Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isisd: IS-IS Segment Routing support #6413

Merged
merged 19 commits into from
May 15, 2020
Merged

isisd: IS-IS Segment Routing support #6413

merged 19 commits into from
May 15, 2020

Conversation

odd22
Copy link
Member

@odd22 odd22 commented May 15, 2020

This PR add Segment Routing support to IS-IS.

It corresponds to the backport of dev_isis_sr branch. Look to this branch for the complete historic of commit.

rwestphal and others added 19 commits April 30, 2020 11:27
Parameters should be const whenever possible to improve code
readability and remove the need to cast away the constness of
const arguments.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
The 'isis_adj_ip_enabled_hook' hook will be called whenever
an adjacency goes from zero to one or more IPv4 or IPv6
addresses. Conversely, the 'isis_adj_ip_disabled_hook' hook will
be called whenever an adjacency goes from one or more IPv4/IPv6
addresses to no addresses at all.

These hooks will be used by the upcoming SR code to add/delete
Adj-SIDs depending on the IP addresses present in the remote
adjacencies.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
The new log_uptime() function logs an UNIX timestamp to a buffer
provided by the user. It's very flexibile and can be used in a
variety of contexts, different from vty_out_timestr() which is too
tied to the VTY code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd implements an optimization that allows multiple routes to
share the same nexthop (using a refcount) in order to save memory.

Now that SR support is coming, however, it will be necessary to
embed additional SR-related information inside the isis_nexthop
structure. But this can only be done if the nexthops aren't shared
among routes anymore.

Removing this memory optimization should have minimal impact since
the isis_nexthop structure is really small. On large networks with
thousands of routes, the memory saving would be in the order of a
few kilobytes.  Not something we should be concerned about nowadays.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Most definitions were borrowed from the IETF IS-IS SR YANG module,
with a few adaptations. Of particular notice are the following:
* No support for the configuration of multiple SRGBs.
* No distinction between local and connected Prefix-SIDs, both are
  configured the same way.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
In the name of consistency, these commands are very similar to the
ospfd SR configuration commands.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This is an implementation of the IS-IS SR draft [1] for FRR.

The following features are supported:
* IPv4 and IPv6 Prefix-SIDs;
* IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs;
* Index and absolute labels;
* The no-php and explicit-null Prefix-SID flags;
* Full integration with the Label Manager.

Known limitations:
* No support for Anycast-SIDs;
* No support for the SID/Label Binding TLV (required for LDP interop).
* No support for persistent Adj-SIDs;
* No support for multiple SRGBs.

[1] draft-ietf-isis-segment-routing-extensions-25

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
This commit introduces a comprehensive test for IS-IS Segment
Routing. It features the following network topology:

                         +---------+
                         |         |
                         |   RT1   |
                         | 1.1.1.1 |
                         |         |
                         +---------+
                              |eth-sw1
                              |
                              |
                              |
         +---------+          |          +---------+
         |         |          |          |         |
         |   RT2   |eth-sw1   |   eth-sw1|   RT3   |
         | 2.2.2.2 +----------+----------+ 3.3.3.3 |
         |         |     10.0.1.0/24     |         |
         +---------+                     +---------+
    eth-rt4-1|  |eth-rt4-2          eth-rt5-1|  |eth-rt5-2
             |  |                            |  |
  10.0.2.0/24|  |10.0.3.0/24      10.0.4.0/24|  |10.0.5.0/24
             |  |                            |  |
    eth-rt2-1|  |eth-rt2-2          eth-rt3-1|  |eth-rt3-2
         +---------+                     +---------+
         |         |                     |         |
         |   RT4   |     10.0.6.0/24     |   RT5   |
         | 4.4.4.4 +---------------------+ 5.5.5.5 |
         |         |eth-rt5       eth-rt4|         |
         +---------+                     +---------+
       eth-rt6|                                |eth-rt6
              |                                |
   10.0.7.0/24|                                |10.0.8.0/24
              |          +---------+           |
              |          |         |           |
              |          |   RT6   |           |
              +----------+ 6.6.6.6 +-----------+
                  eth-rt4|         |eth-rt5
                         +---------+

Each router has both an IPv4 and an IPv6 loopback address, each of
which has a corresponding Prefix-SID configured.

Basic SR functionality is tested. First, the topotest ensures that
all expected Prefix-SIDs and Adj-SIDs are flooded and installed
correctly in all routers of the network. Later, network failures
are simulated and configuration changes are performed in several
different routers. The topotest then checks if IS-IS has converged
as expected in the network according to the network failures and
configuration changes that happened.

The topotest comprises 11 different steps, each with four individual
tests (for a total of 44 tests). A summary of what each step does
is provided below:

---

STEP 1:
-Initial network convergence

---

Step 2:
Action(s):
-Disable IS-IS on the eth-rt5 interface on rt4

Expected changes:
-rt4 should uninstall the Adj-SIDs pointing to rt5
-rt5 should uninstall the Adj-SIDs pointing to rt4
-rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted)
-rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted)
-rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted)
-rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed)
-rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted)
-rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed)

---

Step 3:
Action(s):
-Shut down the eth-rt4 interface on rt6
-Shut down the eth-rt5 interface on rt6

Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP
-rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP
-rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs

---

Step 4:
Action(s):
-Bring up the eth-rt4 interface on rt6
-Bring up the eth-rt5 interface on rt6
-Change rt6's SRGB

Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 and rt5 should install Adj-SIDs for rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB
-rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB
-rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network,
and Adj-SIDs for rt4 and rt5

---

Step 5:
Action(s):
-Disable SR on rt6

Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs
for rt4 and rt5

---

Step 6:
Action(s):
-Enable SR on rt6

Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 should install rt5's Prefix-SIDs through rt6
-rt5 should install rt4's Prefix-SIDs through rt6
-rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for
rt4 and rt5

---

Step 7:
Action(s):
-Delete rt1's Prefix-SIDs

Expected changes:
-All routers should uninstall rt1's Prefix-SIDs

---

Step 8:
Action(s):
-Re-add rt1's Prefix-SIDs

Expected changes:
-All routers should install rt1's Prefix-SIDs

---

Step 9:
Action(s):
-Change rt1's Prefix-SIDs to use the no-php option
-Change rt6's Prefix-SIDs to stop using the explicit-null option

Expected changes:
-rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly
-rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly

---

Step 10:
Action(s):
-Remove the IPv4 address from rt4's eth-rt2-1 interface

Expected changes:
-rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1
interface
-rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4
(ECMP shouldn't be used anymore)
-rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2
(ECMP shouldn't be used anymore)

---

Step 11:
Action(s):
-Restore the original network setup

Expected changes:
-All routes, Prefix-SIDs and Adj-SIDs should be the same as they were
after the initial network convergence (step 1)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Update label enforcement due to modification in zapi message:
zapi_nexthop_label becomes zapi_nexthop as per PR #5813

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
This change modify the way IS-IS is connected to the Label Manager:
 - Add emission of Hello Message prior to the connection as per
   modification introduced by PR #5925
 - Add 'session_id' as per modification introduced by PR #6224
 - Add Doxygen documentation to Label Manager functions

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
 * Rename RB-TREE variable from tree_sr_XXX to srdb_XXX
 * Replace parse_flags by an enum and rename it srdb_state which reflects
   more the role of this flag: determined the state of SR-Node and SR-Prefix
   stored in the SRDB: VALIDATED, NEW, MODIFIED, UNCHANGED

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
 * Rename functions following rules: isis_sr_XXX is kept for external functions
   and isis_sr prefix remove for static ones
 * Rename local_label & remote_label variables by input_label & output_label
 * Change parameter order (to follow other functions) in sr_node_srgb_update()

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add debug macro and debug messages

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
 * Regroup fonctions to install label for Prefix and Adjacency SID
 * Change 'replace_semantics' variable name by 'make_before_break' in
   sr_prefix_reinstall() function and adjust comments
 * Call directly lsp_regenerate_schedule() from isis_nb_config.c when MSD
   is updated

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update comments (doxygen style) for all functions.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
 * Improve `show isis segment-routing prefix-sids` output
 * Add new `show isis segment-routing node' command

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
isisd: Preparation to merge Segment-Routing into master
@polychaeta polychaeta added documentation isis libfrr tests Topotests, make check, etc labels May 15, 2020
@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12306/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
<stdin>:110: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Report for if.c | 5 issues
===============================================
< WARNING: strncat() is error-prone; please use strlcat() if possible#959: FILE: /tmp/f1-10330/if.c:959:
---
> WARNING: strncat() is error-prone; please use strlcat() if possible#959: FILE: /tmp/f2-10330/if.c:959:
103c103
< #1051: FILE: /tmp/f1-10330/if.c:1051:
Report for if.h | 4 issues
===============================================
< WARNING: function definition argument 'const struct prefix *' should also have an identifier name
< #577: FILE: /tmp/f1-10330/if.h:577:
< WARNING: function definition argument 'const struct prefix *' should also have an identifier name
< #579: FILE: /tmp/f1-10330/if.h:579:
Report for isis_errors.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #43: FILE: /tmp/f1-10330/isis_errors.c:43:
Report for isis_misc.c | 7 issues
===============================================
< WARNING: strncat() is error-prone; please use strlcat() if possible#489: FILE: /tmp/f1-10330/isis_misc.c:489:
---
> WARNING: strncat() is error-prone; please use strlcat() if possible#489: FILE: /tmp/f2-10330/isis_misc.c:489:
24c24
< #516: FILE: /tmp/f1-10330/isis_misc.c:516:
< WARNING: Missing a blank line after declarations
< #575: FILE: /tmp/f1-10330/isis_misc.c:575:
Report for isis_nb.c | 44 issues
===============================================
< WARNING: line over 80 characters
< #460: FILE: /tmp/f1-10330/isis_nb.c:460:
< WARNING: line over 80 characters
< #465: FILE: /tmp/f1-10330/isis_nb.c:465:
< WARNING: line over 80 characters
< #467: FILE: /tmp/f1-10330/isis_nb.c:467:
< WARNING: line over 80 characters
< #472: FILE: /tmp/f1-10330/isis_nb.c:472:
< WARNING: line over 80 characters
< #474: FILE: /tmp/f1-10330/isis_nb.c:474:
< WARNING: line over 80 characters
< #478: FILE: /tmp/f1-10330/isis_nb.c:478:
< WARNING: line over 80 characters
< #480: FILE: /tmp/f1-10330/isis_nb.c:480:
< WARNING: line over 80 characters
< #484: FILE: /tmp/f1-10330/isis_nb.c:484:
< WARNING: line over 80 characters
< #486: FILE: /tmp/f1-10330/isis_nb.c:486:
< WARNING: line over 80 characters
< #487: FILE: /tmp/f1-10330/isis_nb.c:487:
< WARNING: line over 80 characters
< #492: FILE: /tmp/f1-10330/isis_nb.c:492:
< WARNING: line over 80 characters
< #494: FILE: /tmp/f1-10330/isis_nb.c:494:
< WARNING: line over 80 characters
< #495: FILE: /tmp/f1-10330/isis_nb.c:495:
< WARNING: line over 80 characters
< #496: FILE: /tmp/f1-10330/isis_nb.c:496:
< WARNING: line over 80 characters
< #497: FILE: /tmp/f1-10330/isis_nb.c:497:
< WARNING: line over 80 characters
< #502: FILE: /tmp/f1-10330/isis_nb.c:502:
< WARNING: line over 80 characters
< #504: FILE: /tmp/f1-10330/isis_nb.c:504:
< WARNING: line over 80 characters
< #508: FILE: /tmp/f1-10330/isis_nb.c:508:
< WARNING: line over 80 characters
< #510: FILE: /tmp/f1-10330/isis_nb.c:510:
< WARNING: line over 80 characters
< #514: FILE: /tmp/f1-10330/isis_nb.c:514:
< WARNING: line over 80 characters
< #516: FILE: /tmp/f1-10330/isis_nb.c:516:
< WARNING: line over 80 characters
< #527: FILE: /tmp/f1-10330/isis_nb.c:527:
Report for isis_nb_config.c | 8 issues
===============================================
< WARNING: line over 80 characters
< #1636: FILE: /tmp/f1-10330/isis_nb_config.c:1636:
< WARNING: line over 80 characters
< #1638: FILE: /tmp/f1-10330/isis_nb_config.c:1638:
< WARNING: line over 80 characters
< #1672: FILE: /tmp/f1-10330/isis_nb_config.c:1672:
< WARNING: line over 80 characters
< #1674: FILE: /tmp/f1-10330/isis_nb_config.c:1674:
Report for isis_nb.h | 4 issues
===============================================
< WARNING: line over 80 characters
< #191: FILE: /tmp/f1-10330/isis_nb.h:191:
< WARNING: line over 80 characters
< #195: FILE: /tmp/f1-10330/isis_nb.h:195:
Report for isis_route.c | 4 issues
===============================================
< WARNING: line over 80 characters
< #133: FILE: /tmp/f1-10330/isis_route.c:133:
< WARNING: line over 80 characters
< #148: FILE: /tmp/f1-10330/isis_route.c:148:
Report for isis_sr.c | 33 issues
===============================================
WARNING: space prohibited between function name and open parenthesis '('
#164: FILE: /tmp/f1-10330/isis_sr.c:164:
+			frr_each (srdb_area_prefix,

WARNING: space prohibited between function name and open parenthesis '('
#484: FILE: /tmp/f1-10330/isis_sr.c:484:
+	frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) {

WARNING: space prohibited between function name and open parenthesis '('
#1056: FILE: /tmp/f1-10330/isis_sr.c:1056:
+		frr_each (lspdb, &area->lspdb[level - 1], lsp) {

WARNING: space prohibited between function name and open parenthesis '('
#1158: FILE: /tmp/f1-10330/isis_sr.c:1158:
+	frr_each_safe (srdb_node_prefix, &srn->prefix_sids, srp)

WARNING: space prohibited between function name and open parenthesis '('
#1179: FILE: /tmp/f1-10330/isis_sr.c:1179:
+		frr_each_safe (srdb_node, &area->srdb.sr_nodes[level - 1], srn)

WARNING: Missing a blank line after declarations
#1563: FILE: /tmp/f1-10330/isis_sr.c:1563:
+		struct interface *ifp;
+		ifp = if_lookup_prefix(&srp->prefix, VRF_DEFAULT);

WARNING: space prohibited between function name and open parenthesis '('
#1669: FILE: /tmp/f1-10330/isis_sr.c:1669:
+	frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) {

WARNING: space prohibited between function name and open parenthesis '('
#1740: FILE: /tmp/f1-10330/isis_sr.c:1740:
+	frr_each (srdb_node, &area->srdb.sr_nodes[level - 1], srn) {
Report for isis_zebra.c | 12 issues
===============================================
< WARNING: please, no space before tabs
< #476: FILE: /tmp/f1-10330/isis_zebra.c:476:
< WARNING: please, no space before tabs
< #518: FILE: /tmp/f1-10330/isis_zebra.c:518:
< WARNING: please, no space before tabs
< #559: FILE: /tmp/f1-10330/isis_zebra.c:559:
< WARNING: line over 80 characters
< #692: FILE: /tmp/f1-10330/isis_zebra.c:692:
< WARNING: line over 80 characters
< #699: FILE: /tmp/f1-10330/isis_zebra.c:699:
< WARNING: Missing a blank line after declarations
< #724: FILE: /tmp/f1-10330/isis_zebra.c:724:

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12306/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200514-07-g82624cef0-0 (missing) -> 7.4-dev-20200514-07-g82624cef0-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200514-07-g82624cef0-0 (missing) -> 7.4-dev-20200514-07-g82624cef0-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200514-07-g82624cef0-0 (missing) -> 7.4-dev-20200514-07-g82624cef0-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200514-07-g82624cef0-0 (missing) -> 7.4-dev-20200514-07-g82624cef0-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200514-07-g82624cef0-0 (missing) -> 7.4-dev-20200514-07-g82624cef0-0~deb10u1

@odd22 odd22 requested a review from donaldsharp May 15, 2020 16:00
@donaldsharp donaldsharp merged commit 1edce7d into dev/7.4 May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation isis libfrr tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants