Policy-Based QOS Configuration

From ImageStream Router Documentation

Revision as of 21:57, 13 November 2009 by Syoder (Talk | contribs)
Jump to: navigation, search
The 4.4.0 distribution utilizes an improved policy-based configuration for quality of service. The default rc.qos script has examples that use a new QoS library of functions, greatly simplifying QoS configuration.
Services define a type of traffic or service. Policies prioritize services, define how the traffic is queued and set minimum and maximum rates as a percentage of the maximum rate. Interface definitions apply a policy to an interface and define the maximum input and output rates as well as the maximum allowed latency for queued traffic. Because policy rates are specified using percentages a policy can be applied to multiple interfaces which may have differing input and output rates.

Contents

QOS_SERVICE

The QOS_SERVICE command defines parameters that match a type of service such as Web traffic or SMTP traffic. ImageStream pre-defines many services that can be added to or modified.
Currently only tc filter matches are supported. See the Linux Advanced Routing and Traffic Control guide for more information on tc filter matching.
Usage: QOS_SERVICE --name <service_name> [--init] --tc_match <tc_filter_command_match>
Example:
Create a new service called ims1 that matches traffic to and from 205.159.243.5
QOS_SERVICE --name ims1 --init --tc_match protocol ip u32 match ip src 205.159.243.5
QOS_SERVICE --name ims1 --tc_match protocol ip u32 match ip dst 205.159.243.5
It is also possible to add on to a pre-defined service. Simply omit the '--init' option to add another match to a service.
Example:
In addition to the IP ToS bit matches also match on the SIP server's IP at 205.159.243.5.
QOS_SERVICE --name voip --tc-match protocol ip u32 match ip src 205.159.243.5
QOS_SERVICE --name voip --tc-match protocol ip u32 match ip dst 205.159.243.5

QOS_POLICY

The QOS_POLICY command prioritizes and rate-limits services. Low latency queueing and class-based queueing are supported.
Low latency queueing provides a strict priority-based first-in-first-out (FIFO) queue which does not rate shape the traffic. This queueing method is preferred for real-time traffic such as VoIP and routing protocols.
Priorities range from 0 to 9. Lower values indicate higher priority.
Minimum and maximum values are expressed as percentages ranging from 1 to 100. The actual rate will be calculated using this percentage and the interface's real bandwidth.
Class-based queueing provides prioritization but also performs rate shaping. This queueing method is preferred for non-realtime traffic such as Web and E-mail.
LLQ Usage: QOS_POLICY --name <policy_name> --type llq --service <service_name> --prio <priority 0-9> --max <max_percent>
Example:
QOS_POLICY --name default --type llq --service voip --prio 0 --max 90
CBQ Usage: QOS_POLICY --name <policy_name> --type cbq [--default | --service <service_name>] --prio <priority 0-9> --min <min_percent> --max <max_percent>
Example:
Set the default traffic class to priority 5 and prioritize TCP ACKs higher than other traffic.
QOS_POLICY --name default --type cbq --default --prio 5 --min 10 --max 75
QOS_POLICY --name default --type cbq --service ack --prio 3 --min 10 --max 40

QOS_INTERFACE

The QOS_INTERFACE command applies a policy to an interface. The maximum input and output rates are specified in Kbps (Kilobits per second). Latency is specified in milliseconds.
Fair queueing can also specified on the interface. ImageStream's PUFQ, standard fair-queueing and simple first-in-first-out (FIFO) queueing are options.
FIFO Usage: QOS_INTERFACE --name <interface_name> --policy <policy_name> --max_in <input_rate_in_Kbps> --max-out <output_rate_in_Kbps> --max-latency <max_latency_in_ms>
Example:
Assign the default policy to Ethernet0 which has a 3.0 Mbps input and 640 Kbps output rate. We want 150 ms max latency.
QOS_INTERFACE --name eth0 --policy default --max_in 3000 --max_out 640 --max_latency 150
Fair-Queueing Usage: QOS_INTERFACE --name <interface_name> --policy <policy_name> --max_in <input_rate_in_Kbps> --max-out <output_rate_in_Kbps> --max-latency <max_latency_in_ms> --fair_queue sfq advanced options
Example:
Assign the default policy to Ethernet0 which has a 3.0 Mbps input and 640 Kbps output rate. We want 150 ms max latency.
QOS_INTERFACE --name eth0 --policy default --max_in 3000 --max_out 640 --max_latency 150
PUFQ Options
--pufq
Enables ImageStream Per User Fair Queueing (PUFQ)
--pufq_iface_type <interface_type>
Valid interface types:
inside Interface facing users.
outside Interface facing away from users (Internet).
nat_inside Interface facing users also performing Network Address Translation (NAT)
nat_outside Interface facing away from users (Internet) also performing NAT.
The interface type allows PUFQ to determine which hash value to use when classifying traffic into user flows. Inside interfaces use the destination IP address for outgoing traffic and the source IP address for incoming traffic. Outside interfaces use the source IP address for outgoing traffic and the destination IP address for incoming traffic. Nat_outside interfaces use the original (pre NAT) source ip address for outgoing traffic and the destination IP address for incoming traffic.
Personal tools
Router software releases