Skip to content

Commit c560c91

Browse files
[Command-Reference] Add CLI docs for route flow counter
1 parent 8b01d3e commit c560c91

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)
@@ -3133,9 +3134,10 @@ Go Back To [Beginning of the document](#) or [Beginning of this section](#featur
31333134
31343135
## Flow Counters
31353136
3136-
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:
3137+
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:
31373138
31383139
- Host interface traps (number of received traps per Trap ID)
3140+
- Routes matching the configured prefix pattern (number of hits and number of bytes)
31393141
31403142
### Flow Counters show commands
31413143
@@ -3165,6 +3167,50 @@ Because clear (see below) is handled on a per-user basis different users may see
31653167
asic1 dhcp 200 3,000 45.25/s
31663168
```
31673169
3170+
**show flowcnt-route stats**
3171+
3172+
This command is used to show the current statistics for route flow patterns.
3173+
3174+
Because clear (see below) is handled on a per-user basis different users may see different counts.
3175+
3176+
- Usage:
3177+
```
3178+
show flowcnt-route stats
3179+
show flowcnt-route stats pattern <route_pattern> [--vrf <vrf>]
3180+
show flowcnt-route stats route <route_prefix> [--vrf <vrf>]
3181+
```
3182+
3183+
- Example:
3184+
```
3185+
admin@sonic:~$ show flowcnt-route stats
3186+
Route pattern VRF Matched routes Packets Bytes
3187+
--------------------------------------------------------------------------------------
3188+
3.3.0.0/16 default 3.3.1.0/24 100 4543
3189+
3.3.2.3/32 3443 929229
3190+
3.3.0.0/16 0 0
3191+
2000::/64 default 2000::1/128 100 4543
3192+
```
3193+
3194+
The "pattern" subcommand is used to display the route flow counter statistics by route pattern.
3195+
3196+
- Example:
3197+
```
3198+
admin@sonic:~$ show flowcnt-route stats pattern 3.3.0.0/16
3199+
Route pattern VRF Matched routes Packets Bytes
3200+
--------------------------------------------------------------------------------------
3201+
3.3.0.0/16 default 3.3.1.0/24 100 4543
3202+
3.3.2.3/32 3443 929229
3203+
3.3.0.0/16 0 0
3204+
```
3205+
3206+
The "route" subcommand is used to display the route flow counter statistics by route prefix.
3207+
```
3208+
admin@sonic:~$ show flowcnt-route stats route 3.3.3.2/32 --vrf Vrf_1
3209+
Route VRF Route Pattern Packets Bytes
3210+
-----------------------------------------------------------------------------------------
3211+
3.3.3.2/32 Vrf_1 3.3.0.0/16 100 4543
3212+
```
3213+
31683214
### Flow Counters clear commands
31693215
31703216
**sonic-clear flowcnt-trap**
@@ -3182,6 +3228,70 @@ This command is used to clear the current statistics for the registered host int
31823228
Trap Flow Counters were successfully cleared
31833229
```
31843230
3231+
**sonic-clear flowcnt-route**
3232+
3233+
This command is used to clear the current statistics for the route flow counter. This is done on a per-user basis.
3234+
3235+
- Usage:
3236+
```
3237+
sonic-clear flowcnt-route
3238+
sonic-clear flowcnt-route pattern <route_pattern> [--vrf <vrf>]
3239+
sonic-clear flowcnt-route route <prefix> [--vrf <vrf>]
3240+
```
3241+
3242+
- Example:
3243+
```
3244+
admin@sonic:~$ sonic-clear flowcnt-route
3245+
Route Flow Counters were successfully cleared
3246+
```
3247+
3248+
The "pattern" subcommand is used to clear the route flow counter statistics by route pattern.
3249+
3250+
- Example:
3251+
```
3252+
admin@sonic:~$ sonic-clear flowcnt-route pattern 3.3.0.0/16 --vrf Vrf_1
3253+
Flow Counters of all routes matching the configured route pattern were successfully cleared
3254+
```
3255+
3256+
The "route" subcommand is used to clear the route flow counter statistics by route prefix.
3257+
3258+
- Example:
3259+
```
3260+
admin@sonic:~$ sonic-clear flowcnt-route route 3.3.3.2/32 --vrf Vrf_1
3261+
Flow Counters of the specified route were successfully cleared
3262+
```
3263+
3264+
### Flow Counters config commands
3265+
3266+
**config flowcnt-route pattern add**
3267+
3268+
This command is used to add or update the route pattern which is used by route flow counter to match route entries.
3269+
3270+
- Usage:
3271+
```
3272+
config flowcnt-route pattern add <prefix> [--vrf <vrf>] [--max <max_match_count>]
3273+
```
3274+
3275+
- Example:
3276+
```
3277+
admin@sonic:~$ config flowcnt-route pattern add --vrf Vrf_1 --max 50 2.2.0.0/16
3278+
```
3279+
3280+
**config flowcnt-route pattern remove**
3281+
3282+
This command is used to remove the route pattern which is used by route flow counter to match route entries.
3283+
3284+
- Usage:
3285+
```
3286+
config flowcnt-route pattern remove <prefix> [--vrf <vrf>]
3287+
```
3288+
3289+
- Example:
3290+
```
3291+
admin@sonic:~$ config flowcnt-route pattern remove --vrf Vrf_1 2.2.0.0/16
3292+
```
3293+
3294+
31853295
Go Back To [Beginning of the document](#) or [Beginning of this section](#flow-counters)
31863296
## Gearbox
31873297

0 commit comments

Comments
 (0)