Queue Scheduling and Traffic Shaping Management
This section describes the configuration model of queue scheduling and traffic shaping management and provides examples of XML packets.
Data Model
The configuration model file matching queue scheduling and traffic shaping management is huawei-qos.yang.
Only the X6H series cards on the S12700E support the /huawei-qos:qos/wlan/ap-shaping object.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/name |
Indicates the name of a queue scheduling profile. |
The value is a string of case-insensitive characters without spaces. |
N/A |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/id |
Indicates the queue index. |
The value is an integer in the range from 0 to 7. |
Eight queues must be configured simultaneously. |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/schedule/schedule-mode |
Indicates the queue scheduling mode. |
Enumerated value. The values are as follows:
|
The X series cards do not support weight-round-robin-queuing. |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/schedule/weight |
Indicates the weight of a queue that participates in WRR or WDRR scheduling. |
The value is an integer. The value range is as follows:
|
N/A |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/shaping/cir |
Indicates the CIR for queue shaping. |
The value is an integer, in kbit/s. The value range differs depending on the interface type:
The default value is the maximum bandwidth of an interface. |
N/A |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/shaping/cbs |
Indicates the CBS for queue shaping. |
The value is an integer in the range from 10000 to 4294967295, in bytes. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-qos:qos/marking/trust |
Indicates the type of priority to be mapped for packets. |
The value is a string. The values are as follows:
|
N/A |
/ietf-interfaces:interfaces/interface/huawei-qos:qos/queues/queue-porfile |
Indicates the name of a queue scheduling profile. |
The value must be the name of an existing queue scheduling profile. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping/cir |
Indicates the CIR when traffic shaping is performed for packets on an interface in the outbound direction. |
The value is an integer, in kbit/s. The value range differs depending on the interface type:
|
N/A |
/ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping/cbs |
Indicates the CBS when traffic shaping is performed for packets on an interface in the outbound direction. |
The value is an integer in the range from 10000 to 4294967295, in bytes. If this object is not specified, the default shaping/cbs is 125 times shaping/cir. |
N/A |
/huawei-qos:qos/wlan/ap-shaping |
Indicates whether to enable traffic shaping for packets from an AC to an AP. |
The value is of the Boolean type:
By default, traffic shaping is disabled for packets from an AC to an AP. |
N/A |
Configuring Queue Scheduling and Traffic Shaping
This section describes how to configure, modify, and delete queue scheduling and traffic shaping using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile /ietf-interfaces:interfaces/interface/huawei-qos:qos/marking/trust /ietf-interfaces:interfaces/interface/huawei-qos:qos/queues/queue-porfile /ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping |
Data Requirement 1
Configure queue scheduling and traffic shaping.
Item |
Data |
Description |
---|---|---|
Name of a queue scheduling profile |
test |
The name of a queue scheduling profile is test. |
Queue index |
0, 1, 2, 3, 4, 5, 6, 7 |
Queue scheduling and traffic shaping are configured for queues 0 to 7. |
Queue scheduling mode |
deficit-round-robin-queuing |
The queue scheduling mode is WDRR. |
Weight of a queue that participates in a scheduling mode |
10, 11, 12, 13, 14, 15, 16, 17 |
The weights of queues 0 to 7 in WDRR scheduling mode are 10, 11, 12, 13, 14, 15, 16, and 17. |
CIR for queue shaping |
5000 |
The CIR for queue shaping is 5000 kbit/s. |
CBS for queue shaping |
125000 |
The CBS for queue shaping is 125000 bytes. |
Type of priority to be mapped for packets |
dscp |
Packets are mapped based on the DSCP priority. |
CIR when traffic shaping is performed for packets on an interface in the outbound direction |
8000 |
The CIR is 8000 kbit/s when traffic shaping is performed for packets on an interface in the outbound direction. |
CBS when traffic shaping is performed for packets on an interface in the outbound direction |
200000 |
The CBS is 200000 bytes when traffic shaping is performed for packets on an interface in the outbound direction. |
Request example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos"> <qos:traffic-queuing> <qos:queue-profiles> <qos:queue-profile> <qos:name>test</qos:name> <qos:queue> <qos:id>0</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>10</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>1</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>11</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>2</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>12</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>3</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>13</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>4</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>14</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>5</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>15</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>6</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>16</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>7</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>17</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> </qos:queue-profile> </qos:queue-profiles> </qos:traffic-queuing> </qos:qos> </config> </edit-config> </rpc>
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>GigabitEthernet1/0/1</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos"> <qos:marking> <qos:trust>dscp</qos:trust> </qos:marking> <qos:queues> <qos:queue-porfile>test</qos:queue-porfile> </qos:queues> <qos:shaping> <qos:cir>8000</qos:cir> <qos:cbs>200000</qos:cbs> </qos:shaping> </qos:qos> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
Response example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>Some node(s) does not supported in protocol layer right now.</error-message> </rpc-error> </rpc-reply>
Data Requirement 2
Change the weight for queue scheduling of queue 1. Only changed data items are provided here. For other information, see data requirement 1.
Item |
Data |
Description |
---|---|---|
Queue index |
1 |
The WDRR weight of queue 1 is 50. |
Weight of a queue that participates in a scheduling mode |
50 |
Request example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos"> <qos:traffic-queuing> <qos:queue-profiles> <qos:queue-profile> <qos:name>test</qos:name> <qos:queue> <qos:id>0</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>10</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>1</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="replace">50</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>2</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>12</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>3</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>13</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>4</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>14</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>5</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>15</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>6</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>16</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> <qos:queue> <qos:id>7</qos:id> <qos:schedule> <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode> <qos:weight>17</qos:weight> </qos:schedule> <qos:shaping> <qos:cir>5000</qos:cir> <qos:cbs>125000</qos:cbs> </qos:shaping> </qos:queue> </qos:queue-profile> </qos:queue-profiles> </qos:traffic-queuing> </qos:qos> </config> </edit-config> </rpc>
Response example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>
Data Requirement 3
Delete the queue scheduling and traffic shaping configuration, that is, delete the configuration in data requirement 1.
Request example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos"> <qos:traffic-queuing> <qos:queue-profiles> <qos:queue-profile xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <qos:name>test</qos:name> <qos:queue> <qos:id>0</qos:id> </qos:queue> <qos:queue> <qos:id>1</qos:id> </qos:queue> <qos:queue> <qos:id>2</qos:id> </qos:queue> <qos:queue> <qos:id>3</qos:id> </qos:queue> <qos:queue> <qos:id>4</qos:id> </qos:queue> <qos:queue> <qos:id>5</qos:id> </qos:queue> <qos:queue> <qos:id>6</qos:id> </qos:queue> <qos:queue> <qos:id>7</qos:id> </qos:queue> </qos:queue-profile> </qos:queue-profiles> </qos:traffic-queuing> </qos:qos> </config> </edit-config> </rpc>
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="9" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>GigabitEthernet1/0/1</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <qos:marking> <qos:trust>dscp</qos:trust> </qos:marking> <qos:queues> <qos:queue-porfile>test</qos:queue-porfile> </qos:queues> <qos:shaping> <qos:cir>8000</qos:cir> <qos:cbs>200000</qos:cbs> </qos:shaping> </qos:qos> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
Response example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>