Example for Configuring Priority Mapping
Networking Requirements
As shown in Figure 4-5, tenant 1 and tenant 2 lease different servers that connect to core switches through an access switch and then access the network outside the data center through egress routers.
The 802.1p priorities of packets from the servers of tenants 1 and 2 are both 0. The customer wants to provide differentiated services for tenant 1 and tenant 2 so that the CoS value of tenant 1 is higher than that of tenant 2. This ensures low-delay services for tenant 1.
Configuration Roadmap
- Create VLANs and add interfaces to corresponding VLANs to enable Switch to communicate with the tenants' servers, SwitchA, and SwitchB.
- Configure the interfaces that packets of tenants pass through to trust outer 802.1p priorities.
- Create DiffServ domains on the Switch to map the 802.1p priority of tenant 1 to AF4 and the 802.1p priority of tenant 2 to AF2. Then apply the DiffServ domains to 10GE1/0/1 and 10GE1/0/2 to provide differentiated services for the two tenants.
Procedure
- Create VLANs and add interfaces to the VLANs.
# Create VLAN 100 and VLAN 200.
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] vlan batch 100 200 [*Switch] commit
# Configure 10GE1/0/3 and 10GE1/0/4 on the Switch as trunk interfaces. Add 10GE1/0/1 to VLAN 100, 10GE1/0/2 to VLAN 200, and 10GE1/0/3 and 10GE1/0/4 to both VLAN 100 and VLAN 200.
[~Switch] interface 10ge 1/0/1 [~Switch-10GE1/0/1] port default vlan 100 [*Switch-10GE1/0/1] quit [*Switch] interface 10ge 1/0/2 [*Switch-10GE1/0/2] port default vlan 200 [*Switch-10GE1/0/2] quit [*Switch] interface 10ge 1/0/3 [*Switch-10GE1/0/3] port link-type trunk [*Switch-10GE1/0/3] port trunk allow-pass vlan 100 200 [*Switch-10GE1/0/3] quit [*Switch] interface 10ge 1/0/4 [*Switch-10GE1/0/4] port link-type trunk [*Switch-10GE1/0/4] port trunk allow-pass vlan 100 200 [*Switch-10GE1/0/4] quit [*Switch] commit
- Configure interfaces to trust outer 802.1p priorities in packets.
By default, an interface trusts outer 802.1p priorities, so this step can be skipped.
- Create DiffServ domains, configure priority mapping in the DiffServ domains, and bind the DiffServ domains to interfaces.
# Create DiffServ domains ds1 and ds2 on the Switch and map 802.1p priority of packets from the tenants' servers to different CoS values.
[~Switch] diffserv domain ds1 [*Switch-dsdomain-ds1] 8021p-inbound 0 phb af4 green [*Switch-dsdomain-ds1] quit [*Switch] diffserv domain ds2 [*Switch-dsdomain-ds2] 8021p-inbound 0 phb af2 green [*Switch-dsdomain-ds2] quit [*Switch] commit
# Bind DiffServ domains ds1 and ds2 to 10GE1/0/1 and 10GE1/0/2, respectively.
[~Switch] interface 10ge 1/0/1 [~Switch-10GE1/0/1] trust upstream ds1 [*Switch-10GE1/0/1] quit [*Switch] interface 10ge 1/0/2 [*Switch-10GE1/0/2] trust upstream ds2 [*Switch-10GE1/0/2] quit [*Switch] commit
- Verify the configuration.
# View packet statistics in queues on an outbound interface.
[~Switch] display qos queue statistics interface 10ge 1/0/3 Queue CIR/PIR Passed Pass Rate Dropped Drop Rate Drop Time (kbps) (Packets/Bytes) (pps/bps) (Packets/Bytes) (pps/bps) ---------------------------------------------------------------------------------------------- 0 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 1 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 2 0 11295086 17516 0 0 - 10000000 114688668 14573986 0 0 ---------------------------------------------------------------------------------------------- 3 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 4 0 11511125 19563 0 0 - 10000000 112653485 15352321 0 0 ---------------------------------------------------------------------------------------------- 5 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 6 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 7 0 0 0 0 0 - 10000000 0 0 0 0 ----------------------------------------------------------------------------------------------
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 100 200
#
diffserv domain ds1
8021p-inbound 0 phb af4 green
#
diffserv domain ds2
8021p-inbound 0 phb af2 green
#
interface 10GE1/0/1
port default vlan 100
trust upstream ds1
#
interface 10GE1/0/2
port default vlan 200
trust upstream ds2
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 100 200
#
return