filter

filter - configure the filters of a port of a card on a chassis.

SYNOPSIS

filter sub-command options

DESCRIPTION

The filter command is used to configure the filters and capture triggers for receiving frames on a port of a card. The incoming frames can be filtered on a combination of varying constraints, such as destination or source address, pattern matching or specific error conditions.

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
asyncTrigger1DA

true/false

Enables or disables User Defined Statistics counter 5 to filter on the destination MAC addresses. (default = false)

asyncTrigger1Enable true/false

Enables or disables User Defined Statistics counter 5 that counts the number of frames filtered. To use this counter the stat mode has to be set to statStreamTrigger. (default = false)

asyncTrigger1Error true/false

Enables or disables User Defined Statistics counter 5 filter on the errored frames. (default = false)

asyncTrigger1Frame

SizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to filter for User Defined Statistics counter 5. (default = false)

asyncTrigger1Frame

SizeFrom

The minimum range of the size of frame to be filtered for User Defined Statistics counter 5. Applicable only when asyncTrigger1FramesizeEnable is set to true. (default = 64)

asyncTrigger1Frame

SizeTo

The maximum range of the size of frame to be filtered for User Defined Statistics counter 5. Applicable only when asyncTrigger1FramesizeEnable is set to true. (default = 1518)

asyncTrigger1Pattern true/false

Enables or disables User Defined Statistics counter 5 to filter on the pattern. (default = false)

asyncTrigger1SA

true/false

Enables or disables User Defined Statistics counter 5 to filter on the source MAC addresses. (default = false)

asyncTrigger2DA

true/false

Enables or disables User Defined Statistics counter 6 to filter on the destination MAC addresses. (default = false)

asyncTrigger2Enable true/false

Enables or disables User Defined Statistics counter 6 that counts the number of frames filtered. (default = false) To use this counter the stat mode has to be set to statStreamTrigger.

asyncTrigger2Error

Enables or disables User Defined Statistics counter 6 filter on the errored frames. (default = false)

asyncTrigger2Frame

SizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to filter for User Defined Statistics counter 6. (default = false)

asyncTrigger2Frame

SizeFrom

The minimum range of the size of frame to be filtered for User Defined Statistics counter 6. Applicable only when asyncTrigger1FramesizeEnable is set to true. (default = 64)

asyncTrigger2Frame

SizeTo

The maximum range of the size of frame to be filtered for User Defined Statistics counter 6. Applicable only when asyncTrigger1FramesizeEnable is set to true. (default = 1518)

asyncTrigger2Pattern true/false

Enables or disables User Defined Statistics counter 6 to filter on the pattern. (default = false)

asyncTrigger2SA

true/false

Enables or disables User Defined Statistics counter 6 to filter on the source MAC addresses. (default = false)

captureFilterDA

One of two available destination MAC addresses to filter on. Applicable only when capturefilternable is set to true. The possible values are:

Option

Value

Usage

anyAddr

0

(default) disables the destination address filter constraint

addr1

1

sets the destination address filter constraint to trigger on frames with a destination MAC address that matches DA1and DA1mask as specified in the filter palette

-notAddr1

2

sets the destination address filter constraint to trigger on all frames except those with a destination MAC address that matches DA1 and DA1 mask as specified in the filter palette

addr2

3

sets the destination address filter constraint to trigger on frames with a destination MAC address that matches DA2 and DA2mask as specified in the filter palette

notAddr2

4

sets the destination address filter constraint to trigger on all frames except those with a destination MAC address that matches DA2 and DA2 mask as specified in the filter palette

captureFilterEnable true/false

Enables or disables the capture filter. (default = false)

captureFilterError

Applicable only when captureFilterEnable is set to true. The possible values are:

Option

Value

Usage

errAnyFrame

0

(default) disables the error filter constraint

errGoodFrame

1

sets the error filter constraint to trigger when frames with no errors are received

errBadCRC

2

sets the error filter constraint to trigger when frames with bad CRC errors are received

errBadFrame

3

sets the error filter constraint to trigger when corrupted frames are received

errAlign

4

sets the error filter constraint to trigger when frames with alignment errors are received (10/100 only)

errDribble

5

sets the error filter constraint to trigger when frames with dribble errors are received (10/100 only)

errBadCRCAlignDribble

5

sets the error filter constraint to trigger when frames with bad CRC, alignment error or dribble errors are received (10/100 only)

errLineError

4

sets the error filter constraint to trigger when frames with line errors are received (gigabit only)

