udf

udf - configure the User-Definable Fields in the frames of a stream.

SYNOPSIS

udf sub-command options

DESCRIPTION

User-Definable Fields (UDFs) are counters that can be inserted anywhere in the frame whose data can be used to represent special purpose patterns. Each of the supported UDFs can be enabled or disabled and contain 8, 16, 24, or 32 bit counters.

The udf command is used to configure the UDF parameters on a stream of a port. It must be followed by a call to stream set.

Table UDFs are a type of UDF which allows multiple static values to be placed at multiple locations in a packet. Table UDFs are enabled and controlled by the tableUdf and tableUdfColumn commands.

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 is with respect to the beginning of the AAL5 packet and must be adjusted by hand to account for the header.

STANDARD OPTIONS
bitOffset

Sets the offset of the UDF (in bits). This must be a value from 0-7 and is only supported on certain cards in certain modes. If this is set to a nonzero value when it is not legal, a 'stream set' error is issued.

cascadeType

Indicates the source of the initial value for the counter. The initial value for the first enabled stream always comes from the initval option.

Option

Value

Usage

udfCascadeNone

0

(default) The initial value always comes from initval.

udfCascadeFromPrevious

1

The initial value is derived from the last executed stream which used this UDF number with cascadeType set to udfCascadeFromPrevious. An initial increment/decrement/random operation is applied from the previous value.

udfCascadeFromSelf

2

The initial value is derived from the last value generated by this UDF with this stream. An initial increment/decrement/random operation is applied from the previous value.

chainFrom

Select what UDF the current UDF should chain from. When this option is employed, the UDF stays in its initial value until the UDF it is chained from reaches its terminating value. Values: None, UDF1 through UDF5 depending on the number of UDFs available for the module, and excluding the UDF that is being configured.:

Option

Value

Usage

udfNone

0

(default)

udf1

1

chains from UDF1

udf2

2

chains from UDF2

udf3

3

chains from UDF3

udf4

4

chains from UDF4

udfI5

5

chains from UDF5

continuousCount
true/false

When set to true, the counter increments or decrements the bytes depending on the updown option. (default = false)

counterMode

The mode of operation of the counter. The following values can be specified for this option:

Option

Value

Usage

udfCounterMode

0

(default) Normal up-down counter as controlled by continuousCount, udfSize, initval, maskselect, maskval, random, repeat, step, updown and cascadeType.

udfRandomMode

1

Generates random values, based on the values in udfSize, maskselect and maskval

udfValueListMode

2

A list of distinct values, based on the values of udfSize, valueList and cascadeType.

udfNestedCounterMode

3

Two nested counters may be used to build complex sequences, based on the values of udfSize, initval, innerLoop, innerRepeat, innerStep, step, repeat and cascadeType.

udfRangeListMode

4

A list of value ranges, based on udfSize, cascadeType and ranges. Ranges must be added to the udf command using the addRange sub-command.

udfIPv4Mode

5

A counter which facilitates generation of IPv4 addresses, based on initval, innerRepeat, innerStep, continuousCount, repeat, enableSkipZerosAndOnes and skipMaskBits.

Not all modes are supported by all port types and not all modes are supported by all UDFs on a port. A stream set fails if any enabled UDF does not support a counterMode. The availability of a particular mode on a particular UDF can be checked with the port isValidFeature command.

countertype

Earlier values of countertype are still valid but on boards and modes that support it, countertype is deprecated in favor of udfSize.

Describes the size and shape of this UDF field. Each field consists of 4 8-bit counters; these counters may be configured as individual counters or in any combination, such as 2 8-bit counters & one 16 bit counter, 2 16-bit counters, or 1 32 bit counter. Note that every 8-bit counter within this field does not have to be used. The options available for this variable select the size (8, 16, 24 or 32 bits) and configuration; for example - if the option c8x8x8x8 is selected the counters is configured as 4 independent 8-bit counters. If the option config8x16 is selected, the counters is configured as one 8-bit counter, one 16-bit counter and the remaining 8-bits is unused. The following values can be specified for this option:

Option

Value

Usage

c8

0

(default) one 8-bit counter

c16

1

one 16 bit counter

c8x8

2

two 8-bit counters

c24

3

one 24-bit counter

c16x8

4

one 16-bit counter followed by a 8-bit counter

c8x16

5

one 8-bit counter followed by a 16-bit counter

c8x8x8

6

three 8-bit counters

c32

7

one 32-bit counter

c24x8

8

one 24-bit counter followed by a 8-bit counter

c16x16

9

two 16-bit counters

c16x8x8

10

one 16-bit counter followed by two 8-bit counters

c8x24

11

one 8-bit counter followed by a 24-bit counter

c8x16x8

12

one 8-bit counter followed by a 16-bit counter followed by another 8-bit counter

c8x8x16

13

two 8-bit counters followed by a 16-bit counter

c8x8x8x8

14

four 8-bit counters

enable true/false

If this option is set to true, then this UDF counter is inserted into the frame. (default = false)

enableCascade
true/false

