Page MenuHomeVyOS Platform

ISIS segment routing was broken...
Closed, ResolvedPublicBUG

Description

There was a break for ISIS segment routing that happened accidentally during a refactor. @c-po spotted the issue and showed me where it was broken. I fixed the break and I am implementing a smoketest to catch if it breaks in the future.

Details

Difficulty level
Normal (likely a few hours)
Version
1.4
Why the issue appeared?
Other
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the task status from Open to Needs testing.Wed, Sep 14, 7:12 PM
Viacheslav assigned this task to Cheeze_It.

Good news. It seems the patch worked properly. Here we show MPLS labels generated via segment routing for the prefix command:

Configuration added is, where X is the loopback IP of the local router:

set protocols isis segment-routing prefix 192.168.0.x/32 index value 'x'

[email protected]:~$ show mpls table
 Inbound Label  Type        Nexthop                Outbound Label
 ------------------------------------------------------------------
 1002           SR (IS-IS)  192.168.255.9          implicit-null
 1003           SR (IS-IS)  192.168.255.9          1003   <--- Here is the new generated prefix label
 1004           SR (IS-IS)  192.168.255.9          1004   <--- Here is the new generated prefix label
 1005           SR (IS-IS)  192.168.255.1          implicit-null
 1006           SR (IS-IS)  192.168.255.9          1006   <--- Here is the new generated prefix label
 1006           SR (IS-IS)  192.168.255.1          1006   <--- Here is the new generated prefix label
 1007           SR (IS-IS)  192.168.255.9          1007   <--- Here is the new generated prefix label
 1007           SR (IS-IS)  192.168.255.1          1007   <--- Here is the new generated prefix label
 1008           SR (IS-IS)  192.168.255.9          1008   <--- Here is the new generated prefix label
 1008           SR (IS-IS)  192.168.255.1          1008   <--- Here is the new generated prefix label
 15000          SR (IS-IS)  192.168.255.1          implicit-null
 15001          SR (IS-IS)  fe80::e06:cfff:fe17:1  implicit-null
 15002          SR (IS-IS)  192.168.255.9          implicit-null
 15003          SR (IS-IS)  fe80::e81:7aff:fe90:3  implicit-null

Here's the routing table showing the same:

[email protected]:~$ show ip route 192.168.0.0/24 longer-prefixes
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 192.168.0.1/32 is directly connected, lo, 00:10:58
I>* 192.168.0.2/32 [115/110] via 192.168.255.9, eth2, label implicit-null, weight 1, 00:00:41
I>* 192.168.0.3/32 [115/210] via 192.168.255.9, eth2, label 1003, weight 1, 00:00:37
I>* 192.168.0.4/32 [115/310] via 192.168.255.9, eth2, label 1004, weight 1, 00:00:33
I>* 192.168.0.5/32 [115/110] via 192.168.255.1, eth1, label implicit-null, weight 1, 00:00:27
I>* 192.168.0.6/32 [115/210] via 192.168.255.1, eth1, label 1006, weight 1, 00:00:21
  *                          via 192.168.255.9, eth2, label 1006, weight 1, 00:00:21
I>* 192.168.0.7/32 [115/310] via 192.168.255.1, eth1, label 1007, weight 1, 00:00:16
  *                          via 192.168.255.9, eth2, label 1007, weight 1, 00:00:16
I>* 192.168.0.8/32 [115/410] via 192.168.255.1, eth1, label 1008, weight 1, 00:00:10
  *                          via 192.168.255.9, eth2, label 1008, weight 1, 00:00:10

Doing further testing, it seems adding the explicit-null broke the configuration:

set protocols isis segment-routing prefix 192.168.0.1/32 index explicit-null
set protocols isis segment-routing prefix 192.168.0.1/32 index value '1'

[email protected]:~$ show mpls table
 Inbound Label  Type        Nexthop                Outbound Label
 ------------------------------------------------------------------
 15000          SR (IS-IS)  192.168.255.1          implicit-null
 15001          SR (IS-IS)  fe80::e06:cfff:fe17:1  implicit-null
 15002          SR (IS-IS)  192.168.255.9          implicit-null
 15003          SR (IS-IS)  fe80::e81:7aff:fe90:3  implicit-null