errLineAndBadCRC

5

sets the error filter constraint to trigger line errors and bad CRC are received (gigabit only)

errLineAndGoodCRC

6

sets the error filter constraint to trigger when frames with line errors and bad CRC are received (gigabit only)

errAnySequenceError

4

sets the error filter constraint to trigger when any of the next three conditions are true

errSmallSequenceError

5

sets the error filter constraint to trigger when the current sequence number minus the previous sequence number is less than or equal to the error threshold and not negative, or when the current sequence number is equal to the previous sequence number

errBigSequenceError

6

sets the error filter constraint to trigger when the current sequence number minus the previous sequence number is greater than the error threshold

errReverseSequenceError

7

sets the error filter constraint to trigger when the current sequence number is less than the previous sequence number

errDataIntegrityError

8

sets the error filter constraint to trigger when any data integrity error is detected

errGfpErrors

9

sets the error filter constraint to trigger when any GFP error is detected. The particular errors that are used are controlled by options of the filterPallette command.

errCdlErrors

10

sets the error filter constraint to trigger when any CDL preamble error is detected

errFcoeInvalidFrame

12

sets the error filter constraint to trigger when any FCoE invalid frame error is detected

errAnyIpTcpUdpChecksumError

13

sets the error filter to trigger and filter on any Ip/Tcp/Udp checksum error

captureFilterFrame

SizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to filter. (default = false)

captureFilterFrame

SizeFrom

Applicable only when captureFilterFrameSizeEnable is enabled. The minimum range of the size of frame to be filtered. (default = 64)

captureFilterFrame

SizeTo

Applicable only when captureFilterFrameSizeEnable is enabled. The maximum range of the size of frame to be filtered. (default = 1518)

captureFilterPattern

Applicable only when captureFilterEnable is set to true. The possible values are:

Option

Value

Usage

anyPattern

0

(default) disables the pattern filter constraint

pattern1

1

sets the pattern filter constraint to trigger on frames with a pattern that matches pattern1and patternMask1 at offset patternOffset1 as specified in the filter palette

notPattern1

2

sets the pattern filter constraint to trigger on frames except those with a pattern that matches pattern1and patternMask1 at offset patternOffset1 as specified in the filter palette

pattern2

3

sets the pattern filter constraint to trigger on frames with a pattern that matches pattern2 and patternMask2 at offset patternOffset2 as specified in the filter palette

notPattern2

4

sets the pattern filter constraint to trigger on frames except those with a pattern that matches pattern2and patternMask2 at offset patternOffset2 as specified in the filter palette

pattern1AndPattern2

5

sets the pattern filter constraint to trigger on frames with a pattern that matches pattern1, pattern2 and patternMask1, patternMask2 at offset patternOffset1 and patternOffset2 as specified in the filter palette

captureFilterSA

One of two available destination MAC addresses to filter on. Applicable only when capturefilternable is set to true. The possible values are:

Option

Value

Usage

anyAddr

0

(default) disables the destination address filter constraint

addr1

1

sets the destination address filter constraint to trigger on frames with a destination MAC address that matches SA1and DA1mask as specified in the filter palette

notAddr1

2

sets the destination address filter constraint to trigger on all frames except those with a destination MAC address that matches SA1 andSA1 mask as specified in the filter palette

addr2

3

sets the destination address filter constraint to trigger on frames with a destination MAC address that matches SA2 and SA2mask as specified in the filter palette

notAddr2

4

sets the destination address filter constraint to trigger on all frames except those with a destination MAC address that matches SA2 and SA2 mask as specified in the filter palette

captureTriggerDA

One of two available destination MAC addresses to filter on. Applicable only when captureTriggerEnable is set to true. The possible values are as in capturefilteredA. (default = 0)

captureTriggerEnable true/false

Enables or disables the capture trigger. (default = false)

captureTriggerError

Applicable only when captureTriggerEnable is set to true. The possible values are as in capturefilterrror. (default = 0)

captureTriggerFrame

SizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to trigger. (default = false)

captureTriggerFrame

SizeFrom

Applicable only when captureTriggerFrameSizeEnable is enabled. The minimum range of the size of frame to be triggered. (default = 64)

captureTriggerFrame

SizeTo

Applicable only when captureTriggerFrameSizeEnable is enabled. The maximum range of the size of frame to be triggered. (default = 1518)

captureTriggerPattern

Applicable only when captureTriggerEnable is set to true. The possible values are as in captureFilterPattern. (default = 0)

