qos
qos - configure the QoS counter parameters for a port
SYNOPSIS
qos sub-command options
DESCRIPTION
This command allows to set up the QoS counter filters and offset of the QoS priority bits.
Note that when using ATM ports, different types of ATM encapsulation result in different length headers, as discussed in atmHeader. The data portion of the packet normally follows the header, except in the case of the two LLC Bridged Ethernet choices, where 12 octets of MAC address and 2 octets of Ethernet type follow the header. The offsets used in this command are with respect to the start of the AAL5 packet and must be adjusted by hand to account for the header.
STANDARD OPTIONS
byteOffset
The offset where the priority value is checked to indicate which of the QoS counters is going to be incremented. (default = 14)
packetType
The type of packet that the QoS counters are looking for priority bits within.
Option |
Value |
Usage |
---|---|---|
ipEthernetII |
0 |
|
ip8023Snap |
1 |
|
vlan |
2 |
|
custom |
3 |
|
ipPpp |
4 |
|
ipCiscoHdlc |
5 |
|
ipAtm |
6 |
|
patternMask
The mask of the pattern that is analyzed by the Receive engine to increment the QoS counter. (default = 00 00)
patternMatch
The pattern that is analyzed by the Receive engine to increment the QoS counter. (default = 81 00)
patternOffset
The offset where the pattern to be matched is located. (default = 12)
patternOffsetType
The point within a frame that patternOffset is with respect to.
Option |
Value |
Usage |
---|---|---|
qosOffsetStartOfFrame |
0 |
(default) From the start of the frame. |
qosOffsetStartOfIp |
1 |
From the start of the IP header. |
qosOffsetStartOfProtocol |
2 |
From the start of the inner protocol header. For example, TCP header. |
qosOffsetStartOfSonet |
3 |
From the stat of the SONET frame. |
COMMANDS
The qos command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
qos cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the qos command
qos config option value
Modify the configuration options of the qos. If no option is specified, returns a list describing all of the available options (see STANDARD OPTIONS) for qos.
qos get chasID cardID portID
Gets the current configuration of the QoS counters on port with id portID on card cardID, chassis chasID. from its hardware. Call this command before calling qos cget option value to get the value of the configuration option. Specific errors are:
- No connection to a chassis
Invalid port number
qos set chasID cardID portID
Sets the configuration of the QoS counters in IxHAL on port with id portID on card cardID, chassis chasID by reading the configuration option values set by the qos config option value command. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
The configured parameters are not valid for this port
qos setDefault
Sets to IxTclHal default values for all configuration options.
qos setuppacketType
Sets the QoS counters to look for priority bits for a certain type of packet. See the packetType standard option description for the choices. Specific errors are:
- Invalid packetType
qos write chasID cardID portID
Writes or commits the changes in IxHAL to hardware the QoS counters configuration for each port with id portID on card cardID, chassis chasID. Before using this command, use the qos set command to configure the port related parameters (byteOffset, patternMatch, patternMask, patternOffset) in IxHAL. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
EXAMPLES
package require IxTclHal
# In this test, we'll generate a number of packets with different
# settings in the QoS field. The directly connected receiving port
# will be set to receive and provide statistics for the number of
# QoS packets received at each of 8 levels
# Connect to chassis and get chassis ID
set host galaxy
set username user
# Check if we're running on UNIX - connect to the TCL Server
# which must be running on the chassis
if [isUNIX] {
if [ixConnectToTclServer $host] {
ixPuts "Could not connect to $host"
return 1
}
}
# Now connect to the chassis
if [ixConnectToChassis $host] {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis ID to use in port lists
set chas [ixGetChassisID $host]
# Assume card to be used is in slot 1
set card 1
set txPort 1
set rxPort 2
set portList [list [list $chas $card $txPort] \
[list $chas $card $rxPort] ]
# Login before taking ownership
if [ixLogin $username] {
ixPuts $::ixErrorInfo
return 1
}
# Take ownership of the ports we'll use
if [ixTakeOwnership $portList] {
ixPuts $::ixErrorInfo
return 1
}
# Setup port 1 to transmit
port setFactoryDefaults $chas $card $txPort
port setDefault
# Stream: 100,000 packets
stream setDefault
stream config -numFrames 100000
stream config -dma stopStream
# IP/ethernetII packets
ip setDefault
ip set $chas $card $txPort
protocol setDefault
protocol config -name ipV4
protocol config -ethernetType ethernetII
# Overlay UDF1 on top of the QoS byte with an appropriate mask
udf setDefault
udf config -enable true
udf config -offset 15
udf config -udfSize c8
udf config -continuousCount true
udf config -maskselect {1F 00 00 00}
udf set 1
stream set $chas $card $txPort 1
port set $chas $card $txPort
# Set up port 2 for QoS Statistics
port setFactoryDefaults $chas $card $rxPort
port setDefault
# QoS statistics mode
stat config -mode statQos
stat set $chas $card $rxPort
# Set up locations of where to find the information
qos setup ipEthernetII
qos set $chas $card $rxPort
protocol setDefault
protocol config -name mac
protocol config -ethernetType ethernetII
port set $chas $card $rxPort
# Write config to hardware
ixWritePortsToHardware portList
# Clear stats, run the transmission
after 1000
ixClearPortStats $chas $card $rxPort
ixStartPortTransmit $chas $card $txPort
after 1000
ixCheckPortTransmitDone $chas $card $txPort
# Get the 8 QoS statistics and print them
stat get allStats $chas $card $rxPort
for {set i 0} {$i <= 7} {incr i} \
{
ixPuts -nonewline "Qos$i = "
ixPuts [stat cget -qualityOfService$i]
}
# Let go of the ports that we reserved
ixClearOwnership $portList
# Disconnect from the chassis we're using
ixDisconnectFromChassis $host
# If we're running on UNIX, disconnect from the TCL Server
if [isUNIX] {
ixDisconnectTclServer $host
}