Utility Commands
byte2IpAddr
byte2IpAddr - convert 4 hex bytes into an IP address in dotted notation
SYNOPSIS
byte2IpAddr <hexVal>
DESCRIPTION
The byte2IpAddr command converts 4 hex bytes into an IP address in dotted notation. It can be used in scripts where IP addresses are read from the capture buffer in hexadecimal format, for example.
EXAMPLE
byte2IpAddr "C0 02 0A 0C"
Returns 192.2.10.12
SEE ALSO
calculateFPS
calculateFPS - calculates the frame rate, in frames/second
Note: This command has been deprecated. Use calculateMaxRate instead.
SYNOPSIS
calculateFrameRate chassis card port [percentMaxRate frameSize preambleOrAtmEncap]
DESCRIPTION
The calculateFPS command calculates the frame rate for a particular port type based on the percentage of the maximum rate, frame size and the preamble size.
COMMAND
The calculateFPS command is invoked with the following arguments.
calculateFPS chassis card port [percentMaxRate frameSize preambleSize]
where:
chassis, card, port: A port of the type that you wish the frame rate calculated for
percentMaxRate: The percentage of the maximum rate (default = 100)
frameSize: the size of the frame (default = 64)
preambleOrAtmEncap: The size of the preamble, or the ATM encapsulation used for ATM cards. The values for ATM encapsulation may be found in the encapsulation option of the atmHeader command. (default = 8)
EXAMPLE
calculateFPS 1 1 1 80 64 8
Returns 11904.7619048
SEE ALSO
calculateMaxRate, calculatePercentMaxRate
calculateGapBytes
calculateGapBytes - calculates the inter-frame gap for a port, expressed in equivalent number of data bytes.
Note: this command has been deprecated. Use calculatePercentMaxRate instead.
SYNOPSIS
calculateGapBytes chassis card port frameRate frameSize preambleSize
DESCRIPTION
The calculateGapBytes command calculates the IFG in terms of the number of data bytes that could fit in the gap, based on the frame rate, frame size and preamble size.
COMMAND
The calculateGapBytes command is invoked with the following arguments.
calculateGapBytes chassis card port frameRate
[frameSize preambleSize]
where:
chassis, card, port: A port of the type that you wish the gap calculated for
frameRate: The input frame rate in FPS
frameSize: The size of the frame (default = 64)
preambleSize: The size of the preamble (default = 8)
EXAMPLE
calculateGapBytes 1 1 1 1000
Returns 1178
SEE ALSO
calculateMaxRate, calculatePercentMaxRate
calculateMaxRate
calculateMaxRate - calculates the inter-frame gap for a port
SYNOPSIS
calculateMaxRate chassis card port frameSize preambleOrAtmEncap
DESCRIPTION
The calculateMaxRate command calculates the maximum frame rate for a port, based on the frame size and preamble size.
COMMAND
The calculateMaxRate command is invoked with the following arguments.
calculateMaxRate chassis card port [frameSize preambleSize]
where:
chassis, card, port: A port of the type that you wish the maximum frame rate calculated for
frameSize: The size of the frame (default = 64)
preambleOrAtmEncap: The size of the preamble, or the ATM encapsulation used for ATM cards. The values for ATM encapsulation may be found in the encapsulation option of the atmHeader command. (default = 8)
EXAMPLE
calculateMaxRate 1 1 1 1518
Returns 813
SEE ALSO
calculatePercentMaxRate
calculatePercentMaxRate - calculates what percentage of the maximum rate a particular frame rate is
SYNOPSIS
calculatePercentMaxRate chassis card port frameRate [frameSize preambleOrAtmEncap]
DESCRIPTION
The calculatePercentMaxRate command calculates what percentage of the maximum rate a particular frame rate is for a particular port type based on the frame size and the preamble size.
COMMAND
The calculatePercentMaxRate command is invoked with the following arguments.
calculatePercentMaxRate chassis card port frameRate
[frameSize preambleSize]
where:
chassis, card, port: A port of the type that you wish the frame rate calculated for
frameRate: The input frame rate in FPS.
frameSize: The size of the frame (default = 64)
preambleOrAtmEncap: The size of the preamble, or the ATM encapsulation used for ATM cards. The values for ATM encapsulation may be found in the encapsulation option of the atmHeader command. (default = 8)
EXAMPLE
package require IxTclHal
# In this example, we'll find all the 10/100/1000 cards
# and program their first port to 128,000 FPS for 64 byte packets
# and 8 byte preamble
set host localhost
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]
# Login before taking ownership
if [ixLogin $username] {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis' number of cards
chassis getFromID $chas
set ncards [chassis cget -maxCardCount]
ixPuts "Chassis $chas, $ncards cards"
for {set i 1} {$i <= $ncards} {incr i} {
# Check for missing card
if {[card get $chas $i] != 0} {
continue
}
set typeName [card cget -typeName]
# If the card is a 10/100 RMII, play with its settable parameters
if {[string first "1000" $typeName] != -1} {
ixPuts "Card $i: $typeName"
set portList [list [list $chas $i 1]]
if [ixTakeOwnership $portList] {
ixPuts $::ixErrorInfo
return 1
}
port setFactoryDefaults $chas $i 1
port config -speed 1000
port set $chas $i 1
set percentMax [calculatePercentMaxRate $chas $i 1 128000 64 8]
stream config -rateMode usePercentRate
stream config -percentPacketRate $percentMax
#############################################################
#
# NOTE: in the past, this was done with the CalculateGap
# command. For example:
#
# set gapTicks [calculateGap 128000 64 8 $card $i 1]
# stream config -rateMode useGap
# stream config -gapUnit gapClockTicks
# stream config -ifg $gapTicks
#
# This no longer works for new Ixia cards, since the definition
# of a clock tick varies per board. calculatePercentMaxRate
# is card independent and works in all cases
#
#############################################################
stream setDefault
stream config -framesize 64
stream config -preambleSize 8
if [stream set $chas $i 1 1] {
ixPuts $ixErrorInfo
return 1
}
ixWriteConfigToHardware 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
}
SEE ALSO
cleanUp
cleanUp - end a test and cleanup all variables
SYNOPSIS
cleanUp
DESCRIPTION
The cleanUp command reliably terminates a test and resets all important parameters. This includes
- Removing all chassis from the chassis chain
- Disconnects from a TCL Server, if necessary
- Removes the effect of a package require IxTclHal
- Resets all commands back to their default state
- Closes all open files
EXAMPLE
cleanUp
SEE ALSO
clearAllMyOwnership
clearAllMyOwnership - clear all current port ownership
SYNOPSIS
clearAllMyOwnership
DESCRIPTION
The clearAllMyOwnership command releases all port ownership for the currently logged on user.
EXAMPLE
clearAllMyOwnership
SEE ALSO
dectohex
dectohex - convert a decimal number to a hexadecimal number
SYNOPSIS
dectohex <decimal number>
DESCRIPTION
The dectohex command converts a decimal number to a hexadecimal number.
EXAMPLE
dectohex 10
Returns A
SEE ALSO
hextodec, host2addr, byte2IpAddr
disableUdfs
disableUdfs - disables all UDFs in the argument list
SYNOPSIS
disableUdfs udfIDlist
DESCRIPTION
The disableUdfs command cycles through all the UDF numbers in the list argument list and disables them.
COMMAND
The disableUdfs command is invoked with the following arguments.
disableUdfs udfList
where udfList is a list of UDF numbers 1 to 4.
EXAMPLE
disableUdfs {1 3}
SEE ALSO
enableEvents
enableEvents - log errors and warnings to a log file
SYNOPSIS
enableEvents {true | false}
DESCRIPTION
The enableEvents command enables or disables the creation of a log file in the C:\Program Files\Ixia folder. The log file is named with the creation date and time. This value is true by default for Windows operating systems and false by default for Unix systems.
COMMAND
The enableEvents command is invoked with the following arguments.
enableEvents true
SEE ALSO
errorMsg
errorMsg - logs text to the error file
SYNOPSIS
errorMsg [-nonewline] arg...
DESCRIPTION
The errorMsg command outputs its arguments to the error file with or without a new line.
ARGUMENTS
-nonewline
If present, suppresses a newline at the end of the output
arg ...
Arguments which are concatenated together and written to the error file.
RETURNS
0
No error; the command was successfully delivered to the IxServer
1
Error; the command was delivered to the IxServer but it could not process the message
EXAMPLE
errorMsg -nonewline "This will write to the errorFile"
SEE ALSO
getErrorString
getErrorString - return an error string corresponding to an error number
SYNOPSIS
getErrorString <error number>
DESCRIPTION
The getErrorString command converts an error number to a text string.
EXAMPLE
% ixUtils getErrorString 1
General Error. Check method parameters.
% ixUtils getErrorString 2
Version mismatch between IxServer and Tcl Client.
SEE ALSO
getStatLabel
getStatLabel - return a statistic value for a statistic.
SYNOPSIS
getStatLabel <string>
DESCRIPTION
The getStatLabel command gets the statistic value for a specified statistic.
EXAMPLE
getStatLabel sArpInstalled
SEE ALSO
hextodec
hextodec - convert a hexadecimal number to a decimal number
SYNOPSIS
hextodec <hex number>
DESCRIPTION
The hextodec command converts a hexadecimal number to a decimal number.
EXAMPLE
hextodec 7a
Returns 122
SEE ALSO
dectohex, host2addr, byte2IpAddr
host2addr
host2addr - convert an IP address in dotted notation to a list of hex bytes
SYNOPSIS
host2addr <IP address>
DESCRIPTION
The host2addr command converts an IP address in dotted notation to a list of hex bytes. This command is useful in scripts where you specify an IP address in dotted notation and it needs to be converted into 4 hexadecimal byte format to store as a list.
EXAMPLE
host2addr 192.1.10.12
Returns C0 01 0A 0C
SEE ALSO
dectohex, host2addr, byte2IpAddr
logMsg
logMsg - logs text to the log file
SYNOPSIS
logMsg [-nonewline] arg...
DESCRIPTION
The logMsg command outputs its arguments to the log file with or without a new line.
ARGUMENTS
-nonewline
If present, suppresses a newline at the end of the output
arg ...
Arguments which are concatenated together and written to the log file.
RETURNS
0
No error; the command was successfully delivered to the IxServer
1
Error; the command was delivered to the IxServer but it could not process the message
EXAMPLE
logMsg -nonewline "This will write to the logFile"
SEE ALSO
logOff
logOn - disables logging.
SYNOPSIS
logOff
DESCRIPTION
The logOff command is used to turn off logging.
STANDARD OPTIONS
None
EXAMPLE
logOff
SEE ALSO
logOn
logOn - enables logging.
SYNOPSIS
logOn filename
DESCRIPTION
The logOn command is used to turn on logging. The log file is configured with the command.
STANDARD OPTIONS
filename
The filename to log output under.
EXAMPLE
logOn "c:/program files/ixia/log.log"
SEE ALSO
mpexpr
mpexpr - performs arbitrary precision arithmetic
SYNOPSIS
mpexpr <expression>
DESCRIPTION
mpexpr works much like Tcl's native expr, but does all calculations using an arbitrary precision math package. mpexpr numbers can be any number of digits, with any decimal precision. Final precision is controlled by a Tcl variable mp_precision, which can be any reasonable integer, limiting only the number of digits to the right of the decimal point.
COMMAND
The mpexpr command should be used on all 64-bit values as marked in the citations below.
EXAMPLE
package require Mpexpr
set $::mp_precision 25
set y 42
set eExpY [mpexpr exp($y)]
puts [mpformat %f $eExpY]
SEE ALSO
showCmd
showCmd - show the current value of a TCL API command's values
SYNOPSIS
showCmd <TCL API command>
DESCRIPTION
showCmd is a very useful command that may be used to display the current value of a command's options. It may be typed into an interactive wish shell or included as a command in a TCL script.
COMMAND
showCmd command
command
The name of any of the command.
EXAMPLE
showCmd port
showCmd rprFairness
SEE ALSO
user
user - configure the user related parameters
SYNOPSIS
user sub-command options
DESCRIPTION
The user command is used to configure user related information. This information is used when the RFC2544, RFC 2285 and non-RFC tests are executed and results are produced. It helps in the identification of the user and used for reference.
STANDARD OPTIONS
comments
A comment associated with the test.
productname
Name of the DUT being tested.
version
Version number of the product.
serial#
Serial number of the product.
username
The name of the user running the tests.
COMMAND
The user command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
user cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the user command.
user config option value
Modify the configuration options of the user. If no option is specified, returns a list describing all of the available options (see STANDARD OPTIONS) for user.
user setDefault
Sets default values for all configuration options.
EXAMPLES
package require IxTclHal
user setDefault
user config -comments "Special XYZ test"
user config -productname "Super router 2000"
user config -version "0.1"
user config -serial# "1"
user config -username "QA Specialist 14"
ixPuts [user cget -productname]
INTERNAL
COMMANDS
The following commands are internal interfaces, for use only by Ixia. Use of these commands may produced undesirable results and are not guaranteed to be backward compatible in future releases:
exists, getHelp, getType, getValidRange, getValidValues, getValidateProc