captureTriggerSA

One of two available source MAC addresses to filter on. Applicable only when captureTriggerEnable is set to true. The possible values are as in captureFilterSA. (default = 0)

enableCircuitList

true/false

Use the circuit list for filtering. (default = false)

userDefinedStat1DA

One of two available destination MAC addresses to filter on. Applicable only when userDefinedStat1Enable is set to true. The possible values are as in capturefilteredA. (default = 0)

userDefinedStat1

Enable true/false

Enables or disables the User Defined Statistics counter 1 that counts the number of frames filtered. (default = false)

userDefinedStat1Error

Applicable only when userDefinedStat1Enable is set to true. The possible values are as in capturefilterrror. (default = 0)

userDefinedStat1FrameSizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to count. (default = false)

userDefinedStat1FrameSizeFrom

Applicable only when userDefinedStat1FrameSizeEnable is enabled. The minimum range of the size of frame to be counted. (default = 64)

userDefinedStat1FrameSizeTo

Applicable only when userDefinedStat1FrameSizeEnable is enabled. The maximum range of the size of frame to be counted. (default = 1518)

userDefinedStat1

Pattern

Applicable only when userDefinedStat1Enable is set to true. The possible values are as in captureFilterPattern. (default = 0)

userDefinedStat1SA

One of two available source MAC addresses to filter on. Applicable only when userDefinedStat1Enable is set to true. The possible values are as in captureFilterSA. (default = 0)

userDefinedStat2DA

One of two available destination MAC addresses to filter on. Applicable only when userDefinedStat2Enable is set to true. The possible values are as in capturefilteredA. (default = 0)

userDefinedStat2

Enable true/false

Enables or disables User Defined Statistics counter 2 that counts the number of frames filtered. (default = false)

userDefinedStat2Error

Applicable only when userDefinedStat2Enable is set to true. The possible values are as in capturefilterrror. (default = 0)

userDefinedStat2FrameSizeEnable true/false

Enables or disables the frame size constraint which specifies a range of frame sizes to count. (default = false)

userDefinedStat2FrameSizeFrom

Applicable only when userDefinedStat2FrameSizeEnable is enabled. The minimum range of the size of frame to be counted. (default = 64)

userDefinedStat2FrameSizeTo

Applicable only when userDefinedStat2FrameSizeEnable is enabled. The maximum range of the size of frame to be counted. (default = 1518)

userDefinedStat2

Pattern

Applicable only when userDefinedStat2Enable is set to true. The possible values are as in captureFilterPattern. (default = 0)

userDefinedStat2SA

One of two available source MAC addresses to filter on. Applicable only when userDefinedStat2Enable is set to true. The possible values are as in captureFilterSA. (default = 0)

DEPRECATED OPTIONS
captureFilterError

The following captureFilterError options have been deprecated:

Option

Value

Usage

errUndersize

7

sets the error filter constraint to trigger when undersized frames (less than 64 bytes) are received

errOversize

8

sets the error filter constraint to trigger when oversized frames (greater than 1518 bytes) are received

errFragment

9

sets the error filter constraint to trigger when fragmented frames are received

COMMANDS

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

filter cget option

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

filter config option value

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

filter get chasID cardID portID

Gets the current configuration of the filter for port with id portID on card cardID, chassis chasID. from its hardware. Call this command before calling filter cget option value to get the value of the configuration option. Specific errors are:

filter set chasID cardID portID

Sets the configuration of the filter in IxHAL for port with id portID on card cardID, chassis chasID by reading the configuration option values set by the filter config option value command. Specific errors are:

filter setDefault

Sets to IxTclHal default values for all configuration options.

EXAMPLES

package require IxTclHal

# In this example we will generate a range of packets with different frame sizes, DA/SA and

#data pattern in order to demonstrate how a directly attached port can collect specific

# statistics and trigger/filter on contents

set tclserver solarsystem

set host galaxy

set username user

# Check if we are running on UNIX - connect to the TCL Server

# Note: it is better to run the TCL Server on a pc other than your chassis, as it could

# potentially use up resources that the chassis needs.

if [isUNIX] {

if {[ixConnectToTclServer $tclserver]} {

errorMsg "Could not connect to TCL Server $tclserver"

return 1

}

}

 

# Now connect to the chassis

if {[ixConnectToChassis $host]} {

errorMsg $::ixErrorInfo

return $::TCL_ERROR

}

 

# 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

ixLogin $username

 

