Storm Control
This section describes the configuration model of storm control and provides examples of XML packets.
Data Model
The configuration model file matching storm control is huawei-storm-control.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-storm-control:storm-controls/storm-control/packet-type |
Indicates the type of packets for which storm control is enabled. |
Enumerated value. The values are as follows:
|
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/packet/min-rate |
Indicates the lower threshold in packet rate limit mode. |
The value is an integer, in pps. The value range is as follows:
|
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/packet/max-rate |
Indicates the upper threshold in packet rate limit mode. |
The value is an integer, in pps. The value range is as follows:
|
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/cir/min-rate |
Indicates the lower threshold in byte rate limit mode. |
The value is an integer, in kbit/s. The value range is as follows:
|
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/cir/max-rate |
Indicates the upper threshold in byte rate limit mode. |
The value is an integer, in kbit/s. The value range is as follows:
|
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/percent/min-rate |
Indicates the lower threshold in percentage rate limit mode. |
The value is an integer, in percentage. The value ranges from 1 to 100. |
N/A |
/huawei-storm-control:storm-controls/storm-control/rate-type/percent/max-rate |
Indicates the upper threshold in percentage rate limit mode. |
The value is an integer, in percentage. The value ranges from 1 to 100. |
N/A |
/huawei-storm-control:storm-controls/action |
Indicates the storm control action. |
Enumerated value. The values are as follows:
|
N/A |
/huawei-storm-control:storm-controls/log |
Indicates whether to record logs during storm control. |
Boolean value:
By default, logs are not recorded during storm control. |
N/A |
/huawei-storm-control:storm-controls/trap |
Indicates whether to report traps during storm control. |
Boolean value:
By default, traps are not reported during storm control. |
N/A |
/huawei-storm-control:storm-controls/interval |
Indicates the storm detection interval. |
The value is an integer that ranges from 1 to 180, in seconds. The default value is 5s. |
N/A |
/huawei-storm-control:storm-controls/storm-control-state/port-name |
Indicates the name of an interface for which storm control is enabled. |
The value is a string. |
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/packet-type |
Indicates the type of packets for which storm control is enabled. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/min-rate |
Indicates the lower threshold of rate limit for storm control. |
The value is an integer. |
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/max-rate |
Indicates the upper threshold of rate limit for storm control. |
The value is an integer. |
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/mode-state |
Indicates the mode in which rate is limited for storm control. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/action-state |
Indicates the storm control action. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/punish-status |
Indicates the status of the interface. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/trap-state |
Indicates the status of the trap function for storm control. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/log-state |
Indicates the status of the log function for storm control. |
Enumerated value. The values are as follows:
|
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/interval-state |
Indicates the storm detection interval. |
The value is an integer. |
This object only supports the get operation. |
/huawei-storm-control:storm-controls/storm-control-state/last-punish-time |
Indicates the last time when storm control is performed. |
The value is string. |
This object only supports the get operation. |
Configuring Storm Control
This section describes how to configure storm control using the config method.
Operation |
XPATH |
---|---|
edit-config:config |
/huawei-storm-control:storm-controls/storm-control/packet-type /huawei-storm-control:storm-controls/storm-control/rate-type/packet/min-rate /huawei-storm-control:storm-controls/storm-control/rate-type/packet/max-rate |
Data Requirements
Item |
Data |
Description |
---|---|---|
Interface number |
GigabitEthernet1/0/1 |
Configure storm control in packet rate limit mode for broadcast packets on GE1/0/1. The lower threshold is 3000 pps, and the upper threshold is 6000 pps. |
Interface type |
ethernetCsmacd |
|
Type of packets for which storm control is enabled |
broadcast |
|
Lower threshold in packet rate limit mode |
3000 |
|
Upper threshold in packet rate limit mode |
6000 |
Request Example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" 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>
<storm-control:storm-controls xmlns:storm-control="urn:huawei:yang:huawei-storm-control">
<storm-control:storm-control>
<storm-control:packet-type>broadcast</storm-control:packet-type>
<storm-control:packet>
<storm-control:min-rate>3000</storm-control:min-rate>
<storm-control:max-rate>6000</storm-control:max-rate>
</storm-control:packet>
</storm-control:storm-control>
</storm-control:storm-controls>
</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="3"> <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="3"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/</error-path> <error-message>parse rpc config error.(Unknown element "interfaces".).</error-message> </rpc-error> </rpc-reply>
Querying Storm Control Configuration
This section describes how to query storm control configuration using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-storm-control:storm-controls/storm-control-state |
Request Example
Query storm control configuration on GE1/0/1.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="subtree">
<if:interfaces-state xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>GigabitEthernet1/0/1</if:name>
<storm-control:storm-controls xmlns:storm-control="urn:huawei:yang:huawei-storm-control"/>
</if:interface>
</if:interfaces-state>
</filter>
</get>
</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="0"> <data> <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <name>GigabitEthernet1/0/1</name> <storm-controls xmlns="urn:huawei:yang:huawei-storm-control"> <storm-control-state> <packet-type>broadcast</packet-type> <port-name>GE1/0/1</port-name> <min-rate>5000</min-rate> <max-rate>7500</max-rate> <mode-state>pps</mode-state> <action-state>none</action-state> <punish-status>normal</punish-status> <trap-state>off</trap-state> <log-state>off</log-state> <interval-state>5</interval-state> <last-punish-time>-</last-punish-time> </storm-control-state> <storm-control-state> <packet-type>unicast</packet-type> <port-name>GE1/0/1</port-name> <min-rate>5000</min-rate> <max-rate>8000</max-rate> <mode-state>pps</mode-state> <action-state>none</action-state> <punish-status>normal</punish-status> <trap-state>off</trap-state> <log-state>off</log-state> <interval-state>5</interval-state> <last-punish-time>-</last-punish-time> </storm-control-state> </storm-controls> </interface> </interfaces-state> </data> </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="0"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path/> <error-message>Failed to get top datapath</error-message> </rpc-error> </rpc-reply>