01-03 MPLS QoS Configuration
01-03 MPLS QoS Configuration
Purpose
MPLS uses label-based forwarding to replace route-based forwarding and provides
powerful and flexible functions to meet requirements of new applications. In
addition, MPLS supports multiple network protocols including IPv4 and IPv6. MPLS
has been widely used for building large-scale networks. On an MPLS network, IP
QoS cannot be used to guarantee quality of services, so MPLS QoS is used.
Implementation
In the DiffServ model, network edge nodes map a service to a service class based
on QoS requirements of the service. A service class is identified by the
differentiated service (DS) field (Type of Service (ToS) field) in IP packets or the
PRI field (802.1p priority) in VLAN packets. Nodes on a backbone network apply
preset policies to the service based on the DS or PRI field to ensure service quality.
For details, see Priority Mapping Configuration (CE12800) in CloudEngine 12800
and 12800E Series Switches Configuration Guide - QoS. The service classification
and label distribution mechanisms of DiffServ are similar to MPLS label
distribution. MPLS DiffServ combines DS or PRI distribution with MPLS label
distribution.
NOTE
Currently, the switches do not support the DiffServ function of the MPLS TE feature.
0 19 22 23 31
Label Exp S TTL
MPLS DiffServ maps the EXP field (as shown in Figure 3-1) to a per-hop behavior
(PHB). LSRs forward MPLS packets based on EXP fields in the MPLS packets. MPLS
DiffServ provides the following solutions for label switched path (LSP) setup:
● E-LSP: an LSP whose PHB is determined by the EXP field. E-LSP applies to a
network with fewer than eight PHBs. A differentiated services code point
(DSCP) or 802.1p priority is mapped to a specified EXP value that identifies a
PHB. Table 3-1 describes the mapping between PHBs and EXP values. Packets
are forwarded based on labels, and the EXP field determines the packet
scheduling algorithm and drop priority at each hop. An LSP transmits a
maximum of eight PHB flows that are identified by the EXP field in the MPLS
packet header. The EXP value can be configured by the Internet service
provider (ISP) or mapped from the DSCP or 802.1p priority in a packet. In E-
LSP, PHB information does not need to be transmitted by signaling protocols.
Additionally, the label efficiency is high, and the label status is easy to
maintain.
BE 0
AF1 1
AF2 2
AF3 3
AF4 4
EF 5
CS6 6
CS7 7
● L-LSP: an LSP whose PHB is determined by both the label and EXP value. L-
LSP applies to a network with any number of PHBs. During packet forwarding,
the label of a packet determines the forwarding path and scheduling
algorithm, whereas the EXP field determines the drop priority of the packet.
Labels differentiate service flows, so service flows of a specified type are
transmitted over the same LSP. This solution requires more labels and
occupies a large number of system resources.
NOTE
DiffServ Domain
As shown in Figure 3-2, DiffServ domains include MPLS DiffServ and IP DiffServ
domains.
In the E-LSP solution, MPLS DiffServ manages and schedules the two DiffServ
domains and implements bidirectional mapping between DSCP or 802.1p priorities
and EXP priorities at the MPLS network edge.
PE PE
MPLS
DiffServ Domain
CE CE
IP IP
DiffServ Domain DiffServ Domain
As shown in Figure 3-3, the MPLS DiffServ domain forwards MPLS packets based
on EXP values and provides differentiated services.
When MPLS packets enter the P device, the P device classifies packets and maps
EXP values in packets to class of service (CoS) values and drop priorities. After
traffic classification, QoS implementations including traffic shaping, traffic
policing, and congestion avoidance are the same as those on an IP network. When
MPLS packets leave the P device, the packets carry EXP values.
PE_1 P PE_2
E-LSP
BE
queue
EF
queue
● The MPLS public network and MPLS L3VPN network support the uniform and short pipe
modes.
● The MPLS L2VPN network supports the uniform and pipe modes.
● Uniform: Packet priorities are uniformly defined on the IP network and the
MPLS network, so the priorities are globally valid. On the ingress node, each
packet is assigned a label and its DSCP or 802.1p priority is mapped to an EXP
value. A change in the EXP value on the MPLS network determines the PHB
used when the packet leaves the MPLS network. The egress node maps the
EXP value to the DSCP or 802.1p priority. Figure 3-4 shows priority mapping
in a uniform tunnel using an L3VPN network as an example. PE_1 maps the
DSCP priority to the outer and inner MPLS EXP values (5). P_2 pops out the
outer MPLS label and changes the inner MPLS EXP value to the outer MPLS
EXP value. PE_2 changes the DSCP priority to 46.
IP/MPLS backbone
network
● Pipe: The EXP value can be manually configured, and the ingress node adds
this EXP value to MPLS packets. Any change in the EXP value is valid only on
the MPLS network. The egress node selects the PHB for MPLS packets
according to the EXP value. When the packets leave the MPLS network, their
DSCP or 802.1p priority is still valid. Figure 3-5 shows priority mapping in a
pipe tunnel using an L2VPN network as an example. PE_1 changes the outer
and inner MPLS EXP values to 1. PE_2 retains the DSCP priority of packets and
selects a PHB based on the inner MPLS EXP value.
IP/MPLS backbone
network
● Short pipe: The EXP value can be manually configured, and the ingress node
adds this EXP value to MPLS packets. Any change in the EXP value is valid
only on the MPLS network. The egress node selects the PHB for MPLS packets
according to the DSCP or 802.1p priority. When the packets leave the MPLS
network, their DSCP or 802.1p priority is still valid. Figure 3-6 shows priority
mapping in a short-pipe tunnel using an L3VPN network as an example. PE_1
changes the outer and inner MPLS EXP values to 1. PE_2 retains the DSCP
priority of packets and selects a PHB on the DSCP priority.
IP/MPLS backbone
network
License Requirements
You can use the MPLS QoS feature only after the MPLS function is enabled. The
MPLS function is controlled by a license. By default, this function is disabled on a
newly purchased switch. To use the MPLS function, apply for and purchase the
license from the equipment supplier.
Version Requirements
CE12804/CE12808/CE12812 V100R001C00
CE12816 V100R003C00
CE12804S/CE12808S V100R005C00
Feature Limitations
When configuring MPLS QoS on the switch, pay attention to the following points:
● CE switches cannot function as PE devices on an MPLS network.
● When configuring MPLS QoS or MPLS L3VPN QoS, you can configure the
MPLS DiffServ mode only on the ingress and egress nodes. The MPLS DiffServ
mode does not take effect on the transit node.
● When configuring MPLS L2VPN QoS, you can only set the MPLS DiffServ
mode to Uniform, so that the device maps 802.1p priorities of packets to EXP
priorities.
● On a transit device, all the following cards cannot perform internal priority
mapping based on the EXP priority of MPLS packets. By default, these cards
map the internal priority based on the 802.1p priority. In this case, you can
configure MQC to map the EXP priority of MPLS packets (if-match mpls-exp)
to the internal priority (remark local-precedence). The involved cards are as
follows: CE-L48GT-EA, CE-L48GT-EC, CE-L48GS-EA, CE-L48GS-EC, CE-L24XS-
BA, CE-L24XS-EA, CE-L48XS-BA, CE-L48XS-EA and CE-L24LQ-EA.
● When the switch is not configured with the MPLS PHP function and uses the
inner label to forward packets after the outer label pops up (for example, the
switch serves as an ASBR in the inter-AS VPN Option B or inter-AS VPN
Option C scenario), the EXP in the label of the forwarded packets cannot be
obtained from outbound priority mappings based on the PHB, and the EXP in
the inner label is used.
● On the CE12800, the user-configured EXP value is preferred as the EXP value
in the outer label of L2VPN packets. If no EXP value is configured, the EXP
value in the inner label is used as the EXP value in the outer label.
In addition, MPLS QoS is developed based on MPLS LDP. For other configuration
notes about MPLS LDP, see MPLS LDP Configuration Notes.
● Table 3-3 lists the mappings from DSCP priorities to EXP priorities in MPLS
packets.
● Table 3-4 lists the mappings between EXP priorities in MPLS packets, DSCP
priorities, and PHBs and colors.
Table 3-3 Mapping from DSCP priorities to EXP priorities in the outbound
direction in the DiffServ domain
0 0 32 4
1 0 33 4
2 0 34 4
3 0 35 4
4 0 36 4
5 0 37 4
6 0 38 4
7 0 39 4
8 1 40 5
9 1 41 5
10 1 42 5
11 1 43 5
12 1 44 5
13 1 45 5
14 1 46 5
15 1 47 5
16 2 48 6
17 2 49 6
18 2 50 6
19 2 51 6
20 2 52 6
21 2 53 6
22 2 54 6
23 2 55 6
24 3 56 7
25 3 57 7
26 3 58 7
27 3 59 7
28 3 60 7
29 3 61 7
30 3 62 7
31 3 63 7
Table 3-4 Mapping between EXP priorities in MPLS packets, DSCP priorities, and
PHBs and colors in the inbound direction in the DiffServ domain
0 BE Green 0
1 AF1 Green 10
2 AF2 Green 18
3 AF3 Green 26
4 AF4 Green 34
5 EF Green 46
6 CS6 Green 48
7 CS7 Green 56
Pre-configuration Tasks
Before configuring MPLS QoS, complete the following tasks:
Context
To implement certain QoS functions on an MPLS network, devices on the network
need to determine the packet priorities based on the MPLS labels. Therefore, you
need to map the MPLS labels to EXP priorities.
MPLS QoS can differentiate different services on an MPLS network. If you want to
retain priorities carried in original packets regardless of the change in the EXP
field, set the DiffServ mode to short pipe. If you set the DiffServ mode to uniform,
priorities carried in original packets may be changed. In uniform mode, the egress
node determines the per-hop behavior (PHB) based on EXP priorities of packets. In
short pipe mode, the egress node determines the PHB based on Differentiated
Service Code Point (DSCP) priorities of packets.
NOTE
The MPLS DiffServ mode configured on a transit device does not take effect.
Procedure
Step 1 Run system-view
For details, see Priority Mapping Configuration in CloudEngine 12800 and 12800E
Series Switches Configuration Guide - QoS.
● Performing the following steps on the ingress:
a. Run diffserv domain ds-domain-name
A DiffServ domain is created and the DiffServ domain view is displayed.
The default domain defines default mappings from packet priorities to
PHBs. You can modify the mapping defined in the default domain but
cannot delete the default domain. In addition to the DiffServ domain
default, a maximum of six user-defined DiffServ domains can be created.
b. Run mpls-exp-outbound dscp-value map exp-value
The DSCP priority is mapped to the EXP priority of MPLS packets in the
outbound direction of an interface.
For details on the default mapping from the DSCP priority to the EXP
priority, see mpls-exp-outbound.
The DSCP priority in this command is the priority carried in packets of a
device's outbound interface.
c. Run quit
Return to the system view.
● Performing the following steps on the egress:
a. Run diffserv domain ds-domain-name
A DiffServ domain is created and the DiffServ domain view is displayed.
The default domain defines default mappings from packet priorities to
PHBs. You can modify the mapping defined in the default domain but
cannot delete the default domain. In addition to the DiffServ domain
default, a maximum of six user-defined DiffServ domains can be created.
b. Run mpls-exp-inbound exp-value phb service-class
The EXP priority of MPLS packets is mapped to the PHB in the inbound
direction of an interface.
For details on the default mapping from the EXP priority to the PHB, see
mpls-exp-inbound.
The EXP priority of MPLS packets is mapped to green in the inbound
direction of an interface.
c. Run quit
Return to the system view.
NOTE
NOTE
When running the mpls mode short-pipe ttl ttl-value exp exp-value command, specify the
same EXP value for the outer and inner MPLS labels. If the parameter exp is not specified,
the inbound interface performs priority mapping for incoming packets based on the original
priorities.
When the MPLS DiffServ mode is uniform, the egress node maps EXP priorities of packets
to DSCP priorities. To map PHBs to DSCP priorities, configure the qos phb marking dscp
enable command in the system view.
----End
Procedure
Step 1 Run system-view
The DiffServ mode for MPLS L2VPN is specified and applied to a DiffServ domain.
When the DiffServ mode for MPLS L2VPN is Uniform, the 802.1p priorities of
packets can only be mapped to EXP priorities.
NOTE
----End
Networking Requirements
Enterprises A and B connect their headquarters to branches by deploying the BGP/
MPLS IP VPN. As shown in Figure 3-7, CE1 and CE3 connect branches to the
headquarters of Enterprise A, and CE2 and CE4 connect branches to the
headquarters of Enterprise B. Enterprise A uses vpna and Enterprise B uses vpnb.
The service quality of video conferences (whose DSCP priority is 32) needs to be
ensured.
CE1 CE3
10GE1/0/1 10GE1/0/1
VLANIF10 VLANIF40
10.1.1.1/24 10.3.1.1/24
Loopback1
10GE1/0/1 2.2.2.9/32 10GE1/0/1
VLANIF10 10GE1/0/1 10GE2/0/2 VLANIF40
10.1.1.2/24 PE1 VLANIF30 VLANIF60 PE2 10.3.1.2/24
Loopback1 172.1.1.2/24 172.2.1.1/24 Loopback1
1.1.1.9/32 10GE3/0/3 10GE3/0/3 3.3.3.9/32
10GE2/0/2 VLANIF30 P VLANIF60 10GE2/0/2
VLANIF20 172.1.1.1/24 AS: 100 172.2.1.2/24 VLANIF50
10.2.1.2/24 10.4.1.2/24
MPLS backbone
10GE1/0/1 10GE1/0/1
VLANIF20 VLANIF50
10.2.1.1/24 10.4.1.1/24
CE2 CE4
vpnb vpnb
AS: 65420 AS: 65440
Configuration Roadmap
To meet the preceding requirements, configure MPLS QoS. The configuration
roadmap is as follows:
1. Configure DiffServ domains on PE1 and PE2, and map DSCP priority 32 to
MPLS EXP 5 to preferentially ensure video quality.
2. Set the MPLS TTL processing mode to pipe on PE1 and PE2 to hide the MPLS
backbone network structure, which ensures network information security.
3. Set the MPLS DiffServ mode to short pipe on PE1 and PE2 so that service data
from a VPN is forwarded on the MPLS network according to the configured
DiffServ priorities. The DSCP value of packets remains unchanged on the
egress node of the MPLS network, and the egress node performs queue
scheduling based on the EXP value in the MPLS label.
NOTE
Procedure
Step 1 Configure OSPF on the MPLS backbone network so that PE and P can
communicate with each other.
# Configure PE1.
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] interface loopback 1
[*PE1-LoopBack1] ip address 1.1.1.9 32
[*PE1-LoopBack1] quit
[*PE1] vlan batch 10 20 30
[*PE1] interface 10ge 1/0/1
[*PE1-10GE1/0/1] port link-type trunk
[*PE1-10GE1/0/1] port trunk allow-pass vlan 10
[*PE1-10GE1/0/1] quit
[*PE1] interface 10ge 2/0/2
[*PE1-10GE2/0/2] port link-type trunk
[*PE1-10GE2/0/2] port trunk allow-pass vlan 20
[*PE1-10GE2/0/2] quit
[*PE1] interface 10ge 3/0/3
[*PE1-10GE3/0/3] port link-type trunk
[*PE1-10GE3/0/3] port trunk allow-pass vlan 30
[*PE1-10GE3/0/3] quit
[*PE1] interface vlanif 30
[*PE1-Vlanif30] ip address 172.1.1.1 24
[*PE1-Vlanif30] quit
[*PE1] commit
[*PE1] ospf 1
[*PE1-ospf-1] area 0
[*PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] commit
[~PE1-ospf-1-area-0.0.0.0] quit
[~PE1-ospf-1] quit
# Configure P.
<HUAWEI> system-view
[~HUAWEI] sysname P
[*HUAWEI] commit
[~P] interface loopback 1
[*P-LoopBack1] ip address 2.2.2.9 32
[*P-LoopBack1] quit
[*P] vlan batch 30 60
[*P] interface 10ge 1/0/1
[*P-10GE1/0/1] port link-type trunk
[*P-10GE1/0/1] port trunk allow-pass vlan 30
[*P-10GE1/0/1] quit
[*P] interface 10ge 2/0/2
[*P-10GE2/0/2] port link-type trunk
[*P-10GE2/0/2] port trunk allow-pass vlan 60
[*P-10GE2/0/2] quit
[*P] interface vlanif 30
[*P-Vlanif30] ip address 172.1.1.2 24
[*P-Vlanif30] quit
[*P] interface vlanif 60
[*P-Vlanif60] ip address 172.2.1.1 24
[*P-Vlanif60] quit
[*P] commit
[*P] ospf
[*P-ospf-1] area 0
[*P-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[*P-ospf-1-area-0.0.0.0] commit
[~P-ospf-1-area-0.0.0.0] quit
[~P-ospf-1] quit
# Configure PE2.
<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] interface loopback 1
[*PE2-LoopBack1] ip address 3.3.3.9 32
[*PE2-LoopBack1] quit
[*PE2] vlan batch 40 50 60
[*PE2] interface 10ge 1/0/1
[*PE2-10GE1/0/1] port link-type trunk
[*PE2-10GE1/0/1] port trunk allow-pass vlan 40
[*PE2-10GE1/0/1] quit
[*PE2] interface 10ge 2/0/2
[*PE2-10GE2/0/2] port link-type trunk
[*PE2-10GE2/0/2] port trunk allow-pass vlan 50
[*PE2-10GE2/0/2] quit
[*PE2] interface 10ge 3/0/3
[*PE2-10GE3/0/3] port link-type trunk
[*PE2-10GE3/0/3] port trunk allow-pass vlan 60
[*PE2-10GE3/0/3] quit
[*PE2] interface vlanif 60
[*PE2-Vlanif60] ip address 172.2.1.2 24
[*PE2-Vlanif60] quit
[*PE2] commit
[*PE2] ospf
[*PE2-ospf-1] area 0
[*PE2-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[*PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] commit
[~PE2-ospf-1-area-0.0.0.0] quit
[~PE2-ospf-1] quit
# Configure P.
[~P] mpls lsr-id 2.2.2.9
[*P] mpls
[*P-mpls] quit
[*P] mpls ldp
[*P-mpls-ldp] quit
[*P] interface vlanif 30
[*P-Vlanif30] mpls
[*P-Vlanif30] mpls ldp
[*P-Vlanif30] quit
[*P] interface vlanif 60
[*P-Vlanif60] mpls
[*P-Vlanif60] mpls ldp
[*P-Vlanif60] quit
[*P] commit
# Configure PE2.
[~PE2] mpls lsr-id 3.3.3.9
[*PE2] mpls
[*PE2-mpls] quit
[*PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] interface vlanif 60
[*PE2-Vlanif60] mpls
[*PE2-Vlanif60] mpls ldp
[*PE2-Vlanif60] quit
[*PE2] commit
After the configuration is complete, LDP sessions are set up between PE1 and P
and between P and PE2. Run the display mpls ldp session command. The
command output shows that the LDP session status is Operational.
PE1 is used as an example
[~PE1] display mpls ldp session
LDP Session(s) in Public Network
LAM: Label Advertisement Mode, KA: KeepAlive SsnAge: Session Age, Unit(DDDD:HH:MM)
An asterisk (*) before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Active 0000:00:01 6/6
------------------------------------------------------------------------------
TOTAL: 1 Session(s) Found.
Step 3 Configure a VPN instance on each PE and connect the CEs to the PEs.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*PE1-vpn-instance-vpna-af-ipv4] quit
[*PE1-vpn-instance-vpna] quit
[*PE1] ip vpn-instance vpnb
[*PE1-vpn-instance-vpnb] ipv4-family
[*PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[*PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[*PE1-vpn-instance-vpnb-af-ipv4] quit
[*PE1-vpn-instance-vpnb] quit
[*PE1] interface vlanif 10
[*PE1-Vlanif10] ip binding vpn-instance vpna
[*PE1-Vlanif10] ip address 10.1.1.2 24
[*PE1-Vlanif10] quit
[*PE1] interface vlanif 20
[*PE1-Vlanif20] ip binding vpn-instance vpnb
[*PE1-Vlanif20] ip address 10.2.1.2 24
[*PE1-Vlanif20] quit
[*PE1] commit
# Configure PE2.
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*PE2-vpn-instance-vpna-af-ipv4] quit
[*PE2-vpn-instance-vpna] quit
# Assign IP addresses to the interfaces on the CEs according to Figure 3-7. The
configuration procedure is not mentioned here.
After the configurations are complete, each PE can ping its connected CE.
NOTE
If a PE has multiple interfaces bound to the same VPN instance, specify a source IP
addresses by specifying -a source-ip-address in the ping -vpn-instance vpn-instance-name
-a source-ip-address dest-ip-address command to ping the CE connected to the remote PE.
If you do not specify a source IP address, the ping fails.
# Configure PE1.
[~PE1] bgp 100
[*PE1-bgp] peer 3.3.3.9 as-number 100
[*PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[*PE1-bgp] ipv4-family vpnv4
[*PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[*PE1-bgp-af-vpnv4] commit
[~PE1-bgp-af-vpnv4] quit
[~PE1-bgp] quit
# Configure PE2.
[~PE2] bgp 100
[*PE2-bgp] peer 1.1.1.9 as-number 100
[*PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[*PE2-bgp] ipv4-family vpnv4
[*PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[*PE2-bgp-af-vpnv4] commit
[~PE2-bgp-af-vpnv4] quit
[~PE2-bgp] quit
After the configuration is complete, run the display bgp peer command on PEs.
The command output shows that the BGP peer relationships have been
established between the PEs.
[~PE1] display bgp peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers :1
Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
3.3.3.9 4 100 12 6 0 00:02:21 Established 0
Step 5 Set up the EBGP peer relationships between the PEs and CEs and import VPN
routes.
# Configure CE1.
[~CE1] bgp 65410
[*CE1-bgp] peer 10.1.1.2 as-number 100
[*CE1-bgp] import-route direct
[*CE1-bgp] commit
[~CE1-bgp] quit
The configurations of CE2, CE3, and CE4 are similar to the configuration of CE1,
and are not mentioned here.
# Configure PE1.
[~PE1] bgp 100
[~PE1-bgp] ipv4-family vpn-instance vpna
[*PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[*PE1-bgp-vpna] import-route direct
[*PE1-bgp-vpna] quit
[*PE1-bgp] ipv4-family vpn-instance vpnb
[*PE1-bgp-vpnb] peer 10.2.1.1 as-number 65420
[*PE1-bgp-vpnb] import-route direct
[*PE1-bgp-vpnb] commit
[~PE1-bgp-vpnb] quit
[~PE1-bgp] quit
The configuration of PE2 is similar to that of PE1, and is not mentioned here.
After the configurations are complete, run the display bgp vpnv4 vpn-instance
peer command on the PEs. The command output shows that BGP peer
relationships between PEs and CEs have been established.
Step 6 Configure PE1 and PE2 to allocate common labels to the penultimate hop.
#Configure PE1.
[~PE1] mpls
[~PE1-mpls] label advertise non-null
[*PE1-mpls] commit
[~PE1-mpls] quit
#Configure PE2.
[~PE2] mpls
[~PE2-mpls] label advertise non-null
[*PE2-mpls] commit
[~PE2-mpls] quit
#Configure PE2.
[~PE2] diffserv domain dsvpnb
[*PE2-dsdomain-dsvpnb] mpls-exp-outbound 32 map 5
[*PE2-dsdomain-dsvpnb] quit
[*PE2] commit
Step 8 Configure the DiffServ modes and MPLS TTL processing modes on PE1 and PE2.
#Configure PE1.
[~PE1] mpls mode short-pipe domain dsvpna
[*PE1] commit
#Configure PE2.
[~PE2] mpls mode short-pipe domain dsvpnb
[*PE2] commit
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
vlan batch 10 20 30
#
diffserv domain dsvpna
mpls-exp-outbound 32 map 5
#
mpls mode short-pipe domain dsvpna
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
label advertise non-null
#
mpls ldp
#
ipv4-family
#
interface Vlanif10
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.0
#
interface Vlanif30
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE2/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE3/0/3
port link-type trunk
port trunk allow-pass vlan 30
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.1.1.1 as-number 65410
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
vlan batch 30 60
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
ipv4-family
#
interface Vlanif30
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif60
ip address 172.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
interface 10GE2/0/2
port link-type trunk
port trunk allow-pass vlan 60
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
vlan batch 40 50 60
#
diffserv domain dsvpnb
mpls-exp-outbound 32 map 5
#
mpls mode short-pipe domain dsvpnb
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
label advertise non-null
#
mpls ldp
#
ipv4-family
#
interface Vlanif40
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface Vlanif50
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
#
interface Vlanif60
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
interface 10GE2/0/2
port link-type trunk
port trunk allow-pass vlan 50
#
interface 10GE3/0/3
port link-type trunk
port trunk allow-pass vlan 60
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.3.1.1 as-number 65430
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.4.1.1 as-number 65440
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
#
return
● CE1 configuration file (enterprise A headquarters egress)
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
import-route direct
peer 10.1.1.2 enable
#
return
● CE2 configuration file (enterprise B headquarters egress)
#
sysname CE2
#
vlan batch 20
#
interface Vlanif20
to exchange Layer 2 services with each other and require that user information in
Layer 2 packets be retained when the packets are transmitted over the backbone
network. The users want to assign 802.1p priorities 7, 6, and 5 for voice, video, and
data services respectively, so that the devices provide different QoS for the three
services in case of network congestion.
Site1 Site2
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure VPLS in Martini mode so that Site1 and Site2 can exchange Layer 2
services with each other and that user information in Layer 2 packets can be
retained when the packets are transmitted over the backbone network.
2. Create a DiffServ domain on PE1 and PE2 and configure priority mapping on
the VPLS network to set the EXP priorities of voice, video, and data packets to
6, 5, and 4 respectively, so that quality of the voice service is ensured.
3. Set the DiffServ mode to pipe on PE1 and PE2, so that VPN services are
forwarded over the VPLS network based on the priorities required by the
enterprise and the egress schedules the packets based on the EXP priorities in
VPLS labels but not change the PHBs and colors carried in the packets.
NOTE
Procedure
Step 1 Configure VPLS in Martini mode so that Site1 and Site2 can exchange Layer 2
services with each other.
For detailed configuration, see Example for Configuring Martini VPLS.
Table 3-5 Mappings from 802.1p priorities of VLAN packets to PHBs and colors in
the inbound direction in the DiffServ domain
Packet Type 802.1p Priority PHB Color
Data 5 EF green
# Configure PE2.
[~PE2] diffserv domain ds1
[*PE2-dsdomain-ds1] exp-outbound cs7 green map 6
[*PE2-dsdomain-ds1] exp-outbound cs6 green map 5
[*PE2-dsdomain-ds1] exp-outbound ef green map 4
[*PE2-dsdomain-ds1] quit
[*PE2] commit
# Configure PE2.
[~PE2] mpls l2vpn mode pipe domain ds1
[*PE2] commit
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 192.168.1.5 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
vlan batch 20 30
#
mpls lsr-id 2.2.2.9
#
mpls
#
mpls ldp
#
interface Vlanif20
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 172.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE2/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
vlan batch 30 40
#
diffserv domain ds1
exp-outbound ef green map 4
exp-outbound cs6 green map 5
exp-outbound cs7 green map 6
#
vlan 40
trust upstream ds1
#
mpls lsr-id 3.3.3.9
#
mpls
#
mpls l2vpn mode pipe domain ds1
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.9
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.9
remote-ip 1.1.1.9
#
interface Vlanif30
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif40
l2 binding vsi a2
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
interface 10GE2/0/2
port link-type trunk
port trunk allow-pass vlan 40
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
#
return