# Take ownership of the ports to use

if {[ixTakeOwnership $portList]} {errorMsg "Error taking ownership"

return $::TCL_ERROR

}

 

# Configure each port to factory defaults first, then configure the streams.

if {[setFactoryDefaults portList]} {

errorMsg "Error - setFactoryDefaults failed"

return $::TCL_ERROR

}

 

# Commit the port's phy configuration to hardware, then check the link state to make sure you

# come up in the proper speed setting. This may affect the stream rate for later

#configuration options.

ixWritePortsToHardware portList

ixCheckLinkState portList

 

# Configure the stream on the transmit port.

set streamId 1

 

stream setDefault

stream config -numFrames 100000

stream config -dma stopStream

stream config -frameSizeType sizeRandom

stream config -sa {00 00 00 01 01 01}

stream config -saRepeatCounter contIncrement

stream config -saMaskSelect {FF FF FF FC FC FC}

stream config -da {00 00 00 01 01 02}

stream config -daRepeatCounter contIncrement

stream config -daMaskSelect {FF FF FF FC FC FC}

if {[stream set $chas $card $txPort $streamId]} {

errorMsg "Error - stream set $chas $card $txPort $streamId failed"

return $::TCL_ERROR

}

 

# Configure the filters on the receive port.

filter setDefault

filter config -captureTriggerDA addr1

filter config -captureTriggerSA addr1

filter config -captureTriggerEnable true

filter config -captureFilterPattern pattern1

filter config -captureFilterFrameSizeEnable true

filter config -captureFilterFrameSizeFrom 128

filter config -captureFilterFrameSizeTo 1024

filter config -captureFilterEnable true

filter config -userDefinedStat1Enable true

filter config -userDefinedStat2Enable true

filter config -userDefinedStat1DA addr1

filter config -userDefinedStat2SA addr1

if {[filter set $chas $card $rxPort]} {

errorMsg "Error - filter set $chas $card $rxPort failed"

return $::TCL_ERROR

}

 

filterPallette setDefault

filterPallette config -DA1 {00 00 00 01 01 02}

filterPallette config -SA1 {00 00 00 01 01 01}

filterPallette config -pattern1 {02 02}

filterPallette config -patternMask1 {02 02}

if {[filterPallette set $chas $card $rxPort]} {

errorMsg "Error - filterPallette set $chas $card $rxPort failed"

return $::TCL_ERROR

}

 

# Here, we are committing just the stream and filter configuration. Because the PHY has

#already been configured, link state will not be affected.

ixWriteConfigToHardware portList

 

ixClearStats portList

ixStartPortCapture $chas $card $rxPort

ixStartPortTransmit $chas $card $txPort

# This delay is to allow the port to transmit for a little while before reading the stats.

after 1000

 

# This is a blocking call and will not return until transmit is complete.

ixCheckPortTransmitDone $chas $card $txPort

ixStopPortCapture $chas $card $rxPort

 

# Here you may retrieve the stats for both tx and rx ports at the same time, then compare.

ixRequestStats portList

 

# Retreive the total number of transmitted frames from the tx port.

if {[statList get $chas $card $txPort]} {

errorMsg "Error - statList get $chas $card $txPort failed"

return $::TCL_ERROR

}

set framesSent [statList cget -framesSent]

 

# Since we configured the capture filters to use the UDS stats, get them to compare to the

# transmit stats later on.

if {[statList get $chas $card $rxPort]} {

errorMsg "Error - statList get $chas $card $rxPort failed"

return $::TCL_ERROR

}

 

set userStat1 [statList cget -userDefinedStat1]

set userStat2 [statList cget -userDefinedStat2]

set triggered [statList cget -captureTrigger]

 

if {[capture get $chas $card $rxPort]} {

errorMsg "Error - capture get $chas $card $rxPort failed"

return $::TCL_ERROR

}

 

set captured [capture cget -nPackets]

ixPuts "frames sent: $framesSent"

ixPuts "$captured captured, $triggered triggered"

ixPuts "stat1 = $userStat1, stat2 = $userStat2"

 

# Let go of the ports that were reserved.

ixClearOwnership $portList

# Disconnect from the chassis in use.

ixDisconnectFromChassis $host

 

# If we are running on UNIX, disconnect from the TCL Server.

if [isUNIX] {

ixDisconnectTclServer $tclserver

}

# This will cleanup any remaining memory, connections, etc. and should be called at the end

#of all scripts.

cleanUp

SEE ALSO

filterPallette