Skip to content

Commit d012be9

Browse files
[Command-Reference] Add CLI docs for route flow counter (#2069)
- What I did Add CLIs document for route flow counter feature, CLI PR: #2031 - How I did it Add CLIs document for route flow counter feature - How to verify it Run build
1 parent 8c07d59 commit d012be9

File tree

1 file changed

+111
-1
lines changed

1 file changed

+111
-1
lines changed

doc/Command-Reference.md

+111-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* [Flow Counters](#flow-counters)
5858
* [Flow Counters show commands](#flow-counters-show-commands)
5959
* [Flow Counters clear commands](#flow-counters-clear-commands)
60+
* [Flow Counters config commands](#flow-counters-config-commands)
6061
* [Gearbox](#gearbox)
6162
* [Gearbox show commands](#gearbox-show-commands)
6263
* [Interfaces](#interfaces)
@@ -3137,9 +3138,10 @@ Go Back To [Beginning of the document](#) or [Beginning of this section](#featur
31373138
31383139
## Flow Counters
31393140
3140-
This section explains all the Flow Counters show commands and clear commands that are supported in SONiC. Flow counters are usually used for debugging, troubleshooting and performance enhancement processes. Flow counters supports case like:
3141+
This section explains all the Flow Counters show commands, clear commands and config commands that are supported in SONiC. Flow counters are usually used for debugging, troubleshooting and performance enhancement processes. Flow counters supports case like:
31413142
31423143
- Host interface traps (number of received traps per Trap ID)
3144+
- Routes matching the configured prefix pattern (number of hits and number of bytes)
31433145
31443146
### Flow Counters show commands
31453147
@@ -3169,6 +3171,50 @@ Because clear (see below) is handled on a per-user basis different users may see
31693171
asic1 dhcp 200 3,000 45.25/s
31703172
```
31713173
3174+
**show flowcnt-route stats**
3175+
3176+
This command is used to show the current statistics for route flow patterns.
3177+
3178+
Because clear (see below) is handled on a per-user basis different users may see different counts.
3179+
3180+
- Usage:
3181+
```
3182+
show flowcnt-route stats
3183+
show flowcnt-route stats pattern <route_pattern> [--vrf <vrf>]
3184+
show flowcnt-route stats route <route_prefix> [--vrf <vrf>]
3185+
```
3186+
3187+
- Example:
3188+
```
3189+
admin@sonic:~$ show flowcnt-route stats
3190+
Route pattern VRF Matched routes Packets Bytes
3191+
--------------------------------------------------------------------------------------
3192+
3.3.0.0/16 default 3.3.1.0/24 100 4543
3193+
3.3.2.3/32 3443 929229
3194+
3.3.0.0/16 0 0
3195+
2000::/64 default 2000::1/128 100 4543
3196+
```
3197+
3198+
The "pattern" subcommand is used to display the route flow counter statistics by route pattern.
3199+
3200+
- Example:
3201+
```
3202+
admin@sonic:~$ show flowcnt-route stats pattern 3.3.0.0/16
3203+
Route pattern VRF Matched routes Packets Bytes
3204+
--------------------------------------------------------------------------------------
3205+
3.3.0.0/16 default 3.3.1.0/24 100 4543
3206+
3.3.2.3/32 3443 929229
3207+
3.3.0.0/16 0 0
3208+
```
3209+
3210+
The "route" subcommand is used to display the route flow counter statistics by route prefix.
3211+
```
3212+
admin@sonic:~$ show flowcnt-route stats route 3.3.3.2/32 --vrf Vrf_1
3213+
Route VRF Route Pattern Packets Bytes
3214+
-----------------------------------------------------------------------------------------
3215+
3.3.3.2/32 Vrf_1 3.3.0.0/16 100 4543
3216+
```
3217+
31723218
### Flow Counters clear commands
31733219
31743220
**sonic-clear flowcnt-trap**
@@ -3186,6 +3232,70 @@ This command is used to clear the current statistics for the registered host int
31863232
Trap Flow Counters were successfully cleared
31873233
```
31883234
3235+
**sonic-clear flowcnt-route**
3236+
3237+
This command is used to clear the current statistics for the route flow counter. This is done on a per-user basis.
3238+
3239+
- Usage:
3240+
```
3241+
sonic-clear flowcnt-route
3242+
sonic-clear flowcnt-route pattern <route_pattern> [--vrf <vrf>]
3243+
sonic-clear flowcnt-route route <prefix> [--vrf <vrf>]
3244+
```
3245+
3246+
- Example:
3247+
```
3248+
admin@sonic:~$ sonic-clear flowcnt-route
3249+
Route Flow Counters were successfully cleared
3250+
```
3251+
3252+
The "pattern" subcommand is used to clear the route flow counter statistics by route pattern.
3253+
3254+
- Example:
3255+
```
3256+
admin@sonic:~$ sonic-clear flowcnt-route pattern 3.3.0.0/16 --vrf Vrf_1
3257+
Flow Counters of all routes matching the configured route pattern were successfully cleared
3258+
```
3259+
3260+
The "route" subcommand is used to clear the route flow counter statistics by route prefix.
3261+
3262+
- Example:
3263+
```
3264+
admin@sonic:~$ sonic-clear flowcnt-route route 3.3.3.2/32 --vrf Vrf_1
3265+
Flow Counters of the specified route were successfully cleared
3266+
```
3267+
3268+
### Flow Counters config commands
3269+
3270+
**config flowcnt-route pattern add**
3271+
3272+
This command is used to add or update the route pattern which is used by route flow counter to match route entries.
3273+
3274+
- Usage:
3275+
```
3276+
config flowcnt-route pattern add <prefix> [--vrf <vrf>] [--max <max_match_count>]
3277+
```
3278+
3279+
- Example:
3280+
```
3281+
admin@sonic:~$ config flowcnt-route pattern add 2.2.0.0/16 --vrf Vrf_1 --max 50
3282+
```
3283+
3284+
**config flowcnt-route pattern remove**
3285+
3286+
This command is used to remove the route pattern which is used by route flow counter to match route entries.
3287+
3288+
- Usage:
3289+
```
3290+
config flowcnt-route pattern remove <prefix> [--vrf <vrf>]
3291+
```
3292+
3293+
- Example:
3294+
```
3295+
admin@sonic:~$ config flowcnt-route pattern remove 2.2.0.0/16 --vrf Vrf_1
3296+
```
3297+
3298+
31893299
Go Back To [Beginning of the document](#) or [Beginning of this section](#flow-counters)
31903300
## Gearbox
31913301

0 commit comments

Comments
 (0)