TE Tunnel with Conditional Attributes

Load mpls.te.base.config.with.ospf.and.affinity.cfg

#IOS-XE
config replace flash:mpls.te.base.config.with.ospf.and.affinity.cfg

#IOS-XR
configure
load bootflash:mpls.te.base.config.with.ospf.and.affinity.cfg
commit replace
y

Configure a bidirectional tunnel between CSR8 and XR11 that achieves the following:

  • Uses signalled bandwidth of 100M and only BLUE links

  • If 100M isn’t available, then the path should attempt to come up with 0 bandwidth

  • If BLUE links aren’t available, the path should attempt to come up with 0 bandwidth and no affinity constraints

Answer

#CSR8
mpls traffic-eng lsp attributes NO_AFFINITY_NO_BW
 affinity 0x0 mask 0x0
 bandwidth 0
!
interface Tunnel0
 ip unnumbered Loopback0
 tunnel mode mpls traffic-eng
 tunnel destination 11.11.11.11
 tunnel mpls traffic-eng priority 7 7
 tunnel mpls traffic-eng bandwidth 100000
 tunnel mpls traffic-eng affinity 0x4 mask 0x4
 tunnel mpls traffic-eng path-option 1 dynamic
 tunnel mpls traffic-eng path-option 2 dynamic bandwidth  0
 tunnel mpls traffic-eng path-option 3 dynamic attributes NO_AFFINITY_NO_BW

#XR11
mpls traffic-eng
 attribute-set path-option NO_BW
  signalled-bandwidth 0
 !
 attribute-set path-option NO_AFFINITY_NO_BW
  signalled-bandwidth 0
  affinity 0x0 mask 0x0
 !
 exit
 exit
!
int tunnel-te 0
 ip unn lo0
 dest 8.8.8.8
 signalled-bandwidth 100000
 affinity 0x4 mask 0x4
 path-option 1 dynamic
 path-option 2 dynamic attribute-set NO_BW
 path-option 3 dynamic attribute-set NO_AFFINITY_NO_BW

Explanation

The LSP attribute set feature allows you to apply attributes to individual path-options instead of to the TE tunnel as a whole. This allows you to do complex logic such as “if the previous path-option is not valid, try with affinity set to <value>.” You can have the router try to remove constraints as previous path-options fail. This can allow the TE tunnel to always be up, even if, for example, someone accidentally removes affinity values from a router in the network.

On IOS-XE, this is accomplised using the following configuration:

#IOS-XE
mpls traffic-eng lsp attributes name
 affinity ...
 bandwidth ...
 priority ...
!
interface Tunnel0
 tunnel mpls traffic-eng path-option num dynamic|explicit attributes name

IOS-XE also allows you to specify only the bandwidth attribute without needing a separate attribute set. Note that when you use this, if the associated path-option is active, the router will attempt to reoptimize the tunnel every 30 seconds to try to satisfy the original bandwidth constraint. This allows for the tunnel to at least be up in case bandwidth cannot be satisfied, but to actually reserve the bandwidth as soon as possible when it becomes available again.

#IOS-XE
interface Tunnel0
 tunnel mpls traffic-eng path-option num dynamic|explicit bandwidth value

On IOS-XR, this is accomplished similarly using an attribute-set. Note that IOS-XR doesn’t support as many features with the attribute-set. The major ones are just signalled-bandwidth and affinity.

#IOS-XR
mpls traffic-eng
 attribute-set path-option name
  signalled-bandwidth ...
  affinity ...
!
int tunnel-te 0
 path-option num dynamic|explicit attribute-set name

To meet the task requirements, we set the affinity and bandwidth for the tunnel to 0x4/0x4 and 100M. Path-option 1 attempts to calculate a dynamic path. Path-option 2 uses zero bandwidth. Path-option 3 uses 0x0/0x0 affinity and zero bandwidth.

#CSR8
mpls traffic-eng lsp attributes NO_AFFINITY_NO_BW
 affinity 0x0 mask 0x0
 bandwidth 0
!
interface Tunnel0
 tunnel mpls traffic-eng bandwidth 100000
 tunnel mpls traffic-eng affinity 0x4 mask 0x4
 tunnel mpls traffic-eng path-option 1 dynamic
 tunnel mpls traffic-eng path-option 2 dynamic bandwidth  0
 tunnel mpls traffic-eng path-option 3 dynamic attributes NO_AFFINITY_NO_BW

#XR11
mpls traffic-eng
 attribute-set path-option NO_BW
  signalled-bandwidth 0
 !
 attribute-set path-option NO_AFFINITY_NO_BW
  signalled-bandwidth 0
  affinity 0x0 mask 0x0
 !
 exit
 exit
!
int tunnel-te 0
 signalled-bandwidth 100000
 affinity 0x4 mask 0x4
 path-option 1 dynamic
 path-option 2 dynamic attribute-set NO_BW
 path-option 3 dynamic attribute-set NO_AFFINITY_NO_BW

Verification

When all links are up, CSR8 should be able to use the first path-option:

If we change all of CSR8’s interfaces to only have 50M available bandwidth, path-option 1 should fail, and path-option 2 should succeed. Notice below that the requested bandwidth on the tunnel when path-option 2 is used is now zero.

#CSR8
int GigabitEthernet2.518 
 ip rsvp bandwidth 50000
int GigabitEthernet2.568 
 ip rsvp bandwidth 50000
int GigabitEthernet2.589
 ip rsvp bandwidth 50000

Lastly, we can change CSR8’s local interfaces no not belong to affinity “BLUE” (0x4). This should cause path-option 2 to fail and path-option 3 should be used. Notice below that the affinity has changed to 0x0/0x0.

#CSR8
int GigabitEthernet2.518 
 no mpls traffic-eng attribute-flags
int GigabitEthernet2.568 
 mpls traffic-eng attribute-flags 0x2

We can also test this on XR11. By default, path-option 1 is used.

If we change XR11’s available bandwidth on all local interfaces to less than 100M, path-option 1 should fail.

#XR11
rsvp
 interface GigabitEthernet0/0/0/0.501
  bandwidth 10000
 !
 interface GigabitEthernet0/0/0/0.512
  bandwidth 10000
 !
 interface GigabitEthernet0/0/0/0.551
  bandwidth 10000

If we remove XR11’s BLUE affinity from local links, path-option 2 should fail and path-option 3 should be used.

#XR11
mpls traffic-eng
 interface GigabitEthernet0/0/0/0.512
  no attribute-names BLUE
 interface GigabitEthernet0/0/0/0.551
  no attribute-names BLUE

Last updated