This article explains how to map a L2circuit traffic to take a particular RSVP LSP, if there are multiple equal-cost RSVP LSP's available to reach the L2circuit neighbor.
How to map a L2circuit traffic to take a particular RSVP LSP, if there are multiple equal-cost RSVP LSP's available to reach the L2circuit neighbor?
By default, if there are multiple equal-cost RSVP LSPs available to reach the L2Circuit neighbor, one of them will be randomly picked for forwarding. In certain cases, customers would like to use the LSPs for a specific L2circuit traffic; so as to deterministically load-share the traffic in the MPLS core.
To map a L2circuit traffic to a particular LSP, perform the following procedure:
- Associate a community value, when defining the L2Circuit configuration.
- Define a policy to match the community value and install the preferred LSP as the nexthop for the matching traffic.
- Apply this policy under the forwarding-table for the PFE to act upon.
Topology used to demonstrate the configuration:
CE1-PE1-P-PE2-CE2
In the above topology, PE1 and PE2 have two equal-cost RSVP LSPs, which are defined to reach each other. They also form a targeted LDP session to carry the L2Circuit between CE1 and CE2.
The following snapshots are taken in the default mode, without making the changes listed above; that is, both PE1 and PE2 will randomly choose one of the LSPs to carry the L2Circuit traffic.
PE1:
lab@PE1# show protocols mpls
label-switched-path LSP-1 {
from 101.101.101.1;
to 103.103.103.1;
}
label-switched-path LSP-2 {
from 101.101.101.1;
to 103.103.103.1;
}
interface ge-0/0/0.0;
lab@PE1# show protocols ldp
interface lo0.0;
[edit]
lab@PE1# show protocols l2circuit
neighbor 103.103.103.1 {
interface ge-0/0/3.300 {
virtual-circuit-id 300;
}
}
lab@PE1# show interfaces ge-0/0/3
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
unit 300 {
encapsulation vlan-ccc;
vlan-id 300;
}
Presently, PE1 has chosen LSP-2 to carry the traffic for the l2circuit; as shown below:
lab@PE1> show route table mpls.0
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 2d 05:24:07, metric 1
Receive
1 *[MPLS/0] 2d 05:24:07, metric 1
Receive
2 *[MPLS/0] 2d 05:24:07, metric 1
Receive
299808 *[L2CKT/7] 23:42:53
> via ge-0/0/3.300, Pop Offset: 4
ge-0/0/3.300 *[L2CKT/7] 23:42:53, metric2 2
to 10.10.10.2 via ge-0/0/0.0, label-switched-path LSP-1
> to 10.10.10.2 via ge-0/0/0.0, label-switched-path LSP-2
lab@PE1> show rsvp session
Ingress RSVP: 2 sessions
To From State Rt Style Labelin Labelout LSPname
103.103.103.1 101.101.101.1 Up 0 1 FF - 300032 LSP-1
103.103.103.1 101.101.101.1 Up 0 1 FF - 300048 LSP-2
lab@PE1> show route forwarding-table family mpls
Routing table: default.mpls
MPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 50 1
0 user 0 recv 49 3
1 user 0 recv 49 3
2 user 0 recv 49 3
299808 user 0 Pop 575 2 ge-0/0/3.300
ge-0/0/3.300 (CCC) user 0 indr 262146 2
10.10.10.2 Push 299904, Push 300048(top) 574 1 ge-0/0/0.0
lab@CE1> ping 100.100.100.2 count 500 size 300 rapid
PING 100.100.100.2 (100.100.100.2): 300 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 100.100.100.2 ping statistics ---
500 packets transmitted, 500 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.956/1.170/12.539/1.232 ms
lab@PE1> show mpls lsp statistics
Ingress LSP: 2 sessions
To From State Packets Bytes LSPname
103.103.103.1 101.101.101.1 Up 0 0 LSP-1
103.103.103.1 101.101.101.1 Up 500 173000 LSP-2
Total 2 displayed, Up 2, Down 0
You make the configuration changes, as suggested above, to ensure that L2circuit traffic is always carried on LSP-1.
- Associate a community value, when defining the L2Circuit configuration:
lab@PE1# show protocols l2circuit
neighbor 103.103.103.1 {
interface ge-0/0/3.300 {
virtual-circuit-id 300;
community test-community;
}
}
lab@PE1# show policy-options
community test-community members 300:300;
- Define a policy to match the community value and install the preferred LSP as the nexthop for the matching traffic:
lab@PE1# show policy-options
policy-statement mapping-l2ckt-to-lsp {
term 1 {
protocol l2circuit;
from community test-community
}
then {
install-nexthop lsp LSP-1;
}
}
}
- Apply this policy under the forwarding-table for the PFE to act upon:
lab@PE1# show routing-options
forwarding-table {
export mapping-l2ckt-to-lsp;
}
lab@PE1> show route table mpls.0
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 00:16:01, metric 1
Receive
1 *[MPLS/0] 00:16:01, metric 1
Receive
2 *[MPLS/0] 00:16:01, metric 1
Receive
299808 *[L2CKT/7] 00:16:00
> via ge-0/0/3.300, Pop Offset: 4
ge-0/0/3.300 *[L2CKT/7] 00:16:00, metric2 2
> to 10.10.10.2 via ge-0/0/0.0, label-switched-path LSP-1
lab@PE1> show rsvp session
Ingress RSVP: 2 sessions
To From State Rt Style Labelin Labelout LSPname
103.103.103.1 101.101.101.1 Up 0 1 FF - 300032 LSP-1
103.103.103.1 101.101.101.1 Up 0 1 FF - 300048 LSP-2
Total 2 displayed, Up 2, Down 0
lab@PE1> show route forwarding-table family mpls
Routing table: default.mpls
MPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 50 1
0 user 0 recv 49 3
1 user 0 recv 49 3
2 user 0 recv 49 3
299808 user 0 Pop 575 2 ge-0/0/3.300
ge-0/0/3.300 (CCC) user 0 indr 262142 2
10.10.10.2 Push 299904, Push 300032(top) 573 3 ge-0/0/0.0
lab@CE1> ping 100.100.100.2 count 500 size 300 rapid
PING 100.100.100.2 (100.100.100.2): 300 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 100.100.100.2 ping statistics ---
500 packets transmitted, 500 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.956/1.170/12.539/1.232 ms
lab@PE1> show mpls lsp statistics
Ingress LSP: 2 sessions
To From State Packets Bytes LSPname
103.103.103.1 101.101.101.1 Up 500 173000 LSP-1
103.103.103.1 101.101.101.1 Up 0 0 LSP-2
Total 2 displayed, Up 2, Down 0
CE1:
lab@CE1> show configuration
## Last commit: 2012-01-06 12:15:43 UTC by lab
interfaces {
ge-0/3/0 {
flexible-vlan-tagging;
unit 300 {
vlan-id 300;
family inet {
address 100.100.100.1/30;
}
}
}
}
lab@CE1>
PE1:
lab@PE1> show configuration
## Last commit: 2012-01-07 12:47:53 UTC by lab
interfaces {
ge-0/0/0 {
unit 0 {
family inet {
address 10.10.10.1/30;
}
family mpls;
}
}
ge-0/0/3 {
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
unit 300 {
encapsulation vlan-ccc;
vlan-id 300;
}
}
lo0 {
unit 0 {
family inet {
address 101.101.101.1/32
}
}
}
}
routing-options {
forwarding-table {
export mapping-l2ckt-to-lsp;
}
}
protocols {
rsvp {
interface lo0.0;
interface ge-0/0/0.0;
}
mpls {
label-switched-path LSP-1 {
from 101.101.101.1;
to 103.103.103.1;
}
label-switched-path LSP-2 {
from 101.101.101.1;
to 103.103.103.1;
}
interface ge-0/0/0.0;
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface lo0.0;
interface ge-0/0/0.0;
}
}
ldp {
interface lo0.0;
}
l2circuit {
neighbor 103.103.103.1 {
interface ge-0/0/3.300 {
virtual-circuit-id 300;
community test-community;
}
}
}
}
policy-options {
policy-statement mapping-l2ckt-to-lsp {
term 1 {
from protocol l2circuit;
from community test-community;
then {
install-nexthop lsp LSP-1;
}
}
}
community test-community members 300:300;
}
lab@PE1>
P:
lab@P# show
## Last changed: 2012-01-07 10:59:29 UTC
interfaces {
ge-0/0/1 {
unit 0 {
family inet {
address 10.10.10.2/30;
}
family mpls;
}
}
ge-0/0/2 {
unit 0 {
family inet {
address 20.20.20.1/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 104.104.104.1/32;
}
}
}
}
protocols {
rsvp {
interface lo0.0;
interface ge-0/0/1.0;
interface ge-0/0/2.0;
}
mpls {
interface ge-0/0/1.0;
interface ge-0/0/2.0;
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface lo0.0;
interface ge-0/0/1.0;
interface ge-0/0/2.0;
}
}
}
[edit]
lab@P#
PE2:
lab@PE2> show configuration
## Last commit: 1999-01-04 00:26:09 UTC by lab
interfaces {
ge-0/3/1 {
Unit 0 {
family inet {
address 20.20.20.2/30;
}
family mpls;
}
}
ge-0/3/2 {
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
unit 300 {
encapsulation vlan-ccc;
vlan-id 300;
}
}
lo0 {
unit 0 {
family inet {
address 103.103.103.1/32;
}
}
}
}
routing-options {
forwarding-table {
export mapping-l2ckt-to-lsp;
}
}
protocols {
rsvp {
interface ge-0/3/1.0;
interface lo0.0;
}
mpls {
label-switched-path LSP-1 {
from 103.103.103.1;
to 101.101.101.1;
}
label-switched-path LSP-2 {
from 103.103.103.1;
to 101.101.101.1;
}
interface ge-0/3/1.0;
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface lo0.0;
interface ge-0/3/1.0;
}
}
ldp {
interface lo0.0;
}
l2circuit {
neighbor 101.101.101.1 {
interface ge-0/3/2.300 {
virtual-circuit-id 300;
community test-community;
}
}
}
}
policy-options {
policy-statement mapping-l2ckt-to-lsp {
term 1 {
from community test-community;
then {
install-nexthop lsp LSP-1;
}
}
}
community test-community members 300:300;
}
lab@PE2>
CE2:
lab@CE2# show
## Last changed: 2012-01-06 12:26:25 UTC
interfaces {
ge-0/2/0 {
flexible-vlan-tagging;
unit 300 {
vlan-id 300;
family inet {
address 100.100.100.2/30;
}
}
}
}
[edit]
lab@CE2#