Saturday, May 9, 2020

SRTE - Traffic Steering By Using Adjacency-Sid

Segment Routing with traffic engineering steers the traffic without maintaining the state in the network. The state is being maintained in the packet itself which provides lot of advantages in terms of savings of network resources.

In previous post, we have seen how to steer traffic by using "Segment Routing Explicit Path", "Segment Routing On Demand Next Hop for L3VPN (ODN)" and "Deploy Network Slice By Using Flex-Algo". "Deploy Network Slice By Using Flex-Algo" also leverages the affinity links so that Flex-Algo(k) must not take the path which is having affinity-map configured.

In today's post, we will see how to steer traffic with constraints by using dynamic path. In other words, we can also say that how we can leverage adjacency-SID while we steer the traffic on headend router. Below is topology used for demonstration purpose only. Configurations will remain be the same as per the earlier post of segment routing.

As per above topology, L4 shows the best path to reach PE7 (7.7.7.7) via GigabitEthernet0/0/0/1 -> Interface towards node S2. On L4, will color GigabitEthernet0/0/0/1 with blue affnity and GigabitEthernet0/0/0/0 with red infinity. SR-TE policy is created with contraint that don't use affinity blue link which is GigabitEthernet0/0/0/1 for color 128 and destination node 7.7.7.7. By default GigabitEthernet0/0/0/1 is selected by IGP but using adjacency-sid (affinity) we can steer the traffic to GigabitEthernet0/0/0/0.

Below output is showing the best path to reach 7.7.7.7/32 (PE7)
       
RP/0/0/CPU0:L4#show route isis
i L2 1.1.1.1/32 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 1.3.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 1.5.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 2.2.2.2/32 [115/10] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 2.3.0.0/24 [115/20] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 2.5.0.0/24 [115/20] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 3.3.3.3/32 [115/20] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 3.10.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 3.11.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 5.5.5.5/32 [115/20] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 5.6.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 5.8.0.0/24 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 6.6.6.6/32 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 6.7.0.0/24 [115/40] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 6.8.0.0/24 [115/40] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 7.7.7.7/32 [115/40] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 7.12.0.0/24 [115/50] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 7.13.0.0/24 [115/50] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
i L2 8.8.8.8/32 [115/30] via 2.4.0.2, 21:45:34, GigabitEthernet0/0/0/1
RP/0/0/CPU0:L4#


Tracerute before configuring link affinity
       
RP/0/0/CPU0:L4#traceroute vrf test 100.0.0.7
 1  2.4.0.2 [MPLS: Labels 16007/24009 Exp 0] 19 msec  9 msec  29 msec
 2  2.5.0.5 [MPLS: Labels 16007/24009 Exp 0] 9 msec  9 msec  9 msec
 3  5.6.0.6 [MPLS: Labels 16007/24009 Exp 0] 9 msec  9 msec  9 msec
 4  6.7.0.7 9 msec  *  9 msec
RP/0/0/CPU0:L4#


Apply below configuration for link affinity
       
RP/0/0/CPU0:L4#sh run segment-routing
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/0
   affinity
    name red
   !
  !
  interface GigabitEthernet0/0/0/1
   affinity
    name blue
   !
  !
  policy L4toL7
   color 128 end-point ipv4 7.7.7.7  -> candidate path instantiation whenever color is 128 and destination will 7.7.7.7 
   candidate-paths
    preference 100
     dynamic
      metric
       type igp
      !
     !
     constraints
      affinity
       exclude-any                       -> exclude blue link which GigabitEthernet0/0/0/1
        name blue
       !
      !
     !
    !
   !
  !
  affinity-map
   name red bit-position 1
   name blue bit-position 2
  !
 !
!
RP/0/0/CPU0:L4#


Check the output of SR-TE database L4:
       
RP/0/0/CPU0:L4#show segment-routing traffic-eng policy
SR-TE policy database
---------------------
Name: L4toL7 (Color: 128, End-point: 7.7.7.7)
  Status:
    Admin: up  Operational: up for 00:01:52 (since May  2 07:46:40.533)
  Candidate-paths:
    Preference 100:
      Constraints:
        Affinity:
          exclude-any:
           blue
      Path Metrics:
        Margin Absolute: 0
        Margin Relative: 0%
        Maximum SID Depth: 10
      Dynamic (active)
        Metric Type: IGP,   Path Accumulated Metric: 130
          24002 [Adjacency-SID, 1.4.0.4 - 1.4.0.1]             -> Adjacency Sid
          16007 [Prefix-SID, 7.7.7.7]                           -> Prefix-Sid
  Attributes:
    Binding SID: 24014                                          -> Binding Sid
      Allocation mode: dynamic
      State: Programmed
      Policy selected: yes
    Forward Class: 0
    Steering BGP disabled: no
    IPv6 caps enable: no
