This is a quick nugget kind of blog where we will see the configuration and working of the SRTE WECMP on IOS-XR device. We know how ECMP works basically if we have multiple paths available then we will use those paths to load balance the traffic and this is done in SRTE by default. With WECMP we have come at next level, If you are Cisco person then you might also have heard similar term in QOS , CBWFQ (class based weighted fair queue) where we define classes of the traffic and put a certain weight on it like 20%,30% etc …and the bandwidth allocation happens on the basis of weight. In Segment routing as well now we have a weighted traffic distribution method and we are going to explore that in this blog.
I am using below network, you can see we have two paths between R4-XR and R1-XE. I will use both these paths in WECMP in 1/3 to 2/3 distribution i.e. out of 3 packets 1 packet will go on orange path and 2 packets will go on red path. Also it is flow based so one flow will always choose same path, its not possible that out of three packet belonging to same flow 2 will go on red and 1 will go orange, if done like this can create out of order packets problem at destination node.

Configuration:
R4-XR configuration
RP/0/0/CPU0:R4-XR#sh run router isis
router isis LAB
is-type level-1
net 49.0000.0000.0000.0004.00
distribute link-state
address-family ipv4 unicast
metric-style wide
mpls traffic-eng level-1
mpls traffic-eng router-id Loopback1
segment-routing mpls
!
interface Loopback1
address-family ipv4 unicast
prefix-sid index 4
!
!
interface GigabitEthernet0/0/0/0
circuit-type level-1
point-to-point
!
!
interface GigabitEthernet0/0/0/1
circuit-type level-1
point-to-point
!
!
!
RP/0/0/CPU0:R4-XR#
RP/0/0/CPU0:R4-XR#sh run segment-routing
segment-routing
traffic-eng
segment-list SR-PATH-1-R1
index 1 mpls label 16002
index 2 mpls label 16001
!
segment-list SR-PATH-2-R1
index 1 mpls label 16005
index 2 mpls label 16003
index 3 mpls label 16002
index 4 mpls label 16001
!
policy POL1
color 20 end-point ipv4 1.1.1.1
candidate-paths
preference 100
explicit segment-list SR-PATH-1-R1
weight 4
!
explicit segment-list SR-PATH-2-R1
weight 2
!
!
!
Notice the wight configured in above configuration.
For IOS-XE router the rest of the configuration remains same just that there is a single command to specify the SRLIST and weight, like below.
R1-XE(config-srte-policy-path-pref)#explicit segment-list SR-LIST weight 2
Verification:
In order to verify if the distribution of traffic I have loopbacks(192.168.10.2/32 and 192.168.10.3/32) configured on the R1-XE router. And you can see how the traffic is getting distributed over both the available paths. It is difficult to say if the distribution is happening exactly in 1/3 to 2/3 manner, for this we need a live environment but in GNS3 perspective atleast we can say that load distribution is working fine.
Notice the tracerote, destination 192.168.10.3 is reachable via shorter path and the 192.168.10.2 is reachable via the orange longer path.
RP/0/0/CPU0:R4-XR#sh running-config router static Thu Aug 5 15:57:20.681 UTC router static address-family ipv4 unicast 192.168.10.2/32 sr-policy POL1 192.168.10.3/32 sr-policy POL1 ! ! RP/0/0/CPU0:R4-XR#traceroute 192.168.10.3 Type escape sequence to abort. Tracing the route to 192.168.10.3 1 10.10.10.9 [MPLS: Label 16001 Exp 0] 0 msec 0 msec 0 msec 2 10.10.10.1 0 msec * 0 msec RP/0/0/CPU0:R4-XR#traceroute 192.168.10.2 Type escape sequence to abort. Tracing the route to 192.168.10.2 1 10.10.10.18 [MPLS: Labels 16003/16002/16001 Exp 0] 9 msec 0 msec 0 msec 2 10.10.10.13 [MPLS: Labels 16002/16001 Exp 0] 0 msec 0 msec 0 msec 3 10.10.10.5 [MPLS: Label 16001 Exp 0] 19 msec 9 msec 0 msec 4 10.10.10.1 59 msec * 0 msec
Conclusion :
In comparison with the RSVP-TE, SRTE definitely gives a great method to traffic distribution. With this now network engineers will have more control with less management headache.
In my next blogs will cover more on SRTE, BGP-LS, Ti-LFA etc. So stay tuned for more. thanks.