[email protected]:~$ show ip route 192.168.0.0/24 longer-prefixes
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 192.168.0.1/32 is directly connected, lo, 00:21:48
I>* 192.168.0.2/32 [115/110] via 192.168.255.9, eth2, weight 1, 00:08:02
I>* 192.168.0.3/32 [115/210] via 192.168.255.9, eth2, weight 1, 00:07:59
I>* 192.168.0.4/32 [115/310] via 192.168.255.9, eth2, weight 1, 00:07:56
I>* 192.168.0.5/32 [115/110] via 192.168.255.1, eth1, weight 1, 00:07:51
I>* 192.168.0.6/32 [115/210] via 192.168.255.1, eth1, weight 1, 00:07:47
  *                          via 192.168.255.9, eth2, weight 1, 00:07:47
I>* 192.168.0.7/32 [115/310] via 192.168.255.1, eth1, weight 1, 00:07:44
  *                          via 192.168.255.9, eth2, weight 1, 00:07:44
I>* 192.168.0.8/32 [115/410] via 192.168.255.1, eth1, weight 1, 00:07:41
  *                          via 192.168.255.9, eth2, weight 1, 00:07:41

It seems it removed "prefix" altogether:

router isis VyOS
 is-type level-2-only
 net 49.0001.1921.6800.0001.00
 segment-routing on
 segment-routing global-block 1000 1999
 segment-routing node-msd 3
exit

Made a fix and now we have:

[email protected]:~$ show configuration commands | match isis | grep prefix
set protocols isis segment-routing prefix 192.168.0.1/32 index value '1'

router isis VyOS
 is-type level-2-only
 net 49.0001.1921.6800.0001.00
 segment-routing on
 segment-routing global-block 1000 1999
 segment-routing node-msd 3
 segment-routing prefix 192.168.0.1/32 index 1   <--- works
exit

Added the configuration to this:

[email protected]:~$ show configuration commands | match isis | grep prefix
set protocols isis segment-routing prefix 192.168.0.1/32 index explicit-null
set protocols isis segment-routing prefix 192.168.0.1/32 index value '1'

router isis VyOS
 is-type level-2-only
 net 49.0001.1921.6800.0001.00
 segment-routing on
 segment-routing global-block 1000 1999
 segment-routing node-msd 3
 segment-routing prefix 192.168.0.1/32 index 1 explicit-null   <--- works again
exit

Added the configuration to this:

[email protected]:~$ show configuration commands | match isis | grep prefix
set protocols isis segment-routing prefix 192.168.0.1/32 index no-php-flag
set protocols isis segment-routing prefix 192.168.0.1/32 index value '1'

router isis VyOS
 is-type level-2-only
 net 49.0001.1921.6800.0001.00
 segment-routing on
 segment-routing global-block 1000 1999
 segment-routing node-msd 3
 segment-routing prefix 192.168.0.1/32 index 1 no-php-flag   <--- works again
exit

I added all of them:

[email protected]:~$ show configuration commands | match isis | grep prefix
set protocols isis segment-routing prefix 192.168.0.1/32 index explicit-null
set protocols isis segment-routing prefix 192.168.0.1/32 index no-php-flag
set protocols isis segment-routing prefix 192.168.0.1/32 index value '1'

This is what I get, and this makes sense because of the way the jinja2 template is coded:

router isis VyOS
 is-type level-2-only
 net 49.0001.1921.6800.0001.00
 segment-routing on
 segment-routing global-block 1000 1999
 segment-routing node-msd 3
 segment-routing prefix 192.168.0.1/32 index 1 no-php-flag
exit

It seems that we have two constraints here.

The first constraint is, if adding the "explicit-null" or the "no-php-flag" options and one wants to switch between them one *must* delete. It seems deleting one and adding the other in one commit doesn't work and doesn't seem to change things. I am unsure how to fix this one.

The second constraint is, we can only have "explicit-null" or "no-php-flag" at one time. Not both at the same time. This makes sense as to my understanding those two options are mutually exclusive. This means I'll have to make a change in the change in the protocols handler to error out if both are configured at the same time.

