Skip to content

QoS Configuration

Table 1 Traffic Behavior View

CommandPurpose
show traffic behavior [traffic_behavior_name]Display the configured CAR policy.

show traffic behavior [traffic_behavior_name]

Section titled “show traffic behavior [traffic_behavior_name]”

[Command]

show traffic behavior [traffic_behavior_name]

[Purpose]

Display the configured CAR(Committed Access Rate) policy.

[Parameters]

ParameterDescription
traffic_behavior_nameTraffic behavior name.

[View]

Privileged User View

[Use Cases]

sonic# show traffic behavior
Name Type Mode CIR CBS
------ ------ ------ ------ -----
test BYTES SR_TCM 100000 64000

Table 2 Traffic Behavior Config

CommandPurpose
traffic behavior traffic_behavior_name (Global Configuration View)Create a traffic behavior and enter Traffic Behavior View.
car {sr-tcm|tr-tcm} [meter-type bytes] cir cir [cbs cbs] [pir pir] [pbs pbs]Add a byte-mode CAR policy.
car {sr-tcm|tr-tcm} meter-typepackets cir cir [cbs cbs] [pir pir] [pbs pbs]Add a packet-mode CAR policy.
traffic-behavior traffic_behavior_name (Physical Interface Configuration View)Apply the CAR policy to an interface.

traffic behavior traffic_behavior_name (Global Configuration View)

Section titled “traffic behavior traffic_behavior_name (Global Configuration View)”

[Command]

traffic behavior traffic_behavior_name

[Purpose]

Create a traffic behavior and enter Traffic Behavior View.

[Parameters]

ParameterDescription
traffic_behavior_nameTraffic behavior name.

[View]

Global Configuration View

[Notes]

Run command no traffic behavior traffic_behavior_name to delete the traffic behavior.

[Use Cases]

sonic# configure terminal
sonic(config)# traffic behavior test
sonic(config-traffic-behavior-test)#

car {sr-tcm|tr-tcm} [meter-type bytes] cir cir [cbs cbs] [pir pir] [pbs pbs]

Section titled “car {sr-tcm|tr-tcm} [meter-type bytes] cir cir [cbs cbs] [pir pir] [pbs pbs]”

[Command]

car {sr-tcm|tr-tcm} [meter-typebytes] cir cir [cbs cbs] [pir pir] [pbs pbs]

[Purpose]

Add a byte-mode CAR policy.

[Parameters]

ParameterDescription
sr-tcmSingle Rate Three Color Marker mode
tr-tcmTwo Rate Three Color Marker mode
cirSpecify CIR(Committed Information Rate) in bps. The range is 62500~2400000000000.
cbsSpecify CBS(Committed Burst Size) in bytes. The range is 1000~1500000000.
pirSpecify PIR(Peak Information Rate) in bps(only for tr-tcm). The range is 62500~2400000000000.
pbsSpecify PBS(Peak Burst Size) in bytes(only for tr-tcm). The range is 1000~1500000000.

[View]

traffic behavior Configuration View

[Notes]

If not specified the mode, the default is byte-mode. Run command no car to delete the CAR policy.

[Use Cases]

sonic# configure terminal
sonic(config)# traffic behavior test
sonic(config-traffic-behavior-test)# car sr-tcm meter-type PACKETS cir 1000000

car {sr-tcm|tr-tcm} meter-type packets cir cir [cbs cbs] [pir pir] [pbs pbs]

Section titled “car {sr-tcm|tr-tcm} meter-type packets cir cir [cbs cbs] [pir pir] [pbs pbs]”

[Command]

car {sr-tcm|tr-tcm} meter-typepackets cir cir [cbs cbs] [pir pir] [pbs pbs]

[Purpose]

Add a packet-mode CAR policy.

[Parameters]

ParameterDescription
sr-tcmSingle Rate Three Color Marker mode
tr-tcmTwo Rate Three Color Marker mode
cirSpecify CIR(Committed Information Rate) in pps. The range is 78 ~ 3000000000.
cbsSpecify CBS(Committed Burst Size) in packets. The range is 10 ~ 15000000.
pirSpecify PIR(Peak Information Rate) in pps(only for tr-tcm). The range is 78 ~ 3000000000.
pbsSpecify PBS(Peak Burst Size) in packets(only for tr-tcm). The range is 10 ~ 15000000.

[View]

traffic behavior Configuration View

[Notes]

Run command no car to delete the CAR policy.

[Use Cases]

sonic# configure terminal
sonic(config)# traffic behavior test
sonic(config-traffic-behavior-test)# car sr-tcm meter-type PACKETS cir 1000000

traffic-behavior traffic_behavior_name (Physical Interface Configuration View)

Section titled “traffic-behavior traffic_behavior_name (Physical Interface Configuration View)”

[Command]

traffic-behavior traffic_behavior_name

[Purpose]

Apply the CAR policy to an interface.

[Parameters]

ParameterDescription
traffic_behavior_nameTraffic behavior name.

[View]

Physical Interface Configuration View

[Notes]

Run command no traffic-behavior to unbind the CAR policy to an interface.

[Use Cases]

sonic# configure terminal
sonic(config)# interface ethernet 0/124
sonic(config-if-0/124)# traffic-behavior TEST
sonic(config-if-0/124)# show this
!
interface ethernet 0/124
traffic-behavior TEST

Table 3 Class Map View

CommandPurpose
show class-map [class_map_name]Display class map configuration.

[Command]

show class-map [class_map_name]

[Purpose]

Display class map configuration.

[Parameters]

ParameterDescription
class_map_nameClass map name.

[View]

Privileged User View

[Use Cases]

sonic# show class-map

Table 4 Class Map Config

CommandPurpose
class-map class_map_nameCreate a class map, and enter Class Map Configuration View
match cos cos_valueSpecify the COS value.

[Command]

class-map class_map_name

[Purpose]

Create a class map, and enter Class Map Configuration View

[Parameters]

ParameterDescription
class_map_nameClass map name.

[View]

Global Configuration View

[Notes]

Run command no class-map class_map_name to delete the class map.

[Use Cases]

sonic# configure terminal
leaf-138(config)# class-map cmap_4
leaf-138(config-cmap-cmap_4)# match cos 4
leaf-138(config-cmap-cmap_4)# show this
!
class-map cmap_4
match cos 4
leaf-138(config-cmap-cmap_4)#
leaf-138(config-cmap-cmap_4)# match cos 3 4
leaf-138(config-cmap-cmap_4)# show this
!
class-map cmap_4
match cos 3 4

[Command]

match cos cos_value

[Purpose]

Specify the COS value.

[Parameters]

ParameterDescription
cos_valueThe range is from 0 to7. When specifying more than one, use spaces to separate them.

[View]

Class Map Configuration View

[Notes]

COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet.

[Use Cases]

sonic# configure terminal
sonic(config)# class-map test_1000
sonic(config-cmap-test_1000)# match cos 2 3 4 5

Table 5 Diffserv Map View

CommandPurpose
show diffserv-map [type {ip-dscp default|diffserv_map_name |8021p diffserv_map_name}]Display diffserv map configuration.

show diffserv-map [type {ip-dscp default|diffserv_map_name |8021p diffserv_map_name}]

Section titled “show diffserv-map [type {ip-dscp default|diffserv_map_name |8021p diffserv_map_name}]”

[Command]

show diffserv-map [type {ip-dscp default|diffserv_map_name |8021p diffserv_map_name}]

[Purpose]

Display diffserv map configuration.

[Parameters]

ParameterDescription
diffserv_map_nameDiffserv map name.

[View]

Privileged User View

[Notes]

default is the default diffserv map (ip-dscp type).

[Use Cases]

sonic# show diffserv-map
Diffserv Map default:
Type ip-dscp
from 30 to 3
from 42 to 5
from 43 to 5
from 60 to 7
from 61 to 7
from 62 to 7
from 63 to 7
from 53 to 6
from 52 to 6
from 23 to 2
from 24 to 3
from 25 to 3
from 26 to 3
from 27 to 3
from 20 to 2
from 21 to 2
from 22 to 2
from 49 to 6
from 46 to 5
from 47 to 5
from 44 to 5
from 45 to 5
from 28 to 3
from 29 to 3
from 40 to 5
from 41 to 5
from 1 to 0
from 0 to 0
from 3 to 0
from 2 to 0
from 5 to 0
from 4 to 0
from 7 to 0
from 6 to 0
from 9 to 1
from 8 to 1
from 18 to 2
from 39 to 4
from 38 to 4
from 59 to 7
from 32 to 4
from 14 to 1
from 11 to 1
from 10 to 1
from 13 to 1
from 12 to 1
from 15 to 1
from 58 to 7
from 17 to 2
from 16 to 2
from 19 to 2
from 54 to 6
from 31 to 3
from 56 to 7
from 51 to 6
from 36 to 4
from 35 to 4
from 34 to 4
from 33 to 4
from 55 to 6
from 37 to 4
from 48 to 6
from 57 to 7
from 50 to 6

Table 6 Diffserv Map Config

CommandPurpose
diffserv-map type {ip-dscp|8021p} diffserv_map_nameCreate a diffserv map, and enter Diffserv Map Configuration View
default {cos_value|copy}Configure COS mapping in bulk.
ip-dscp dscp_value cos cos_valueSet DSCP to COS mapping.
8021p dot1p_value cos cos_valueSet DOT1P to COS mapping.

diffserv-map type {ip-dscp|8021p} diffserv_map_name

Section titled “diffserv-map type {ip-dscp|8021p} diffserv_map_name”

[Command]

diffserv-maptype {ip-dscp|8021p} diffserv_map_name

[Purpose]

Create a diffserv map, and enter Diffserv Map Configuration View

[Parameters]

ParameterDescription
diffserv_map_nameDiffserv map name.

[View]

Global Configuration View

[Notes]

There are DSCP mappings and DOT1P mappings.

[Use Cases]

sonic# configure terminal
sonic(config)# diffserv-map type ip-dscp testdiff1
sonic(config-diffservmap-testdiff1)# exit
sonic(config)#diffserv-map type 8021p testdiff2
sonic(config-diffservmap-testdiff2)#

[Command]

default {cos_value|copy}

[Purpose]

Configure COS mapping in bulk.

[Parameters]

ParameterDescription
cos_valueThe range is from 0 to7.

[View]

Diffserv Map Configuration View

[Notes]

COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet.; default cos_value indicates that all traffic will be mapped to the specified COS value. default copy indicates to use the default DSCP mapping(only for DSCP to COS mapping). Run command no default to delete this mapping configuration.

[Use Cases]

sonic(config)# diffserv-map type 8021p test1
sonic(config-diffservmap-test1)# default 0
sonic(config-diffservmap-test1)# do show diffserv-map
Diffserv Map test1:
Type 8021p
from 0 to 0
from 1 to 0
from 2 to 0
from 3 to 0
from 4 to 0
from 5 to 0
from 6 to 0
from 7 to 0

[Command]

ip-dscp dscp_value cos cos_value

[Purpose]

Set DSCP to COS mapping.

[Parameters]

ParameterDescription
dscp_valueThe range is from 0 to 63.
cos_valueThe range is from 0 to7.

[View]

DSCP Diffserv Map Configuration View

[Notes]

COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet.; Run command no ip-dscp dscp_value cos cos_value to delete DSCP to COS mapping.

[Use Cases]

sonic(config)# diffserv-map type ip-dscp testdiff1
sonic(config-diffservmap-testdiff1)# ip-dscp 0 cos 2
sonic(config-diffservmap-testdiff1)# ip-dscp 1 cos 4

[Command]

8021p dot1p_value cos cos_value

[Purpose]

Set DOT1P to COS mapping.

[Parameters]

ParameterDescription
dot1p_valueThe range is from 0 to7.
cos_valueThe range is from 0 to7.

[View]

DOT1P Diffserv Map Configuration View

[Notes]

COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet.; Run command no 8021p dot1p_value cos cos_value to delete DOT1P to COS mapping.

[Use Cases]

sonic(config)# diffserv-map type 8021p testdiff2
sonic(config-diffservmap-testdiff2)# 8021p 0 cos 2
sonic(config-diffservmap-testdiff2)# 8021p 1 cos 4

Table 7 Policy Map View

CommandPurpose
show policy-map [policy_map_name]Display policy map configuration.
show interface policy-mapDisplay the relationship between interfaces and policy-maps.

[Command]

show policy-map [policy_map_name]

[Purpose]

Display policy map configuration.

[Parameters]

ParameterDescription
policy_map_namePolicy map name.

[View]

Privileged User View

[Use Cases]

sonic# show policy-map
!
policy-map test
!
policy-map test11
!
policy-map test_pfc
class cmap_4
priority-group-buffer pg_lossless_1
!

[Command]

show interface policy-map

[Purpose]

Display the relationship between interfaces and policy-maps.

[View]

Privileged User View

[Use Cases]

sonic# show interface policy-map
Port service policy
------ ----------------
0/0 roce_lossless
0/4 test
0/8 roce_lossless
0/12 roce_lossless
0/16 roce_lossless
0/20 roce_lossless
0/24 roce_lossless
0/28 roce_lossless
0/32 roce_lossless
0/36 roce_lossless
0/40 roce_lossless
0/44 roce_lossless
0/48 roce_lossless
……

Table 8 Policy Map Config

CommandPurpose
policy-map policy_map_nameCreate a policy map, and enter Traffic Policy Configuration View.
set cos {dscp|8021p} diffserv diffserv_map_nameSet DSCP or DOT1P to COS mapping.
port-shape target-bit-rate burst-sizeAdd a speed limit policy for ports.
queue-sheduler priority queue queue-idAdd strict queue scheduling policies.
queue-scheduler queue-limit percent queue-wight queue queue-idAdd DWRR queue scheduling policies.
class {class_map_name|class-default}Specify the COS value of the policy, and enter Policy Map-Class Map Configuration View.
queue-shape target-bit-rate burst-sizeAdd a speed limit policy for queues.
wred {wred_profile_name|default_drop|default_ecn}Bind WRED profile to the class map.
priority-group-buffer buffer_profile_nameBind a custom PG buffer profile (Ingress).
queue-buffer buffer_profile_nameBind a custom Queue Buffer Profile (Egress).
bandwidth rate-bps [burst-size]Set minimum guaranteed bandwidth.
service-policy policy_map_nameApply the policy to the interface.

[Command]

policy-map policy_map_name

[Purpose]

Create a policy map, and enter Traffic Policy Configuration View.

[Parameters]

ParameterDescription
policy_map_namePolicy map name.

[View]

Global Configuration View

[Notes]

Run command no policy-map policy_map_name to delete the policy map.

[Use Cases]

sonic# configure terminal
sonic(config)# policy-map test1
sonic(config-pmap-test1)#

set cos {dscp|8021p} diffserv diffserv_map_name

Section titled “set cos {dscp|8021p} diffserv diffserv_map_name”

[Command]

set cos {dscp|8021p} diffserv diffserv_map_name

[Purpose]

Set DSCP or DOT1P to COS mapping.

[Parameters]

ParameterDescription
diffserv_map_nameDiffserv map name.

[View]

Traffic Policy Configuration View

[Notes]

COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet. Run command no set cos {dscp|8021p} diffserv diffserv_map_name to delete the mapping.

[Use Cases]

sonic(config-pmap-test1)# set cos dscp diffserv testdiff1

[Command]

port-shape target-bit-rate burst-size

[Purpose]

Add a speed limit policy for ports.

[Parameters]

ParameterDescription
target-bit-rateSpecify the target rate in Bps, and the range is from 64000 to line rate.
burst-sizeSpecify the burst size in bytes, and the range is from 1000 to 3145728.

[View]

Traffic Policy Configuration View

[Notes]

The port shaping policy should be configured on the egress interface of the traffic. Run command no port-shape to delete the speed limit policy.

[Use Cases]

Limit the speed of the interface to 2Gbps.
sonic(config)# policy-map pmap1
sonic(config-pmap-pmap1)# port-shape 250000000 128000
sonic(config-pmap-pmap1)# interface ethernet 0/76
sonic(config-if-0/76)# service-policy pmap1

[Command]

queue-scheduler priority queue queue-id

[Purpose]

Add strict queue scheduling policies.

[Parameters]

ParameterDescription
queue-idQueue ID, the range is [0,7]

[View]

Traffic Policy Configuration View

[Notes]

Run command no queue-scheduler priority queue queue-id to delete strict queue scheduling policies.

[Use Cases]

sonic(config-pmap-test1)# queue-scheduler priority queue 2
sonic(config-pmap-test1)# queue-scheduler priority queue 3

queue-scheduler queue-limit percent queue-wight queue queue-id

Section titled “queue-scheduler queue-limit percent queue-wight queue queue-id”

[Command]

queue-scheduler queue-limit percent queue-wight queue queue-id

[Purpose]

Add DWRR queue scheduling policies.

[Parameters]

ParameterDescription
queue-wightQueue weight, the range is [1,100]
queue-idQueue ID, the range is [0,7]

[View]

Traffic Policy Configuration View

[Notes]

Run command no queue-scheduler queue-limit percent queue-wight queue queue-id to delete DWRR queue scheduling policies.

[Use Cases]

sonic(config-pmap-test1)# queue-scheduler priority queue 2
sonic(config-pmap-test1)# queue-scheduler priority queue 3
sonic(config-pmap-test1)# queue-scheduler queue-limit percent 20 queue 4
sonic(config-pmap-test1)# queue-scheduler queue-limit percent 20 queue 5

[Command]

class {class_map_name|class-default}

[Purpose]

Specify the COS value of the policy, and enter Policy Map-Class Map Configuration View.

[Parameters]

ParameterDescription
class_map_nameClass map name.

[View]

Traffic Policy Configuration View

[Notes]

When configuring queue limit/WRED/Queue Buffer/PG Buffer policy, you need to specify the matching COS value first. COS 07 corresponds to queues 07 one-to-one. Modifying the map of COS to queues is not supported yet.; class-default is the default class map of the system, which will match any other unclassified packets. Run command no class {class_map_name|class-default} to unbind the class map from the policy.

[Use Cases]

sonic(config)# policy-map roce_lossless
sonic(config-pmap-roce_lossless)# class roce_lossless_class_map
sonic(config-pmap-c)#

[Command]

queue-shape target-bit-rate burst-size

[Purpose]

Add a speed limit policy for queues.

[Parameters]

ParameterDescription
target-bit-rateSpecify the target rate in Bps, and the range is from 64000 to line rate.
burst-sizeSpecify the burst size in bytes, and the range is from 1000 to 3145728.

[View]

Policy Map-Class Map Configuration View

[Notes]

Before running this command, please bind an existing class map to specify the queue to be matched for the policy. Run command no queue-shape to delete the speed limit policy.

[Use Cases]

sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# queue-shape 1200000 128000

wred {wred_profile_name|default_drop|default_ecn}

Section titled “wred {wred_profile_name|default_drop|default_ecn}”

[Command]

wred {wred_profile_name|default_drop|default_ecn}

[Purpose]

Bind WRED profile to the class map.

[Parameters]

ParameterDescription
wred_profile_nameProfile name.

[View]

Policy Map-Class Map Configuration View

[Notes]

Before running this command, please bind an existing class map to specify the queue to be matched for the policy. Two default WRED templates, default_drop and default_ecn, are built in ‘-N’ model switches, which users can bind directly, and not in ‘-N-V2’. Run command no wred wred_profile_name to unbind the WRED profile.

[Use Cases]

sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# wred wred_profile

[Command]

priority-group-buffer buffer_profile_name

[Purpose]

Bind a custom PG buffer profile (Ingress).

[Parameters]

ParameterDescription
buffer_profile_nameProfile name.

[View]

Policy Map-Class Map Configuration View

[Notes]

Use this command to bind a PG buffer profile when configuring a custom PFC. Before running this command, please bind an existing class map to specify the queue to be matched for the policy. Run command no priority-group-buffer buffer_profile_name to unbind the PG buffer profile.

[Use Cases]

sonic(config)# buffer-profile pg_lossless_100000_100m_profile
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class cmap_4
sonic(config-pmap-c)# priority-group-buffer pg_lossless_100000_100m_profile

[Command]

queue-buffer buffer_profile_name

[Purpose]

Bind a custom Queue Buffer Profile (Egress).

[Parameters]

ParameterDescription
buffer_profile_nameProfile name.

[View]

Policy Map-Class Map Configuration View

[Notes]

Before running this command, please bind an existing class map to specify the queue to be matched for the policy. It is generally not recommended to modify the interface egress queue buffer manually, so please be careful. Setting unreasonable parameters may cause loss of packets while forwarding traffic on the interface. Run command no queue-buffer buffer_profile_name to unbind the queue buffer profile.

[Use Cases]

sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# queue-buffer buffer_profile

[Command]

bandwidth rate-Bps [burst-size]

[Purpose]

Set minimum guaranteed bandwidth.

[Parameters]

ParameterDescription
rate-BpsBandwidth value, unit bytes/s, minimum value 64000
burst-sizeBurst value, unit byte, range [64000,3145728]

[View]

Policy Map-Class Map Configuration View

[Notes]

Before running this command, please bind an existing class map to specify the queue to be matched for the policy. Run command no bandwidth to delete Bandwidth Configuration.

[Use Cases]

sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# bandwidth 64000

[Command]

service-policy policy_map_name

[Purpose]

Apply the policy to the interface.

[Parameters]

ParameterDescription
policy_map_namePolicy map name.
[View]

Physical Interface Configuration View

[Notes]

When the policy has been applied to an interface, please unbind the interface from the policy before modifying the policy configuration. Run command no service-policy policy_map_name to unbind the policy.

[Use Cases]

sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# service-policy test1

Table 9 Buffer View

CommandPurpose
show buffer profileDisplay buffer profile configuration.

[Command]

show buffer profile

[Purpose]

Display buffer profile configuration.

[View]

Privileged User View

[Use Cases]

sonic# show buffer profile
{
"egress_lossless_profile":{
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"static_th":"23001600"
},
"egress_lossy_profile":{
"dynamic_th":"2",
"pool":"[BUFFER_POOL|lossy_pool]",
"size":"1518"
},
"ingress_lossless_profile":{
"dynamic_th":"1",
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"1518",
"xoff":"38816",
"xon_offset":"13440"
},
"ingress_lossy_profile":{
"pool":"[BUFFER_POOL|lossy_pool]",
"size":"0",
"static_th":"23001600"
},
"pg_lossless_100000_40m_profile":{
"dynamic_th":"1",
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"1518",
"xoff":"38816",
"xon":"0",
"xon_offset":"13440"
},
"pg_lossless_25000_40m_profile":{
"dynamic_th":"1",
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"1518",
"xoff":"16928",
"xon":"0",
"xon_offset":"13440"
}
}

Table 10 Buffer Config

CommandPurpose
buffer-profile buffer_profile_nameCreate a buffer profile, and enter Buffer Configuration View.
mode lossless {static static_th|dynamic dynamic_th} size size xoff xoff xon-offset xon-offset [xon xon]Set a lossless buffer profile.
mode lossy {static static_th|dynamic dynamic_th} size sizeSet a lossy buffer profile.

[Command]

buffer-profile buffer_profile_name

[Purpose]

Create a buffer profile, and enter Buffer Configuration View.

[Parameters]

ParameterDescription
buffer_profile_nameProfile name.

[View]

Global Configuration View

[Notes]

Run command no buffer-profile buffer_profile_name to delete the buffer profile.

[Use Cases]

sonic(config)# buffer-profile test
sonic(config-buffer-profile-test)#

mode lossless {static static_th|dynamic dynamic_th} size size xoff xoff xon-offset xon-offset [xon xon]

Section titled “mode lossless {static static_th|dynamic dynamic_th} size size xoff xoff xon-offset xon-offset [xon xon]”

[Command]

mode lossless {static static_th|dynamic dynamic_th} size size xoff xoff xon-offset xon-offset [xon xon]

[Purpose]

Set a lossless buffer profile.

[Parameters]

ParameterDescription
static_thSet the static threshold value in bytes. The range is from 0 to 47218432.
dynamic_thSet the dynamic threshold value in integer. The range is from -4 to 3. Dynamic threshold = 2dynamic_th * remaining available buffer. For example, if dynamic_th is set to 1, then dynamic threshold is two times the remaining available buffer, that is, the actual threshold is two-thirds of the total available buffer. Recommended value is -3 for CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, and -1 for other models.
sizeSet the guaranteed buffer in bytes. The recommended value is 1518.
xoffSet PFC pause frame trigger cache threshold value in bytes, which is recommended to be an integer multiple of the cell size. Xoff value must be greater than xon value. This parameter is not supported on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2.
xon-offsetSet PFC pause frame stop buffer threshold value in bytes, it is recommended to be an integer multiple of cell size. The recommended value is 13440. This parameter is not supported on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2.
xon(Optional) It should be an integer multiple of cell size and the unit is byte. It is recommended to configure 0, since the actual xon takes the larger value of xon and xon-offset, so it is generally not necessary to set the value of xon. This parameter is not supported on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2.

[View]

Buffer Configuration View

[Notes]

The cell size varies by model. On CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, the cell size is 128 Bytes. On other models, the cell size is 224 bytes. The sum of the lossless buffers allocated to each queue shall be no greater than the lossless pool size. It is generally not recommended to modify the interface egress queue buffer manually, so please be careful. Setting unreasonable parameters may cause loss of packets while forwarding traffic on the interface.

[Use Cases]

sonic(config)# buffer-profile buffer_test1
sonic(config-buffer-profile-buffer_test1)# mode lossless dynamic -1 size 1518 xoff 46496 xon-offset 13440

mode lossy{static static_th|dynamic dynamic_th} size size

Section titled “mode lossy{static static_th|dynamic dynamic_th} size size”

[Command]

mode lossy {static static_th|dynamic dynamic_th} size size

[Purpose]

Set a lossy buffer profile.

[Parameters]

ParameterDescription
static_thSet the static threshold value in bytes. This parameter is meaningless on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, and should be configured as 0. On other models of switches, it should be no larger than the lossy pool size.
dynamic_thSet the dynamic threshold value in integer. Dynamic threshold = (dynamic_th + 6) * remaining available buffer on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2. On other models of switches, dynamic threshold = 2dynamic_th * remaining available buffer.
sizeSet the guaranteed buffer in bytes. On CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, it is recommended to be an integer multiple of the cell size. On other switch models, the recommended value is 1518.

[View]

Buffer Configuration View

[Notes]

The sum of the lossy buffers allocated to each queue shall be no greater than the lossy pool size. It is generally not recommended to modify the interface egress queue buffer manually, so please be careful. Setting unreasonable parameters may cause loss of packets while forwarding traffic on the interface.

[Use Cases]

sonic(config)# buffer-profile buffer_test
sonic(config-buffer-profile-buffer_test)# mode lossy size 1518 dynamic 1

Table 11 Queue View

CommandPurpose
show counters queue [interface_name]Display queue counters.
clear counters queueClear queue counters.

[Command]

show counters queue [interface_name]

[Purpose]

Display queue counters.

[Parameters]

ParameterDescription
interface_nameInterface name (eg.0/1)

[View]

Privileged User View

[Use Cases]

sonic# show counters queue 0/0
The poll time of QUEUES COUNTERS is 2000.0 ms, update time of queue rates is 4000.0 ms
Port TxQ Counter/pkts Counter/bytes Drop/pkts Drop/bytes CounterRate/pkts CounterRate/bytes DropRate/pkts DropRate/bytes Occupancy/bytes SharedOccupancy/bytes
--------- ----- -------------- --------------- ----------- ------------ ------------------ ------------------- --------------- ---------------- ----------------- -----------------------
0/0 UC0 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC1 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC2 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC3 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC4 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC5 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC6 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0
0/0 UC7 0 0 0 0 0.00/s 0.00 B/s 0.00/s 0.00 B/s 0 0

[Command]

clear counters queue

[Purpose]

Clear queue counters.

[View]

Privileged User View

[Use Cases]

sonic# clear counters queue

Table 12 WRED View

CommandPurpose
show wred [wred_profile_name]Display WRED profile.

[Command]

show wred [wred_profile_name]

[Purpose]

Display WRED Profile.

[Parameters]

ParameterDescription
wred_profile_nameProfile name.

[View]

Privileged User View

[Notes]

The default_drop is the system-predefined WRED profile.

[Use Cases]

sonic# show wred
Wred profile default_drop:
ecn: ecn_none
green_drop_probability: 100
green_max_threshold: 1792000
green_min_threshold: 15360
red_drop_probability: 100
red_max_threshold: 8960000
red_min_threshold: 15360
wred_green_enable: true
wred_red_enable: true
wred_yellow_enable: true
yellow_drop_probability: 100
yellow_max_threshold: 7168000
yellow_min_threshold: 15360
Wred profile default_ecn:
ecn: ecn_all
green_drop_probability: 100
green_max_threshold: 1792000
green_min_threshold: 15360
red_drop_probability: 100
red_max_threshold: 8960000
red_min_threshold: 15360
wred_green_enable: true
wred_red_enable: true
wred_yellow_enable: true
yellow_drop_probability: 100
yellow_max_threshold: 7168000
yellow_min_threshold: 15360

Table 13 WRED Config

CommandPurpose
wred wred_profile_nameCreate a WRED profile and enter WRED Configuration View.
mode drop gmin min_th gmax max_th gprobability probability [ymin min_th ymax max_th yprobability probability|rmin min_th rmax max_th rprobability probability]Set WRED parameters for green/yellow/red messages.
wred {wred_profile_name|default_drop}Apply the WRED profile to interfaces.

[Command]

wred wred_profile_name

[Purpose]

Create a WRED profile and enter WRED Configuration View.

[Parameters]

ParameterDescription
wred_profile_nameProfile name.

[View]

Global Configuration View

[Notes]

Run command no wred wred_profile_name to delete the WRED profile.

[Use Cases]

sonic(config)# wred test
sonic(config-wred-test)#

mode drop gmin min_th gmax max_th gprobability probability [ymin min_th ymax max_th yprobability probability|rmin min_th rmax max_th rprobability probability]

Section titled “mode drop gmin min_th gmax max_th gprobability probability [ymin min_th ymax max_th yprobability probability|rmin min_th rmax max_th rprobability probability]”

[Command]

mode drop gmin min_th gmax max_th gprobability probability [ymin min_th ymax max_th yprobability probability|rmin min_th rmax max_th rprobability probability]

[Purpose]

Set WRED parameters for green/yellow/red messages.

[Parameters]

ParameterDescription
min_thSet the low limit absolute value of WRED discard in bytes. When the message length in the queue reaches this value, the interface starts to discard. The configurable minimum value is 15 KB.
max_thSet the high limit absolute value of WRED discard in bytes. When the message length in the queue reaches this value, the interface starts to discard all newly received packets. For CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, the range is min_th ~ 25165824, for CX864E-N, the range is min_th – 16777216, and for other models, the range is min_th ~ 10240000.
probabilitySet the maximum discard probability in integer form. The range is [1,100]. It is recommended to set the drop probability to 90 percent for latency-sensitive services and 10 percent for throughput-sensitive services.

[View]

WRED Configuration View

[Use Cases]

sonic(config-wred-test)# mode drop gmin 15360 gmax 150000 gprobability 10

[Command]

wred {wred_profile_name|default_drop}

[Purpose]

Apply the WRED profile to interfaces.

[Parameters]

ParameterDescription
wred_profile_nameProfile name.

[View]

Policy Map-Class Map Configuration View

[Notes]

Before running this command, please bind an existing class map to specify the queue to be matched for the policy. The default_drop is the system-predefined WRED profile. Run command no wred wred_profile_name unbind the WRED profile.

[Use Cases]

sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# wred wred_profile