All Classes Namespaces Files Functions Pages
Tx.Stream Class Reference

A ByteBlower stream is an object representing a stream of ByteBlower frames (Frame) used for transmission on a ByteBlower port. More...

Methods

 Counters.Brief.Get
 Returns a short list of values for the frames currently transmitted. More...
 
 Counters.Clear
 Resets the counter values to zero. More...
 
 Counters.SizeDistribution.Get
 Returns an extended list of values. More...
 
 Description.Get
 Returns a textual description of the object.
 
 ErrorStatus.Get
 Returns error status information. More...
 
 Frame.Add
 Adds a frame to the stream. More...
 
 Frame.Get
 Returns list of frames on this stream. More...
 
 InitialTimeToWait.Get
 Returns the time to wait before the first frame will be sent. More...
 
 InitialTimeToWait.Set duration
 Sets a delay before sending the first frame. More...
 
 InterFrameGap.Get
 Returns the inter-frame gap for the stream. More...
 
 InterFrameGap.Set duration
 Sets the inter-frame gap for the stream. More...
 
 Modifier.Frame.Get
 Returns the active frame modifier. More...
 
 Modifier.Frame.Set type
 Sets a frame modifier. More...
 
 Modifier.Timing.Get
 Returns the active timing modifier. More...
 
 Modifier.Timing.Set type
 Sets a timing modifier. More...
 
 NumberOfFrames.Get
 Gets the current burstcount of a stream. More...
 
 NumberOfFrames.Set count
 Sets the burst count of a stream. More...
 
 Parent.Get
 Returns the parent object.
 
 Result.Clear
 Resets the current result counters to zero and empties the Result.History. More...
 
 Result.Get
 Returns the current result counters. More...
 
 Result.History.Get
 Returns the current History counters. More...
 
 Start
 Starts the stream. More...
 
 Status.Get
 Returns status information. More...
 
 Stop
 Stops the stream. More...
 

Class overview

A ByteBlower stream is an object representing a stream of ByteBlower frames (Frame) used for transmission on a ByteBlower port.

A ByteBlower stream contains the following data:

Frames
A list of Frame objects
NumberOfFrames
The number of frames the stream should transmit
InterFrameGap
The inter frame gap between 2 transmitted frames
InitialTimeToWait
An initial time to wait, if needed
TimingModifier
A timing modifier
Example

This example will show a typical stream usage flow.

1 set stream [ $port Tx.Stream.Add ] set frame [ $stream Frame.Add ] $frame Bytes.Set 0001020304050607000102030405060700010203040506070001020304050607000102030405060700010203040506070001020304050607
2 configure the stream to send 10 frames per second
3 
4 $stream InterFrameGap.Set 100ms
5 configure the stream to send 100 frames
6 
7 $stream NumberOfFrames.Set 100
8 
9 $stream Start
10 Since the stream will send 100 frames at 10 fps, the stream will
11 send traffic for about 10 seconds (10000 ms)
12 
13 after 10000
14 A call to Stop is not necessary, but added for completeness
15 
16 $stream Stop
17 
18 set result [ $stream Result.Get ] return $result

Returns:

<Tx.Stream.ResultSnapshot object> 

Definition at line 24468 of file api.tcl.

Method documentation

Tx.Stream::Counters.Brief.Get

Returns a short list of values for the frames currently transmitted.

Deprecated:
Use Result.Get to retrieve the total transmission counters. Result.History.Get will return the history total counters for this stream. If you want the transmission count for each type of frame, you must use the method Frame::Result.Get. This will return a Tx.Frame.ResultSnapshot object containing its transmission-counters for this frame.
Example
1 $stream Counters.Brief.Get

Returns:

NrOfFramesSent 12 Frame_1 4 Frame_2 8 

Definition at line 24480 of file api.tcl.

Tx.Stream::Counters.Clear

Resets the counter values to zero.

Deprecated:
Use Result.Clear to reset the counter values

Definition at line 24488 of file api.tcl.

Tx.Stream::Counters.SizeDistribution.Get

Returns an extended list of values.

Deprecated:
The transmission sizeDistribution is only useful when there is a modifier. Therefore you can use the method Result.Get on a FrameModifier.
Example
1 $stream Counters.SizeDistribution.Get

Returns:

NrOfFramesSent 3 Frame_1 [ NrOfFrames 3 NrOfFramesPerSize [ 100 1 101 2 ] ] 

Definition at line 24500 of file api.tcl.

Tx.Stream::ErrorStatus.Get

Returns error status information.

Deprecated:
Use Status.Get instead
Returns
An enumeration which represents the error status
None
no error occurred
OutOfResources
The stream went out of resources.

Definition at line 24515 of file api.tcl.

Tx.Stream::Frame.Add

Adds a frame to the stream.

Example

This example adds a frame to a stream.

1 $stream Frame.Add

Returns:

<Frame object> 

Definition at line 24525 of file api.tcl.

Tx.Stream::Frame.Get

Returns list of frames on this stream.

Example

This example lists the frames of a stream.

1 $stream Frame.Get

Returns:

[ <Frame object> ... ] 

Definition at line 24535 of file api.tcl.

Tx.Stream::InitialTimeToWait.Get

Returns the time to wait before the first frame will be sent.

Returns
The initial time to wait in nanoseconds.
Example

This example gets the current initial time to wait from a stream.

