Example for Configuring Adaptive Traffic Shaping
Networking Requirements
As shown in Figure 3-10, the enterprise headquarters connects to the Internet through GE1/0/0 of RouterA and connects to RouterB of the branch through a 3G network.
Link bandwidth on the 3G network is variable. The enterprise requires that the rate of packets sent from the headquarters to the branch be dynamically changed in accordance with the 3G link bandwidth, to reduce jitter on the 3G network.
The priorities of data, video, and voice packets sent from the headquarters to the branch are af11, af21, and ef respectively. Voice packets need to be processed first, whereas video and data packets require bandwidth guarantee.
Configuration Roadmap
- Configure a jitter NQA test instance on RouterA and RouterB to detect the status of the link between the headquarters and branch.
- Configure an adaptive traffic profile and apply it to GE1/0/0 of RouterA. When the NQA test instance detects that packet loss ratios of over 30% for three consecutive times, RouterA reduces the packet transmission rate on GE1/0/0.
- Configure traffic classifiers on RouterA to classify data, video, and voice packets.
- Configure traffic behaviors on RouterA and specify different congestion management actions for data, video, and voice packets in the traffic behaviors.
- Configure a traffic policy on RouterA, associate the traffic classifiers with the traffic behaviors in the traffic policy, and apply the traffic policy to GE1/0/0 so that data, video, and voice packets are processed in different manners.
Procedure
- Configure an NQA test instance.
# Configure the IP address and port number for the UDP server.
<Huawei> system-view [Huawei] sysname RouterB [RouterB] nqa-server udpecho 192.168.2.2 9000
# Enable the NQA client and create a jitter NQA test instance.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] nqa test-instance admin jitter1 [RouterA-nqa-admin-jitter1] test-type jitter [RouterA-nqa-admin-jitter1] destination-address ipv4 192.168.2.2[RouterA-nqa-admin-jitter1] destination-port 9000 [RouterA-nqa-admin-jitter1] start now [RouterA-nqa-admin-jitter1] quit
- Configure an adaptive traffic profile on RouterA.
[RouterA] qos adaptation-profile gts1 [RouterA-qos-adaptation-profile-gts1] rate-range low-threshold 128 high-threshold 512 [RouterA-qos-adaptation-profile-gts1] rate-adjust step 32 [RouterA-qos-adaptation-profile-gts1] rate-adjust loss low-threshold 20 high-threshold 30 [RouterA-qos-adaptation-profile-gts1] track nqa admin jitter1 [RouterA-qos-adaptation-profile-gts1] quit
- Apply the adaptive traffic profile to GE1/0/0 on RouterA.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] qos gts adaptation-profile gts1 [RouterA-GigabitEthernet1/0/0] quit
- Configure traffic classifiers on RouterA to differentiate data, video, and voice services.
[RouterA] traffic classifier data [RouterA-classifier-data] if-match dscp af11 [RouterA-classifier-data] quit [RouterA] traffic classifier video [RouterA-classifier-video] if-match dscp af21 [RouterA-classifier-video] quit [RouterA] traffic classifier voice [RouterA-classifier-voice] if-match dscp ef [RouterA-classifier-voice] quit
- Create traffic behaviors on RouterA, and specify the queues and bandwidth for packets matching traffic classifiers.
[RouterA] traffic behavior data [RouterA-behavior-data] queue af bandwidth pct 30 [RouterA-behavior-data] quit [RouterA] traffic behavior video [RouterA-behavior-video] queue af bandwidth pct 60 [RouterA-behavior-video] quit [RouterA] traffic behavior voice [RouterA-behavior-voice] queue llq bandwidth pct 5 [RouterA-behavior-voice] quit
- Configure a traffic policy on RouterA, and associate the traffic classifiers with the traffic behaviors in the traffic policy.
[RouterA] traffic policy p1 [RouterA-trafficpolicy-p1] classifier voice behavior voice [RouterA-trafficpolicy-p1] classifier video behavior video [RouterA-trafficpolicy-p1] classifier data behavior data [RouterA-trafficpolicy-p1] quit
- Apply the traffic policy to GE1/0/0 of RouterA.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 192.168.1.2 24 [RouterA-GigabitEthernet1/0/0] traffic-policy p1 outbound [RouterA-GigabitEthernet1/0/0] quit
- Verify the configuration.
# View the record of the adaptive traffic profile gts1 on GE1/0/0 of RouterA.
[RouterA] display qos adaptation-profile gts1 interface gigabitethernet 1/0/0 applied-record Interface: GigabitEthernet1/0/0 ----------------------------------------------------------------- QoS gts adaptation-profile: gts1 ----------------------------------------------------------------- NQA admin Name: admin NQA test Name: jitter1 Current Rate: 256(Kbps) Last packet loss: 25(%) The latest traffic shaping rate fails to be updated because the packet loss ratio is within the allowed range.
Configuration Files
RouterA configuration file
# sysname RouterA # qos adaptation-profile gts1 rate-range low-threshold 128 high-threshold 512 track nqa admin jitter1 rate-adjust loss low-threshold 20 high-threshold 30 rate-adjust step 32 # traffic classifier video operator or if-match dscp af21 traffic classifier data operator or if-match dscp af11 traffic classifier voice operator or if-match dscp ef # traffic behavior video queue af bandwidth pct 60 traffic behavior data queue af bandwidth pct 30 traffic behavior voice queue llq bandwidth pct 5 # traffic policy p1 classifier voice behavior voice precedence 5 classifier video behavior video precedence 10 classifier data behavior data precedence 15 # interface GigabitEthernet1/0/0 ip address 192.168.1.2 255.255.255.0 qos gts adaptation-profile gts1 traffic-policy p1 outbound # nqa test-instance admin jitter1 test-type jitter destination-address ipv4 192.168.2.2 destination-port 9000 # return
RouterB configuration file
# sysname RouterB # nqa-server udpecho 192.168.2.2 9000 # return