mpls

mpls - configure the MPLS parameters for a port on a card on a chassis

SYNOPSIS

mpls sub-command options

DESCRIPTION

The mpls command is used to configure the MPLS information when building MPLS labeled packets. See draft-ietf-mpls-arch-06.txt "work in progress" for a complete definition of MPLS label fields. Note that stream get must be called before this command's get sub-command.

STANDARD OPTIONS
enableAutomaticallySetLabel true/false

Sets MPLS to automatically set the label values. (default = true)

forceBottomOfStack true/false

Automatically sets bottom of the stack bit. (default = true)

type

Sets the MPLS type. Options include:

Option

Value

Usage

mplsUnicast

0

(default)

mplsMulticast

1

 

COMMANDS

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

mpls cget option

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

mpls config option value

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

mpls decode capFrame [chasID cardID portID]

Decodes a captured frame in the capture buffer and updates TclHal. mpls cget option command can be used after decoding to get the option data. Specific errors are:

mpls get chasID cardID portID

Gets the current MPLS configuration of the port with id portID on card cardID, chassis chasID. Note that stream get must be called before this command's get sub-command. Call this command before calling mpls cget option to get the value of the configuration option. Specific errors are:

mpls set chasID cardID portID

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

mpls setDefault

Sets to IxTclHal default values for all configuration options.

EXAMPLES

package require IxTclHal

 

# Connect to chassis and get chassis ID

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]

 

set card 1

set txPort 1

set rxPort 2

 

# Useful port lists

set portList [list [list $chas $card $txPort] \

[list $chas $card $rxPort]]

 

# 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 Transmit Port

 

# Nothing special about the ports

port setFactoryDefaults $chas $card $txPort

port setDefault

port set $chas $card $txPort

port set $chas $card $rxPort

 

# Stream: 10 packets

stream setDefault

stream config -numFrames 10

stream config -dma stopStream

#stream config -percentPacketRate 100

#stream config -rateMode usePercentRate

 

protocol setDefault

protocol config -ethernetType ethernetII

protocol config -enableMPLS true

 

# Setup up two mpls labels

mpls setDefault

mpls config -type mplsUnicast

 

mplsLabel setDefault

mplsLabel config -label 128

mplsLabel config -bottomOfStack false

mplsLabel set 1

 

mplsLabel config -label 256

mplsLabel config -bottomOfStack true

mplsLabel set 2

 

mpls set $chas $card $txPort

 

stream set $chas $card $txPort 1

 

# Commit to hardware

ixWritePortsToHardware portList

 

# Make sure link is up

after 1000

ixCheckLinkState portList

ixStartPortCapture $chas $card $rxPort

 

# Clear stats and transmit MPLS labeled frames

ixClearStats portList

ixStartPortTransmit $chas $card $txPort

 

# 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, protocol, mplsLabel.