forcedCollisions

forcedCollisions - configure the forced collision parameters for 10/100 ports

SYNOPSIS

forcedCollisions sub-command options

DESCRIPTION

The forcedCollisions command is used to configure the forced collision parameters for 10/100Mbit ports. Forced collisions cause deliberate collisions for specified duty cycles.

STANDARD OPTIONS
collisionDuration

The duration of each collision, measured in nibbles. (default = 10)

consecutiveCollisions

The number of consecutive collisions to generate at a time. Collisions take place on the first received packet after enabled. (default = 4)

consecutive

Non-CollidingPackets

After each time that the number of programmed consecutive collisions have occurred this is the number of packets that is not modified. (default = 4)

continuous

true / false

If true, the pattern of collisions and non-collisions is repeated indefinitely. (default = true)

enable true / false

Enables the generation of forced collisions. (default = false)

packetOffset

The offset from the beginning of packet active carrier sense (the beginning of the preamble) to the start of the collision, measured in nibbles. (default = 64)

repeatCount

If continuous operation is not selected, this value is the number of times that the pattern of collisions/non-collisions is repeated. (default = 2)

COMMANDS

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

forcedCollisions cget option

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

forcedCollisions config option value

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

forcedCollisions get chasID cardID portID

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

forcedCollisions set chasID cardID portID

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

forcedCollisions setDefault

Sets to IxTclHal default values for all configuration options.

EXAMPLES

package require IxTclHal

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 that card 1 is a 10/100 card

set card 1

set portA 1

set portB 2

# Set up mapping

map new -type one2one

map config -type one2one

map add $chas $card $portA $chas $card $portB

map add $chas $card $portB $chas $card $portA

set portList [list [list $chas $card $portA] [list $chas $card $portB]]

# 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

}

# Set up both ports to 10Mbps and half duplex

port setDefault

port config -autonegotiate false

port config -duplex half

port config -speed 10

port set $chas $card $portA

port set $chas $card $portB

 

# Configure forced collisions

forcedCollisions setDefault

forcedCollisions config -enable 1

forcedCollisions config -consecutiveNonCollidingPackets 9

forcedCollisions set $chas $card $portA

forcedCollisions set $chas $card $portB

 

# Make the collision backoff algorithm try harder

collisionBackoff setDefault

collisionBackoff config -maxRetryCount 32

collisionBackoff set $chas $card $portA

collisionBackoff set $chas $card $portB

 

# Configure the streams to transmit at 50%

stream setDefault

stream config -percentPacketRate 50

stream config -rateMode usePercentRate

stream config -dma stopStream

stream config -numFrames 10000

stream set $chas $card $portA 1

stream set $chas $card $portB 1

 

# Write config to hardware, check the link state and clear statistics

# Error checking omitted for brevity

ixWritePortsToHardware one2oneArray

after 1000

ixCheckLinkState one2oneArray

ixClearStats one2oneArray

 

# Start collisions

ixStartCollisions one2oneArray

# Make sure that ports don't attempt to transmit at the same instant

ixStartStaggeredTransmit one2oneArray

 

ixCheckTransmitDone one2oneArray

 

ixCollectStats $portList collisions rxStats totals

ixPuts "$totals total collisions, port 1 = $rxStats(1,1,1), port 2 = $rxStats(1,1,2)"

 

# 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

portGroup