# Profile 27 w/ Constraints

Coming from the previous lab, color the XR1-XR3 link RED. Configure the static SR Tree-SID policy to exclude RED links.





































































## Answer <a href="#id-29eeb90f-3c87-4b67-b614-de089b3c4946" id="id-29eeb90f-3c87-4b67-b614-de089b3c4946"></a>

```
#XR1, XR3
segment-routing
 traffic-eng
  interface GigabitEthernet0/0/0/0.3013
   affinity
    name RED
   !
  !
  affinity-map
   name RED bit-position 1

#XR9
pce
 segment-routing
  traffic-eng
   affinity bit-map
    RED 1
   !
   p2mp
    policy Tree-SID-Pol1
     candidate-paths
      constraints
       affinity
        exclude
         RED
```



## Explanation <a href="#a5c479b5-da6e-45f2-830d-8711b0403a10" id="a5c479b5-da6e-45f2-830d-8711b0403a10"></a>

Tree-SID allows us to use standard SR-TE tools to engineer the path an mVPN distribution tree takes. This is a big benefit over mLDP, as mLDP doesn’t give us this control.



To accomplish this lab we simply set the RED affinity on the XR1-XR3 link on both of those nodes.



The PCE must define the bit-mapping under the PCE config, and then include this as a constraint on the static Tree-SID policy.



We can see that the calculated policy now avoids XR3:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F7LVK9IRC7GDl5PiwS4Nv%2Fimage.png?alt=media&#x26;token=a4e77bf8-b8a5-4124-8545-a31eb77a52a4" alt=""><figcaption></figcaption></figure></div>



XR3 no longer has any Tree-SID state:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FWVchFUrMH1bTSzFoSmpf%2Fimage.png?alt=media&#x26;token=61f152f6-e1b6-42bd-b8a3-f231a40ed850" alt=""><figcaption></figcaption></figure></div>



The multicast distribution tree is now taking this path:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FiDi2db7zDy3dlr3mAuWm%2Fimage.png?alt=media&#x26;token=86246280-1503-423d-834e-896cb8a98f87" alt=""><figcaption></figcaption></figure></div>
