Affinity is an interesting attribute that can be used to either include or exclude a link that could be used in the TE path. In this example, I used it to exclude a link in the path to route around the IGP shortest path and take a slightly longer path, since the shortest path may not be the best path ;).
CSR3
interface GigabitEthernet2
mpls traffic-eng attribute-flags 0x1
CSR1
interface Tunnel100
ip unnumbered Loopback0
tunnel mode mpls traffic-eng
tunnel destination 192.0.2.13
tunnel mpls traffic-eng affinity 0x0 mask 0x1
tunnel mpls traffic-eng path-option 100 dynamic
CSR1#show mpls traffic-eng tunnels tunnel 100
Name: CSR1_t100 (Tunnel100) Destination: 192.0.2.13
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 100, type dynamic (Basis for Setup, path weight 50)
Config Parameters:
Bandwidth: 0 kbps (Global) Priority: 7 7 Affinity: 0x0/0x1
Metric Type: TE (default)
AutoRoute: disabled LockDown: disabled Loadshare: 0 [0] bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 100 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : -
OutLabel : GigabitEthernet1, 19
Next Hop : 10.1.3.3
RSVP Signalling Info:
Src 192.0.2.1, Dst 192.0.2.13, Tun_Id 100, Tun_Instance 34
RSVP Path Info:
My Address: 10.1.3.1
Explicit Route: 10.1.3.3 10.3.9.3 10.3.9.9 10.9.15.9
10.9.15.15 10.14.15.15 10.14.15.14 10.13.14.14
10.13.14.13 192.0.2.13
Record Route: NONE
Tspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Shortest Unconstrained Path Info:
Path Weight: 30 (TE)
Explicit Route: 10.1.3.1 10.1.3.3 10.3.14.3 10.3.14.14
10.13.14.14 10.13.14.13 192.0.2.13
History:
Tunnel:
Time since created: 43 minutes, 19 seconds
Time since path change: 37 seconds
Number of LSP IDs (Tun_Instances) used: 34
Current LSP: [ID: 34]
Uptime: 37 seconds
Prior LSP: [ID: 33]
ID: path option unknown
Removal Trigger: tunnel shutdown
XR14
mpls traffic-eng
interface GigabitEthernet0/0/0/0
attribute-flags 0x1
XR13
interface tunnel-te100
affinity 0x0 mask 0x1
RP/0/0/CPU0:XR13(config)#int tunnel-te 100
RP/0/0/CPU0:XR13(config-if)#affinity 0x0 mask 0x1
RP/0/0/CPU0:XR13(config-if)#shut
RP/0/0/CPU0:XR13(config-if)#commit
RP/0/0/CPU0:XR13(config-if)#no shut
RP/0/0/CPU0:XR13(config-if)#commit
RP/0/0/CPU0:XR13(config-if)#do sh mpls traffic-eng tunnels 100
Sun Sep 15 23:35:12.646 UTC
Name: tunnel-te100 Destination: 192.0.2.1 Ifhandle:0x980
Signalled-Name: XR13_t100
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 100, type dynamic (Basis for Setup, path weight 50)
G-PID: 0x0800 (derived from egress interface properties)
Bandwidth Requested: 0 kbps CT0
Creation Time: Sun Sep 15 23:15:09 2019 (00:20:03 ago)
Config Parameters:
Bandwidth: 0 kbps (CT0) Priority: 7 7 Affinity: 0x0/0x1
Metric Type: TE (default)
Path Selection:
Tiebreaker: Min-fill (default)
Hop-limit: disabled
Cost-limit: disabled
Path-invalidation timeout: 10000 msec (default), Action: Tear (default)
AutoRoute: disabled LockDown: disabled Policy class: not set
Forward class: 0 (default)
Forwarding-Adjacency: disabled
Loadshare: 0 equal loadshares
Auto-bw: disabled
Fast Reroute: Disabled, Protection Desired: None
Path Protection: Not Enabled
BFD Fast Detection: Disabled
Reoptimization after affinity failure: Enabled
Soft Preemption: Disabled
History:
Tunnel has been up for: 00:00:08 (since Sun Sep 15 23:35:04 UTC 2019)
Current LSP:
Uptime: 00:00:08 (since Sun Sep 15 23:35:04 UTC 2019)
Prior LSP:
ID: 4 Path Option: 100
Removal Trigger: tunnel shutdown
Path info (IS-IS 1 level-1):
Node hop count: 5
Hop0: 10.13.14.14
Hop1: 10.14.15.14
Hop2: 10.14.15.15
Hop3: 10.9.15.15
Hop4: 10.9.15.9
Hop5: 10.3.9.9
Hop6: 10.3.9.3
Hop7: 10.1.3.3
Hop8: 10.1.3.1
Hop9: 192.0.2.1
LSP Tunnel 192.0.2.1 100 [34] is signalled, Signaling State: up
Tunnel Name: CSR1_t100 Tunnel Role: Tail
InLabel: GigabitEthernet0/0/0/0, implicit-null
Signalling Info:
Src 192.0.2.1 Dst 192.0.2.13, Tun ID 100, Tun Inst 34, Ext ID 192.0.2.1
Router-IDs: upstream 192.0.2.14
local 192.0.2.13
Bandwidth: 0 kbps (CT0) Priority: 7 7 DSTE-class: 0
Soft Preemption: None
SRLGs: not collected
Path Info:
Incoming Address: 10.13.14.13
Incoming:
Explicit Route:
Strict, 10.13.14.13
Strict, 192.0.2.13
Record Route: Disabled
Tspec: avg rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Session Attributes: Local Prot: Not Set, Node Prot: Not Set, BW Prot: Not Set
Soft Preemption Desired: Not Set
Resv Info: None
Record Route: Disabled
Fspec: avg rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Displayed 1 (of 1) heads, 0 (of 0) midpoints, 1 (of 1) tails
Displayed 1 up, 0 down, 0 recovering, 0 recovered heads
CSR3
interface GigabitEthernet2
mpls traffic-eng attribute-flags 0x1
CSR1
interface Tunnel100
ip unnumbered Loopback0
tunnel mode mpls traffic-eng
tunnel destination 192.0.2.13
tunnel mpls traffic-eng affinity 0x0 mask 0x1
tunnel mpls traffic-eng path-option 100 dynamic
CSR1#show mpls traffic-eng tunnels tunnel 100
Name: CSR1_t100 (Tunnel100) Destination: 192.0.2.13
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 100, type dynamic (Basis for Setup, path weight 50)
Config Parameters:
Bandwidth: 0 kbps (Global) Priority: 7 7 Affinity: 0x0/0x1
Metric Type: TE (default)
AutoRoute: disabled LockDown: disabled Loadshare: 0 [0] bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 100 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : -
OutLabel : GigabitEthernet1, 19
Next Hop : 10.1.3.3
RSVP Signalling Info:
Src 192.0.2.1, Dst 192.0.2.13, Tun_Id 100, Tun_Instance 34
RSVP Path Info:
My Address: 10.1.3.1
Explicit Route: 10.1.3.3 10.3.9.3 10.3.9.9 10.9.15.9
10.9.15.15 10.14.15.15 10.14.15.14 10.13.14.14
10.13.14.13 192.0.2.13
Record Route: NONE
Tspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Shortest Unconstrained Path Info:
Path Weight: 30 (TE)
Explicit Route: 10.1.3.1 10.1.3.3 10.3.14.3 10.3.14.14
10.13.14.14 10.13.14.13 192.0.2.13
History:
Tunnel:
Time since created: 43 minutes, 19 seconds
Time since path change: 37 seconds
Number of LSP IDs (Tun_Instances) used: 34
Current LSP: [ID: 34]
Uptime: 37 seconds
Prior LSP: [ID: 33]
ID: path option unknown
Removal Trigger: tunnel shutdown
XR14
mpls traffic-eng
interface GigabitEthernet0/0/0/0
attribute-flags 0x1
XR13
interface tunnel-te100
affinity 0x0 mask 0x1
RP/0/0/CPU0:XR13(config)#int tunnel-te 100
RP/0/0/CPU0:XR13(config-if)#affinity 0x0 mask 0x1
RP/0/0/CPU0:XR13(config-if)#shut
RP/0/0/CPU0:XR13(config-if)#commit
RP/0/0/CPU0:XR13(config-if)#no shut
RP/0/0/CPU0:XR13(config-if)#commit
RP/0/0/CPU0:XR13(config-if)#do sh mpls traffic-eng tunnels 100
Sun Sep 15 23:35:12.646 UTC
Name: tunnel-te100 Destination: 192.0.2.1 Ifhandle:0x980
Signalled-Name: XR13_t100
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 100, type dynamic (Basis for Setup, path weight 50)
G-PID: 0x0800 (derived from egress interface properties)
Bandwidth Requested: 0 kbps CT0
Creation Time: Sun Sep 15 23:15:09 2019 (00:20:03 ago)
Config Parameters:
Bandwidth: 0 kbps (CT0) Priority: 7 7 Affinity: 0x0/0x1
Metric Type: TE (default)
Path Selection:
Tiebreaker: Min-fill (default)
Hop-limit: disabled
Cost-limit: disabled
Path-invalidation timeout: 10000 msec (default), Action: Tear (default)
AutoRoute: disabled LockDown: disabled Policy class: not set
Forward class: 0 (default)
Forwarding-Adjacency: disabled
Loadshare: 0 equal loadshares
Auto-bw: disabled
Fast Reroute: Disabled, Protection Desired: None
Path Protection: Not Enabled
BFD Fast Detection: Disabled
Reoptimization after affinity failure: Enabled
Soft Preemption: Disabled
History:
Tunnel has been up for: 00:00:08 (since Sun Sep 15 23:35:04 UTC 2019)
Current LSP:
Uptime: 00:00:08 (since Sun Sep 15 23:35:04 UTC 2019)
Prior LSP:
ID: 4 Path Option: 100
Removal Trigger: tunnel shutdown
Path info (IS-IS 1 level-1):
Node hop count: 5
Hop0: 10.13.14.14
Hop1: 10.14.15.14
Hop2: 10.14.15.15
Hop3: 10.9.15.15
Hop4: 10.9.15.9
Hop5: 10.3.9.9
Hop6: 10.3.9.3
Hop7: 10.1.3.3
Hop8: 10.1.3.1
Hop9: 192.0.2.1
LSP Tunnel 192.0.2.1 100 [34] is signalled, Signaling State: up
Tunnel Name: CSR1_t100 Tunnel Role: Tail
InLabel: GigabitEthernet0/0/0/0, implicit-null
Signalling Info:
Src 192.0.2.1 Dst 192.0.2.13, Tun ID 100, Tun Inst 34, Ext ID 192.0.2.1
Router-IDs: upstream 192.0.2.14
local 192.0.2.13
Bandwidth: 0 kbps (CT0) Priority: 7 7 DSTE-class: 0
Soft Preemption: None
SRLGs: not collected
Path Info:
Incoming Address: 10.13.14.13
Incoming:
Explicit Route:
Strict, 10.13.14.13
Strict, 192.0.2.13
Record Route: Disabled
Tspec: avg rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Session Attributes: Local Prot: Not Set, Node Prot: Not Set, BW Prot: Not Set
Soft Preemption Desired: Not Set
Resv Info: None
Record Route: Disabled
Fspec: avg rate=0 kbits, burst=1000 bytes, peak rate=0 kbits
Displayed 1 (of 1) heads, 0 (of 0) midpoints, 1 (of 1) tails
Displayed 1 up, 0 down, 0 recovering, 0 recovered heads