Cost Calculation of IGP routes over TE tunnels

Cost Calculation of IGP routes over TE tunnels

By default, MPLS TE uses TE metrics of the links to route TE tunnels. However, by default TE metrics are same as the IGP metrics. To change this default behaviour of using TE metrics of the links to route TE tunnels over to IGP, use

tunnel mpls traffic-eng path-selection metric <igp | te> command from Tunnel interface configuration mode.

To change TE metric for a TE tunnel, use

mpls traffic-eng administrative-weight <weight> command from the physical interface.

When autoroute announce is used to calculate the cost of the TE tunnel and build IP routing table, it uses the IGP path with lowest cost as the TE tunnel cost.

Let's check out few scenarios and try to calculate the TE metric.

1) A TE tunnel is setup from R1 to R5. TE tunnel source is R1's Loopback 0 and destination is R5's Loopback 0.

The cost of the TE tunnel is 2 which is the cost of reaching R4 plus cost of reaching R4 to R5.

R1# show mpls traffic-eng tunnels tunnel 0

Name: R1_t0 (Tunnel0) Destination: 10.200.254.2

Status:

Admin: up Oper: up Path: valid Signalling: connected

path option 1, type dynamic (Basis for Setup, path weight 2)

Config Parameters:

Bandwidth: 101 kbps (Global) Priority: 1 1 Affinity: 0x0/0xFFFF

Metric Type: TE (default)

AutoRoute: enabled LockDown: disabled Loadshare: 101 bw-based

auto-bw: disabled

InLabel : -

OutLabel : Serial0/1, 16

RSVP Signalling Info:

Src 10.200.254.1, Dst 10.200.254.2, Tun_Id 0, Tun_Instance 6

RSVP Path Info:

My Address: 10.200.254.1

Explicit Route: 10.1.1.6 10.4.4.2 10.200.254.2

Record Route:

Tspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

RSVP Resv Info:

Record Route: 10.1.1.6 10.4.4.2

Fspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

Shortest Unconstrained Path Info:

Path Weight: 2 (TE)

Explicit Route: 10.1.1.6 10.4.4.2 10.200.254.2

History:

Tunnel:

Time since created: 6 minutes, 55 seconds

Time since path change: 6 minutes, 42 seconds

Current LSP:

Uptime: 6 minutes, 42 seconds

Since 10.200.254.2/32 is directly connected to R5, the IGP cost to reach this network from R1 is 3 in the routing table and reachable via TE tunnel 0. Although, there is also an IP path R1-R4-R5 with the cost of 3 to reach 10.200.254.2/32, no load-balancing occurs since the rule suggests- for a prefix on the tail-end router (10.200.254.2/32 on R5), only the tunnel that ends on the tail-end router should be used to reach the prefix.

R1# show ip route 10.200.254.2

Routing entry for 10.200.254.2/32

Known via "ospf 1", distance 110, metric 3, type intra area

Last update from 10.200.254.2 on Tunnel0, 00:03:58 ago

Routing Descriptor Blocks:

* 10.200.254.2, from 10.200.254.2, 00:03:58 ago, via Tunnel0

Route metric is 3, traffic share count is 1

2) A TE Tunnel is setup from R1 to R3. TE tunnel source is R1's Loopback 0 and destination is R3's Loopback 0. Cost of link from R1 to R4 is now 3 using "ip ospf cost 3" interface configuration mode.

Here too, the cost of TE tunnel is 2.

R1# show mpls traffic-eng tunnels tunnel 0

Name: R1_t0 (Tunnel0) Destination: 10.200.254.3

Status:

Admin: up Oper: up Path: valid Signalling: connected

path option 1, type dynamic (Basis for Setup, path weight 2)

Config Parameters:

Bandwidth: 101 kbps (Global) Priority: 1 1 Affinity: 0x0/0xFFFF

Metric Type: TE (default)

AutoRoute: enabled LockDown: disabled Loadshare: 101 bw-based

auto-bw: disabled

InLabel : -

OutLabel : Serial0/0, 17

RSVP Signalling Info:

Src 10.200.254.1, Dst 10.200.254.3, Tun_Id 0, Tun_Instance 14

RSVP Path Info:

My Address: 10.200.254.1

Explicit Route: 10.1.1.2 10.2.2.2 10.200.254.3

Record Route:

Tspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

RSVP Resv Info:

Record Route: 10.1.1.2 10.2.2.2

Fspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

Shortest Unconstrained Path Info:

Path Weight: 2 (TE)

Explicit Route: 10.1.1.6 10.3.3.1 10.200.254.3

History:

Tunnel:

Time since created: 18 minutes, 17 seconds

Time since path change: 15 seconds

Current LSP:

Uptime: 15 seconds

Prior LSP:

ID: path option 1 [13]

Removal Trigger: tunnel shutdown

Now, there are two different paths to reach 10.200.254.2/32 on R5 router- first is the IP path R1-R4-R5 with the cost of 5 and second is through the TE tunnel{R1-R2-R3} -R4-R5 with the cost of 5. Hence the traffic to 10.200.254.2/32 is load-balanced between two paths.

R1# show ip route 10.200.254.2

Routing entry for 10.200.254.2/32

Known via "ospf 1", distance 110, metric 5, type intra area

Last update from 10.1.1.6 on Serial0/1, 00:00:29 ago

Routing Descriptor Blocks:

* 10.200.254.3, from 10.200.254.2, 00:00:29 ago, via Tunnel0

