capture

capture - configure the capture parameters on a port of a card on a chassis.

SYNOPSIS

capture sub-command options

DESCRIPTION

The capture command is used to configure the capture parameters and sets up the capture buffer. The afterTriggerFilter, beforeTriggerFIlter, captureMode, continuousFilter, fullAction and triggerPosition options are associated with the circular buffer feature which is only available on some card types. Refer to the Ixia Hardware Guide for a list of which modules support the features.

The capture process itself is started through the use of the portGroup setCommand startCapture command, or the ixStartCapture high-level command. The capture is stopped with the use of the portGroup setCommand stopCapture command, or the ixStopCapture high-level command, or a captureBuffer get command. That is, the act of reading the capture buffer stops the capture process. The high-level command, ixCheckTransmitDone, may be used to wait until all ports have finished transmitting.

STANDARD OPTIONS
afterTriggerFilter

Controls the capture of data after triggering when operating in triggered mode (captureMode = captureTriggerMode). Available option values are:

Option

Value

Usage

captureAfterTriggerAll

0

capture all data after trigger.

captureAfterTrigger

Filter

1

(default) capture filtered data after trigger using filter settings.

captureAfterTrigger

ConditionFilter

2

capture filtered data after trigger as per the filter settings.

beforeTriggerFilter

Controls the capture of data prior to triggering when operating in triggered mode (captureMode = captureTriggerMode). Available option values are:

Option

Value

Usage

captureBeforeTriggerAll

0

capture all databefore trigger.

captureBeforeTrigger

None

1

(default) capture none of the data before trigger.

captureBeforeTrigger

Filter

2

capture filtered data before trigger as per the filter settings.

captureMode

Controls whether data capture is performed in a continuous or triggered mode. Available option values are:

Option

Value

Usage

captureContinuous

Mode

0

capture data in the buffer continuously, regardless of trigger settings. Data may be filtered; see continuousFilter. When the buffer is full, begin storing new frames at the end of the buffer over-writing the previously stored frames.

captureTriggerMode

1

(default) capture data only after triggered. After the buffer is full, do not capture any more frames.

continuousFilter

Controls whether data captured in continous mode (captureMode = captureContinuousMode) is filtered or not. Available option values are:

Option

Value

Usage

captureContinuousAll

0

(default) capture all data, regardless of filter settings.

captureContinuousFilter

1

capture only filtered data, as per filter settings.

enableSmallPacket

Capture true/false

Applies to OC12 cards only. Capture of packets of 48 bytes or less at full wire rates can be problematic and is usually treated as an error. This setting allows packets of 48 bytes or less in length to be captured. The data captured, however, may be corrupt. (default = false)

fullAction

Used for LM100Tx boards only. Controls the action of the buffer when it reaches the full status. Available option values are:

Option

Value

Usage

lock

0

(default) after the buffer is full, do not capture any more frames

wrap

1

when the buffer is full, start storing the new frames at the beginning of the buffer over-writing the previously stored frames

nPackets

Read-only. Number of packets available or captured in the capture buffer.

sliceSize

The maximum number of octets of each frame that is saved in this capture buffer. For example, if a 1500 octet frame is received by the probe and this option is set to 500, then only 500 octets of the frame is stored in the associated capture buffer. If this option is set to 0, the capture buffer saves as many octets as is possible. If the sliceSize is set larger than the maximim hardware supported slice size, the maximum is used. (default = 8191)

triggerPosition

Controls the dividing line within the capture buffer between before trigger data and post trigger data. This control is only useful in triggered mode (captureMode = captureTriggerMode) and before trigger capture enabled (beforeTriggerFilter = captureBeforeTriggerAll or captureBeforeTriggerFilter). TriggerPosition is expressed as a percentage of the total buffer size. The beginning of the buffer with this percentage is used in a wrap-around mode for before trigger data and the remainder is filled up with triggered data. (default = 1.0)

DEPRECATED

STANDARD OPTIONS

COMMANDS

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

capture cget option

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

capture config option value

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

capture get chasID cardID portID

Gets the current configuration of the capture for port with id portID on card cardID, chassis chasID. from its hardware. Call this command before calling capture cget option value to get the value of the configuration option. In order for this command to succeed, the port must either be unowned, or you must be logged in as the owner of the port. Specific errors are:

capture set chasID cardID portID

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

capture setDefault

Sets to IxTclaldefault values for all configuration options.

capture write chasID cardID portID

Writes or commits the changes in IxHAL to hardware for the capture related parameters on port with id portID on card cardID, chassis chasID. Before using this command, use the capture set. Specific errors are:

