How to Define Traffic Forwarding in the IPQoS Configuration File
The next procedure shows how to define traffic forwarding by adding per-hop behaviors for a class into the IPQoS configuration file.
Before You Begin
The procedure assumes that you have an existing IPQoS configuration file with already defined classes and already defined filters. The steps continue building the /var/ipqos/Goldweb.qos file from Example 34-1.
Note - The procedure shows how to configure traffic forwarding by using the dscpmk marker module. For information about traffic forwarding on VLAN systems by using the dlclosmk marker, refer to Using the dlcosmk Marker With VLAN Devices.
Open the IPQoS configuration file, and locate the end of the last filter you defined.
For example, on the IPQoS-enabled server Goldweb, you would start after the following filter clause in /var/ipqos/Goldweb.qos:
filter { name videoout sport videosrv direction LOCAL_OUT class video } }
Note that this filter clause is at the end of the ipgpc classifier action statement. Therefore, you need a closing brace to terminate the filter and a second closing brace to terminate the action statement.
Invoke the marker with the following action statement.
action { module dscpmk name markAF11
module dscpmk
Calls the marker module dscpmk.
name markAF11
Gives the name markAF11 to the action statement.
The previously defined class goldweb includes a next_action markAF11 statement. This statement sends traffic flows to the markAF11 action statement after the classifier concludes processing.
Define actions for the marker to take on the traffic flow.
params { global_stats FALSE dscp_map{0-63:10} next_action continue } }
global_stats FALSE
Enables statistics collection for the markAF11 marker action statement. However, because the value of enable_stats is FALSE, statistics are not collected.
dscp_map{0-63:10}
Assigns a DSCP of 10 to the packet headers of the traffic class goldweb, which is currently being processed by the marker.
next_action continue
Indicates that no further processing is required on packets of the traffic class goldweb, and that these packets can return to the network stream.
The DSCP of 10 instructs the marker to set all entries in the dscp map to the decimal value 10 (binary 001010). This codepoint indicates that packets of the goldweb traffic class are subject to the AF11 per-hop behavior. AF11 guarantees that all packets with the DSCP of 10 receive a low-drop, high-priority service. Thus, outgoing traffic for premium customers on Goldweb is given the highest priority that is available for the Assured Forwarding (AF) PHB. For a table of possible DSCPs for AF, refer to Table 37-2.
Start another marker action statement.
action { module dscpmk name markEF
module dscpmk
Calls the marker module dscpmk.
name markEF
Gives the name markEF to the action statement.
Define actions for the marker to take on the traffic flow.
params { global_stats TRUE dscp_map{0-63:46} next_action acct } }
global_stats TRUE
Enables statistics collection on class video, which selects streaming video packets.
dscp_map{0-63:46}
Assigns a DSCP of 46 to the packet headers of the traffic class video, which is currently being processed by the marker.
next_action acct
Instructs the dscpmk module to pass packets of the class video to the acct action statement after dscpmk completes processing. The acct action statement invokes the flowacct module.
The DSCP of 46 instructs the dscpmk module to set all entries in the dscp map to the decimal value 46 (binary 101110) in the DS field. This codepoint indicates that packets of the video traffic class are subject to the Expedited Forwarding (EF) per-hop behavior.
Note - The recommended codepoint for EF is 46 (binary 101110). Other DSCPs assign AF PHBs to a packet.
The EF PHB guarantees that packets with the DSCP of 46 are given the highest precedence by IPQoS and Diffserv-aware systems. Streaming applications require highest-priority service, which is the rationale behind assigning to streaming applications the EF PHBs in the QoS policy. For more details about the expedited forwarding PHB, refer to Expedited Forwarding (EF) PHB.
Add the DSCPs that you have just created to the appropriate files on the Diffserv router.
For more information, refer to How to Configure a Router on an IPQoS-Enabled Network.
See Also
To start gathering flow-accounting statistics on traffic flows, refer to How to Enable Accounting for a Class in the IPQoS Configuration File.
To define forwarding behaviors for the marker modules, refer to How to Define Traffic Forwarding in the IPQoS Configuration File.
To define flow-control parameters for the metering modules, refer to How to Configure Flow Control in the IPQoS Configuration File.
To activate the IPQoS configuration file, refer to How to Apply a New Configuration to the IPQoS Kernel Modules.
To define additional filters, refer to How to Define Filters in the IPQoS Configuration File.
To create classes for traffic flows from applications, refer to How to Configure the IPQoS Configuration File for an Application Server.
How to Enable Accounting for a Class in the IPQoS Configuration File
The next procedure shows how to enable accounting on a traffic class in the IPQoS configuration file. The procedure shows how to define flow accounting for the video class, which is introduced in How to Create the IPQoS Configuration File and Define Traffic Classes. This class selects streaming video traffic, which must be billed as part of a premium customer's SLA.
Before You Begin
The procedure assumes that you have an existing IPQoS configuration file with already defined classes, filters, metering actions, if appropriate, and marking actions, if appropriate. The steps continue building the /var/ipqos/Goldweb.qos file from Example 34-1.
Open the IPQoS configuration file, and locate the end of the last action statement you defined.
For example, on the IPQoS-enabled server Goldweb, you would start after the following markEF action statement in /var/ipqos/Goldweb.qos.
action { module dscpmk name markEF params { global_stats TRUE dscp_map{0-63:46} next_action acct } }
Begin an action statement that calls flow accounting.
action { module flowacct name acct
module flowacct
Invokes the flow-accounting module flowacct.
name acct
Gives the name acct to the action statement
Define a params clause to control accounting on the traffic class.
params { global_stats TRUE timer 10000 timeout 10000 max_limit 2048 next_action continue } }
global_stats TRUE
Enables statistics collection on the class video, which selects streaming video packets.
timer 10000
Specifies the duration of the interval, in milliseconds, when the flow table is scanned for timed-out flows. In this parameter, that interval is 10000 milliseconds.
timeout 10000
Specifies the minimum interval time out value. A flow "times out" when packets for the flow are not seen during a time out interval. In this parameter, packets time out after 10000 milliseconds.
max_limit 2048
Sets the maximum number of active flow records in the flow table for this action instance.
next_action continue
Indicates that no further processing is required on packets of the traffic class video, and that these packets can return to the network stream.
The flowacct module gathers statistical information on packet flows of a particular class until a specified timeout value is reached.
See Also
To configure per-hop behaviors on a router, refer to How to Configure a Router on an IPQoS-Enabled Network.
To activate the IPQoS configuration file, refer to How to Apply a New Configuration to the IPQoS Kernel Modules.
To create classes for traffic flows from applications, refer to How to Configure the IPQoS Configuration File for an Application Server.