SR-MPLS – Computed LSP
1. Intro
Another way to create an LSP is to calculate the path dynamically based on a set of traffic engineering constraints. This option uses a version of the CSPF algorithm (similar to RSVP), called Distributed CSPF (D-CSPF). The name reflects the fact that the protocol can be run on any router in the network, in contrast to using a centralized controller.
D-CSPF offers some TE constraints found in RSVP, such as admin groups and shared risk link groups. Additionally, it includes segment routing-specific constraints, like limiting the maximum number of segments pushed onto a packet or exclusively using links that support local repair. D-CSPF can also consider alternative shortest-path metrics, such as TE metrics or delay metrics. Junos OS collects a set of constraints together into an object called a compute profile. This set of constraints can then be applied consistently to any TE path that requires those constraints.
We will use the same test topology from the previous posts:

The initial config is simple:
### In this post there is no LSPs created yet. Find next the starting config:
### When configuring SR LSPs, it is always a good idea to have maximum-labels and TE database configured.
### In fact, computed LSPs will not work if either maximum-labels or TE database is not configured.
set interfaces ge-0/0/1 unit 0 family mpls maximum-labels 8
set interfaces ge-0/0/2 unit 0 family mpls maximum-labels 8
set protocols isis interface ge-0/0/1.0 point-to-point
set protocols isis interface ge-0/0/2.0 point-to-point
set protocols isis interface lo0.0 passive
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 10000
set protocols isis source-packet-routing node-segment ipv4-index 1001
set protocols isis level 2 wide-metrics-only
set protocols isis level 1 disable
set protocols isis traffic-engineering l3-unicast-topology
set protocols mpls interface lo0.0
set protocols mpls interface ge-0/0/2.0
set protocols mpls interface ge-0/0/1.0
### No LSP route is installed in the inet.3 table:
root@R1# run show route table inet.3 17.0.0.8/32
inet.3: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.8/32 *[L-ISIS/14] 2d 20:32:47, metric 30
> to 17.8.1.2 via ge-0/0/2.0, Push 801008
### This next hop is being used by our L3VPN:
root@R1# run show route table Cust-A.inet 192.168.8.1
Cust-A.inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.8.1/32 *[BGP/170] 2d 19:39:37, localpref 100, from 17.0.0.4
AS path: I, validation-state: unverified
> to 17.8.1.2 via ge-0/0/2.0, Push 25, Push 801008(top)
2. Configure the computed LSP
We will configure one LSP form R1 to R8, but we want to go via R7, this way: R1 – R3 – R6 – R7 – R8.
Because we want the path to be computed using the D-CSPF algorithm, then we must configure the ‘compute‘ knob under the segment list, and after that we must create a ‘compute-profile‘ and attach it to the primary path LSP:
### Let's configure a segment list, where we must configure the 'compute' option:
set protocols source-packet-routing segment-list COMPUTE-LIST compute
set protocols source-packet-routing segment-list COMPUTE-LIST VIA-R7 ip-address 17.0.0.7
set protocols source-packet-routing segment-list COMPUTE-LIST VIA-R7 loose
### Configuring the segment-list with the 'compute' knob is not enough.
### We must also define a 'compute-profile'.
### Note that the only constraint of the compute-profile is the compute-segment-list:
set protocols source-packet-routing compute-profile COMPUTE-PROFILE compute-segment-list COMPUTE-LIST
### Last, configure the LSP and attach the compute-profile:
set protocols source-packet-routing source-routing-path R7-PATH to 17.0.0.8
set protocols source-packet-routing source-routing-path R7-PATH primary PRI-VIA-R7 compute COMPUTE-PROFILE
### Note:
### In the previous posts PRI-VIA-R7 was referencing a configured segment-list, but not the case anymore.
### Now, PRI-VIA-R7 is just the name of the primary path, PRI-VIA-R7 is not referring any config construct.
### After the commmit, we can see the LSP is UP:
root@R1# run show spring-traffic-engineering lsp detail
Name: R7-PATH
Tunnel-source: Static configuration
Tunnel Forward Type: SRMPLS
To: 17.0.0.8
Te-group-id: 0
State: Up
Path: PRI-VIA-R7
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE
Total number of computed paths: 1
Segment ID : 128
Computed-path-index: 1
BFD status: N/A BFD name: N/A
BFD remote-discriminator: N/A
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 2
computed segment : 1 (computed-node-segment):
node segment label: 801007
router-id: 17.0.0.7
computed segment : 2 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
Total displayed LSPs: 1 (Up: 1, Down: 0)
### We can see the destination in the inet.3 table:
root@R1# run show route table inet.3 17.0.0.8/32
inet.3: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.8/32 *[SPRING-TE/8] 00:17:04, metric 1, metric2 30
> to 17.8.1.2 via ge-0/0/2.0, Push 801008, Push 801007(top)
[L-ISIS/14] 2d 21:28:47, metric 30
> to 17.8.1.2 via ge-0/0/2.0, Push 801008
### Ping to R8 works:
root@R1# run ping routing-instance Cust-A 192.168.8.1
PING 192.168.8.1 (192.168.8.1): 56 data bytes
64 bytes from 192.168.8.1: icmp_seq=0 ttl=62 time=4.744 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=5.712 ms
64 bytes from 192.168.8.1: icmp_seq=2 ttl=62 time=4.763 ms
^C
--- 192.168.8.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.744/5.073/5.712/0.452 ms
### With tcpdump we can see what labels are used by R1 to forward the packet:
12:54:37.281441 MPLS (label 801007, exp 0, ttl 64) (label 801008, exp 0, ttl 64) (label 25, exp 0, [S], ttl 64) IP 192.168.1.1 > 192.168.8.1: ICMP echo request, id 14213, seq 0, length 64
3. Configure a new secondary path using admin-groups
We will configure the following admin-groups (colors) in the network, and then configure a backup path to use the red links:

