CBQ configuration example
Network requirements
As shown in Figure 21, configure a QoS policy to meet the following requirements:
Traffic from Router C is classified into three classes based on DSCP values. Perform AF for traffic with the DSCP values being AF11 and AF21, and set a minimum guaranteed bandwidth percentage of 5% for the traffic.
Perform EF for traffic with the DSCP value being EF and set the maximum bandwidth percentage for the traffic to 30%.
Before performing the configuration, make sure that:
The route from Router C to Router D through Router A and Router B is reachable.
The DSCP fields have been set for the traffic before the traffic enters Router A.
Figure 21: Network diagram
Configuration procedure
Configure Router A:
# Define three classes to match the IP packets with the DSCP values AF11, AF21, and EF, respectively.
<RouterA> system-view [RouterA] traffic classifier af11_class [RouterA-classifier-af11_class] if-match dscp af11 [RouterA-classifier-af11_class] quit [RouterA]traffic classifier af21_class [RouterA-classifier-af21_class] if-match dscp af21 [RouterA-classifier-af21_class] quit [RouterA] traffic classifier ef_class [RouterA-classifier-ef_class] if-match dscp ef [RouterA-classifier-ef_class] quit
# Define two traffic behaviors, and enable AF and set a minimum guaranteed bandwidth percentage of 5% in each traffic behavior.
[RouterA] traffic behavior af11_behav [RouterA-behavior-af11_behav] queue af bandwidth pct 5 [RouterA-behavior-af11_behav] quit [RouterA] traffic behavior af21_behav [RouterA-behavior-af21_behav] queue af bandwidth pct 5 [RouterA-behavior-af21_behav] quit
# Define a traffic behavior, and enable EF and set a maximum bandwidth percentage of 30% (both bandwidth and delay are guaranteed for EF traffic) in the traffic behavior.
[RouterA] traffic behavior ef_behav [RouterA-behavior-ef_behav] queue ef bandwidth pct 30 [RouterA-behavior-ef_behav] quit
# Define a QoS policy and associate the configured traffic behaviors with classes in the QoS policy.
[RouterA] qos policy dscp [RouterA-qospolicy-dscp] classifier af11_class behavior af11_behav [RouterA-qospolicy-dscp] classifier af21_class behavior af21_behav [RouterA-qospolicy-dscp] classifier ef_class behavior ef_behav [RouterA-qospolicy-dscp] quit
# Apply the QoS policy to the outgoing traffic of ATM PVC ATM 1/0.
[RouterA] interface atm 1/0 [RouterA-atm1/0] ip address 1.1.1.1 255.255.255.0 [RouterA-atm1/0] pvc qostest 0/40 [RouterA-atm-pvc-atm1/0-0/40-qostest] qos apply policy dscp outbound
The configuration enables EF traffic to be forwarded preferentially when congestion occurs.