Skip to content

Commit 5202129

Browse files
authored
Merge pull request sonic-net#203 from BRCM-SONIC/link_flap_err_disable
Link-flap error-disable: CLI and RESTCONF section update
2 parents 8b29d62 + d8e7bce commit 5202129

File tree

1 file changed

+133
-19
lines changed

1 file changed

+133
-19
lines changed

system/intf-dampening-HLD.md

+133-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Port Link Flap Error Disable
1818
|:---:|:-----------:|:------------------:|------------------------------------------------------|
1919
| 0.1 | 04/14/2021 | Steven Lu | Initial version for requirements |
2020
| 0.2 | 04/20/2021 | Steven Lu | Change feature name to Port Link Flap Error Disable |
21-
| 0.3 | 05/11/2021 | Steven Lu | Add design details |
21+
| 0.3 | 05/11/2021 | Steven Lu | Add design details |
22+
| 0.4 | 05/24/2021 | Prasanth Kunjum Veettil | Add CLI and RESTCONF details |
2223

2324
# About this Manual
2425
This document provides general information about the Port Link Flap Error Disable feature implementation in SONiC.
@@ -30,7 +31,7 @@ This document describes the high level design of Port Link Flap Error Disable fe
3031
### Table 1: Abbreviations
3132
| **Term** | **Meaning** |
3233
|--------------------------|-------------------------------------|
33-
| XYZ | Term description |
34+
| xcvrd | Transceiver Daemon |
3435

3536
# 1 Feature Overview
3637
The Port Link Flap Error Disable feature uses an exponential decay mechanism to prevent excessive interface flapping events from adversely affecting routing protocols and routing tables in the network. Suppressing port state change events to protect the system resources.
@@ -39,35 +40,35 @@ When Port Link Flap Error Disable is enabled, the system monitors the number of
3940

4041
The sampling time or window (the time during which the specified toggle threshold can occur before the wait period is activated) is triggered when the first "up to down" transition occurs.
4142

42-
If the port link state toggles from up to down for a specified number of times within a specified period, the interface is physically disabled for the specified wait period. Once the wait period expires, the port link state is re-enabled. However, if the wait period is set to zero (0) seconds, the port link state will remain disabled until it is manually re-enabled.
43+
If the port link state toggles from up to down for a specified number of times within a specified period, the interface is physically disabled for the specified wait period. Once the wait period expires, the port link state is re-enabled. However, if the wait period is set to zero (0) seconds, the port link state will remain disabled until it is manually disabled and re-enabled or Port Link Flap Error Disable is disabled on this port.
4344

4445

4546
## 1.1 Requirements
4647
System shall be able to suppress interfaces state change events to protect system resources.
4748
User shall be able to enable or disable the feature on individual interfaces and globally.
4849
The feature must be disabled on all interfaces by default.
4950
The feature shall be supported on physical interfaces.
50-
There must be two sets of configuration parameters (sample-interval, waiting-period, and toggling-frequency) a per-interface set and a global set. If both global and per-interface are configured, the per-interface values are used only for given interfaces. Global values are used for all other physical interfaces.
51+
There must be two sets of configuration parameters (sample-interval, recovery-interval, and flap-threshold) a per-interface set and a global set. If both global and per-interface are configured, the per-interface values are used only for given interfaces. Global values are used for all other physical interfaces.
5152
If no values are specified by user, a default set of parameters are applied to all interfaces.
5253
User shall be able to save configuration parameters (both global and per-interface).
5354
The configuration parameters (both global and per-interface) must be preserved across device reboot.
5455

5556
### 1.1.1 Functional Requirements
5657
Port Link Flap Error Disable shall use below parameters to supress and protect system.
57-
- toggle-frequency
58+
- flap-threshold
5859
Specifies the number of times a port link state goes from up to down before the wait period is activated. The value ranges from 1 through 50.
5960
- sample-interval
60-
Specifies the amount of time, in seconds, during which the specified toggle threshold can occur before the wait period is activated. The default value is 0 and indicates that the time is forever. The value ranges from 0 through 65535.
61-
- waiting-period
62-
Specifies the amount of time in seconds, for which the port remains disabled (down) before it becomes enabled. The value ranges from 0 through 65535. A value of 0 indicates that the port will stay down until an administrative override occurs.
61+
Specifies the amount of time, in seconds, during which the specified toggle threshold can occur before the wait period is activated. The value ranges from 1 through 65535.
62+
- recovery-interval
63+
Specifies the amount of time in seconds, for which the port remains disabled (down) before it becomes enabled. The value ranges from 0 through 65534. A value of 0 indicates that the port will stay down until an administrative override occurs.
6364

6465
### 1.1.2 Configuration and Management Requirements
6566
- Port Link Flap Error Disable feature default is OFF on all physical interfaces and port-channels
6667
- When Port Link Flap Error Disable is enabled, use below default values:
68+
flap-threshold: 3
6769
sample-interval: 10
68-
toggle-frequency: 3
69-
waiting-period: 30
70-
- User shall be able to specify different sample-interval, toggle-frequency and waiting-period on a physical interface
70+
recovery-interval: 300
71+
- User shall be able to specify different sample-interval, flap-threshold and recovery-interval on a physical interface
7172
- User shall be able to display current Port Link Flap Error Disable confiuration values.
7273
- User shall be able to display current interface status if it was surpresed by Port Link Flap Error Disable
7374
- User shall be able to display Link-Down-Reason if a port is disabled by Port Link Flap Error Disable feature
@@ -96,8 +97,80 @@ The Interface Error Disable feature exist in below modules and containers:
9697

9798
# 2 Functionality
9899
## 2.1 CLI
99-
100-
100+
### 2.1.1 Configuration Commands
101+
- *link-error-disable flap-threshold <flap count> sampling-interval <interval in sec> recovery-interval <recovery interval in sec>*
102+
Example:
103+
```
104+
sonic(conf-if-Ethernet0)# link-error-disable flap-threshold 10 sampling-time 3 recovery-timeout 10
105+
```
106+
In this example, the values for the parameters are as follows:
107+
108+
The flap-threshold is set at 10 times. This interval is the number of times that the port's link state goes from up to down and down to up before the recovery-timeout is activated. Enter a valid value range from 1-50. Default is 3.
109+
110+
111+
The sampling-time is set to 3 seconds. This time period is the amount of time during which the specified flap-threshold can be crossed. If the flap-threshold is crossed during this sampling-time, port will be error-disabled. Enter a value between 1 and 65535 seconds. Default is 10.
112+
113+
114+
The recovery-timeout is set to 10 seconds. This period of time is the amount of time the port remains disabled (down) before it becomes enabled. Entering 0 indicates that the port will stay down until an administrative override occurs. Enter a value between 0 and 65534 seconds. Default is 300.
115+
116+
117+
This config command can be executed on a range of interfaces as well. Example:
118+
```
119+
sonic(conf-if-range-eth**)# link-error-disable flap-threshold 10 sampling-time 3 recovery-timeout 10
120+
```
121+
Example for disabling link-flap error-disable on a port:
122+
```
123+
sonic(conf-if-Ethernet0)#no link-error-disable
124+
```
125+
This command shall be supported on interface range as well. Example:
126+
```
127+
sonic(conf-if-range-eth**)#no link-error-disable
128+
```
129+
130+
- *[no] errdisable recovery cause link-flap*
131+
This is a global command to enable the link-flap error-disable feature. This is an existing command tree and link-flap CLI node is added.
132+
133+
Link-flap feature has to be enabled globally to start this feature even when port level configurations are already present.
134+
When the user executes 'no errdisable recovery cause link-flap' to disable the feature at system level, the current monitoring for link-flaps on all the ports will be stopped.
135+
136+
```
137+
sonic(config)# errdisable recovery cause link-flap
138+
sonic(config)# no errdisable recovery cause link-flap
139+
```
140+
141+
### 2.1.2 Show Commands
142+
143+
"show errdisable recovery" is an existing CLI command. This output will be updated to list the ports in recovery period.
144+
- *show errdisable recovery*
145+
This command displays the err-disable recovery features. Link-flap is one among the features where in err-disable recovery option can be enabled.
146+
Example:
147+
```
148+
sonic#show errdisable recovery
149+
Err-Disable Reason Timer Status
150+
-----------------------------------
151+
udld Disabled
152+
bpduguard Disabled
153+
xcvrd Disabled
154+
link-flap Enabled
155+
156+
Interfaces that will be enabled at the next timeout:
157+
Interface Errdisable reason Time left(sec)
158+
-----------------------------------------------------
159+
Ethernet0 link-flap 24
160+
```
161+
- *show errdisable link-flap*
162+
Status and configuration details of link-flap error-disable is shown with this command.
163+
The ports which does not have non-default error disable configurations will not be displayed in the output.
164+
165+
Example:
166+
```
167+
sonic#show errdisable link-flap
168+
Interface Flap-threshold Sampling-time Recovery-timeout Status
169+
---------------------------------------------------------------------------
170+
Ethernet0 10 3 30 Errdisabled
171+
Ethernet4 10 3 60 Not-errdisabled
172+
Ethernet8 5 10 300 Off
173+
```
101174
# 2.2 Functional Description
102175

