Ensure traffic priority with DSCP marking

Mark egress traffic with differentiated services code point (DSCP) values to implement QoS policies.

Before you begin

  • Your administrator has enabled the Networking service with the qos service plugin. (The plugin is loaded by default.)
  • The administrator has created a project for you and has provided you with a clouds.yaml file for you to access the cloud.
  • The python-openstackclient package is on your workstation.
    $ dnf list installed python-openstackclient

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. Confirm that the qos service plugin is loaded in the Networking service:
    $ openstack network qos policy list

    If the qos service plugin is not loaded, then you receive a ResourceNotFound error, and you must configure the Networking service before you can continue. For more information, see your RHOSO administrator.

  3. Identify the ID of the project you want to create the QoS policy for:
    $ openstack project list
    Sample output
    +----------------------------------+----------+
    | ID                               | Name     |
    +----------------------------------+----------+
    | 4b0b98f8c6c040f38ba4f7146e8680f5 | auditors |
    | 519e6344f82e4c079c8e2eabb690023b | services |
    | 80bf5732752a41128e612fe615c886c6 | demo     |
    | 98a2f53c20ce4d50a40dac4a38016c69 | admin    |
    +----------------------------------+----------+
  4. Using the project ID from the previous step, create a QoS policy for the project.
    Example

    In this example, a QoS policy named qos-web-servers is created for the admin project:

    openstack network qos policy create --project 98a2f53c20ce4d50a40dac4a38016c69 qos-web-servers
  5. Create a DSCP rule and apply it to a policy.
    Example

    In this example, a DSCP rule is created using DSCP mark 18 and is applied to the qos-web-servers policy:

    openstack network qos rule create --type dscp-marking --dscp-mark 18 qos-web-servers
    Sample output
    Created a new dscp_marking_rule:
    +-----------+--------------------------------------+
    | Field     | Value                                |
    +-----------+--------------------------------------+
    | dscp_mark | 18                                   |
    | id        | d7f976ec-7fab-4e60-af70-f59bf88198e6 |
    +-----------+--------------------------------------+
  6. You can change the DSCP value assigned to a rule.
    Example

    In this example, the DSCP mark value is changed to 22 for the rule, d7f976ec-7fab-4e60-af70-f59bf88198e6, in the qos-web-servers policy:

    $ openstack network qos rule set --dscp-mark 22 qos-web-servers d7f976ec-7fab-4e60-af70-f59bf88198e6
  7. You can delete a DSCP rule.
    Example

    In this example, the DSCP rule, d7f976ec-7fab-4e60-af70-f59bf88198e6, in the qos-web-servers policy is deleted:

    $ openstack network qos rule delete qos-web-servers d7f976ec-7fab-4e60-af70-f59bf88198e6

Results

  • Confirm that the DSCP rule is applied to the QoS policy.
    Example

    In this example, the DSCP rule, d7f976ec-7fab-4e60-af70-f59bf88198e6 is applied to the QoS policy, qos-web-servers:

    $ openstack network qos rule list qos-web-servers
    Sample output
    +-----------+--------------------------------------+
    | dscp_mark | id                                   |
    +-----------+--------------------------------------+
    |        18 | d7f976ec-7fab-4e60-af70-f59bf88198e6 |
    +-----------+--------------------------------------+