You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Configuration and Management](#configuration-and-management)
19
19
-[Config DB Enhancements](#config-db-enhancements)
20
-
-[ACL table](#acl-table)
21
-
-[Custom ACL Table Type --\> no change](#custom-acl-table-type----no-change)
22
-
-[ACL rule](#acl-rule)
20
+
-[ACL Tables Table --\> No Change](#acl-tables-table----no-change)
21
+
-[ACL Table Type Table](#acl-table-type-table)
22
+
-[ACL Rules Table](#acl-rules-table)
23
23
-[YANG Model Enhancements](#yang-model-enhancements)
24
24
-[CLI Config Commands](#cli-config-commands)
25
25
-[CLI Show Commands](#cli-show-commands)
@@ -30,6 +30,7 @@
30
30
-[Unit Test Cases](#unit-test-cases)
31
31
-[System Test Cases](#system-test-cases)
32
32
-[CLI Level Tests](#cli-level-tests)
33
+
-[Negative Test Cases](#negative-test-cases)
33
34
-[DB validation](#db-validation)
34
35
-[Open/Action Items](#openaction-items)
35
36
-[Related HLDs](#related-hlds)
@@ -60,27 +61,32 @@ This document describes the Custom ACL Based Metering (CABM) feature design in S
60
61
---
61
62
### Overview
62
63
63
-
Policers in networking are responsible for **metering** (Monitoring the rate of traffic) and **marking** (Flagging traffic that exceeds defined limits) traffic based on predefined criteria.
64
-
By applying policers to ACL rules, SONiC can effectively control the flow of network traffic, ensuring fairness, optimizing bandwidth utilization, and preventing network congestion.
64
+
The Custom ACL-Based Metering (CABM) feature extends SONiC's capabilities to provide granular traffic management by integrating policers with ACL rules.
65
+
Policers are essential tools for **metering** (Monitoring the rate of traffic) and **marking** (Flagging traffic that exceeds defined limits) traffic based on predefined criteria.
66
+
67
+
By leveraging flexible ACL tables with customized match fields and action sets, CABM allows customers to implement smart traffic policies dedicated to their needs.
68
+
This flexibility ensures scalability and adaptability in diverse network environments.
65
69
66
70
Usage examples:
67
-
-**Security**: Custom ACL Based Metering can be used to guard against **network storms or DDoS attacks** by limiting traffic rates.
68
-
-**Fair Bandwidth Distribution**: Ensures bandwidth is allocated effectively across applications and services.
71
+
-**Security**: Custom ACL Based Metering can be used to guard against **DoS attacks (such as TCP SYN attacks)**.
72
+
This can be done by defining rules that detect specific traffic patterns (e.g., TCP SYN packets) and applies rate-limiting policers to minimize their impact.
73
+
-**Efficient Bandwidth Distribution**: Ensures bandwidth is allocated effectively across applications and services by rate-limiting specific traffic types (e.g., backup traffic sent with SCP or FTP), ensuring priority traffic can operate without interruption.
69
74
70
75
---
71
76
### Requirements
72
77
#### Functional Requirements
73
-
- Backward compatibility for existing ACL features - If policer is not set, the system will function as it did previously.
74
-
- Ability to config policers with ACL entries.
75
-
- Support existing Policer types (Policer mode, meter_type).
76
-
- Support custom ACL type mechanism with policers.
78
+
- Backward compatibility for existing ACL features.
79
+
- Ability to bind policers to ACL entries.
80
+
- Extend [ACL User Defined Table Type](https://github.com/sonic-net/SONiC/blob/master/doc/acl/ACL-Table-Type-HLD.md) (custom ACL type) mechanism with policers.
81
+
- Ability to have customer specific table that contains a list of actions and match fields.
- Support multiple rules within ACL to be bound to one policer.
84
+
- Support binding of multiple ACL rules to a single policer.
79
85
- Query and validate SAI capabilities.
80
86
#### CLI Requirements
81
-
-Bind policers with ACL rules.
82
-
-Unbind policer from ACL rules.
83
-
-Show ACLs with policers
87
+
-Extend ACL table command to support policer.
88
+
-Extend ACl rules command to bind and unbind rule to policers.
89
+
-Support show ACL rules command with policers.
84
90
---
85
91
### Architecture Design
86
92
@@ -89,50 +95,50 @@ No SONiC architecture changes are required as the existing infrastructure is bei
89
95
---
90
96
### High-Level Design
91
97
92
-
#### Modules and Sub-Modules
98
+
#### Custom ACL Mechanism
99
+
SONiC currently supports [ACL User Defined Table Types](https://github.com/sonic-net/SONiC/blob/master/doc/acl/ACL-Table-Type-HLD.md) that enables customers to define flexible ACL tables tailored to specific operational needs.
100
+
This mechanism extends SONiC’s ACL framework by allowing users to specify their own match fields and actions supporting a wide range of traffic management policies.
93
101
94
-
-**SWSS**
95
-
- ACL-Orch
96
-
- Set or disable policer action.
97
-
- Query from SAI the ACL actions capability.
98
-
- Allow policer action only when the capability is enabled.
99
-
- Parse policer action fields.
100
-
- Policer-Orch
101
-
- Validate policer info.
102
-
- Map policer name to policer object ID.
103
-
- Prevent from deleting policer that bound to ACLs.
102
+
Custom ACL Based Metering (CABM) builds directly upon this custom ACL mechanism by introducing support for policer actions within custom ACL table types, allowing customers to enforce advanced traffic management policies.
104
103
105
-
##### *Image 1: Configuration Flow Overview*
104
+
####**Configuration Flow**
106
105
107
106

108
107
109
108
109
+
1. Query Capabilities on Initialization: ACL-Orch queries SAI to retrieve supported ACL actions, including SAI_ACL_ACTION_TYPE_SET_POLICER.
110
+
2. Create Policer Object: Policer configurations are defined in POLICER_TABLE, validated, and created in SAI.
111
+
3. Define Custom ACL Table Type: Users define custom ACL table types in ACL_TABLE_TYPE with specified matches and actions, including POLICER_ACTION.
112
+
4. Verify Table Capabilities: ACL-Orch ensures that the custom table type's action set, including POLICER_ACTION, is supported by the queried SAI capabilities.
113
+
5. Create ACL Table: Add an ACL table in ACL_TABLE, referencing the custom table type and validates the configuration.
114
+
6. Create ACL Rule: Add an ACL rule in ACL_RULE, referencing actions, including policer_action.
115
+
7. Verify Rule Compatibility: ACL-Orch validates that the rule action compatibility with the associated ACL table type.
116
+
8. Verify and Map Policer to SAI Object: Policer-Orch maps the policer_action name if it exists from CONFIG_DB to SAI object IDs.
117
+
9. Program ACL Rule in SAI: ACL-Orch programs ACL rule entries into SAI associating them with the policer object.
118
+
110
119
---
111
120
112
121
### Configuration and Management
113
122
#### Config DB Enhancements
114
123
115
-
##### ACL table
116
-
- When a new ACL is created, SAI API should get a packet-action list of supported actions that could be used in the rules belonging to this table.
117
-
- An existing mechanism allows defining **custom ACL table types** and specifying the desired combination of actions and match fields (ACL User Defined Table Type HLD).
118
-
- To support the new policer action, the custom table type will be extended with the policer action attribute - SAI_ACL_ACTION_TYPE_SET_POLICER.
124
+
##### ACL Tables Table --> No Change
125
+
126
+
##### ACL Table Type Table
127
+
When a new ACL table is created, SAI needs to receive a list of supported actions which the rules belonging to this table are allowed to use.
128
+
To support the new policer action, the custom table types table schema will be extended with a policer action attribute - **"POLICER_ACTION"** for the actions attribute field.
119
129
120
-
###### Custom ACL Table Type --> no change
121
130
```
122
131
key: ACL_TABLE_TYPE|<TYPE_NAME> ; key of the ACL table type entry.
123
132
; the name is arbitary name user chooses.
124
-
;field = value
133
+
;field = value
125
134
matches = match-list ; list of matches for this table.
126
135
; matches are same as in ACL_RULE table.
127
136
actions = action-list ; list of actions for this table.
128
-
; actions are same as in ACL_RULE table.
129
-
bind_points = bind-points-list ; list of bind point types for this table.
137
+
; ["REDIRECT_ACTION", ... , "POLICER_ACTION"]
130
138
```
131
139
132
-
##### ACL rule
133
-
- The CONFIG_DB ACL rules table schema will be updated with a new attribute **"policer_action"** with the value of one of the existing policer object names.
134
-
- This proposed schema is flexible and can support rules with more than a single action.
135
-
- The existing design of SONiC ACL allows only one action to be defined per rule, this consept will be kept.
140
+
##### ACL Rules Table
141
+
The CONFIG_DB ACL Rules Table schema will be updated with a new attribute field **"policer_action"** with the value of one of the existing policer object names.
136
142
137
143
```
138
144
key: ACL_RULE|<TABLE_NAME>|<RULE_NAME> ; key of the rule entry in the table,
@@ -376,18 +373,27 @@ During warmboot or fastboot, both ACL rules and policers configurations are rest
376
373
---
377
374
### Testing Requirements/Design
378
375
#### Unit Test Cases
376
+
- Create custom acl table type with policer attribute.
377
+
- Create acl table of the custom type and add acl rule with policer action.
378
+
- Delete acl rule with valid policer action.
379
+
- Create acl rule with valid policer and try to delete the policer.
380
+
- Create acl rule with action as non-existent policer.
379
381
- Test ACL-Orch and Policer-Orch logic for correct processing.
380
382
#### System Test Cases
381
383
- Ensure correct packet marking based on policer configurations.
382
384
- Test different traffic patterns and rates to ensure consistent marking.
383
385
- Warm/Fast reboot tests
384
-
- verify that policer configurations are preserved across reboots
385
-
- verify that ACL configurations are preserved across reboots
386
+
- verify that policer configurations are preserved across reboots.
387
+
- verify that ACL configurations are preserved across reboots.
386
388
#### CLI Level Tests
387
-
- Verify command run successfully with valid parameter enable/disable.
389
+
- Verify command run successfully with valid policer parameter.
388
390
- Verify command abort with invalid policer parameter.
389
-
- Verify command output.
391
+
- Verify show acl rule command display the policer parameter.
390
392
- Verify binding and unbinding policers with ACL rules.
393
+
##### Negative Test Cases
394
+
- Configure a rule with an action not listed in the custom ACL table type's action set, verify that the configuration is rejected with an appropriate error message.
395
+
- Configure a rule with a non-existent policer name, verify that the configuration is rejected with an appropriate error message.
396
+
- Attempt to delete a policer referenced by active ACL rules, verify that the deletion is blocked with an appropriate error message.
0 commit comments