SR-MPLS – Static colored LSP
1. Intro
The ingress route of the colored LSP is installed in the inetcolor.0 or inet6color.0 routing tables, with destination-ip-address, color as key for mapping IP traffic.
We will use the same test topology from the previous posts:

The initial config is simple:
###
root@R1# show protocols source-packet-routing | display set
set protocols source-packet-routing segment-list R1-TO-R8-primary LABEL-TO-R7 label 801007
set protocols source-packet-routing segment-list R1-TO-R8-primary LABEL-TO-R8 label 801008
set protocols source-packet-routing source-routing-path R1-TO-R8 to 17.0.0.8
set protocols source-packet-routing source-routing-path R1-TO-R8 primary R1-TO-R8-primary
### We can see the 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, 8 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.8/32 *[SPRING-TE/8] 00:09:29, metric 1, metric2 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801008, Push 801007(top)
[L-ISIS/14] 1w5d 01:18:15, metric 30
> to 17.1.3.3 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: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.8.1/32 *[BGP/170] 1w0d 00:07:35, localpref 100, from 17.0.0.4
AS path: I, validation-state: unverified
> to 17.1.3.3 via ge-0/0/2.0, Push 16, Push 801008, Push 801007(top)
### We can ping the remote VPN on R8:
root@R1# run ping 192.168.8.1 routing-instance Cust-A
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.132 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=5.027 ms
^C
--- 192.168.8.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 5.027/5.079/5.132/0.053 ms
2. Colored LSP
We want to transform our source-routing-path R1-TO-R8 to a colored LSP:
### Make our LSP a colored one:
root@R1# set protocols source-packet-routing source-routing-path R1-TO-R8 color 1818
[edit]
root@R1# show | compare
[edit protocols source-packet-routing source-routing-path R1-TO-R8]
+ color 1818;
[edit]
root@R1# commit
commit complete
### Ping still works:
root@R1# run ping 192.168.8.1 routing-instance Cust-A
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.309 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=4.234 ms
^C
--- 192.168.8.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.234/4.271/4.309/0.038 ms
### But the LSP is not used for forwarding:
root@R1# run show route table Cust-A.inet 192.168.8.1
Cust-A.inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.8.1/32 *[BGP/170] 1w0d 00:06:44, localpref 100, from 17.0.0.4
AS path: I, validation-state: unverified
> to 17.1.3.3 via ge-0/0/2.0, Push 16, Push 801008(top)
root@R1# run show route table Cust-A.inet 192.168.8.1/32 extensive
Cust-A.inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
192.168.8.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 192.168.8.1/32 -> {indirect(1048574)}
*BGP Preference: 170/-101
Route Distinguisher: 17.0.0.8:100
Next hop type: Indirect, Next hop index: 0
Address: 0x7bc02c4
Next-hop reference count: 6, key opaque handle: 0x0, non-key opaque handle: 0x0
Kernel Table Id: 0
Source: 17.0.0.4
Next hop type: Router, Next hop index: 690
Next hop: 17.1.3.3 via ge-0/0/2.0, selected
Label operation: Push 16, Push 801008(top)
Label TTL action: prop-ttl, prop-ttl(top)
Load balance label: Label 16: None; Label 801008: None;
Label element ptr: 0xe175898
Label parent element ptr: 0xe171888
Label element references: 1
Label element child references: 0
Label element lsp id: 0
Session Id: 141
Protocol next hop: 17.0.0.8
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791da20 1048574 INH Session ID: 351
State: <Secondary Active Int Ext ProtectionCand>
Local AS: 64512 Peer AS: 64512
Age: 1w0d 0:09:52 Metric2: 30
Validation State: unverified
Task: BGP_64512.17.0.0.4
Announcement bits (1): 0-KRT
AS path: I (Originator)
Cluster list: 17.0.0.4
Originator ID: 17.0.0.8
Communities: target:64512:100
Import Accepted
VPN Label: 16
Localpref: 100
Router ID: 17.0.0.4
Primary Routing Table: bgp.l3vpn.0
Thread: junos-main
Indirect next hops: 1
Protocol next hop: 17.0.0.8 Metric: 30 ResolvState: Resolved
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791da20 1048574 INH Session ID: 351
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
17.0.0.8/32 Originating RIB: inet.3
Metric: 30 Node path count: 1
Forwarding nexthops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 0
### The SR-TE route is no longer there:
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] 1w5d 01:25:46, metric 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801008
### Now, because it is a colored LSP, it will install the next-hop in the inetcolor.0 table:
root@R1# run show route table inetcolor.0
inetcolor.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.8-1818<c>/64
*[SPRING-TE/8] 00:03:31, metric 1, metric2 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801008, Push 801007(top)
But this is not enough, now we will instruct our L3VPN to use this colored LSP.. First we need to attach a BGP color community to our L3VPN prefixes, and then we need to instruct R1 to use it (using resolution map):
### On R8, configure the VRF to attach the colored BGP community:
root@R8# show | compare
[edit]
+ policy-options {
+ policy-statement Cust-A-export {
+ then {
+ community add RT-Cust-A;
+ community add Color-Cust-A;
+ accept;
+ }
+ }
+ community Color-Cust-A members color:0:1818;
+ community RT-Cust-A members target:64512:100;
+ }
[edit routing-instances Cust-A]
+ vrf-export Cust-A-export;
[edit routing-instances Cust-A vrf-target]
- export target:64512:100;
[edit]
root@R8# commit
commit complete
### Back to R1, we can see the BGP color comunity is there:
root@R1# run show route table Cust-A.inet 192.168.8.1/32 extensive
Cust-A.inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
192.168.8.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 192.168.8.1/32 -> {indirect(1048574)}
*BGP Preference: 170/-101
Route Distinguisher: 17.0.0.8:100
Next hop type: Indirect, Next hop index: 0
Address: 0x7bc02c4
Next-hop reference count: 6, key opaque handle: 0x0, non-key opaque handle: 0x0
Kernel Table Id: 0
Source: 17.0.0.4
Next hop type: Router, Next hop index: 690
Next hop: 17.1.3.3 via ge-0/0/2.0, selected
Label operation: Push 16, Push 801008(top)
Label TTL action: prop-ttl, prop-ttl(top)
Load balance label: Label 16: None; Label 801008: None;
Label element ptr: 0xe175898
Label parent element ptr: 0xe171888
Label element references: 1
Label element child references: 0
Label element lsp id: 0
Session Id: 141
Protocol next hop: 17.0.0.8
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791da20 1048574 INH Session ID: 351
State: <Secondary Active Int Ext ProtectionCand>
Local AS: 64512 Peer AS: 64512
Age: 5 Metric2: 30
Validation State: unverified
ORR Generation-ID: 0
Task: BGP_64512.17.0.0.4
Announcement bits (1): 0-KRT
AS path: I (Originator)
Cluster list: 17.0.0.4
Originator ID: 17.0.0.8
Communities: target:64512:100 color:0:1818
Import Accepted
VPN Label: 16
Localpref: 100
Router ID: 17.0.0.4
Primary Routing Table: bgp.l3vpn.0
Thread: junos-main
Indirect next hops: 1
Protocol next hop: 17.0.0.8 Metric: 30 ResolvState: Resolved
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791da20 1048574 INH Session ID: 351
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
17.0.0.8/32 Originating RIB: inet.3
Metric: 30 Node path count: 1
Forwarding nexthops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 0
### Now, let's tell R1 to use the inetcolor.0 table:
root@R1# show | compare
[edit policy-options]
+ policy-statement Cust-A-import {
+ term IMPORT {
+ from community RT-Cust-A;
+ then {
+ accept;
+ resolution-map RMAP-Cust-A;
+ }
+ }
+ then reject;
+ }
[edit policy-options]
+ community RT-Cust-A members target:64512:100;
+ resolution-map RMAP-Cust-A {
+ mode ip-color;
+ }
[edit routing-instances Cust-A]
+ vrf-import Cust-A-import;
[edit routing-instances Cust-A vrf-target]
- import target:64512:100;
[edit]
root@R1# commit
commit complete
### Now we are using the inetcolor.0 table instead of inet.3:
root@R1# run show route table Cust-A.inet 192.168.8.1/32 extensive
Cust-A.inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
192.168.8.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 192.168.8.1/32 -> {indirect(1048578)}
*BGP Preference: 170/-101
Route Distinguisher: 17.0.0.8:100
Next hop type: Indirect, Next hop index: 0
Address: 0x7bbfa74
Next-hop reference count: 4, key opaque handle: 0x0, non-key opaque handle: 0x0
Kernel Table Id: 0
Source: 17.0.0.4
Next hop type: Router, Next hop index: 687
Next hop: 17.1.3.3 via ge-0/0/2.0, selected
Label operation: Push 16, Push 801008, Push 801007(top)
Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)
Load balance label: Label 16: None; Label 801008: None; Label 801007: None;
Label element ptr: 0xe1727d8
Label parent element ptr: 0xe174240
Label element references: 1
Label element child references: 0
Label element lsp id: 0
Session Id: 141
Protocol next hop: 17.0.0.8-1818<c>
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791e218 1048578 INH Session ID: 0
State: <Secondary Active IndepResolution Int Ext ProtectionCand>
Local AS: 64512 Peer AS: 64512
Age: 44 Metric2: 30
Validation State: unverified
ORR Generation-ID: 0
Task: BGP_64512.17.0.0.4
Announcement bits (1): 0-KRT
AS path: I (Originator)
Cluster list: 17.0.0.4
Originator ID: 17.0.0.8
Communities: target:64512:100 color:0:1818
Import Accepted
VPN Label: 16
Localpref: 100
Router ID: 17.0.0.4
Primary Routing Table: bgp.l3vpn.0
Thread: junos-main
Indirect next hops: 1
Protocol next hop: 17.0.0.8-1818<c> Metric: 30 ResolvState: Resolved
Label operation: Push 16
Label TTL action: prop-ttl
Load balance label: Label 16: None;
Indirect next hop: 0x791e218 1048578 INH Session ID: 0
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
17.0.0.8-1818<c>/64 Originating RIB: inetcolor.0
Metric: 30 Node path count: 1
Composite next hops: 1
Protocol next hop: 801007 Metric: 30 ResolvState: Resolved
Inode flags: 0x204 path flags: 0x0
Path fnh link: 0x76d2fe0 path inh link: 0x7fc2b50
Label operation: Push 801008
Label TTL action: prop-ttl
Load balance label: Label 801008: None;
Composite next hop: 0x76d3880 - INH Session ID: 0
Indirect next hop: 0x791dee8 - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 0
801007 /52 Originating RIB: mpls.0
Metric: 30 Node path count: 1
Forwarding nexthops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
### Let's see again the inetcolor.0 table:
root@R1# run show route table inetcolor.0
inetcolor.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.0.0.8-1818<c>/64
*[SPRING-TE/8] 00:33:21, metric 1, metric2 30
> to 17.1.3.3 via ge-0/0/2.0, Push 801008, Push 801007(top)
### Ping is working:
root@R1# run ping 192.168.8.1 routing-instance Cust-A
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.785 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=62 time=7.495 ms
^C
--- 192.168.8.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.785/6.140/7.495/1.355 ms
### And we can see the correct labels if we check a tcpdump capture:
14:35:13.532808 MPLS (label 801007, exp 0, ttl 64) (label 801008, exp 0, ttl 64) (label 16, exp 0, [S], ttl 64) IP 192.168.1.1 > 192.168.8.1: ICMP echo request, id 21606, seq 14, length 64
3. Colored LSP for BGP inet unicast
The previous example was for L3VPNs, but how can we do the same for BGP inet unicast prefixes (GRT), where we don’t have VRF import policies to activate next-hop resolution in the inetcolor.0 table? See next:
### R1 is receiving the following prefix:
root@R1# run show route table inet.0 protocol bgp
inet.0: 43 destinations, 43 routes (43 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
17.8.19.0/24 *[BGP/170] 00:00:57, localpref 100, from 17.0.0.4
AS path: I, validation-state: unverified
> to 17.1.3.3 via ge-0/0/2.0, Push 801008
### To activate LSP color based forwarding we will use the following cli command:
root@R1# set protocols bgp group iBGP family inet unicast extended-nexthop-color
[edit]
root@R1# show | compare
[edit protocols bgp group iBGP family inet unicast]
+ extended-nexthop-color;
[edit]
root@R1# commit
commit complete
### It's not working yet, next-hop resolution is still in the inet.3 table:
root@R1# run show route table inet.0 protocol bgp 17.8.19.0/24 extensive
inet.0: 43 destinations, 43 routes (43 active, 0 holddown, 0 hidden)
17.8.19.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 17.8.19.0/24 -> {indirect(1048583)}
*BGP Preference: 170/-101
Next hop type: Indirect, Next hop index: 0
Address: 0x7bbfb54
Next-hop reference count: 2, key opaque handle: 0x0, non-key opaque handle: 0x0
Kernel Table Id: 0
Source: 17.0.0.4
Next hop type: Router, Next hop index: 696
Next hop: 17.1.3.3 via ge-0/0/2.0, selected
Label operation: Push 801008
Label TTL action: prop-ttl
Load balance label: Label 801008: None;
Label element ptr: 0xe171888
Label parent element ptr: 0x0
Label element references: 2
Label element child references: 1
Label element lsp id: 0
Session Id: 141
Protocol next hop: 17.0.0.8
Indirect next hop: 0x791e548 1048583 INH Session ID: 356
State: <Active Int Ext>
Local AS: 64512 Peer AS: 64512
Age: 9:37 Metric2: 30
Validation State: unverified
ORR Generation-ID: 0
Task: BGP_64512.17.0.0.4
Announcement bits (2): 0-KRT 4-Resolve tree 6
AS path: I (Originator)
Cluster list: 17.0.0.4
Originator ID: 17.0.0.8
Accepted
Localpref: 100
Router ID: 17.0.0.4
Thread: junos-main
Indirect next hops: 1
Protocol next hop: 17.0.0.8 Metric: 30 ResolvState: Resolved
Indirect next hop: 0x791e548 1048583 INH Session ID: 356
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
17.0.0.8/32 Originating RIB: inet.3
Metric: 30 Node path count: 1
Forwarding nexthops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
### On R8, let's advertise the prefix with the BGP community color:
root@R8# set policy-options policy-statement iBGP-export then community add Color-Cust-A
### Now it is working, because we have the color community:
root@R1# run show route table inet.0 protocol bgp 17.8.19.0/24 extensive
inet.0: 43 destinations, 43 routes (43 active, 0 holddown, 0 hidden)
17.8.19.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 17.8.19.0/24 -> {composite(645)}
*BGP Preference: 170/-101
Next hop type: Indirect, Next hop index: 0
Address: 0x7bbeab4
Next-hop reference count: 3, key opaque handle: 0x0, non-key opaque handle: 0x0
Kernel Table Id: 0
Source: 17.0.0.4
Next hop type: Router, Next hop index: 644
Next hop: 17.1.3.3 via ge-0/0/2.0, selected
Label operation: Push 801008, Push 801007(top)
Label TTL action: prop-ttl, prop-ttl(top)
Load balance label: Label 801008: None; Label 801007: None;
Label element ptr: 0xe176270
Label parent element ptr: 0x7f66c88
Label element references: 2
Label element child references: 1
Label element lsp id: 0
Session Id: 141
Protocol next hop: 17.0.0.8-1818<c>
Composite next hop: 0x76d2140 645 INH Session ID: 0
Indirect next hop: 0x791e6e0 1048574 INH Session ID: 0
State: <Active Int Ext>
Local AS: 64512 Peer AS: 64512
Age: 1 Metric2: 30
Validation State: unverified
Task: BGP_64512.17.0.0.4
Announcement bits (1): 0-KRT
AS path: I (Originator)
Cluster list: 17.0.0.4
Originator ID: 17.0.0.8
Communities: color:0:1818
Accepted
Localpref: 100
Router ID: 17.0.0.4
Thread: junos-main
Composite next hops: 1
Protocol next hop: 17.0.0.8-1818<c> Metric: 30 ResolvState: Resolved
Composite next hop: 0x76d2140 645 INH Session ID: 0
Indirect next hop: 0x791e6e0 1048574 INH Session ID: 0
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
17.0.0.8-1818<c>/64 Originating RIB: inetcolor.0
Metric: 30 Node path count: 1
Composite next hops: 1
Protocol next hop: 801007 Metric: 30 ResolvState: Resolved
Inode flags: 0x204 path flags: 0x0
Path fnh link: 0x76d2fe0 path inh link: 0x7fc2b50
Label operation: Push 801008
Label TTL action: prop-ttl
Load balance label: Label 801008: None;
Composite next hop: 0x76d3880 - INH Session ID: 0
Indirect next hop: 0x791dee8 - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 0
801007 /52 Originating RIB: mpls.0
Metric: 30 Node path count: 1
Forwarding nexthops: 1
Next hop type: Router
Next hop: 17.1.3.3 via ge-0/0/2.0
Session Id: 141
### Ping is working:
root@R1# run ping 17.8.19.1 source 17.1.19.1
PING 17.8.19.1 (17.8.19.1): 56 data bytes
64 bytes from 17.8.19.1: icmp_seq=0 ttl=62 time=4.474 ms
64 bytes from 17.8.19.1: icmp_seq=1 ttl=62 time=4.764 ms
^C
--- 17.8.19.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 4.474/4.619/4.764/0.145 ms
### With tcpdump we can see the slightly longer path via R7:
15:07:32.130995 MPLS (label 801007, exp 0, ttl 64) (label 801008, exp 0, [S], ttl 64) IP 17.1.19.1 > 17.8.19.1: ICMP echo request, id 46447, seq 1, length 64
External Resources: