All user interactions with the QoS module are performed with the cpqos
command.
Included Topics |
cpqos - Manage the network quality of service.
cpqos install - Install the QoS policy. cpqos uninstall - Uninstall the QoS policy. cpqos status - Check if policy is installed. cpqos class show [-b] - Show the QoS policy. [-b] display dscp in binary numbers. cpqos class add <name> prio <val> type <llq|reg> [weight <val>] dscp <val[,val2[,val3...]]> - Add new class with specified name prio - priority (1-15) type - low-latency or regular DSCP - values "default" or 0-63 (decimal or 8 bits binary) weight - (1-1000) for classes of type "reg" cpqos class del <name> - Delete specified class name. cpqos stats [-u] - Show statistics. [-u] will show statistics per CPU. |
For cpqos:
cpqos commands
This command adds a class with the following arguments:
Argument |
Value |
---|---|
name |
Unique name for the class |
priority |
Value between 1 and 15. A low value indicates a higher priority |
type |
"llq" for low-latency classes or "reg" for regular, weighted classes |
weight |
This value is used only for classes of type "reg". It determines the relative portion of the resources that the class will receive in relation to other weighted classes. Valid values are between 0 and 1000. |
dscp |
The DiffServ code-points assigned to the class. Multiple DSCP's can be specified, separated by commas, with no spaces between values. Values are in decimal (not binary format) with values from 0 to 63 or "default". There can be only one class with a "default" DSCP. The default class is used for traffic without DiffServ marking (e.g. tos=0) or traffic with DSCP values that are not assigned to any other class. If no class is used as "default", all 64 DSCP values must be assigned to the classes. A DSCP value cannot be assigned to more than one class. |
Note - Changes to the policy with cpqos class add are enforced only after the policy is installed. |
This command deletes the class of the specified name. Changes to the policy with cpqos class del
are enforced only after the policy is installed.
This command shows the classes defined in the QoS policy.
This command installs the previously created QoS policy. It also validates the overall integrity of the policy. Once installed, the policy remains installed even if the machine reboots.
This command un-installs the previously installed QoS policy. If un-installed, the policy will not be installed again when the machine boots.
This command shows QoS statistics. cpqos stats
prints a line of statistics for each of the defined classes. Each line includes the following data columns:
Column |
Value |
---|---|
rx |
Number of bytes that arrived to this class since the last time statistics were presented |
tx |
Number of bytes that were transmitted from this class since the last time statistics were presented |
drops |
Number of bytes that were dropped from this class since the last time statistics were presented |
Note:
watch
command to periodically present the statistics.The QoS policy file is qos_policy.C
, located in the $FWDIR/database
directory. The QoS policy file is created when the cpqos
command is run for the first time. The QoS policy file should not be edited manually. Use cpqos class add/del
to create entries. To maintain multiple QoS policies, rename qos_policy.C
or copy it to another directory, and copy it back to $FWDIR/database/qos_policy.C
when the policy needs to be enforced.
Default QoS configuration is set to "uninstall" (for example, not enforced).
Run the cpqos install
or cpqos uninstall
command to set the desired default configuration after boot.
This section presents a sample differentiated services implementation. It includes examples for configuration, monitoring and statistics.
Traffic Type |
Meaning... |
---|---|
Diamond |
Real-time traffic (e.g. VOIP) which requires little bandwidth and is sensitive to latency and drops. This traffic is usually assigned to the EF (Expedited-Forwarding) PHB (Per Hop Behavior). |
Platinum |
Real-time traffic with low bandwidth requirements that is less sensitive to latency and drops than Diamond. |
Gold |
Traffic which is sensitive to drops |
Silver |
Traffic which is less sensitive to drops than Gold. |
Bronze |
Various types of traffic which require resource allocation. This traffic is usually assigned to the Best-Effort PHB. |
Copper |
High-volume traffic with a tendency to consume bandwidth |
Your QoS policy should apply these guidelines:
This examples of the cpqos class add
command creates classes for traffic of various types:
|
Monitoring example shows previously defined classes:
|
Statistics example shows statistics for the previously defined classes:
|
From this statistical output, it is apparent that: