Useful Articles




Policy Based Tunnel Selection (PBTS) is analogous to Class Based Tunnel Selection (CBTS) with only difference that you cannot configure CBTS on IOS-XR devices to manipulate/route the traffic based on EXP/DSCP/Precedence values, therefore we use PBTS on IOS-XR devices. Please refer to CBTS link for more information on how CBTS works.

Consider the below diagram for PBTS:


Aim: We need to have the connectivity b/w two customer sites of customer “xyz”

As shown in the image above, the primary path in the core backbone for CE1 to reach CE2 is R1–XR2–XR3–R7 (as shown by Green marker in above diagram)

If XR2–XR3 core links goes down, whole traffic will be routed via path R1–XR6–R7 (as shown by Red marker in above diagram). The R1–XR6 link might experience congestion if all the primary path traffic gets routed via R1–XR6–R7 path affecting the high priority Voice traffic.

In order to avoid congestion on R1–XR6 link, we will route some of low priority traffic (say Precedence/EXP 0,1,2) via another available path R1–XR4–XR5–R7 and rest of  high priority traffic going via R1–XR6–R7 path.

Steps and configuration for PBTS -  IOS-XR routers

1. Classify/Mark the traffic using Class-Maps.
2. Create a rule using Policy-Map for classified traffic using forward-class.
3. Configure a Service-policy to each backbone interface that would be used for PBTS path.
4. Create 2 TE-Tunnels, First for carrying high Priority Voice traffic with and Second for carrying low priority/Data traffic ( EXP 0,1,2).
Let's discuss these steps in detail.

Step1: Configuring Class-Map

class-map type traffic match-any CMAP_PBTS_Voice
 match mpls experimental topmost 5
class-map type traffic match-any CMAP_PBTS_Data
 match mpls experimental topmost 0  1  2

Step2: Configure Policy-Map

policy-map type pbr PM_PBTS
 class type traffic CMAP_PBTS_Voice
  set forward-class 5
class type traffic CMAP_PBTS_Data
  set forward-class 2

Step3: Configure Service-Policy under all expected Core Interfaces in the PBTS path

interface Te0/1/0/0
 service-policy type pbr input PM_PBTS

Step4: Configure TE Tunnels

interface tunnel-te10
 ipv4 unnumbered Loopback0
 path-option 1 dynamic
 autoroute announce
 forward-class 5

Note: TE Tunnel 10 will carry Voice traffic Via XR2–XR6–XR3 path (as shown by Red marker in diagram above.)

interface tunnel-te20
 ipv4 unnumbered Loopback0
 path-option 1 explicit name path_tunnel20
 autoroute announce
 forward-class 2
explicit-path name path_tunnel20
 index 1 exclude-address ipv4 unicast

Note: is link b/w R1-R6 with .1/24 on R1 and .6/24 on R6 respectively.

TE Tunnel 20 will carry Voice traffic Via XR2–XR4–XR5–XR3 path (as shown by Blue Marker in diagram above.)
We can also achieve same target sending low-priority Data Traffic (EXP 0,1,2) via XR2–XR4–XR5–XR3 by mapping it under forward-class 2 in Tunnel20 and rest of high priority traffic to be send under Tunnel 10 which is not configured with any forward-class.

If we’ll restore the primary path again,  the data with all precedence values will again start flowing through the primary path (Green marker).

Hope you have enjoyed reading this Post. Please share your feedback if you liked this post. You can also write to us on