15 mins read

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:

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:

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:

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:

Leave a Reply