Example for Configuring Traffic Shaping on the S2700EI, S2710SI, S3700SI, and S3700EI
Networking Requirements
The Switch is connected to the router through Eth0/0/2. The 802.1p priorities of voice, video, and data services are 6, 5, and 2, and these services can reach residential users through the router and Switch, as shown in Figure 3-3. The transmission rate of traffic from the enterprise campus network is higher than the transmission rate of traffic from the router; therefore, jitter may occur on Eth0/0/1. The requirements are as follows to prevent jitter and ensure bandwidth of services:
- The CIR on the interface is 10000 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 each interface so that the residential user can access the network through the Switch.
Configure interfaces to trust 802.1p priorities of packets.
Configure traffic shaping on an interface to limit the bandwidth of the interface.
Configure traffic shaping in an interface queue to limit the CIRs of voice, video, and data services.
Procedure
- Create VLANs and configure interfaces.
# Create VLAN 10.
<Quidway> system-view [Quidway] sysname Switch [Switch] vlan batch 10
# Configure the type of Eth0/0/1 and Eth0/0/2 as trunk, and then add Eth0/0/1 and Eth0/0/2 to VLAN 10.
[Switch] interface ethernet 0/0/1 [Switch-Ethernet0/0/1] port link-type trunk [Switch-Ethernet0/0/1] port trunk allow-pass vlan 10 [Switch-Ethernet0/0/1] quit [Switch] interface ethernet 0/0/2 [Switch-Ethernet0/0/2] port link-type trunk [Switch-Ethernet0/0/2] port trunk allow-pass vlan 10 [Switch-Ethernet0/0/2] quit
# Create VLANIF 10 and assign network segment address 10.10.10.2/24 to VLANIF 10.
[Switch] interface vlanif 10 [Switch-Vlanif10] ip address 10.10.10.2 255.255.255.0 [Switch-Vlanif10] quit
Assign IP address 10.10.10.1/24 to the interface connecting the router and Switch.
- Configure the interface to trust packets.
# Configure the interface to trust 802.1p priorities of packets.
[Switch] interface ethernet 0/0/2 [Switch-Ethernet0/0/2] trust 8021p [Switch-Ethernet0/0/2] quit
- Configure traffic shaping on an interface.
# Configure traffic shaping on an interface of the Switch and set the CIR to 10000 kbit/s.
[Switch] interface ethernet 0/0/1 [Switch-Ethernet0/0/1] qos lr outbound cir 10000
- Configure traffic shaping in an interface queue.
# Configure traffic shaping in the interface queues on the Switch, and then set the CIR and PIR of the voice service to 3000 kbit/s and 5000 kbit/s, the CIR and PIR of the video service to 5000 kbit/s and 8000 kbit/s, and the CIR and PIR of the data service to 2000 kbit/s and 3000 kbit/s.
[Switch-Ethernet0/0/1] qos queue 6 shaping cir 3000 pir 5000 [Switch-Ethernet0/0/1] qos queue 5 shaping cir 5000 pir 8000 [Switch-Ethernet0/0/1] qos queue 2 shaping cir 2000 pir 3000 [Switch-Ethernet0/0/1] quit
- Verify the configuration.
# If the configuration succeeds, the committed bandwidth for the packets transmitted by Eth0/0/1 is 10000 kbit/s; the transmission rate of the voice service ranges from 3000 kbit/s to 5000 kbit/s; the transmission rate of the video service ranges from 5000 kbit/s to 8000 kbit/s; the transmission rate of the data service ranges from 2000 kbit/s to 3000 kbit/s.
Configuration Files
- Configuration file of the Switch
# sysname Switch # vlan batch 10 # interface Vlanif10 ip address 10.10.10.2 255.255.255.0 # interface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 qos lr outbound cir 10000 cbs 1250000 qos queue 2 shaping cir 2000 pir 3000 qos queue 5 shaping cir 5000 pir 8000 qos queue 6 shaping cir 3000 pir 5000 # interface Ethernet0/0/2 port link-type trunk port trunk allow-pass vlan 10 trust 8021p # return