<chapter id="ipqos-config-planning-1"><title>Planning for an IPQoS-Enabled Network (Tasks)</title><highlights><para>You can configure IPQoS on any system that runs the Solaris OS. The
IPQoS system then works with Diffserv-aware routers to provide differentiated
services and traffic management on an intranet. </para><para>This chapter contains planning tasks for adding IPQoS-enabled systems
onto a Diffserv-aware network. The following topics are covered.</para><itemizedlist><listitem><para><olink targetptr="ipqos-config-planning-2" remap="internal">General IPQoS Configuration
Planning (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="ipqos-config-planning-5" remap="internal">Planning the Diffserv
Network Topology</olink></para>
</listitem><listitem><para><olink targetptr="ipqos-config-planning-7" remap="internal">Planning the Quality-of-Service
Policy</olink></para>
</listitem><listitem><para><olink targetptr="euiht" remap="internal">QoS Policy Planning (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="ipqos-config-planning-13" remap="internal">Introducing the
IPQoS Configuration Example</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="ipqos-config-planning-2"><title>General IPQoS Configuration Planning
(Task Map)</title><para>Implementing differentiated services, including IPQoS, on a network
requires extensive planning. You must consider not only the position and function
of each IPQoS-enabled system, but also each system's relationship to the router
on the local network. The following task map lists the major planning tasks
for implementing IPQoS on your network.</para><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>1. Plan a Diffserv network topology that incorporates IPQoS-enabled
systems.</para>
</entry><entry><para>Learn about the various Diffserv network topologies to determine the
best solution for your site.</para>
</entry><entry><para><olink targetptr="ipqos-config-planning-5" remap="internal">Planning the Diffserv Network
Topology</olink>.</para>
</entry>
</row><row><entry><para>2. Plan the different types of services to be offered by the IPQoS systems.</para>
</entry><entry><para>Organize the types of services that the network provides into service-level
agreements (SLAs).</para>
</entry><entry><para><olink targetptr="ipqos-config-planning-7" remap="internal">Planning the Quality-of-Service
Policy</olink>.</para>
</entry>
</row><row><entry><para>3. Plan the QoS policy for each IPQoS system.</para>
</entry><entry><para>Decide on the classes, metering, and accounting features that are needed
to implement each SLA.</para>
</entry><entry><para><olink targetptr="ipqos-config-planning-7" remap="internal">Planning the Quality-of-Service
Policy</olink>.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>4. If applicable, plan the policy for the Diffserv router.</para>
</entry><entry colsep="1" rowsep="1"><para>Decide any scheduling and queuing policies for the Diffserv router that
is used with the IPQoS systems.</para>
</entry><entry colsep="1" rowsep="1"><para>Refer to router documentation for queuing and scheduling policies.</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ipqos-config-planning-5"><title>Planning the Diffserv Network Topology</title><para>To provide differentiated services for your network, you need
at least one IPQoS-enabled system and a Diffserv-aware router. You can expand
this basic scenario in a variety of ways, as explained in this section.</para><sect2 id="ipqos-config-planning-3"><title>Hardware Strategies for the Diffserv
Network</title><para>Typically, customers run IPQoS on servers and server consolidations,
such as the Sun Enterprise&trade; 0000 server. Conversely, you can also run
IPQoS on desktop systems such as UltraSPARC&reg; systems, depending
on the needs of your network. The following list describes possible systems
for an IPQoS configuration:</para><itemizedlist><listitem><para>Solaris systems that offer various services, such as web servers
and database servers</para>
</listitem><listitem><para>Application servers that offer email, FTP, or other popular
network applications</para>
</listitem><listitem><para>Web cache servers or proxy servers</para>
</listitem><listitem><para>Network of IPQoS-enabled server farms that are managed by
Diffserv-aware load balancers</para>
</listitem><listitem><para>Firewalls that manage traffic for a single heterogeneous network</para>
</listitem><listitem><para>IPQoS systems that are part of a virtual local area network
(LAN)</para>
</listitem>
</itemizedlist><para>You might introduce IPQoS systems into a network topology with already
functioning Diffserv-aware routers. If your router does not currently offer
Diffserv, consider the Diffserv solutions that are offered by Cisco Systems,
Juniper Networks, and other router manufacturers. If the local router does
not implement Diffserv, then the router passes marked packets on to the next
hop without evaluating the marks.</para>
</sect2><sect2 id="ipqos-config-planning-4"><title>IPQoS Network Topologies</title><para>This section illustrates IPQoS strategies for various network
needs.</para><sect3 id="ipqos-config-planning-9"><title>IPQoS on Individual Hosts</title><para>The following figure shows a single network of IPQoS-enabled systems. </para><figure id="ipqos-config-planning-fig-41"><title>IPQoS Systems on a Network
Segment</title><mediaobject><imageobject><imagedata entityref="ipqos-hosts-topology"/>
</imageobject><textobject><simpara>Topology diagram shows a local network with a Diffserv
router, and three IPQoS-enabled systems: FTP server, database server, and
a web server.</simpara>
</textobject>
</mediaobject>
</figure><para>This network is but one segment of a corporate intranet. By enabling
IPQoS on the application servers and web servers, you can control the rate
at which each IPQoS system releases outgoing traffic. If you make the router
Diffserv aware, you can further control incoming and outgoing traffic.</para><para>The examples in this guide use the &ldquo;IPQoS on an individual host&rdquo;
scenario. For the example topology that is used throughout the guide, see <olink targetptr="ipqos-config-planning-fig-44" remap="internal">Figure 33&ndash;4</olink>.</para>
</sect3><sect3 id="ipqos-config-planning-10"><title>IPQoS on a Network of Server Farms</title><para>The following figure shows a network with several heterogeneous
server farms.</para><figure id="ipqos-config-planning-fig-42"><title>Network of IPQoS-Enabled
Server Farms</title><mediaobject><imageobject><imagedata entityref="ipqos-sever-farm-topology"/>
</imageobject><textobject><simpara>Topology diagram shows a network with a Diffserv router,
an IPQoS-enabled load balancer, and three server farms.</simpara>
</textobject>
</mediaobject>
</figure><para>In such a topology, the router is Diffserv aware, and therefore able
to queue and rate both incoming and outgoing traffic. The load balancer is
also Diffserv-aware, and the server farms are IPQoS enabled. The load balancer
can provide additional filtering beyond the router by using selectors such
as user ID and project ID. These selectors are included in the application
data.</para><para>This scenario provides flow control and traffic forwarding to manage
congestion on the local network. This scenario also prevents outgoing traffic
from the server farms from overloading other portions of the intranet.</para>
</sect3><sect3 id="ipqos-config-planning-11"><title>IPQoS on a Firewall</title><para>The following figure shows a segment of a corporate network that
is secured from other segments by a firewall.</para><figure id="ipqos-config-planning-fig-43"><title>Network Protected by an IPQoS-Enabled
Firewall</title><mediaobject><imageobject><imagedata entityref="ipqos-firewall-topology"/>
</imageobject><textobject><simpara>Topology diagram shows a network consisting of a Diffserv
router, an IPQoS-enabled firewall, a Solaris system, and other hosts.</simpara>
</textobject>
</mediaobject>
</figure><para>In this scenario, traffic flows into a Diffserv-aware router where the
packets are filtered and queued. All incoming traffic that is forwarded by
the router then travels into the IPQoS-enabled firewall. To use IPQoS, the
firewall must not bypass the IP forwarding stack.</para><para>The firewall's security policy determines whether incoming traffic is
permitted to enter or depart the internal network. The QoS policy controls
the service levels for incoming traffic that has passed the firewall. Depending
on the QoS policy, outgoing traffic can also be marked with a forwarding behavior. </para>
</sect3>
</sect2>
</sect1><sect1 id="ipqos-config-planning-7"><title>Planning the Quality-of-Service
Policy</title><para>When you plan the quality-of-service (QoS) policy, you must review,
classify, and then prioritize the services that your network provides. You
must also assess the amount of available bandwidth to determine the rate at
which each traffic class is released onto the network. </para><sect2 id="ipqos-config-planning-19"><title>QoS Policy Planning Aids</title><para>Gather information for planning the QoS policy in a format that
includes the information needed for the IPQoS configuration file. For example,
you can use the following template to list the major categories of information
to be used in the IPQoS configuration file.</para><table frame="topbot" pgwide="100" id="ipqos-config-planning-tbl-28"><title>QoS
Planning Template</title><tgroup cols="7" colsep="0" rowsep="0"><colspec colname="colspec2" colwidth="14.71*"/><colspec colname="colspec1" colwidth="14.71*"/><colspec colname="colspec3" colwidth="22.01*"/><colspec colname="colspec0" colwidth="14.47*"/><colspec colname="colspec4" colwidth="20.55*"/><colspec colname="colspec5" colwidth="26.00*"/><colspec colname="colspec6" colwidth="16.77*"/><thead><row rowsep="1"><entry><para>Class</para>
</entry><entry><para>Priority</para>
</entry><entry><para>Filter</para>
</entry><entry><para>Selector</para>
</entry><entry><para>Rate</para>
</entry><entry><para>Forwarding?</para>
</entry><entry><para>Accounting?</para>
</entry>
</row>
</thead><tbody><row><entry><para>Class 1</para>
</entry><entry><para>1</para>
</entry><entry><para>Filter 1</para><para>Filter 3</para>
</entry><entry><para>Selector 1</para><para>Selector 2</para>
</entry><entry><para>Meter rates, depending on meter type</para>
</entry><entry><para>Marker drop precedence</para>
</entry><entry><para>Requires flow-accounting statistics</para>
</entry>
</row><row><entry><para>Class 1</para>
</entry><entry><para>1</para>
</entry><entry><para>Filter 2</para>
</entry><entry><para>Selector 1</para><para>Selector 2</para><para></para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry>
</row><row><entry><para>Class 2</para>
</entry><entry><para>2</para>
</entry><entry><para>Filter 1</para>
</entry><entry><para>Selector 1</para><para>Selector 2</para>
</entry><entry><para>Meter rates, depending on meter type</para>
</entry><entry><para>Marker drop precedence</para>
</entry><entry><para>Requires flow-accounting statistics</para>
</entry>
</row><row><entry><para>Class 2</para>
</entry><entry><para>2</para>
</entry><entry><para>Filter 2</para>
</entry><entry><para>Selector 1</para><para>Selector 2</para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>You can divide each major category to further define the QoS policy.
Subsequent sections explain how to obtain information for the categories that
are shown in the template.</para>
</sect2><sect2 id="euiht"><title>QoS Policy Planning (Task Map)</title><para>This task map lists the major tasks for planning a QoS policy.</para><informaltable frame="all" pgwide="100"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry colsep="1" rowsep="1"><para>Task</para>
</entry><entry colsep="1" rowsep="1"><para>Description</para>
</entry><entry colsep="1" rowsep="1"><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para>1. Design your network topology to support IPQoS.</para>
</entry><entry colsep="1" rowsep="1"><para>Identify the hosts and routers on your network to provide differentiated
services.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-32" remap="internal">How to Prepare a Network
for IPQoS</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>2. Define the classes into which services on your network must be divided.</para>
</entry><entry colsep="1" rowsep="1"><para>Examine the types of services and SLAs that are offered by your site,
and determine the discrete traffic classes into which these services fall.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes
for Your QoS Policy</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>3. Define filters for the classes.</para>
</entry><entry colsep="1" rowsep="1"><para>Determine the best ways of separating traffic of a particular class
from the network traffic flow.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in
the QoS Policy</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>4. Define flow-control rates for measuring traffic as packets leave
the IPQoS system.</para>
</entry><entry colsep="1" rowsep="1"><para>Determine acceptable flow rates for each class of traffic.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-16" remap="internal">How to Plan Flow Control</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>5. Define DSCPs or user-priority values to be used in the QoS policy.</para>
</entry><entry colsep="1" rowsep="1"><para>Plan a scheme to determine the forwarding behavior that is assigned
to a traffic flow when the flow is handled by the router or switch.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-45" remap="internal">How to Plan Forwarding Behavior</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>6. If applicable, set up a statistics-monitoring plan for traffic flows
on the network.</para>
</entry><entry colsep="1" rowsep="1"><para>Evaluate the traffic classes to determine which traffic flows must be
monitored for accounting or statistical purposes.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipqos-config-planning-18" remap="internal">How to Plan for Flow Accounting</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><note><para>The rest of this section explains how to plan the QoS policy of
an IPQoS-enabled system. To plan the QoS policy for the Diffserv router, refer
to the router documentation and the router manufacturer's web site. </para>
</note>
</sect2><task id="ipqos-config-planning-32"><title>How to Prepare a Network for IPQoS</title><tasksummary><para>The following procedure lists general planning tasks to do before you
create the QoS policy.</para>
</tasksummary><procedure><step id="ipqos-config-planning-step-37"><para>Review your network topology.
Then, plan a strategy that uses IPQoS systems and Diffserv routers.</para><para>For
topology examples, see <olink targetptr="ipqos-config-planning-5" remap="internal">Planning
the Diffserv Network Topology</olink>.</para>
</step><step id="ipqos-config-planning-step-350"><para>Identify the hosts in the
topology that require IPQoS or that might become good candidates for IPQoS
service.</para>
</step><step id="ipqos-config-planning-step-360"><para>Determine which IPQoS-enabled
systems could use the same QoS policy.</para><para>For example, if you plan
to enable IPQoS on all hosts on the network, identify any hosts that could
use the same QoS policy. Each IPQoS-enabled system must have a local QoS policy,
which is implemented in its IPQoS configuration file. However, you can create
one IPQoS configuration file to be used by a range of systems. You can then
copy the configuration file to every system with the same QoS policy requirements.</para>
</step><step id="ipqos-config-planning-step-340"><para>Review and perform any planning
tasks that are required by the Diffserv router on your network.</para><para>Refer
to the router documentation and the router manufacturer's web site for details.</para>
</step>
</procedure>
</task><task id="ipqos-config-planning-14"><title>How to Define the Classes for Your
QoS Policy</title><tasksummary><para>The first step in defining the QoS policy is organizing traffic flows
into classes. You do not need to create classes for every type of traffic
on a Diffserv network. Moreover, depending on your network topology, you might
have to create a different QoS policy for each IPQoS-enabled system.</para><note><para>For an overview of classes, see <olink targetptr="ipqos-intro-26" remap="internal">IPQoS
Classes</olink>.</para>
</note><para>The next procedure assumes that you have determined which systems on
your network are to be IPQoS-enabled, as identified in <olink targetptr="ipqos-config-planning-32" remap="internal">How to Prepare a Network for IPQoS</olink>.</para>
</tasksummary><procedure><step id="ipqos-config-planning-step-39"><para>Create a QoS planning table
for organizing the QoS policy information.</para><para>For suggestions, refer
to <olink targetptr="ipqos-config-planning-tbl-28" remap="internal">Table 33&ndash;1</olink>. </para>
</step><step id="ipqos-config-planning-step-40"><para>Perform the remaining steps
for every QoS policy that is on your network.</para>
</step><step id="ipqos-config-planning-step-38"><para>Define the classes to be used
in the QoS policy.</para><para>The following questions are a guideline for
analyzing network traffic for possible class definitions.</para><itemizedlist><listitem><para><emphasis role="strong">Does your company offer service-level
agreements to customers?</emphasis></para><para>If yes, then evaluate the
relative priority levels of the SLAs that your company offers to customers.
The same applications might be offered to customers who are guaranteed different
priority levels.</para><para>For example, your company might offer web site
hosting to each customer, which indicates that you need to define a class
for each customer web site. One SLA might provide a premium web site as one
service level.  Another SLA might offer a &ldquo;best-effort&rdquo; personal
web site to discount customers. This factor indicates not only different web
site classes but also potentially different per-hop behaviors that are assigned
to the web site classes.</para>
</listitem><listitem><para><emphasis role="strong">Does the IPQoS system offer popular
applications that might need flow control?</emphasis></para><para>You can
improve network performance by enabling IPQoS on servers offering popular
applications that generate excessive traffic. Common examples are electronic
mail, network news, and FTP. Consider creating separate classes for incoming
and outgoing traffic for each service type, where applicable. For example,
you might create a <literal>mail-in</literal> class and a <literal>mail-out</literal> class
for the QoS policy for a mail server.</para>
</listitem><listitem><para><emphasis role="strong">Does your network run certain applications
that require highest-priority forwarding behaviors?</emphasis></para><para>Any critical applications that require highest-priority forwarding
behaviors must receive highest priority in the router's queue. Typical examples
are streaming video and streaming audio. </para><para>Define incoming classes
and outgoing classes for these high-priority applications. Then, add the classes
to the QoS policies of both the IPQoS-enabled system that serves the applications
and the Diffserv router. </para>
</listitem><listitem><para><emphasis role="strong">Does your network experience traffic
flows that must be controlled because the flows consume large amounts of bandwidth?</emphasis></para><para>Use <command>netstat</command>, <command>snoop</command>, and
other network monitoring utilities to discover the types of traffic that are
causing problems on the network. Review the classes that you have created
thus far, and then create new classes for any undefined problem traffic category.
If you have already defined classes for a category of problem traffic, then
define rates for the meter to control the problem traffic.</para><para>Create
classes for the problem traffic on every IPQoS-enabled system on the network.
Each IPQoS system can then handle any problem traffic  by limiting the rate
at which the traffic flow is released onto the network. Be sure also to define
these problem classes in the QoS policy on the Diffserv router. The router
can then queue and schedule the problem flows as configured in its QoS policy.</para>
</listitem><listitem><para><emphasis role="strong">Do you need to obtain statistics on
certain types of traffic?</emphasis></para><para>A quick review of an SLA
can indicate which types of customer traffic require accounting. If your site
does offer SLAs, you probably have already created classes for traffic that
requires accounting. You might also define classes to enable statistics gathering
on traffic flows that you are monitoring. You could also create classes for
traffic to which you  restrict access for security reasons.</para>
</listitem>
</itemizedlist>
</step><step id="ipqos-config-planning-step-41"><para>List the classes that you have
defined in the QoS planning table you created in Step 1.</para>
</step><step id="ipqos-config-planning-step-33"><para>Assign a priority level to
each class.</para><para>For example, have priority level 1 represent the 
highest-priority class, and assign descending-level priorities to the remaining
classes. The priority level that you assign is for organizational purposes
only. Priority levels that you set in the QoS policy template are not actually
used by IPQoS. Moreover, you can assign the same priority to more than one
class, if appropriate for your QoS policy. </para>
</step><step id="ipqos-config-planning-step-52"><para>When you finish defining classes,
you next define filters for each class, as explained in <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in the QoS Policy</olink>.</para>
</step>
</procedure><taskrelated-custom><title>Prioritizing the Classes</title><para>As you create classes, you quickly realize which classes have highest
priority, medium priority, and best-effort priority. A good scheme for prioritizing
classes becomes particularly important when you assign per-hop behaviors to
outgoing traffic, as explained in <olink targetptr="ipqos-config-planning-45" remap="internal">How
to Plan Forwarding Behavior</olink>. </para><para>In addition to assigning a PHB to a class, you can also define a priority
selector in a filter for the class. The priority selector is active on the
IPQoS-enabled host only. Suppose several classes with equal rates and identical
DSCPs sometimes compete for bandwidth as they leave the IPQoS system. The
priority selector in each class can further order the level of service that
is given to the otherwise identically valued classes.</para>
</taskrelated-custom>
</task><sect2 id="ipqos-config-planning-483"><title>Defining Filters</title><para>You create filters to identify packet flows as members of a particular
class. Each filter contains selectors, which define the criteria for evaluating
a packet flow. The IPQoS-enabled system then uses the criteria in the selectors
to extract packets from a traffic flow. The IPQoS system then associates the
packets with a class.  For an introduction to filters, see <olink targetptr="ipqos-intro-27" remap="internal">IPQoS Filters</olink>.</para><para>The following table lists the most commonly used selectors. The
first five selectors represent the IPQoS 5-tuple, which the IPQoS system uses
to identify packets as members of a flow. For a complete list of selectors,
see <olink targetptr="ipqos-reference-tbl-32" remap="internal">Table 37&ndash;1</olink>.</para><table frame="topbot" pgwide="100" id="ipqos-config-planning-tbl-47"><title>Common
IPQoS Selectors</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec2" colwidth="29.30*"/><colspec colname="colspec3" colwidth="47.90*"/><thead><row rowsep="1"><entry><para>Name</para>
</entry><entry><para>Definition</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>saddr</literal></para>
</entry><entry><para>Source address.</para>
</entry>
</row><row><entry><para><literal>daddr</literal></para>
</entry><entry><para>Destination address.</para>
</entry>
</row><row><entry><para><literal>sport</literal></para>
</entry><entry><para>Source port number. You can use a well-known port number, as defined
in <filename>/etc/services</filename>, or a user-defined port number.</para>
</entry>
</row><row><entry><para><literal>dport</literal></para>
</entry><entry><para>Destination port number.</para>
</entry>
</row><row><entry><para><literal>protocol</literal></para>
</entry><entry><para>IP protocol number or protocol name that is assigned to the traffic
flow type in <filename>/etc/protocols</filename>.</para>
</entry>
</row><row><entry><para><literal>ip_version</literal></para>
</entry><entry><para>Addressing style to use. Use either IPv4 or IPv6. IPv4 is the default.</para>
</entry>
</row><row><entry><para><literal>dsfield</literal></para>
</entry><entry><para>Contents of the DS field, that is, the DSCP. Use this selector for extracting
incoming packets that are already marked with a particular DSCP.</para>
</entry>
</row><row><entry><para><literal>priority</literal></para>
</entry><entry><para>Priority level that is assigned to the class. For more information,
see <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes
for Your QoS Policy</olink>.</para>
</entry>
</row><row><entry><para><literal>user</literal></para>
</entry><entry><para>Either the UNIX user ID or user name that is used when the upper-level
application is executed.</para>
</entry>
</row><row><entry><para><literal>projid</literal></para>
</entry><entry><para>Project ID that is used when the upper-level application is executed.</para>
</entry>
</row><row><entry><para><literal>direction</literal></para>
</entry><entry><para>Direction of traffic flow. Value is either <literal>LOCAL_IN</literal>, <literal>LOCAL_OUT</literal>, <literal>FWD_IN</literal>, or <literal>FWD_OUT</literal>.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>Be judicious in your choice of selectors. Use only as many selectors
as you need to extract packets for a class. The more selectors that you define,
the greater the impact on IPQoS performance.</para>
</note>
</sect2><task id="ipqos-config-planning-42"><title>How to Define Filters in the QoS
Policy</title><taskprerequisites><para>Before you can perform the next steps, you should have completed the
procedure <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes
for Your QoS Policy</olink>.</para>
</taskprerequisites><procedure><step id="ipqos-config-planning-step-48"><para>Create at least one filter
for each class in the QoS planning table that you created in <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes for Your QoS
Policy</olink>.</para><para>Consider creating separate filters for incoming
and outgoing traffic for each class, where applicable. For example, add an <literal>ftp-in</literal> filter and an <literal>ftp-out</literal> filter to the QoS
policy of an IPQoS-enabled FTP server.  You then can define an appropriate <literal>direction</literal> selector in addition to the basic selectors. </para>
</step><step id="ipqos-config-planning-step-44"><para>Define at least one selector
for each filter in a class.</para><para>Use the QoS planning table that was
introduced in <olink targetptr="ipqos-config-planning-tbl-28" remap="internal">Table 33&ndash;1</olink> to
fill in filters for the classes you defined.</para>
</step>
</procedure><example id="eojbp"><title>Defining Filters for FTP Traffic</title><para>The next table shows how you would define a filter for outgoing FTP
traffic.</para><informaltable frame="topbot"><tgroup cols="4" colsep="0" rowsep="0"><colspec colname="colspec2" colwidth="39.38*"/><colspec colname="colspec0" colwidth="33.33*"/><colspec colname="colspec3" colwidth="26.26*"/><colspec colname="colspec1" colwidth="101.03*"/><thead><row rowsep="1"><entry><para>Class</para>
</entry><entry><para>Priority</para>
</entry><entry><para>Filters</para>
</entry><entry><para>Selectors</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>ftp-traffic</literal></para>
</entry><entry><para>4</para>
</entry><entry><para><literal>ftp-out</literal></para>
</entry><entry><para><literal>saddr 10.190.17.44</literal></para><para><literal>daddr 10.100.10.53</literal></para><para><literal>sport 21</literal></para><para><literal>direction LOCAL_OUT</literal></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</example><taskrelated role="see-also"><itemizedlist><listitem><para>To define a flow-control scheme, refer to <olink targetptr="ipqos-config-planning-16" remap="internal">How to Plan Flow Control</olink>.</para>
</listitem><listitem><para>To define forwarding behaviors for flows as the flows return
to the network stream, refer to <olink targetptr="ipqos-config-planning-45" remap="internal">How
to Plan Forwarding Behavior</olink>.</para>
</listitem><listitem><para>To plan for flow accounting of certain types of traffic, refer
to <olink targetptr="ipqos-config-planning-18" remap="internal">How to Plan for Flow Accounting</olink>.</para>
</listitem><listitem><para>To add more classes to the QoS policy, refer to <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes for Your QoS
Policy</olink>.</para>
</listitem><listitem><para>To add more filters to the QoS policy, refer to <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in the QoS Policy</olink>.</para>
</listitem>
</itemizedlist>
</taskrelated>
</task><task id="ipqos-config-planning-16"><title>How to Plan Flow Control</title><tasksummary><para>Flow control involves measuring traffic flow for a class and then releasing
packets onto the network at a defined rate. When you plan flow control, you
define parameters to be used by the IPQoS metering modules. The meters determine
the rate at which traffic is released onto the network. For an introduction
to the metering modules, see <olink targetptr="ipqos-intro-19" remap="internal">Meter (tokenmt
and tswtclmt) Overview</olink>. </para><para>The next procedure assumes that you have defined filters and selectors,
as described in <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define
Filters in the QoS Policy</olink>.</para>
</tasksummary><procedure><step id="ipqos-config-planning-step-36"><para>Determine the maximum bandwidth
for your network.</para>
</step><step id="ipqos-config-planning-step-32"><para>Review any SLAs that are supported
on your network. Identify customers and the type of service that is guaranteed
to each customer.</para><para>To guarantee a certain level of service, you
might need to meter certain traffic classes that are generated by the customer. </para>
</step><step id="ipqos-config-planning-step-34"><para>Review the list of classes
that you created in <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define
the Classes for Your QoS Policy</olink>.</para><para>Determine if any classes
other than those classes that are associated with SLAs need to be metered.</para><para>Suppose the IPQoS system runs an application that generates a high level
of traffic. After you classify the application's traffic, meter the flows
to control the rate at which the packets of the flow return to the network.</para><note><para>Not all classes need to be metered. Remember this guideline as
you review your list of classes.</para>
</note>
</step><step id="ipqos-config-planning-step-380"><para>Determine which filters in
each class select traffic that needs flow control. Then, refine your list
of classes that require metering.</para><para>Classes that have more than
one filter might require metering for only one filter. Suppose that you define
filters for incoming and outgoing traffic of a certain class. You might conclude
that only traffic in one direction requires flow control.</para>
</step><step id="ipqos-config-planning-step-35"><para>Choose a meter module for each
class to be flow controlled.</para><para>Add the module name to the meter
column in your QoS planning table. </para>
</step><step id="ipqos-config-planning-step-390"><para>Add the rates for each class
to be metered to the organizational table.</para><para>If you use the <command>tokenmt</command> module, you need to
define the following rates in bits per second:</para><itemizedlist><listitem><para>Committed rate</para>
</listitem><listitem><para>Peak rate</para>
</listitem>
</itemizedlist><para>If these rates are sufficient to meter a particular class, you can define
only the committed rate and the committed burst for <command>tokenmt</command>. </para><para>If needed, you can also define the following rates:</para><itemizedlist><listitem><para>Committed burst</para>
</listitem><listitem><para>Peak burst</para>
</listitem>
</itemizedlist><para>For a complete definition of <command>tokenmt</command> rates, refer
to <olink targetptr="ipqos-reference-13" remap="internal">Configuring tokenmt as a Two-Rate
Meter</olink>. You can also find more detailed information in the <command>tokenmt</command>(7ipp) man page.</para><para>If you use the <command>tswtclmt</command> module,
you need to define the following rates in bits per second.</para><itemizedlist><listitem><para>Committed rate</para>
</listitem><listitem><para>Peak rate</para>
</listitem>
</itemizedlist><para>You can also define the window size in milliseconds. These rates are
defined in <olink targetptr="ipqos-reference-20" remap="internal">tswtclmt Metering Module</olink> and
in the <command>twstclmt</command>(7ipp) man page.</para>
</step><step id="ipqos-config-planning-step-370"><para>Add traffic conformance outcomes
for the metered traffic.</para><para>The outcomes for both metering modules are green, red, and yellow.
Add to your QoS organizational table the traffic conformance outcomes that
apply to the rates you define. Outcomes for the meters are fully explained
in <olink targetptr="ipqos-reference-8" remap="internal">Meter Module</olink>.</para><para>You
need to determine what action should be taken on traffic that conforms, or
does not conform, to the committed rate. Often,  but not always, this action
is to mark the packet header with a per-hop behavior. One acceptable action
for green-level traffic could be to continue processing while traffic flows
do not exceed the committed rate. Another action could be to drop packets
of the class if flows exceed peak rate.</para>
</step>
</procedure><example id="eojbq"><title>Defining Meters</title><para>The next table shows meter entries for a class of email traffic. The
network on which the IPQoS system is located has a total bandwidth of 100
Mbits/sec, or 10000000 bits per second. The QoS policy assigns a low priority
to the email class. This class also receives best-effort forwarding behavior.</para><informaltable frame="topbot"><tgroup cols="5" colsep="0" rowsep="0"><colspec colname="colspec5" colwidth="15.84*"/><colspec colname="colspec6" colwidth="15.84*"/><colspec colname="colspec7" colwidth="15.84*"/><colspec colname="colspec8" colwidth="20.41*"/><colspec colname="colspec9" colwidth="32.07*"/><thead><row rowsep="1"><entry><para>Class</para>
</entry><entry><para>Priority</para>
</entry><entry><para>Filter</para>
</entry><entry><para>Selector</para>
</entry><entry><para>Rate</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>email</literal></para>
</entry><entry><para>8</para>
</entry><entry><para><literal>mail_in</literal></para>
</entry><entry><para><literal>daddr</literal><literal>10.50.50.5</literal></para><para><literal>dport imap</literal></para><para><literal>direction LOCAL_IN</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>email</literal> </para>
</entry><entry><para>8</para>
</entry><entry><para><literal>mail_out</literal></para>
</entry><entry><para><literal>saddr</literal><literal>10.50.50.5</literal></para><para><literal>sport imap</literal></para><para><literal>direction LOCAL_OUT</literal></para>
</entry><entry><para>meter=<literal>tokenmt</literal></para><para>committed rate=5000000</para><para>committed burst =5000000</para><para>peak rate =10000000</para><para>peak burst=1000000</para><para>green precedence=continue processing</para><para>yellow precedence=mark yellow PHB</para><para>red precedence=drop</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</example><taskrelated role="see-also"><itemizedlist><listitem><para>To define forwarding behaviors for flows as the packets return
to the network stream, refer to <olink targetptr="ipqos-config-planning-45" remap="internal">How
to Plan Forwarding Behavior</olink>.</para>
</listitem><listitem><para>To plan for flow accounting of certain types of traffic, refer
to <olink targetptr="ipqos-config-planning-18" remap="internal">How to Plan for Flow Accounting</olink>.</para>
</listitem><listitem><para>To add more classes to the QoS policy, refer to <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes for Your QoS
Policy</olink>.</para>
</listitem><listitem><para>To add more filters to the QoS policy, refer to <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in the QoS Policy</olink>.</para>
</listitem><listitem><para>To define another flow-control scheme, refer to <olink targetptr="ipqos-config-planning-16" remap="internal">How to Plan Flow Control</olink>.</para>
</listitem><listitem><para>To create an IPQoS configuration file, refer to <olink targetptr="ipqos-policy-planning-32" remap="internal">How to Create the IPQoS Configuration
File and Define Traffic Classes</olink>.</para>
</listitem>
</itemizedlist>
</taskrelated>
</task><task id="ipqos-config-planning-45"><title>How to Plan Forwarding Behavior</title><tasksummary><para>Forwarding behavior determines the priority and drop precedence of traffic
flows that are about to be forwarded to the network. You can choose two major
forwarding behaviors: prioritize the flows of a class in relationship to other
traffic classes or drop the flows entirely. </para><para>The Diffserv model uses the marker to assign the chosen forwarding behavior
to traffic flows. IPQoS offers the following marker modules.</para><itemizedlist><listitem><para><command>dscpmk</command> &ndash; Used to mark the DS field of
an IP packet with a DSCP</para>
</listitem><listitem><para><command>dlcosmk</command> &ndash; Used to mark the VLAN tag
of a datagram with a class-of-service (CoS) value</para>
</listitem>
</itemizedlist><note><para>The suggestions in this section refer specifically to IP packets.
If your IPQoS system includes a VLAN device, you can use the <command>dlcosmk</command> marker
to mark forwarding behaviors for datagrams. For more information, refer to <olink targetptr="ipqos-reference-110" remap="internal">Using the dlcosmk Marker With VLAN Devices</olink>.</para>
</note><para>To prioritize IP traffic, you need to assign a DSCP to each packet.
The <command>dscpmk</command> marker marks the DS field of the packet with
the DSCP. You choose the DSCP for a class from a group of well-known codepoints
that are associated with the forwarding behavior type. These well-known codepoints
are 46 (101110) for the EF PHB and a range of codepoints for the AF PHB. For
overview information on DSCP and forwarding, refer to <olink targetptr="ipqos-intro-54" remap="internal">Traffic Forwarding on an IPQoS-Enabled Network</olink>.</para>
</tasksummary><taskprerequisites><para>The next steps assume that you have defined classes and filters for
the QoS policy. Though you often use the meter with the marker to control
traffic, you can use the marker alone to define a forwarding behavior.</para>
</taskprerequisites><procedure><step id="ipqos-config-planning-step-50"><para>Review the classes that you
have created thus far and the priorities that you have assigned to each class.</para><para>Not all traffic classes need to be marked. </para>
</step><step id="ipqos-config-planning-step-49"><para>Assign the EF per-hop behavior to the class with the highest priority.</para><para>The EF PHB guarantees that packets with the EF DSCP 46  (101110)
are released onto the network before packets with any AF PHBs. Use the EF
PHB for your highest-priority traffic. For more information about EF, refer
to <olink targetptr="ipqos-reference-140" remap="internal">Expedited Forwarding (EF) PHB</olink>.</para>
</step><step id="ipqos-config-planning-step-47"><para>Assign forwarding behaviors
to classes that have traffic to be metered.</para>
</step><step id="ipqos-config-planning-step-480"><para>Assign DS codepoints to the
remaining classes in agreement with the priorities that you have assigned
to the classes.</para>
</step>
</procedure><example id="eupqz"><title>QoS Policy for a Games Application</title><para>Traffic is generally metered for the following reasons:</para><itemizedlist><listitem><para>An SLA guarantees packets of this class greater service or
lesser service when the network is heavily used.</para>
</listitem><listitem><para>A class with a lower priority might have a tendency to flood
the network.</para>
</listitem>
</itemizedlist><para>You use the marker with the meter to provide differentiated services
and bandwidth management to these classes. For example, the following table
shows a portion of a QoS policy. This policy defines a class for a popular
games application that generates a high level of traffic.</para><informaltable frame="topbot" pgwide="100"><tgroup cols="6" colsep="0" rowsep="0"><colspec colwidth="13.37*"/><colspec colwidth="10.04*"/><colspec colwidth="12.89*"/><colspec colname="colspec2" colwidth="12.39*"/><colspec colname="colspec4" colwidth="15.61*"/><colspec colname="colspec3" colwidth="15.94*"/><thead><row rowsep="1"><entry><para>Class</para>
</entry><entry><para>Priority</para>
</entry><entry><para>Filter</para>
</entry><entry><para>Selector</para>
</entry><entry><para>Rate</para>
</entry><entry><para>Forwarding?</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>games_app</literal></para>
</entry><entry><para>9</para>
</entry><entry><para><literal>games_in</literal></para>
</entry><entry><para><literal>sport 6080</literal></para>
</entry><entry><para>N/A</para>
</entry><entry><para>N/A</para>
</entry>
</row><row><entry><para><literal>games_app</literal></para>
</entry><entry><para>9</para>
</entry><entry><para><literal>games_out</literal></para>
</entry><entry><para><literal>dport 6081</literal></para>
</entry><entry><para>meter=<literal>tokenmt</literal></para><para>committed rate=5000000</para><para>committed burst =5000000</para><para>peak rate =10000000</para><para>peak burst=15000000</para><para>green precedence=continue processing</para><para>yellow precedence=mark yellow PHB</para><para>red precedence=drop</para>
</entry><entry><para>green =AF31</para><para>yellow=AF42</para><para>red=drop</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>The forwarding behaviors assign low-priority DSCPs to <literal>games_app</literal> traffic
that conforms to its committed rate or is under the peak rate. When <literal>games_app</literal> traffic exceeds peak rate, the QoS policy indicates that packets
from <literal>games_app</literal> are to be dropped. All AF codepoints are
listed in <olink targetptr="ipqos-reference-tbl-16" remap="internal">Table 37&ndash;2</olink>.</para>
</example><taskrelated role="see-also"><itemizedlist><listitem><para>To plan for flow accounting of certain types of traffic, refer
to <olink targetptr="ipqos-config-planning-18" remap="internal">How to Plan for Flow Accounting</olink>.</para>
</listitem><listitem><para>To add more classes to the QoS policy, refer to <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes for Your QoS
Policy</olink>.</para>
</listitem><listitem><para>To add more filters to the QoS policy, refer to <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in the QoS Policy</olink>.</para>
</listitem><listitem><para>To define a flow-control scheme, refer to <olink targetptr="ipqos-config-planning-16" remap="internal">How to Plan Flow Control</olink>.</para>
</listitem><listitem><para>To define additional forwarding behaviors for flows as the
packets return to the network stream, refer to <olink targetptr="ipqos-config-planning-45" remap="internal">How to Plan Forwarding Behavior</olink>.</para>
</listitem><listitem><para>To create an IPQoS configuration file, refer to <olink targetptr="ipqos-policy-planning-32" remap="internal">How to Create the IPQoS Configuration
File and Define Traffic Classes</olink>.</para>
</listitem>
</itemizedlist>
</taskrelated>
</task><task id="ipqos-config-planning-18"><title>How to Plan for Flow Accounting</title><tasksummary><para>You use the IPQoS <command>flowacct</command> module to track traffic
flows for billing or network management purposes. Use the following procedure
to determine if your QoS policy should include flow accounting.</para>
</tasksummary><procedure><step id="ipqos-config-planning-step-60"><para>Does your company offer SLAs
to customers?</para><para>If the answer is yes, then you should use flow accounting.
Review the SLAs to determine what types of network traffic your company wants
to bill customers for. Then, review your QoS policy to determine which classes
select traffic to be billed.</para>
</step><step id="ipqos-config-planning-step-57"><para>Are there applications that
might need monitoring or testing to avoid network problems?</para><para>If
the answer is yes, consider using flow accounting to observe the behavior
of these applications. Review your QoS policy to determine the classes that
you have assigned to traffic that requires monitoring.</para>
</step><step id="ipqos-config-planning-step-58"><para>Mark Y in the flow-accounting
column for each class that requires flow accounting in your QoS planning table.</para>
</step>
</procedure><taskrelated role="see-also"><itemizedlist><listitem><para>To add more classes to the QoS policy, refer to <olink targetptr="ipqos-config-planning-14" remap="internal">How to Define the Classes for Your QoS
Policy</olink>.</para>
</listitem><listitem><para>To add more filters to the QoS policy, refer to <olink targetptr="ipqos-config-planning-42" remap="internal">How to Define Filters in the QoS Policy</olink>.</para>
</listitem><listitem><para>To define a flow-control scheme, refer to <olink targetptr="ipqos-config-planning-16" remap="internal">How to Plan Flow Control</olink>.</para>
</listitem><listitem><para>To define forwarding behaviors for flows as the packets return
to the network stream, refer to <olink targetptr="ipqos-config-planning-45" remap="internal">How
to Plan Forwarding Behavior</olink>.</para>
</listitem><listitem><para>To plan for additional flow accounting of certain types of
traffic, refer to <olink targetptr="ipqos-config-planning-18" remap="internal">How to Plan
for Flow Accounting</olink>.</para>
</listitem><listitem><para>To create the IPQoS configuration file, refer to <olink targetptr="ipqos-policy-planning-32" remap="internal">How to Create the IPQoS Configuration
File and Define Traffic Classes</olink>.</para>
</listitem>
</itemizedlist>
</taskrelated>
</task>
</sect1><sect1 id="ipqos-config-planning-13"><title>Introducing the IPQoS Configuration
Example</title><para>Tasks in the remaining chapters of the guide use the example IPQoS configuration
that is introduced in this section. The example shows the differentiated services
solution on the public intranet of BigISP, a fictitious service provider.
BigISP offers services to  large companies that reach BigISP through leased
lines. Individuals who dial in from modems can also buy services from BigISP.</para><sect2 id="ipqos-config-planning-12"><title>IPQoS Topology</title><para>The following figure shows the network topology that is used for
BigISP's public intranet.</para><figure id="ipqos-config-planning-fig-44"><title>IPQoS Example Topology</title><mediaobject><imageobject><imagedata entityref="ipqos-topology-ex"/>
</imageobject><textobject><simpara> Topology diagram shows two user types, corporate and
individual, who access an ISP network that is defined in the next context.</simpara>
</textobject>
</mediaobject>
</figure><para>BigISP has implemented these four tiers in its public intranet:</para><itemizedlist><listitem><para><emphasis role="strong">Tier 0</emphasis> &ndash; Network <literal>10.10.0.0</literal> includes a large Diffserv router that is called <literal>Bigrouter</literal>, which has both external and internal interfaces. Several companies,
including a large organization that is called Goldco, have rented leased-line
services that terminate at <literal>Bigrouter</literal>. Tier 0 also handles
individual customers who call over telephone lines or ISDN.</para>
</listitem><listitem><para><emphasis role="strong">Tier 1</emphasis> &ndash; Network <literal>10.11.0.0</literal> provides web services. The <literal>Goldweb</literal> server
hosts the web site which was purchased by Goldco as part of the premium service
that Goldco has purchased from BigISP. The server <literal>Userweb</literal> hosts
small web sites that were purchased by individual customers. Both <literal>Goldweb</literal> and <literal>Userweb</literal> are IPQoS enabled.</para>
</listitem><listitem><para><emphasis role="strong">Tier 2</emphasis> &ndash; Network <literal>10.12.0.0</literal> provides applications for all customers to use. <literal>BigAPPS</literal>, one of the application servers, is IPQoS-enabled. <literal>BigAPPS</literal> provides
SMTP, News, and FTP services.</para>
</listitem><listitem><para><emphasis role="strong">Tier 3</emphasis> &ndash; Network <literal>10.13.0.0</literal> houses large database servers. Access to Tier 3 is controlled
by <literal>datarouter</literal>, a Diffserv router.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
</chapter>