If this option is set to true, then the UDF counter is not reset with the start of each stream, but rather continues counting from the ending value of the previous stream. (default = false)

enableIndexMode

If this option is set to true, the index mode is enabled.

enableKillBitMode

If this option is set to true, enables Kill Bit Mode.

killBitUDFSize

The Kill Bit UDF size.

enableSkipZeros
AndOnes

If counterMode is udfIPv4Mode and this option is set to true, then values of all 0's and all 1's as masked by skipMaskBits is skipped when generating values. This normally corresponds to network broadcast addresses. (default = false)

initval

The initial value of the counter. (default = {08 00})

The default value in Tcl is different than the default value in IxExplorer GUI.

innerLoop

The number of times the inner loop is repeated. Used when counterMode is set to udfNestedCounterMode. (default = 1)

valueRepeatCount

The repeat count for each valuelist udf entry.

innerRepeat

The number of times each value in the inner loop is repeated. Used when counterMode is set to udfNestedCounterMode. (default = 1)

innerStep

The steps size between inner loop values. Used when counterMode is set to udfNestedCounterMode. (default = 1)

linearCoefficientEnable

Enables the linear coefficient.

linearCoefficient

The linear coefficient value.

linearCoefficientLoop
Count0

The value of coefficient loop count is 0.

linearCoefficientLoop
Count2

The value of coefficient loop count is 2.

tripleNestedLoop0
Increment

The triple nested loop increment value is set to 0.

maskselect

This is a 32-bit mask that enables, on a bit-by-bit basis, use of the absolute counter value bits as defined by maskval option. (default = {00 00})

maskval

A 32-bit mask of absolute values for this UDF counter. It is used in association with the maskselect; bits must be set 'on' or the bits in maskselect is ignored. (default = {00 00})

offset

The absolute offset to insert this udf into the frame. Note that DA and SA use the fixed offsets at 0 and 6, respectively. This option applies to all counterModes. (default = 12)

random true/false

If this object is set to true, then this counter contains random data. The UDFs may not have part counter and part random data. (default = false)

repeat

The counter is incremented or decremented the number of times based on this option. If continuousCount option is set then this value is ignored. (default = 1)

skipMaskBits

If counterMode is udfIPv4Mode and enableSkipZerosAndOnes is set to true, this is the number of low order bits to check when looking for all 0's and all 1's. This normally corresponds to network broadcast addresses. (default = 8)

step

The step size for counter increment/decrement, if supported by the load module. (default = 1)

udfSize

Sets the UDF field size (in bits). This must be a value from 1-32 and is only supported on certain cards in certain modes. If this is set to a nonzero value when it is not legal, a 'stream set' error is issued.

updown

This option describes whether each of the 8-bit counters are to be incremented or decremented. If two or more counters are cascaded together as a larger counter (ie, 16,24 or 32-bit counter), that group of counters must all be incremented or decremented. Note that the most-significant byte selection takes precedence if there is a discrepancy. The possible values of this options are:

Option

Value

Usage

uuuu

15

(default) all bytes are incrementing

uuud

14

bytes 1,2 and 3 are incrementing and byte 4 is decrementing

uudu

13

bytes 1,2 and 4 are incrementing and byte 3 is decrementing

uudd

12

bytes 1 and 2 are incrementing and bytes 3 and 4 are decrementing

uduu

11

bytes 1,3 and 4 are incrementing and byte 2 is decrementing

udud

10

bytes 1 and 3 are incrementing and bytes 2 and 4 are decrementing

uddu

9

bytes 1 and 4 are incrementing and bytes 2 and 3 are decrementing

uddd

8

byte 1 is incrementing and bytes 2,3 and 4 are decrementing

duuu

7

byte 1 is decrementing and bytes 2,3 and 4 are incrementing

duud

6

bytes 1 and 4 are decrementing and bytes 2 and 3 are incrementing

dudu

5

bytes 1 and 3 are decrementing and bytes 2 and 4 are incrementing

dudd

4

bytes 1,3 and 4 are decrementing and byte 2 is incrementing

dduu

3

bytes 1 and 2 are decrementing and bytes 3 and 4 are incrementing

ddud

2

bytes 1,2 and 4 are decrementing and byte 3 is incrementing

dddu

1

bytes 1,2 and 3 are decrementing and byte 4 is incrementing

dddd

0

all bytes are decrementing

valueList

A list which holds the values to be used when counterMode is set to udfValueListMode. (default = {})

randomType

Select Random type: Random ( default), Random with seed or Random with starting value.

Value

Usage

0

(default) Random

1

Random with seed

2

Random with starting value

randomMinval

Minimum value for a random range ( default = 0)

randomMaxval

Maximum value for a random range (default = ff)

randomStartval

First value in a random range (default = 1)

randomSeed

Seed to generate random values ( default = ff ff ff ff)

skipUdfValue

If this option is enabled, the value configured by randomSkipval will not be included in the generated random values ( dafault = false).

Note: Skip udf setting is available on UDF1, UDF3, UDF5, UDF7 and UDF9.

randomSkipval

Value to be skipped ( default = 1).

skipSynchronization