RP/0/0/CPU0:L4#


Check the below output to see adjacency-sid is allocated to Gi0/0/0/0 which is red link affinity.
       
RP/0/0/CPU0:L4#show mpls forwarding
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes
Label  Label       or ID              Interface                    Switched
------ ----------- ------------------ ------------ --------------- ------------
16001  16001       SR Pfx (idx 1)     Gi0/0/0/1    2.4.0.2         0
16002  Pop         SR Pfx (idx 2)     Gi0/0/0/1    2.4.0.2         0
16003  16003       SR Pfx (idx 3)     Gi0/0/0/1    2.4.0.2         0
16005  16005       SR Pfx (idx 5)     Gi0/0/0/1    2.4.0.2         0
16006  16006       SR Pfx (idx 6)     Gi0/0/0/1    2.4.0.2         0
16007  16007       SR Pfx (idx 7)     Gi0/0/0/1    2.4.0.2         0
17001  17001       SR Pfx (idx 1001)  Gi0/0/0/1    2.4.0.2         0
17002  Pop         SR Pfx (idx 1002)  Gi0/0/0/1    2.4.0.2         0
17003  17003       SR Pfx (idx 1003)  Gi0/0/0/1    2.4.0.2         0
17005  17005       SR Pfx (idx 1005)  Gi0/0/0/1    2.4.0.2         0
17006  17006       SR Pfx (idx 1006)  Gi0/0/0/1    2.4.0.2         0
17007  17007       SR Pfx (idx 1007)  Gi0/0/0/1    2.4.0.2         0
24000  Aggregate   test: Per-VRF Aggr[V]   \
                                      test                         14272
24001  Pop         SR Adj (idx 1)     Gi0/0/0/0    1.4.0.1         0
24002  Pop         SR Adj (idx 3)     Gi0/0/0/0    1.4.0.1         0     -> Adjacency-Sid
24003  Pop         SR Adj (idx 1)     Gi0/0/0/1    2.4.0.2         0
24004  Pop         SR Adj (idx 3)     Gi0/0/0/1    2.4.0.2         0
24009  Aggregate   test_without_odn: Per-VRF Aggr[V]   \
                                     test_without_odn             1784
RP/0/0/CPU0:L4#


Below output is showing whenever the color 128 prefix is received from PE7, BSID (24014) is attached to it.
       
RP/0/0/CPU0:L4#show bgp vpnv4 unicast vrf test 100.0.0.7
BGP routing table entry for 100.0.0.7/32, Route Distinguisher: 100:100
  Not advertised to any peer
  Local
    7.7.7.7 C:128 (bsid:24014) (metric 40) from 8.8.8.8 (7.7.7.7)
      Received Label 24009
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate, imported
      Received Path ID 0, Local Path ID 1, version 78
      Extended community: Color:128 RT:100:100
      Originator: 7.7.7.7, Cluster list: 8.8.8.8
      SR policy color 128, up, not-registered, bsid 24014
      Source AFI: VPNv4 Unicast, Source VRF: test, Source Route Distinguisher: 100:100
RP/0/0/CPU0:L4#


Run traceroute to 100.0.0.7 which is vrf test and being advertised by 7.7.7.7. Below output shows that the path is changed to Gi0/0/0/0 which is red link affinity. Earlier it was going via Gi0/0/0/1. Check the above traceroute output and match it with the below one. Difference can be seen easily.
       
RP/0/0/CPU0:L4#traceroute vrf test 100.0.0.7
 1  1.4.0.1 [MPLS: Labels 16007/24009 Exp 0] 19 msec  19 msec  9 msec
 2  1.5.0.5 [MPLS: Labels 16007/24009 Exp 0] 0 msec  9 msec  9 msec
 3  5.6.0.6 [MPLS: Labels 16007/24009 Exp 0] 9 msec  9 msec  19 msec
 4  6.7.0.7 9 msec  *  9 msec
RP/0/0/CPU0:L4#

People who read this post also read :



No comments: