Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,19 @@ In this table the physical port configurations are defined. Each object
will have port name as its key, and port name alias and port speed as
optional attributes.

The following optional attributes configure per port link event damping
(AIED algorithm, based on RFC 2439), which suppresses link events from a
flapping interface:

| Attribute | Description |
| ------------------------------ | ----------- |
| `link_event_damping_algorithm` | `disabled` (default), `aied` (suppress link events when penalty exceeds the suppress threshold), or `aied-monitor` (RFC 7196 monitor only mode: calculate penalties and emit syslog but do not suppress; pending swss support). |
| `max_suppress_time` | Maximum seconds an interface may stay suppressed since the last link down event, regardless of penalty. Industry default 20. |
| `decay_half_life` | Seconds after which the accumulated penalty halves while the interface is stable. Must be less than or equal to `max_suppress_time`. Industry default 5. |
| `suppress_threshold` | Penalty above which damping activates. Industry default 2000. |
| `reuse_threshold` | Penalty at or below which damping deactivates. Must be less than or equal to `suppress_threshold`. Industry default 1000. |
| `flap_penalty` | Penalty added for each link down transition. Industry standard 1000. |

```
{
"PORT": {
Expand All @@ -2102,7 +2115,13 @@ optional attributes.
"dom_polling": "enabled",
"core_id": "1",
"core_port_id": "1",
"num_voq": "8"
"num_voq": "8",
"link_event_damping_algorithm": "aied",
"max_suppress_time": "20",
"decay_half_life": "5",
"suppress_threshold": "2000",
"reuse_threshold": "1000",
"flap_penalty": "1000"
},
"Ethernet1": {
"index": "1",
Expand Down
8 changes: 7 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,13 @@
"laser_freq": "191600",
"tx_power": "-26.6",
"mode":"trunk",
"dhcp_rate_limit": "300"
"dhcp_rate_limit": "300",
"link_event_damping_algorithm": "aied",
"max_suppress_time": "20",
"decay_half_life": "5",
"suppress_threshold": "2000",
"reuse_threshold": "1000",
"flap_penalty": "1000"
},
"Ethernet1": {
"alias": "Eth1/2",
Expand Down
18 changes: 16 additions & 2 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,22 @@
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2": {
"desc": "PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2 no failure."
},
"PORT_VALID_DAMPING_AIED_TEST": {
"desc": "PORT_VALID_DAMPING_AIED_TEST no failure."
},
"PORT_VALID_DAMPING_AIED_MONITOR_TEST": {
"desc": "PORT_VALID_DAMPING_AIED_MONITOR_TEST no failure."
},
"PORT_INVALID_DAMPING_ALGORITHM_TEST": {
"desc": "PORT_INVALID_DAMPING_ALGORITHM_TEST invalid algorithm pattern failure.",
"eStrKey" : "Pattern",
"eStr": ["disabled|aied|aied-monitor"]
},
"PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST": {
"desc": "PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST must condition failure.",
"eStrKey" : "None",
"eStr": ["decay_half_life must be less than or equal to max_suppress_time"]
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,86 @@
"alias": "etp1a",
"speed": 100000,
"role": "Int"


}
]
}
}
},

"PORT_VALID_DAMPING_AIED_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied",
"max_suppress_time": 20,
"decay_half_life": 5,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
}
},

"PORT_VALID_DAMPING_AIED_MONITOR_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied-monitor",
"max_suppress_time": 20,
"decay_half_life": 5,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
}
},

"PORT_INVALID_DAMPING_ALGORITHM_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "invalid_value"
}
]
}
}
},

"PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied",
"max_suppress_time": 10,
"decay_half_life": 15,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
Expand Down
73 changes: 73 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,79 @@ module sonic-port{
description "Enable or disable fast link-up on the port";
}

leaf link_event_damping_algorithm {
description "Link event damping algorithm.
'disabled' - no damping applied to this interface.
'aied' - Additive Increase Exponential Decrease algorithm
based on RFC 2439. Actively suppresses link events
when penalty exceeds suppress threshold.
'aied-monitor' - Same AIED algorithm but monitor-only mode.
Calculates penalties and emits syslog messages but
does NOT suppress link events. Use to safely tune
parameters in production before enabling full
dampening. Recommended by RFC 7196.";
type string {
pattern "disabled|aied|aied-monitor";
}
default "disabled";
}

leaf max_suppress_time {
description "Maximum time in seconds that an interface can remain
in damped (suppressed) state since the last link-down
event, regardless of accumulated penalty.
A value of 0 means this parameter is not configured.
Industry default: 20 seconds.";
type uint32;
default 0;
}

leaf decay_half_life {
description "Time in seconds after which the accumulated penalty
is halved if the interface remains stable (no flaps).
Must be less than or equal to max_suppress_time.
A value of 0 means this parameter is not configured.
Industry default: 5 seconds.";
must "current() = 0 or ../max_suppress_time = 0 or current() <= ../max_suppress_time" {
error-message "decay_half_life must be less than or equal to max_suppress_time";
}
type uint32;
default 0;
}

leaf suppress_threshold {
description "Penalty threshold above which damping is activated
on the interface. Link events are suppressed when the
accumulated penalty exceeds this value.
A value of 0 means this parameter is not configured.
Industry default: 2000.";
type uint32;
default 0;
}

leaf reuse_threshold {
description "Penalty threshold at or below which damping is
deactivated. The interface returns to normal operation
when penalty decays to this value.
Must be less than or equal to suppress_threshold.
A value of 0 means this parameter is not configured.
Industry default: 1000.";
must "current() = 0 or ../suppress_threshold = 0 or current() <= ../suppress_threshold" {
error-message "reuse_threshold must be less than or equal to suppress_threshold";
}
type uint32;
default 0;
}

leaf flap_penalty {
description "Penalty value added to accumulated penalty for each
link-down (UP to DOWN) transition event.
A value of 0 means this parameter is not configured.
Industry standard: 1000.";
type uint32;
default 0;
}


} /* end of list PORT_LIST */

Expand Down
Loading