### Configure the admin-groups on the network (only R1 is showed, but do the same for all routers):
root@R1# show protocols mpls | display set
set protocols mpls admin-groups BLUE 0
set protocols mpls admin-groups GREEN 1
set protocols mpls admin-groups RED 2
set protocols mpls interface lo0.0
set protocols mpls interface ge-0/0/2.0 admin-group BLUE
set protocols mpls interface ge-0/0/1.0 admin-group RED
set protocols mpls interface ge-0/0/1.0 admin-group GREEN
### If we check the ISIS database, there is no admin-group information, something is missing!
root@R1# run show isis database R1 extensive
[... output trimmed ...]
IS extended neighbor: R2.00, Metric: default 10 SubTLV len: 72
IP address: 17.8.0.1
IPv6 address: 2001:db88:8::1
Neighbor's IP address: 17.8.0.2
Neighbor's IPv6 address: 2001:db88:8::2
Local interface index: 334, Remote interface index: 334
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 27
P2P IPv6 Adj-SID: 27, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 26
P2P IPv4 Adj-SID: 26, Weight: 0, Flags: --VL--
IS extended neighbor: R3.00, Metric: default 10 SubTLV len: 72
IP address: 17.8.1.1
IPv6 address: 2001:db88:8:1::1
Neighbor's IP address: 17.8.1.2
Neighbor's IPv6 address: 2001:db88:8:1::2
Local interface index: 335, Remote interface index: 334
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 29
P2P IPv6 Adj-SID: 29, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 28
P2P IPv4 Adj-SID: 28, Weight: 0, Flags: --VL--
[... output trimmed ...]
### Administrative groups are only advertised if you either:
### - configure RSVP, or
### - configure 'traffic-engineering advertisement always'
set protocols isis traffic-engineering advertisement always
### After we configure 'traffic-engineering advertisement always' and commit:
root@R1# run show isis database R1 extensive
[... output trimmed ...]
IS extended neighbor: R2.00, Metric: default 10 SubTLV len: 84
IP address: 17.8.0.1
IPv6 address: 2001:db88:8::1
Neighbor's IP address: 17.8.0.2
Neighbor's IPv6 address: 2001:db88:8::2
Local interface index: 334, Remote interface index: 334
Maximum bandwidth: 1000Mbps
Administrative groups: 0x6 RED GREEN
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 27
P2P IPv6 Adj-SID: 27, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 26
P2P IPv4 Adj-SID: 26, Weight: 0, Flags: --VL--
IS extended neighbor: R3.00, Metric: default 10 SubTLV len: 84
IP address: 17.8.1.1
IPv6 address: 2001:db88:8:1::1
Neighbor's IP address: 17.8.1.2
Neighbor's IPv6 address: 2001:db88:8:1::2
Local interface index: 335, Remote interface index: 334
Maximum bandwidth: 1000Mbps
Administrative groups: 0x1 BLUE
P2P IPV6 Adj-SID - Flags:0xb0(F:1,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 29
P2P IPv6 Adj-SID: 29, Weight: 0, Flags: F-VL--
P2P IPV4 Adj-SID - Flags:0x30(F:0,B:0,V:1,L:1,S:0,P:0), Weight:0, Label: 28
P2P IPv4 Adj-SID: 28, Weight: 0, Flags: --VL--
[... output trimmed ...]
### Now we can configure our new compute-profile and apply it to our secondary path:
set protocols source-packet-routing compute-profile COMPUTE-PROFILE-RED admin-group include-any RED
set protocols source-packet-routing source-routing-path R7-PATH secondary BACKUP-VIA-RED compute COMPUTE-PROFILE-RED
### Now the secondary LSP is also UP:
root@R1# run show spring-traffic-engineering lsp detail
Name: R7-PATH
Tunnel-source: Static configuration
Tunnel Forward Type: SRMPLS
To: 17.0.0.8
Te-group-id: 0
State: Up
Path: PRI-VIA-R7
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE
Total number of computed paths: 1
Segment ID : 128
Computed-path-index: 1
BFD status: N/A BFD name: N/A
BFD remote-discriminator: N/A
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 2
computed segment : 1 (computed-node-segment):
node segment label: 801007
router-id: 17.0.0.7
computed segment : 2 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
Path: BACKUP-VIA-RED
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE-RED
Total number of computed paths: 1
Segment ID : 256
Computed-path-index: 1
BFD status: N/A BFD name: N/A
BFD remote-discriminator: N/A
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 3
computed segment : 1 (computed-node-segment):
node segment label: 801002
router-id: 17.0.0.2
computed segment : 2 (computed-node-segment):
node segment label: 801005
router-id: 17.0.0.5
computed segment : 3 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
4. Add BFD
The configuration is not complete, since we have 2 paths, one primary and one secondary we also need to take care of failure detection. Configuring sBFD is the way to do that:
### Add sBFD to the paths:
set protocols source-packet-routing source-routing-path R7-PATH primary PRI-VIA-R7 bfd-liveness-detection sbfd remote-discriminator 8811
set protocols source-packet-routing source-routing-path R7-PATH primary PRI-VIA-R7 bfd-liveness-detection minimum-interval 1000
set protocols source-packet-routing source-routing-path R7-PATH primary PRI-VIA-R7 bfd-liveness-detection multiplier 3
set protocols source-packet-routing source-routing-path R7-PATH secondary BACKUP-VIA-RED bfd-liveness-detection sbfd remote-discriminator 8822
set protocols source-packet-routing source-routing-path R7-PATH secondary BACKUP-VIA-RED bfd-liveness-detection minimum-interval 1000
set protocols source-packet-routing source-routing-path R7-PATH secondary BACKUP-VIA-RED bfd-liveness-detection multiplier 3
### R8 was configured like:
set protocols bfd sbfd local-discriminator 8811
set protocols bfd sbfd local-discriminator 8822
### The sBFD is up:
root@R1# run show bfd session
Detect Transmit
Address State Interface Time Interval Multiplier
127.0.0.1 Up 3.000 1.000 3
127.0.0.1 Up 3.000 1.000 3
2 sessions, 2 clients
Cumulative transmit rate 2.0 pps, cumulative receive rate 2.0 pps
root@R1# run show bfd session extensive
Detect Transmit
Address State Interface Time Interval Multiplier
127.0.0.1 Up 6.000 1.000 3
Client SPRING-TE, TX interval 1.000, RX interval 1.000
Session up time 00:00:03
Local diagnostic None, remote diagnostic None
Remote state Up, version 1
Session type: Multi hop BFD (Seamless)
Min async interval 1.000, min slow interval 1.000
Adaptive async TX interval 1.000, RX interval 1.000
Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3
Remote min TX interval 2.000, min RX interval 0.050, multiplier 3
Local discriminator 18, remote discriminator 8811
Echo TX interval 0.000, echo detection interval 0.000
Echo mode disabled/inactive
Remote is control-plane independent
Path-Name V4-srte_bfd_session-2
Session ID: 0
Detect Transmit
Address State Interface Time Interval Multiplier
127.0.0.1 Up 3.000 1.000 3
Client SPRING-TE, TX interval 1.000, RX interval 1.000
Session up time 00:47:13
Local diagnostic None, remote diagnostic None
Remote state Up, version 1
Session type: Multi hop BFD (Seamless)
Min async interval 1.000, min slow interval 1.000
Adaptive async TX interval 1.000, RX interval 1.000
Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3
Remote min TX interval 1.000, min RX interval 0.050, multiplier 3
Local discriminator 17, remote discriminator 8822
Echo TX interval 0.000, echo detection interval 0.000
Echo mode disabled/inactive
Remote is control-plane independent
Path-Name V4-srte_bfd_session-3
Session ID: 0
2 sessions, 2 clients
Cumulative transmit rate 2.0 pps, cumulative receive rate 1.5 pps
### Tcpdump capture of sBFD packets on the primary path via R7 (capture on R3-R6 link):
15:29:58.600284 MPLS (label 801007, exp 7, ttl 255) (label 801008, exp 7, [S], ttl 255) IP 17.0.0.1.4784 > localhost.7784: UDP, length 24
### Tcpdump capture of sBFD packets on the secondary RED path (capture on R4-R5 link):
15:29:54.453770 MPLS (label 801008, exp 7, [S], ttl 253) IP 17.0.0.1.4784 > localhost.7784: UDP, length 24
### The LSP paths are UP:
root@R1# run show spring-traffic-engineering lsp detail
Name: R7-PATH
Tunnel-source: Static configuration
Tunnel Forward Type: SRMPLS
To: 17.0.0.8
Te-group-id: 0
State: Up
Path: PRI-VIA-R7
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE
Total number of computed paths: 1
Segment ID : 128
Computed-path-index: 1
BFD status: Up BFD name: V4-srte_bfd_session-2
BFD remote-discriminator: 8811(configured)
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 2
computed segment : 1 (computed-node-segment):
node segment label: 801007
router-id: 17.0.0.7
computed segment : 2 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
Path: BACKUP-VIA-RED
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE-RED
Total number of computed paths: 1
Segment ID : 256
Computed-path-index: 1
BFD status: Up BFD name: V4-srte_bfd_session-3
BFD remote-discriminator: 8822(configured)
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 3
computed segment : 1 (computed-node-segment):
node segment label: 801002
router-id: 17.0.0.2
computed segment : 2 (computed-node-segment):
node segment label: 801005
router-id: 17.0.0.5
computed segment : 3 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
### After we simulate a failure on R7 the primary path is down:
root@R1# run show spring-traffic-engineering lsp detail
Name: R7-PATH
Tunnel-source: Static configuration
Tunnel Forward Type: SRMPLS
To: 17.0.0.8
Te-group-id: 0
State: Up
Path: PRI-VIA-R7
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE
Total number of computed paths: 1
Segment ID : 128
Computed-path-index: 1
BFD status: Down BFD name: V4-srte_bfd_session-2
BFD remote-discriminator: 8811(configured)
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 2
computed segment : 1 (computed-node-segment):
node segment label: 801007
router-id: 17.0.0.7
computed segment : 2 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
Path: BACKUP-VIA-RED
Path Status: NA
Outgoing interface: NA
Auto-translate status: Disabled Auto-translate result: N/A
Compute Status:Enabled , Compute Result:success , Compute-Profile Name:COMPUTE-PROFILE-RED
Total number of computed paths: 1
Segment ID : 256
Computed-path-index: 1
BFD status: Up BFD name: V4-srte_bfd_session-3
BFD remote-discriminator: 8822(configured)
TE metric: 40, IGP metric: 40
Delay metrics: Min: 67108860, Max: 67108860, Avg: 67108860
Metric optimized by type: TE
computed segments count: 3
computed segment : 1 (computed-node-segment):
node segment label: 801002
router-id: 17.0.0.2
computed segment : 2 (computed-node-segment):
node segment label: 801005
router-id: 17.0.0.5
computed segment : 3 (computed-node-segment):
node segment label: 801008
router-id: 17.0.0.8
### But ping is still OK, using the secondary (RED) path:
root@R1# run ping routing-instance Cust-A 192.168.8.1
PING 192.168.8.1 (192.168.8.1): 56 data bytes
64 bytes from 192.168.8.1: icmp_seq=0 ttl=62 time=5.046 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=5.161 ms
^C
--- 192.168.8.1 ping statistics ---
23 packets transmitted, 23 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.323/5.661/7.465/0.900 ms
### Tcpdump capture on R4-R5 link:
15:33:49.602345 MPLS (label 801008, exp 0, ttl 62) (label 25, exp 0, [S], ttl 64) IP 192.168.1.1 > 192.168.8.1: ICMP echo request, id 14379, seq 8, length 64
External Resources: