Example for Configuring Traffic Shaping
Networking Requirements
As shown in Figure 5-12, the Switch connects to RouterA through 10GE1/0/2. Three servers are deployed in the data center to provide voice, video, and data services. Packets of voice, video, and data services are identified by 802.1p priorities 5, 3, and 2 respectively. When packets reach 10GE1/0/2, jitter may occur. The following requirements must be met to reduce jitter and ensure bandwidth of services:
The CIR on 10GE1/0/2 is 12000 kbit/s.
The CIR and PIR for the voice service are 3000 kbit/s and 5000 kbit/s respectively.
The CIR and PIR for the video service are 5000 kbit/s and 8000 kbit/s respectively.
The CIR and PIR for the data service are 2000 kbit/s and 3000 kbit/s respectively.
Configuration Roadmap
- Create VLANs and configure interfaces on the Switch so that users can access the network.
Set priorities for server-side interfaces of SwitchA to differentiate service packets.
Configure outbound interface-based rate limiting to limit the bandwidth on the interface.
Configure traffic shaping for queues on the interface to limit the bandwidth of voice, video, and data services.
Procedure
- Create VLANs and configure interfaces on the Switch.
# Create VLANs 10, 20, and 30.
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] vlan batch 10 20 30 [*Switch] commit
# Configure 10GE1/0/1 and 10GE1/0/2 as trunk interfaces, and add them to VLANs 10, 20, and 30.
[~Switch] interface 10ge 1/0/1 [~Switch-10GE1/0/1] port link-type trunk [*Switch-10GE1/0/1] port trunk allow-pass vlan 10 20 30 [*Switch-10GE1/0/1] quit [*Switch] commit [~Switch] interface 10ge 1/0/2 [~Switch-10GE1/0/2] port link-type trunk [*Switch-10GE1/0/2] port trunk allow-pass vlan 10 20 30 [*Switch-10GE1/0/2] quit [*Switch] commit
- Set priorities for server-side interfaces on SwitchA.
# Set priorities of 10GE1/0/1, 10GE1/0/2, and 10GE1/0/3 to 5, 3, and 2, respectively. Add 10GE1/0/4 to VLAN 10, VLAN 20, and VLAN 30.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 10 20 30 [*SwitchA] commit [~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] port default vlan 10 [*SwitchA-10GE1/0/1] port priority 5 [*SwitchA-10GE1/0/1] quit [*SwitchA] commit [~SwitchA] interface 10ge 1/0/2 [~SwitchA-10GE1/0/2] port default vlan 20 [*SwitchA-10GE1/0/2] port priority 3 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit [~SwitchA] interface 10ge 1/0/3 [~SwitchA-10GE1/0/3] port default vlan 30 [*SwitchA-10GE1/0/3] port priority 2 [*SwitchA-10GE1/0/3] quit [*SwitchA] commit [~SwitchA] interface 10ge 1/0/4 [~SwitchA-10GE1/0/4] port link-type trunk [*SwitchA-10GE1/0/4] port trunk allow-pass vlan 10 20 30 [*SwitchA-10GE1/0/4] quit [*SwitchA] commit
- Configure outbound rate limiting on 10GE1/0/2 to limit the traffic rate to 12000 kbit/s.
[~Switch] interface 10ge 1/0/2 [~Switch-10GE1/0/2] qos lr cir 12000 outbound [*Switch-10GE1/0/2] quit [*Switch] commit
- Configure traffic shaping for queues on the interface.
# Configure queue shaping on the Switch. Set the CIR values of voice, video, and data services to 3000 kbit/s, 5000 kbit/s, and 2000 kbit/s respectively and their PIR values to 5000 kbit/s, 8000 kbit/s, and 3000 kbit/s respectively.
[~Switch] interface 10ge 1/0/2 [~Switch-10GE1/0/2] qos queue 5 shaping cir 3000 pir 5000 [*Switch-10GE1/0/2] qos queue 3 shaping cir 5000 pir 8000 [*Switch-10GE1/0/2] qos queue 2 shaping cir 2000 pir 3000 [*Switch-10GE1/0/2] quit [*Switch] commit
- Verify the configuration.
# View outbound queue statistics on 10GE1/0/2.
[~Switch] display qos queue statistics interface 10ge 1/0/2 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 2000 54584 0 0 0 - 3000 5676736 0 0 0 ---------------------------------------------------------------------------------------------- 3 5000 49648 0 0 0 - 8000 5163392 0 0 0 ---------------------------------------------------------------------------------------------- 4 0 0 0 0 0 - 10000000 0 0 0 0 ---------------------------------------------------------------------------------------------- 5 3000 49998 0 0 0 - 5000 5199792 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 10 20 30 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 20 30 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 10 20 30 qos lr cir 12000 kbps outbound qos queue 2 shaping cir 2000 kbps pir 3000 kbps qos queue 3 shaping cir 5000 kbps pir 8000 kbps qos queue 5 shaping cir 3000 kbps pir 5000 kbps # return
SwitchA configuration file
# sysname SwitchA # vlan batch 10 20 30 # interface 10GE1/0/1 port default vlan 10 port priority 5 # interface 10GE1/0/2 port default vlan 20 port priority 3 # interface 10GE1/0/3 port default vlan 30 port priority 2 # interface 10GE1/0/4 port link-type trunk port trunk allow-pass vlan 10 20 30 # return