103176
# 3 Design
@@ -108,19 +181,19 @@ For individual physcial interface
108181
"PORT|Ethernet124":
109182
{
110183
"error-disable": "on|off",
111-
"toggle-frequency": "3",
184+
"flap-threshold": "3",
112185
"sampling-interval": "5",
113-
"wait-time-period": "10"
186+
"recovery-interval": "10"
114187
},
115188

116189
### 3.2.2 APP DB
117190
For individual physcial interface
118191
"PORT_TABLE|Ethernet124":
119192
{
120193
"error-disable": "on|off",
121-
"toggle-frequency": "3",
194+
"flap-threshold": "3",
122195
"sampling-interval": "5",
123-
"wait-time-period": "10"
196+
"recovery-interval": "10"
124197
},
125198

126199
To surpress interface:
@@ -139,9 +212,9 @@ Record number of link flaps within sampling-interval:
139212
"supress-time": time,
140213

141214
"error-disable": "on|off",
142-
"toggle-frequency": "3",
215+
"flap-threshold": "3",
143216
"sampling-interval": "5",
144-
"wait-time-period": "10"
217+
"recovery-interval": "10"
145218
}
146219

147220
### 3.2.4 ASIC DB
@@ -172,6 +245,47 @@ Can be reference to YANG if applicable. Also cover gNMI here.
172245
Refer to Functionality
173246

174247
### 3.6.3 REST API Support
248+
POST "<REST-SERVER:PORT>/restconf/data/openconfig-errdisable-ext:errdisable-port/port=<ifname>/link-flap"
249+
Request body:
250+
{
251+
"openconfig-errdisable-ext:link-flap": {
252+
"config": {
253+
"error-disable": <string>,
254+
"flap-threshold": <number>,
255+
"sampling-interval": <number>,
256+
"recovery-interval": <number>
257+
}
258+
}
259+
}
260+
261+
Example:
262+
```
263+
POST "<REST-SERVER:PORT>/restconf/data/openconfig-errdisable-ext:errdisable-port/port=Ethernet24/link-flap"
264+
{
265+
"openconfig-errdisable-ext:link-flap": {
266+
"config": {
267+
"error-disable": "on",
268+
"flap-threshold": 10,
269+
"sampling-interval": 20,
270+
"recovery-interval": 300
271+
}
272+
}
273+
}
274+
```
275+
276+
GET "<REST-SERVER:PORT>/restconf/data/openconfig-errdisable-ext:errdisable-port/port=<ifname>/link-flap/state"
277+
278+
Example:
279+
```
280+
GET "<REST-SERVER:PORT>/restconf/data/openconfig-errdisable-ext:errdisable-port/port=Ethernet24/link-flap/state"
281+
Response data:
282+
{
283+
"openconfig-errdisable-ext:state": {
284+
"time-left": 14
285+
}
286+
}
287+
```
288+
175289
### 3.6.4 Service and Docker Management
176290
No new service ot docker introduced
177291

0 commit comments

Comments
 (0)