If this option is enabled, even-numbered UDF will be paired with its master UDF ( UDF pairs are UDF1 and UDF2; UDF3 and UDF4; UDF5 and UDF6; UDF7 and UDF8, UDF9 and UDF10) ( default = false).

Note: This option is available on UDF2, UDF4, UDF6, UDF8 and UDF10.

DEPRECATED OPTIONS
countertype

Earlier values of countertype are still valid but on boards and modes that support it, countertype is deprecated in favor of udfSize.:

Option

Value

Usage

c8

0

(default) one 8-bit counter

c16

1

one 16 bit counter

c8x8

2

two 8-bit counters

c24

3

one 24-bit counter

c16x8

4

one 16-bit counter followed by a 8-bit counter

c8x16

5

one 8-bit counter followed by a 16-bit counter

c8x8x8

6

three 8-bit counters

c32

7

one 32-bit counter

c24x8

8

one 24-bit counter followed by a 8-bit counter

c16x16

9

two 16-bit counters

c16x8x8

10

one 16-bit counter followed by two 8-bit counters

c8x24

11

one 8-bit counter followed by a 24-bit counter

c8x16x8

12

one 8-bit counter followed by a 16-bit counter followed by another 8-bit counter

c8x8x16

13

two 8-bit counters followed by a 16-bit counter

c8x8x8x8

14

four 8-bit counters

COMMANDS

The udf command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.

udf addRange

Used when counterMode is set to udfRangeListMode. Adds the values in initVal, repeat and step to the list of values associated with the UDF. Ranges added to the range list are given an index starting at 1; this is used in the getRange sub-command. Specific errors are:

udf cget option

Returns the current value of the configuration option given by option. Option may have any of the values accepted by the udf command.

udf clearRangeList

Clears all values in the range list associated with the UDF.

udf config option value

Modify the configuration options of the port. If no option is specified, returns a list describing all of the available options (see STANDARD OPTIONS) for port.

udf get udfID

After using stream get command, this command gets the UDF with id udfID.

udf getFirstRange

Finds the first range in the range list and places the values in initval, repeat and step. Specific errors are:

udf getNextRange

Finds the next range in the range list and places the values in initval, repeat and step. getFirstRange must have been called before this call. Specific errors are:

udf getRange rangeIndex

Finds the range in the range list with index rangeIndex and places the values in initval, repeat and step. Specific errors are:

udf set udfID

Sets the configuration of the UDF with ID udfID by reading the configuration option values set by the udf config option value command. stream set must be called after setting this UDF.

Note: The command stream setDefault also overwrites the udf set command.

udf setDefault

Sets to IxTclHal default values for all configuration options.

EXAMPLES

package require IxTclHal

# Connect to chassis and get chassis ID

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 i[ixGetChassisID $host]

# Assume card 4 has a TXS4, with every UDF function

set card 68

set port 1

set portList [list [list $chas $card $port]]

# 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

}

# Make sure the port is at factory default

port setFactoryDefaults $chas $card $port

stream setDefault

# UDF 3: normal counter mode, 8 bits counting up continuously

# from 0

udf setDefault

udf config -enable true

udf config -offset 12

udf config -udfSize c8

udf config -counterMode udfCounterMode

udf config -continuousCount true

udf config -updown uuuu

udf config -initval 00

# Set UDF 3

udf set 3

# UDF 1: 24-bits at offset 12 in packet

# Two ranges: start = 0x4200, increment by 14, repeat 100

# start = 0x100000, increment by 100, repeat 2

# Remove all existing range list items

udf clearRangeList

udf setDefault

udf config -enable true

udf config -counterMode udfRangeListMode

udf config -offset 12

udf config -udfSize c24

udf config -initval {00 00 42 00}

udf config -repeat 100

udf config -step 14

# Add the range to the UDF

udf addRange

udf config -initval {00 10 00 00}

udf config -repeat 2

udf config -step 100

# Add the second range to the UDF

udf addRange

# Set UDF 1

udf set 1

# UDF 2: 8-bits at offset 12 in packet

# Value list mode. Values are: 0x01, 0x10, 0x42

udf setDefault

udf config -enable true

udf config -counterMode udfValueListMode

udf config -offset 12

udf config -udfSize c8

udf config -valueList { { 00 00 00 01 } \

{ 00 00 00 10 } \

{ 00 00 00 42 } }

# Set UDF 2

udf set 2

#UDF4: 16 bits at offset 12

# Nested counters: Outer: start at 0x0100, step by 10,

# repeat 100 times

# Inner: repeat each value 2 times,

# step by 4, repeat 3 times

udf setDefault

udf config -enable true

udf config -offset 12

udf config -udfSize c16

udf config -counterMode udfNestedCounterMode

udf config -initval {01 00}

udf config -repeat 100

udf config -step 10

udf config -innerRepeat 2

udf config -innerStep 4

udf config -innerLoop 3

# Set UDF 4

udf set 4

# Make sure to use stream set to set the UDFs

stream set $chas $card $port 1

ixWriteConfigToHardware portList

# 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

}

SEE ALSO

stream, tableUdf, tableUdfColumn