Route metric is 5, traffic share count is 1

10.1.1.6, from 10.200.254.2, 00:00:29 ago, via Serial0/1

Route metric is 5, traffic share count is 1

3) A TE tunnel is setup from R1 to R3, however the path is explicitly routed through R4.

R1(config)# int tunnel 0

R1(config-if)# tunnel mpls traffic-eng path-option 1 explicit name EXPLICIT

..

R1(config)# ip explicit-path name EXPLICIT

R1(cfg-ip-expl-path)# next-address 10.200.254.4

R1(cfg-ip-expl-path)# next-address 10.200.254.3

It is explicitly specified that that tunnel path be taken through R4 for which the total cost of path is 4. However, when IP routing table is build, the IGP uses the lowest cost path. So, the cost of the tunnel used to reach the prefixes will be 2 i.e. through router R2.

R1#show mpls traffic-eng tunnels tunnel 0

Name: R1_t0 (Tunnel0) Destination: 10.200.254.3

Status:

Admin: up Oper: up Path: valid Signalling: connected

path option 1, type explicit EXPLICIT (Basis for Setup, path weight 4)

path option 2, type dynamic

Config Parameters:

Bandwidth: 101 kbps (Global) Priority: 1 1 Affinity: 0x0/0xFFFF

Metric Type: TE (default)

AutoRoute: enabled LockDown: disabled Loadshare: 101 bw-based

auto-bw: disabled

InLabel : -

OutLabel : Serial0/1, 16

RSVP Signalling Info:

Src 10.200.254.1, Dst 10.200.254.3, Tun_Id 0, Tun_Instance 15

RSVP Path Info:

My Address: 10.200.254.1

Explicit Route: 10.1.1.6 10.3.3.1 10.200.254.3

Record Route:

Tspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

RSVP Resv Info:

Record Route: 10.1.1.6 10.3.3.1

Fspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

Shortest Unconstrained Path Info:

Path Weight: 2 (TE)

Explicit Route: 10.1.1.2 10.2.2.2 10.200.254.3

History:

Tunnel:

Time since created: 32 minutes, 58 seconds

Time since path change: 12 seconds

Current LSP:

Uptime: 12 seconds

Prior LSP:

ID: path option 2 [14]

Removal Trigger: tunnel shutdown

Again, there are two different paths in R1 to reach 10.200.254.2/32 on R5- the first one is through Tunnel 0{R1-R4-R3} - R4 - R5 with a cost of 5, and a second one through R1-R2-R3-R4-R5 with a cost of 5.

R1# show ip route 10.200.254.2

Routing entry for 10.200.254.2/32

Known via "ospf 1", distance 110, metric 5, type intra area

Last update from 10.200.254.3 on Tunnel0, 00:00:21 ago

Routing Descriptor Blocks:

* 10.200.254.3, from 10.200.254.2, 00:00:21 ago, via Tunnel0

Route metric is 5, traffic share count is 1

10.1.1.6, from 10.200.254.2, 00:00:21 ago, via Serial0/1

Route metric is 5, traffic share count is 1

4) A TE tunnel is setup between R1 and R4, explicitly routed through R2 & R3.

The total cost of the tunnel is 3.

R1# show mpls traffic-eng tunnels tunnel 0

Name: R1_t0 (Tunnel0) Destination: 10.200.254.4

Status:

Admin: up Oper: up Path: valid Signalling: connected

path option 1, type explicit EXPLICIT (Basis for Setup, path weight 3)

path option 2, type dynamic

Config Parameters:

Bandwidth: 101 kbps (Global) Priority: 1 1 Affinity: 0x0/0xFFFF

Metric Type: TE (default)

AutoRoute: enabled LockDown: disabled Loadshare: 101 bw-based

auto-bw: disabled

InLabel : -

OutLabel : Serial0/0, 16

RSVP Signalling Info:

Src 10.200.254.1, Dst 10.200.254.4, Tun_Id 0, Tun_Instance 28

RSVP Path Info:

My Address: 10.200.254.1

Explicit Route: 10.1.1.2 10.2.2.2 10.3.3.2 10.200.254.4

Record Route:

Tspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

RSVP Resv Info:

Record Route: 10.1.1.2 10.2.2.2 10.3.3.2

Fspec: ave rate=101 kbits, burst=1000 bytes, peak rate=101 kbits

Shortest Unconstrained Path Info:

Path Weight: 3 (TE)

Explicit Route: 10.1.1.6 10.200.254.4

History:

Tunnel:

Time since created: 3 hours, 58 minutes

Time since path change: 15 seconds

Current LSP:

Uptime: 15 seconds

Prior LSP:

ID: path option 2 [27]

Removal Trigger: tunnel shutdown

Although, it seems there should be multiple paths to reach 10.200.254.2/32 on R5- on through Tunnel 0{R1-R2-R3-R4}-R5 with a cost of 5, and another through R1-R4-R5 with a cost of 5 too. But in fact, the routing table on R1 installs only one path to 10.200.254.2/32 which is through Tunnel 0. The reason being the IP path crosses the tunnel path and hence only the tunnel path is installed.

R1# show ip route 10.200.254.2

Routing entry for 10.200.254.2/32

Known via "ospf 1", distance 110, metric 5, type intra area

Last update from 10.200.254.4 on Tunnel0, 00:00:02 ago

Routing Descriptor Blocks:

* 10.200.254.4, from 10.200.254.2, 00:00:02 ago, via Tunnel0

Route metric is 5, traffic share count is 1