EXAMPLES

package require IxTclHal

set host techpubs-400

set username user

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

# which must be running on the chassis

if [isUNIX] {

ixPuts "Could not connect to $host"

\\\\\\\\\\\\\\\\return 1

}

 

# Now connect t the chassis

if [ixConnectToChassis $host] {

ixPuts $::ixErrorInfo

return 1

}

# Get the chassis ID to use in port lists

set chas [ixGetChassisID $host]

# Assume that there's a four port 10/100 TXS card in this slot

# with port 1 looped to port 2

set card 1

set portlist [list [list $chas $card 1] [list $chas $card 2]]

set txPortList [list [list $chas $card 1]]

set rxPortList [list [list $chas $card 2]]

# 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}

# Reset Ports for Factory Defaults Stream Mode / Capture

port setFactoryDefaults $chas $card 1

port setFactoryDefaults $chas $card 2

port setDefault

if [port set $chas $card 1] {

ixPuts $::ixErrorInfo

return 1

}

if [port set $chas $card 2] {

ixPuts $::ixErrorInfo

return 1

}

# The number of frames to get in the capture buffer at one time

# It's better not to read all of the captured packets -

# It might be very large and take a good deal of time and memory

set frameSlice 4000

# Put the time in the outbound stream

stream setDefault

stream config -sa {00 de ad be ef 00}

stream config -da {00 ba be fa ce 00}

stream config -dma stopStream

stream config -numFrames 50000

stream config -fir true

if [stream set $chas $card 1 1] {

ixPuts $::ixErrorInfo

}

if [ixWritePortsToHardware portlist] {

ixPuts $::ixErrorInfo

return 1

}

 

# Wait for Link

after 1000

if [ixCheckLinkState portList] {

ixPuts $::ixErrorInfo

return 1

}

if [ixClearStats rxPortList] {

ixPuts $::ixErrorInfo

return 1

}

if [ixStartCapture rxPortList] {

ixPuts $::ixErrorInfo

return 1

}

if [ixStartTransmit txPortList] {

ixPuts $::ixErrorInfo

return 1}

if [ixCheckTransmitDone txPortList] {

ixPuts $::ixErrorInfo

return 1

}

if [ixStopCapture rxPortList] {

ixPuts $::ixErrorInfo

return 1

}

 

# Get the number of frames captured

if [capture get $chas $card 2] {

ixPuts $::ixErrorInfo

return 1

}

set numFrames [capture cget -nPackets]

ixPuts "$numFrames frames captured"

# Set up jitter calculation for 64 byte packets only

captureBuffer config -enableFramesize true

captureBuffer config -framesize 64

captureBuffer setConstraint {

ixPuts "Could not set captureBuffer constraints"

}

# Only look at the first $frameSlice frames

if {$numFrames > $frameSlice} {set numFrames $frameSlice}

ixPuts "Frame\tTime\t\tLatncy\tData"

 

# Go through all of the frames $frameSlice frames at a time

for {set frameNo 1} {$frameNo <= $numFrames} \

{incr frameNo $frameSlice} {

set lastFrame [expr $frameNo + $frameSlice - 1]

if {$lastFrame > $numFrames} {$lastFrame = $numFrames}

 

# Get the batch of frames

if [captureBuffer get $chas $card 2 $frameNo $lastFrame] {

ixPuts $::ixErrorInfo

return 1

}

set numCaptured [expr $lastFrame - $frameNo +1]

ixPuts "Average latency is [captureBuffer cget -averageLatency]"

# Go through each frame in the capture buffer starting at 1

for {set i 1} {$i < $numCaptured} {incr i} {

# Note that the frame number starts at 1

captureBuffer getframe $i

# Get the actual frame data

set data [captureBuffer cget -frame]

# We'll only look at the first bunch of bytes

set data [string range $data 0 50]

# Get timestamp and latency too

set timeStamp [captureBuffer cget -timestamp]set latency [captureBuffer cget -latency]

set status 'Bad'

ixPuts "Status is [format "%x" [captureBuffer cget -status]]"

if {[captureBuffer cget -status] & $::cap10100DpmGoodPacket} {

set status 'Good'

}

ixPuts -nonewline [expr $frameNo + $i - 1]

ixPuts -nonewline "\t$timeStamp"

ixPuts -nonewline "\t$latency"

ixPuts -nonewline "\t$status"

ixPuts "\t$data"

}

}

 

# 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

}

return 0

SEE ALSO

captureBuffer