Added a new pull request to make ISIS segment routing work again.

https://github.com/vyos/vyos-1x/pull/1543/files

Cheeze_It triaged this task as Normal priority.Tue, Sep 20, 4:25 PM

It seems we have working ISIS segment routing:

[email protected]:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

I   192.168.0.0/31 [115/20] via 192.168.0.1, eth1 inactive, weight 1, 00:03:00
C>* 192.168.0.0/31 is directly connected, eth1, 00:08:46
I>* 192.168.0.2/31 [115/20] via 192.168.0.9, eth2, weight 1, 00:03:00
I>* 192.168.0.4/31 [115/30] via 192.168.0.9, eth2, weight 1, 00:02:59
I>* 192.168.0.6/31 [115/40] via 192.168.0.9, eth2, weight 1, 00:02:58
I   192.168.0.8/31 [115/20] via 192.168.0.9, eth2 inactive, weight 1, 00:03:00
C>* 192.168.0.8/31 is directly connected, eth2, 00:08:44
I>* 192.168.0.10/31 [115/20] via 192.168.0.1, eth1, weight 1, 00:03:00
I>* 192.168.0.12/31 [115/20] via 192.168.0.9, eth2, weight 1, 00:03:00
I>* 192.168.0.14/31 [115/30] via 192.168.0.1, eth1, weight 1, 00:02:56
  *                          via 192.168.0.9, eth2, weight 1, 00:02:56
I>* 192.168.0.16/31 [115/30] via 192.168.0.9, eth2, weight 1, 00:02:59
I>* 192.168.0.18/31 [115/40] via 192.168.0.1, eth1, weight 1, 00:02:56
  *                          via 192.168.0.9, eth2, weight 1, 00:02:56
C>* 192.168.255.1/32 is directly connected, lo, 00:08:47
eight 1, 00:01:02
I>* 192.168.255.3/32 [115/30] via 192.168.0.9, eth2, label 53, weight 1, 00:00:56
I>* 192.168.255.4/32 [115/40] via 192.168.0.9, eth2, label 54, weight 1, 00:00:52
I>* 192.168.255.5/32 [115/20] via 192.168.0.1, eth1, label IPv4 Explicit Null, weight 1, 00:00:47
I>* 192.168.255.6/32 [115/30] via 192.168.0.1, eth1, label 56, weight 1, 00:00:42
  *                           via 192.168.0.9, eth2, label 56, weight 1, 00:00:42
I>* 192.168.255.7/32 [115/40] via 192.168.0.1, eth1, label 57, weight 1, 00:00:37
  *                           via 192.168.0.9, eth2, label 57, weight 1, 00:00:37
I>* 192.168.255.8/32 [115/50] via 192.168.0.1, eth1, label 58, weight 1, 00:00:33
  *                           via 192.168.0.9, eth2, label 58, weight 1, 00:00:33
[email protected]:~$
[email protected]:~$ show mpls table
 Inbound Label  Type        Nexthop                Outbound Label
 ----------------------------------------------------------------------
 52             SR (IS-IS)  192.168.0.9            IPv4 Explicit Null
 53             SR (IS-IS)  192.168.0.9            53
 54             SR (IS-IS)  192.168.0.9            54
 55             SR (IS-IS)  192.168.0.1            IPv4 Explicit Null
 56             SR (IS-IS)  192.168.0.9            56
 56             SR (IS-IS)  192.168.0.1            56
 57             SR (IS-IS)  192.168.0.9            57
 57             SR (IS-IS)  192.168.0.1            57
 58             SR (IS-IS)  192.168.0.9            58
 58             SR (IS-IS)  192.168.0.1            58
 15000          SR (IS-IS)  192.168.0.9            implicit-null
 15001          SR (IS-IS)  fe80::e81:7aff:fe90:3  implicit-null
 15002          SR (IS-IS)  192.168.0.1            implicit-null
 15003          SR (IS-IS)  fe80::e06:cfff:fe17:1  implicit-null
Cheeze_It changed Why the issue appeared? from Will be filled on close to Other.