1 $stream InitialTimeToWait.Get

Returns:

9000000000 

This stream will thus wait 9s before transmitting the first frame

Definition at line 24547 of file api.tcl.

Tx.Stream::InitialTimeToWait.Set   duration  

Sets a delay before sending the first frame.

Parameters
durationThe amount of time to wait before sending the first frame.
ns
nanoseconds
us
microseconds
ms
milliseconds
s
seconds
Default: ns
Example

This example sets the initial time to wait before sending the first frame.

1 $stream InitialTimeToWait.Set 9ms

Definition at line 24559 of file api.tcl.

Tx.Stream::InterFrameGap.Get

Returns the inter-frame gap for the stream.

Returns
The inter-frame gap is returned in nanoseconds.
Example

This example gets the inter-frame gap of a stream.

1 $stream InterframeGap.Get

Returns:

10000 

Definition at line 24571 of file api.tcl.

Tx.Stream::InterFrameGap.Set   duration  

Sets the inter-frame gap for the stream.

Parameters
durationA time unit can be specified as a suffix. E.g: 20ms. If no time unit is specified then nanoseconds are used.
ns
nanoseconds
us
microseconds
ms
milliseconds
s
seconds
Default: ns
Example

This example sets the inter-frame gap on a stream.

1 $stream InterframeGap.Set 10us

Definition at line 24583 of file api.tcl.

Tx.Stream::Modifier.Frame.Get

Returns the active frame modifier.

Deprecated:
Since 2.3.0, please use Frame::Modifier.Size.Growing.Get and Frame::Modifier.Size.Random.Get
Returns
The current frame modifier.
growing
A StreamModifier.GrowingSize object.
random
A StreamModifier.RandomSize object.

Definition at line 24593 of file api.tcl.

Tx.Stream::Modifier.Frame.Set   type  

Sets a frame modifier.

Deprecated:
Since 2.3.0, please use the Frame::Modifier.Size.Growing.Set and Frame::Modifier.Size.Random.Set
Parameters
typeThe modifier type to set.
none
Removes current modifier
growing
Grow frame size over time
random
Send frames with random sizes
Returns
The frame modifier.
growing
A StreamModifier.GrowingSize object.
random
A StreamModifier.RandomSize object.
Example

This example sets a growing frame modifier.

1 $stream Modifier.Frame.Set "growing"

Returns:

<StreamFrameModifier.Growing object> 

Definition at line 24609 of file api.tcl.

Tx.Stream::Modifier.Timing.Get

Returns the active timing modifier.

Returns
The current timing modifier.
none
Removes current modifier
multiburst
Sends frames in bursts with pauses in between them.

Definition at line 24617 of file api.tcl.

Tx.Stream::Modifier.Timing.Set   type  

Sets a timing modifier.

Parameters
typeThe timing modifier type.
none
Removes current modifier
multiburst
Sends frames in bursts with pauses in between them.
Returns
The TimingModifier.MultiBurst object.
Example

This example sets a multiburst timing modifier.

1 $stream Modifier.Timing.Set "multiburst"

Returns:

<TimingModifier.MultiBurst object> 

Definition at line 24631 of file api.tcl.

Tx.Stream::NumberOfFrames.Get

Gets the current burstcount of a stream.

Example

This example gets the frame count of the stream.

1 $stream NumberOfFrames.Get

Returns:

100 

Definition at line 24641 of file api.tcl.

Tx.Stream::NumberOfFrames.Set   count  

Sets the burst count of a stream.

This defines the number of frames a stream will send. -1 means continues.

Parameters
countThe number of frames to set. Use -1 to send infinitely.
Example

This example sets the frame count of the stream.

1 $stream NumberOfFrames.Set 100

Definition at line 24655 of file api.tcl.

Tx.Stream::Result.Clear

Resets the current result counters to zero and empties the Result.History.

Since
2.1.0
Example
1 $stream Result.Clear

Definition at line 24672 of file api.tcl.

Tx.Stream::Result.Get

Returns the current result counters.

Returns
The OID of the Tx.Stream.ResultSnapshot object.
Example
1 $stream Result.Get

Returns:

<Tx.Stream.ResultSnapshot object> 

Definition at line 24684 of file api.tcl.

Tx.Stream::Result.History.Get

Returns the current History counters.

Returns
The OID of the Tx.Stream.ResultHistory object.
Example
1 $stream Results.History.Get

Returns:

<Tx.Stream.ResultHistory object> 

Definition at line 24696 of file api.tcl.

Tx.Stream::Start

Starts the stream.

The stream will be started when this method is called. This will also cause the results for the stream and attached frames to be cleared. The objects of the types below will thus be cleared.

StreamResult
Tx.Stream.ResultSnapshot
StreamHistory
Tx.Stream.ResultHistory
FrameResult
Tx.Frame.ResultSnapshot
FrameHistory
Tx.Frame.ResultHistory
Example
1 $stream Start

Definition at line 24708 of file api.tcl.

Tx.Stream::Status.Get

Returns status information.

Returns
The OID of an object of the type Tx.Stream.RuntimeStatus
Example
1 $stream Result.Get

Returns:

<Tx.Stream.RuntimeStatus object> 

Definition at line 24720 of file api.tcl.

Tx.Stream::Stop

Stops the stream.

Example
1 $stream Stop

Definition at line 24730 of file api.tcl.