8.3.1.4. Stream
This module contains the L23 stream classes deal with configuration of the traffic streams transmitted from a L23 port. The stream command names all have the form PS_<xxx>
and require both a module index id and a port index id, as well as a sub-index identifying a particular stream.
General Information
Enabling Traffic
Whether the port is actually transmitting packets is controlled both by the P_TRAFFIC
command for the parent port and by the PS_ENABLE
command for the stream.
While the parent port is transmitting, the parameters of any enabled stream cannot be changed.
Stream Test Payload Data (TPLD)
Each Xena test packet contains a special proprietary data area called the Test Payload Data (TPLD), which contains various information about the packet and is identified by a Test Payload ID (TID). The TPLD is located just before the Ethernet FCS and consists of the following sections:
Field |
Length |
Explanation |
---|---|---|
Checksum (optional) |
2 bytes |
See the note. |
Sequence Number |
3 bytes |
Packet sequence number used for loss and misordering detection. |
Timestamp |
4 bytes |
Timestamp value used for latency measurements. |
Test Payload ID (TID) |
2 bytes |
Test payload identifier used to identify the sending stream. |
Payload Integrity Offset |
1 byte |
Offset in packet from where to calculate payload integrity. |
First Packet Flag |
1 bit |
Set if this is the first packet after traffic is started. |
Checksum Enabled |
1 bit |
Set if payload integrity checksum is used. |
<reserved> |
7 bits |
|
Payload Integrity Offset (MSB) |
3 bits |
Offset in packet from where to calculate payload integrity, MSB (bits 10:9:8) |
Timestamp Decimals |
4 bits |
Additional decimals for the timestamp. |
Checksum |
8 bytes |
TPLD integrity checksum. |
Total TPLD Size |
20 or 22 bytes |
Note
If the P_CHECKSUM offset
(Payload Checksum Offset) is enabled on the parent port, then an additional 2-byte checksum field is inserted in the TPLD, just before the Sequence Number. This increases the total size of the TPLD to 22 bytes.
Field |
Length |
Explanation |
---|---|---|
First Packet Flag |
1 bit |
Packet sequence number used for loss and misordering detection. |
<reserved> |
1 bit |
|
Test Payload ID (TID) |
10 bits |
Test payload identifier used to identify the sending stream. |
Timestamp |
28 bits |
Timestamp value used for latency measurements. |
Checksum |
8 bits |
TPLD integrity checksum (CRC-8) |
Total Micro-TPLD Size |
6 bytes |
The selection between the default TPLD and the micro-TPLD is done on the parent port. It is thus not possible to use different TPLD types for streams on the same port.
Disabling TPLD The TPLD function can also be completely disabled for any given stream by setting the Test Payload ID (TID) value for the stream to the value -1.
Minimum Packet Size Considerations
The stream will generally accept any configuration and attempt to transmit packets according to the configuration. In order for the various Xena stream features to work correctly certain aspects about the minimum packet size used must be observed.
The minimum packet size must obviously be large enough to accommodate the defined protocol headers + the final Ethernet FCS field
.
If the TPLD function explained above is enabled then each packet must also be able to contain the TPLD area (20, 22 or 6 bytes depending on the configuration).
If the stream payload type is set to Incrementing
, then an additional minimum payload area of 2 bytes is needed. Otherwise excessive payload errors will be reported. This is however not necessary if the P_CHECKSUM offset
(Payload Checksum Offset) option is enabled on the parent port as this will override the payload integrity check implied by the Incrementing
payload type.
- class PS_ARPREQUEST[source]
Bases:
object
Generates an outgoing ARP request on the test port. The packet header for the stream must contain an IP protocol segment, and the destination IP address is used in the ARP request. If there is a gateway IP address specified for the port and it is on a different subnet than the destination IP address in the packet header, then the gateway IP address is used instead. The framing of the ARP request matches the packet header, including any VLAN protocol segments. This command does not generate an immediate result, but waits until an ARP reply is received on the test port. If no reply is received within 500 milliseconds, it returns.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- mac_address
six hex bytes, specifying the six bytes of the MAC address.
- get()[source]
Generates an outgoing ARP request on the test port. The packet header for the stream must contain an IP protocol segment, and the destination IP address is used in the ARP request. If there is a gateway IP address specified for the port and it is on a different subnet than the destination IP address in the packet header, then the gateway IP address is used instead. The framing of the ARP request matches the packet header, including any VLAN protocol segments. This command does not generate an immediate result, but waits until an ARP reply is received on the test port. If no reply is received within 500 milliseconds, it returns.
- Returns:
the MAC address of the peer port
- Return type:
- class PS_AUTOADJUST[source]
Bases:
object
Added in version v2.0.
Executing PS_AUTOADJUST will adjust the packet length distribution (
PS_PACKETLENGTH
) of the stream:Set the type of packet length distribution (
PS_PACKETLENGTH
<length_type>
) toFIXED
.
(2) Set the lower limit on the packet length (
PS_PACKETLENGTH
<min_val>
) to exactly fit the specified protocol headers, TPLD and FCS (but never set to less than 64).Set the payload type of packets transmitted for the stream (
PS_PAYLOAD
<payload_type>
) toPATTERN
.
(4) If necessary, also set the maximum number of header content bytes (P_MAXHEADERLENGTH <p_maxheaderlength_label>
<max_header_length>
) that can be freely specified for each generated stream of the port to a higher value, if needed to accommodate the header size of the stream (implicitly given by the PS_PACKETHEADER command).(5) If the needed maximum header length (P_MAXHEADERLENGTH <p_maxheaderlength_label>
<max_header_length>
) is not possible with the actual number of active streams for the port, the command will fail with :<BADVALUE>.
- class PS_BURST[source]
Bases:
object
The burstiness of the traffic transmitted for a stream, expressed in terms of the number of packets in each burst, and how densely they are packed together. The burstiness does not affect the bandwidth consumed by the stream, only the spacing between the packets. A density value of 100 means that the packets are packed tightly together, only spaced by the minimum inter-frame gap. A value of 0 means even, non-bursty, spacing. The exact spacing achieved depends on the other enabled streams of the port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- density
integer, the percentage of the available spacing that is inserted between bursts.
- size
integer, the number of packets lumped together in a burst.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- density
integer, the percentage of the available spacing that is inserted between bursts.
- size
integer, the number of packets lumped together in a burst.
- get()[source]
Get the burstiness of the traffic transmitted for a stream, expressed in terms of the number of packets in each burst, and how densely they are packed together.
- Returns:
the number of packets lumped together in a burst, and the percentage of the available spacing that is inserted between bursts
- Return type:
- set(size, density)[source]
Set the burstiness of the traffic transmitted for a stream, expressed in terms of the number of packets in each burst, and how densely they are packed together. The burstiness does not affect the bandwidth consumed by the stream, only the spacing between the packets. A density value of 100 means that the packets are packed tightly together, only spaced by the minimum inter-frame gap. A value of 0 means even, non-bursty, spacing. The exact spacing achieved depends on the other enabled streams of the port.
- class PS_BURSTGAP[source]
Bases:
object
When the port is in in Burst TX mode, this command defines the gap between packets in a burst (inter-packet gap) and the gap after a burst defined in one stream stops until a burst defined in the next stream starts (inter-burst gap).
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- inter_burst_gap
integer, Inter Burst Gap (in bytes).
- inter_packet_gap
integer, Burst Inter Packet Gap (in bytes).
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- inter_burst_gap
integer, Inter Burst Gap (in bytes).
- inter_packet_gap
integer, Burst Inter Packet Gap (in bytes).
- get()[source]
Get the gap between packets in a burst (inter-packet gap) and the gap after a burst defined in one stream stops until a burst defined in the next stream starts (inter-burst gap).
- Returns:
the gap between packets in a burst
- Return type:
- class PS_CDFCOUNT[source]
Bases:
object
This command is part of the Custom Data Field (CDF) feature. It controls the number of custom data fields available for each stream. You can set a different number of fields for each stream. Changing the field count value to a larger value will leave all existing fields intact. Changing the field count value to a smaller value will remove all existing fields with an index larger than or equal to the new count. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- cdf_count
integer, the number of CDF data fields to allocate for the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- cdf_count
integer, the number of CDF data fields to allocate for the stream.
- get()[source]
Get the number of custom data fields available for each stream. You can set a different number of fields for each stream. Changing the field count value to a larger value will leave all existing fields intact. Changing the field count value to a smaller value will remove all existing fields with an index larger than or equal to the new count. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Returns:
the number of CDF data fields to allocate for the stream
- Return type:
- set(cdf_count)[source]
Set the number of custom data fields available for each stream. You can set a different number of fields for each stream. Changing the field count value to a larger value will leave all existing fields intact. Changing the field count value to a smaller value will remove all existing fields with an index larger than or equal to the new count. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Parameters:
cdf_count (int) – the number of CDF data fields to allocate for the stream
- class PS_CDFDATA[source]
Bases:
object
This command is part of the Custom Data Field (CDF) feature. It controls the actual field data for a single field. It is possible to define fields with different data lengths for each stream. If the length of a data field exceeds (packet length - CDF offset) defined for the stream the field data will be truncated when transmitted. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- hex_data
list of hex bytes, the actual field data for a single field.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- hex_data
list of hex bytes, a pattern of bytes to be used.
- get()[source]
Get the actual field data for a single field. It is possible to define fields with different data lengths for each stream. If the length of a data field exceeds (packet length - CDF offset) defined for the stream the field data will be truncated when transmitted. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Returns:
the actual field data for a single field
- Return type:
- set(hex_data)[source]
Set the actual field data for a single field. It is possible to define fields with different data lengths for each stream. If the length of a data field exceeds (packet length - CDF offset) defined for the stream the field data will be truncated when transmitted. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Parameters:
hex_data (Hex) – a pattern of bytes to be used
- class PS_CDFOFFSET[source]
Bases:
object
This command is part of the Custom Data Field (CDF) feature. The CDF offset for the stream is the location in the stream data packets where the various CDF data will be inserted. All fields for a given stream uses the same offset value. The default value is zero (0) which means that the CDF data will be inserted at the very start of the packet, thus overwriting the packet protocol headers. If you want the CDF data to start immediately after the end of the packet protocol headers you will have to set the CDF field offset manually. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- offset
integer, the location where the CDF data will be inserted.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- offset
integer, the location where the CDF data will be inserted.
- get()[source]
Get the CDF offset for the stream. This command is part of the Custom Data Field (CDF) feature. The CDF offset for the stream is the location in the stream data packets where the various CDF data will be inserted. All fields for a given stream uses the same offset value. The default value is zero (0) which means that the CDF data will be inserted at the very start of the packet, thus overwriting the packet protocol headers. If you want the CDF data to start immediately after the end of the packet protocol headers you will have to set the CDF field offset manually. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Returns:
the location where the CDF data will be inserted
- Return type:
- set(offset)[source]
Set the CDF offset for the stream. This command is part of the Custom Data Field (CDF) feature. The CDF offset for the stream is the location in the stream data packets where the various CDF data will be inserted. All fields for a given stream uses the same offset value. The default value is zero (0) which means that the CDF data will be inserted at the very start of the packet, thus overwriting the packet protocol headers. If you want the CDF data to start immediately after the end of the packet protocol headers you will have to set the CDF field offset manually. The feature requires that the P_PAYLOADMODE command on the parent port has been set to CDF. This enables the feature for all streams on this port.
- Parameters:
offset (int) – the location where the CDF data will be inserted
- class PS_COMMENT[source]
Bases:
object
The description of a stream.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- comment
string, specifying the description of the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- comment
string, specifying the description of the stream.
- class PS_CREATE[source]
Bases:
object
Creates an empty stream definition with the specified sub-index value.
- class PS_DELETE[source]
Bases:
object
Deletes the stream definition with the specified sub-index value.
- class PS_ENABLE[source]
Bases:
object
This property determines if a stream contributes outgoing packets for a port. The value can be toggled between ON and SUPPRESS while traffic is enabled at the port level. Streams in the OFF state cannot be set to any other value while traffic is enabled. The sum of the rates of all enabled or suppressed streams must not exceed the effective port rate.
- set(state)[source]
Set the stream status. The value can be toggled between ON and SUPPRESS while traffic is enabled at the port level. Streams in the OFF state cannot be set to any other value while traffic is enabled. The sum of the rates of all enabled or suppressed streams must not exceed the effective port rate.
- Parameters:
state (OnOffWithSuppress) – a stream state
- set_off()
Set the stream status to OFF.
- set_on()
Set the stream status to ON.
- set_suppress()
Set the stream status to SUPPRESS.
- class PS_EXTPAYLOAD[source]
Bases:
object
This command controls the extended payload feature. The PS_PAYLOAD command described above only allow the user to specify an 18-byte pattern (when PS_PAYLOAD is set to PATTERN). The PS_EXTPAYLOAD command allow the definition of a much larger (up to MTU) payload buffer for each stream. The extended payload will be inserted immediately after the end of the protocol segment area. The feature requires the P_PAYLOADMODE command on the parent port being set to EXTPL. This enables the feature for all streams on this port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- hex_data
list of hex bytes, a pattern of bytes to be repeated.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- hex_data
list of hex bytes, a pattern of bytes to be repeated.
- get()[source]
Get the extended payload in bytes of a stream.
- Returns:
the extended payload in bytes of a stream
- Return type:
- set(hex_data)[source]
Set the extended payload in bytes of a stream. The PS_EXTPAYLOAD command allow the definition of a much larger (up to MTU) payload buffer for each stream. The extended payload will be inserted immediately after the end of the protocol segment area. The feature requires the P_PAYLOADMODE command on the parent port being set to EXTPL. This enables the feature for all streams on this port.
- Parameters:
hex_data (Hex) – the extended payload in bytes of a stream
- class PS_HEADERPROTOCOL[source]
Bases:
object
This command will inform the Xena tester how to interpret the packet header byte sequence specified with PS_PACKETHEADER. This is mainly for information purposes, and the stream will transmit the packet header bytes even if no protocol segments are specified. The Xena tester however support calculation of certain field values in hardware, such as the IP, TCP and UDP length and checksum fields. This allow the use of hardware modifiers for these protocol segments. In order for this function to work the Xena tester needs to know the type of each segment that precedes the segment where the hardware calculation is to be performed.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- segments
list of coded bytes, a number specifying a built-in protocol segment.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- segments
list of coded bytes, a number specifying a built-in protocol segment.
- get()[source]
Get the packet header segments in protocol names.
- Returns:
a number specifying a built-in protocol segment
- Return type:
- set(segments)[source]
Inform the Xena tester how to interpret the packet header byte sequence specified with PS_PACKETHEADER. This is mainly for information purposes, and the stream will transmit the packet header bytes even if no protocol segments are specified. The Xena tester however support calculation of certain field values in hardware, such as the IP, TCP and UDP length and checksum fields. This allow the use of hardware modifiers for these protocol segments. In order for this function to work the Xena tester needs to know the type of each segment that precedes the segment where the hardware calculation is to be performed.
- Parameters:
segments (List[ProtocolOption]) – a number specifying a built-in protocol segment
- class PS_INDICES[source]
Bases:
object
The full list of which streams are defined for a port. These are the sub-index values that are used for the parameters defining the traffic patterns transmitted for the port. Setting the value of this command creates a new empty stream for each value that is not already in use, and deletes each stream that is not mentioned in the list. The same can be accomplished one-stream-at-a- time using the
PS_CREATE
andPS_DELETE
commands.- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- stream_indices
list of integers, the sub-indices of streams on the port.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- stream_indices
list of integers, the sub-indices of streams on the port.
- class PS_INJECTFCSERR[source]
Bases:
object
Force a frame checksum error in one of the packets currently being transmitted from a stream. This can aid in analyzing the error-detection functionality of the system under test. Traffic must be on for the port, and the stream must be enabled.
- class PS_INJECTMISERR[source]
Bases:
object
Force a misorder error by swapping the test payload sequence numbers in two of the packets currently being transmitted from a stream. This can aid in analyzing the error-detection functionality of the system under test. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- set()[source]
Set a misorder error by swapping the test payload sequence numbers in two of the packets currently being transmitted from a stream. This can aid in analyzing the error-detection functionality of the system under test. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- class PS_INJECTPLDERR[source]
Bases:
object
Force a payload integrity error in one of the packets currently being transmitted from a stream. Payload integrity validation is only available for incrementing payloads, and the error is created by changing a byte from the incrementing sequence. The packet will have a correct frame checksum, but the receiving Xena chassis will detect the invalid payload based on information in the test payload. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- set()[source]
Set a payload integrity error in one of the packets currently being transmitted from a stream. Payload integrity validation is only available for incrementing payloads, and the error is created by changing a byte from the incrementing sequence. The packet will have a correct frame checksum, but the receiving Xena chassis will detect the invalid payload based on information in the test payload. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- class PS_INJECTSEQERR[source]
Bases:
object
Force a sequence error by skipping a test payload sequence number in one of the packets currently being transmitted from a stream. This can aid in analyzing the error-detection functionality of the system under test. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- set()[source]
Set a sequence error by skipping a test payload sequence number in one of the packets currently being transmitted from a stream. This can aid in analyzing the error-detection functionality of the system under test. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- class PS_INJECTTPLDERR[source]
Bases:
object
Force a test payload error in one of the packets currently being transmitted from a stream. This means that the test payload will not be recognized at the receiving port, so it will be counted as a no-test-payload packet, and there will be a lost packet for the stream. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- set()[source]
Set a test payload error in one of the packets currently being transmitted from a stream. This means that the test payload will not be recognized at the receiving port, so it will be counted as a no-test-payload packet, and there will be a lost packet for the stream. Traffic must be on for the port, and the stream must be enabled and include test payloads.
- class PS_INSERTFCS[source]
Bases:
object
Whether a valid frame checksum is added to the packets of a stream.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- on_off
coded byte, whether frame checksums are inserted.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- on_off
coded byte, whether frame checksums are inserted.
- get()[source]
Get whether a valid frame checksum is added to the packets of a stream.
- Returns:
whether frame checksums are inserted
- Return type:
- set(on_off)[source]
Set whether a valid frame checksum is added to the packets of a stream.
- Parameters:
on_off (OnOff) – whether frame checksums are inserted
- set_off()
Disable a valid frame checksum to be added to the packets of a stream.
- set_on()
Enable a valid frame checksum to be added to the packets of a stream.
- class PS_IPV4GATEWAY[source]
Bases:
object
An IPv4 gateway configuration specified for a stream.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- gateway
address, the IPv4 gateway address of the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- gateway
address, IPv4 gateway address of the stream.
- get()[source]
Get the IPv4 gateway address of a stream.
- Returns:
the IPv4 gateway address of the stream
- Return type:
- set(gateway)[source]
Set the IPv4 gateway address of a stream.
- Parameters:
gateway (Union[str, ipaddress.IPv4Address, int]) – the IPv4 gateway address of the stream
- class PS_IPV6GATEWAY[source]
Bases:
object
An IPv6 gateway configuration specified for a stream.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- gateway
address, the IPv6 gateway address of the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- gateway
address, IPv6 gateway address of the stream.
- get()[source]
Get the IPv6 gateway address of a stream.
- Returns:
the IPv6 gateway address of the stream
- Return type:
- set(gateway)[source]
Set the IPv6 gateway address of a stream.
- Parameters:
gateway (Union[str, ipaddress.IPv6Address, int]) – the IPv6 gateway address of the stream
- class PS_MODIFIER[source]
Bases:
object
A packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- action
coded integer, which action to perform on the affected bits.
- mask
four hex bytes, the mask specifying which bits to affect.
- position
integer, the byte position from the start of the packet.
- repetition
integer, how many times to repeat on each packet.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- action
coded integer, which action to perform on the affected bits.
- mask
four hex bytes, the mask specifying which bits to affect.
- position
integer, the byte position from the start of the packet.
- repetition
integer, how many times to repeat on each packet.
- get()[source]
Get a packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- Returns:
the byte position from the start of the packet, the mask specifying which bits to affect, which action to perform on the affected bits, and how many times to repeat on each packet
- Return type:
- set(position, mask, action, repetition)[source]
Set a packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- Parameters:
position (int) – the byte position from the start of the packet
mask (str) – the mask specifying which bits to affect
action (ModifierAction) – which action to perform on the affected bits
repetition (int) – how many times to repeat on each packet
- set_dec(position, mask, *, action=ModifierAction.DEC, repetition)
Set a packet modifier action to decrementing.
- set_inc(position, mask, *, action=ModifierAction.INC, repetition)
Set a packet modifier action to incrementing.
- set_random(position, mask, *, action=ModifierAction.RANDOM, repetition)
Set a packet modifier action to random.
- class PS_MODIFIERCOUNT[source]
Bases:
object
The number of standard 16-bit modifiers active on the packet header of a stream. Each modifier is specified using PS_MODIFIER.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- modifier_count
integer, the number of modifiers for the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- modifier_count
integer, the number of modifiers for the stream.
- class PS_MODIFIEREXT[source]
Bases:
object
An extended packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. The modifier acts on 32 bits and takes up the space for two 16-bit modifiers to do this. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- action
coded integer, which action to perform on the affected bits.
- mask
four hex bytes, the mask specifying which bits to affect.
- position
integer, the byte position from the start of the packet. Cannot be < 1!
- repetition
integer, how many times to repeat on each packet. Note: For now the only value supported is 1.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- action
coded integer, which action to perform on the affected bits.
- mask
four hex bytes, the mask specifying which bits to affect.
- position
integer, the byte position from the start of the packet. Cannot be < 1!
- repetition
integer, how many times to repeat on each packet. Note: For now the only value supported is 1.
- get()[source]
Get an extended packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. The modifier acts on 24 bits and takes up the space for two 16-bit modifiers to do this. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- Returns:
the byte position from the start of the packet. Cannot be < 1!, the mask specifying which bits to affect, which action to perform on the affected bits, and how many times to repeat on each packet. Note: For now the only value supported is 1.
- Return type:
- set(position, mask, action, repetition)[source]
Set an extended packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. The modifier acts on 24 bits and takes up the space for two 16-bit modifiers to do this. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.
- Parameters:
position (int) – the byte position from the start of the packet. Cannot be < 1!
mask (str) – the mask specifying which bits to affect
action (ModifierAction) – which action to perform on the affected bits,
repetition (int) – how many times to repeat on each packet. Note: For now the only value supported is 1.
- set_dec(position, mask, *, action=ModifierAction.DEC, repetition)
Set modifier action to Decrementing.
- set_inc(position, mask, *, action=ModifierAction.INC, repetition)
Set modifier action to Incrementing.
- set_random(position, mask, *, action=ModifierAction.RANDOM, repetition)
Set modifier action to Random.
- class PS_MODIFIEREXTCOUNT[source]
Bases:
object
The number of extended 24-bit modifiers active on the packet header of a stream. Each modifier is specified using PS_MODIFIEREXT.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- ext_modifier_count
integer, the number of extended 24-bit modifiers for the stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- ext_modifier_count
integer, the number of extended 24-bit modifiers for the stream.
- class PS_MODIFIEREXTRANGE[source]
Bases:
object
Range specification for an extended packet modifier for a stream header, specifying which values the modifier should take on. This applies only to incrementing and decrementing modifiers; random modifiers always produce every possible bit pattern. The range is specified as a three values: mix, step, and max, where max must be equal to min plus a multiple of step. Note that when “decrement” is specified in PS_MODIFIEREXT as the action, the value sequence will begin with the max value instead of the min value and decrement from there: {max, max-1, max-2, …., min, max, max-1…}.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- max_val
integer, the maximum modifier value.
- min_val
integer, the minimum modifier value.
- step
integer, the increment between modifier values.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- max_val
integer, the maximum modifier value.
- min_val
integer, the minimum modifier value.
- step
integer, the increment between modifier values.
- get()[source]
Get the range specification for an extended packet modifier for a stream header, specifying which values the modifier should take on.
- Returns:
the minimum modifier value, the increment between modifier values, the maximum modifier value.
- Return type:
- set(min_val, step, max_val)[source]
Set the range specification for an extended packet modifier for a stream header, specifying which values the modifier should take on. This applies only to incrementing and decrementing modifiers; random modifiers always produce every possible bit pattern. The range is specified as a three values: mix, step, and max, where max must be equal to min plus a multiple of step. Note that when “decrement” is specified in PS_MODIFIEREXT as the action, the value sequence will begin with the max value instead of the min value and decrement from there: {max, max-1, max-2, …., min, max, max-1…}.
- class PS_MODIFIERRANGE[source]
Bases:
object
Range specification for a packet modifier for a stream header, specifying which values the modifier should take on. This applies only to incrementing and decrementing modifiers; random modifiers always produce every possible bit pattern. The range is specified as three values: mix, step, and max, where max must be equal to min plus a multiple of step. Note that when “decrement” is specified in PS_MODIFIER as the action, the value sequence will begin with the max value instead of the min value and decrement from there: {max, max-1, max-2, …., min, max, max-1…}.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- max_val
integer, the maximum modifier value.
- min_val
integer, the minimum modifier value.
- step
integer, the increment between modifier values.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- max_val
integer, the maximum modifier value.
- min_val
integer, the minimum modifier value.
- step
integer, the increment between modifier values.
- get()[source]
Get the range specification for a packet modifier for a stream header, specifying which values the modifier should take on.
- Returns:
the minimum modifier value, the increment between modifier values, the maximum modifier value.
- Return type:
- set(min_val, step, max_val)[source]
Set the range specification for a packet modifier for a stream header, specifying which values the modifier should take on. This applies only to incrementing and decrementing modifiers; random modifiers always produce every possible bit pattern. The range is specified as three values: mix, step, and max, where max must be equal to min plus a multiple of step. Note that when “decrement” is specified in PS_MODIFIER as the action, the value sequence will begin with the max value instead of the min value and decrement from there: {max, max-1, max-2, …., min, max, max-1…}.
- class PS_OPTIONS[source]
Bases:
object
Define the set of active option flags for the stream. The set form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- options
coded byte, This flag affects the INC8/DEC8/INC16/DEC16 payload types (refer to the PS_PAYLOAD command): With the flag set, the first payload byte/word after the header will be 0 (INC8/INC16) or -1 (DEC8/DEC16). With the flag unset, the default is used: The first payload byte/word of the payload will be equal to <length of header> (INC8/INC16), or -<length of header> - 1 (DEC8/DEC16).
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- options
coded byte, This flag affects the INC8/DEC8/INC16/DEC16 payload types (refer to the PS_PAYLOAD command): With the flag set, the first payload byte/word after the header will be 0 (INC8/INC16) or -1 (DEC8/DEC16). With the flag unset, the default is used: The first payload byte/word of the payload will be equal to <length of header> (INC8/INC16), or -<length of header> - 1 (DEC8/DEC16).
- get()[source]
Define the set of active “option flags” for the stream. The “set” form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
- Returns:
the option flags
- Return type:
PS_OPTION.GetDataAttr
- set(options)[source]
Define the set of active “option flags” for the stream. The “set” form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
- Parameters:
options (StreamOption) – the option flags
- class PS_PACKETHEADER[source]
Bases:
object
The first portion of the packet bytes that are transmitted for a stream. This starts with the 14 bytes of the Ethernet header, followed by any contained protocol segments. All packets transmitted for the stream start with this fixed header. Individual byte positions of the packet header may be varied on a packet-to-packet basis using modifiers. The full packet comprises the header, the payload, an optional test payload, and the frame checksum. The header data is specified as raw bytes, since the script environment does not know the field- by-field layout of the various protocol segments.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- hex_data
list of hex bytes, the raw bytes comprising the packet header.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- hex_data
list of hex bytes, the raw bytes comprising the packet header.
- get()[source]
Get the packet header of a stream. This starts with the 14 bytes of the Ethernet header, followed by any contained protocol segments. All packets transmitted for the stream start with this fixed header. Individual byte positions of the packet header may be varied on a packet-to-packet basis using modifiers. The full packet comprises the header, the payload, an optional test payload, and the frame checksum. The header data is specified as raw bytes, since the script environment does not know the field- by-field layout of the various protocol segments.
- Returns:
the raw bytes comprising the packet header
- Return type:
- set(hex_data)[source]
Set the packet header of a stream. This starts with the 14 bytes of the Ethernet header, followed by any contained protocol segments. All packets transmitted for the stream start with this fixed header. Individual byte positions of the packet header may be varied on a packet-to-packet basis using modifiers. The full packet comprises the header, the payload, an optional test payload, and the frame checksum. The header data is specified as raw bytes, since the script environment does not know the field- by-field layout of the various protocol segments.
- Parameters:
hex_data (Hex) – the raw bytes comprising the packet header
- class PS_PACKETLENGTH[source]
Bases:
object
The length distribution of the packets transmitted for a stream. The length of the packets transmitted for a stream can be varied from packet to packet, according to a choice of distributions within a specified min…max range. The length of each packet is reflected in the size of the payload portion of the packet, whereas the header has constant length. Length variation complements, and is independent of, the content variation produced by header modifiers.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- length_type
coded integer, the kind of distribution of packet length.
- max_val
integer, upper limit on the packet length.
- min_val
integer, lower limit on the packet length.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- length_type
coded integer, the kind of distribution of packet length.
- max_val
integer, upper limit on the packet length.
- min_val
integer, lower limit on the packet length.
- get()[source]
Get the length distribution of the packets transmitted for a stream. The length of the packets transmitted for a stream can be varied from packet to packet, according to a choice of distributions within a specified min..max range. The length of each packet is reflected in the size of the payload portion of the packet, whereas the header has constant length. Length variation complements, and is independent of, the content variation produced by header modifiers.
- Returns:
the kind of distribution of packet length, lower limit on the packet length, and upper limit on the packet length.
- Return type:
- set(length_type, min_val, max_val)[source]
Set the length distribution of the packets transmitted for a stream. The length of the packets transmitted for a stream can be varied from packet to packet, according to a choice of distributions within a specified min..max range. The length of each packet is reflected in the size of the payload portion of the packet, whereas the header has constant length. Length variation complements, and is independent of, the content variation produced by header modifiers.
- Parameters:
length_type (LengthType) – the kind of distribution of packet length
min_val (int) – lower limit on the packet length
max_val (int) – upper limit on the packet length
- set_butterfly(min_val, max_val)
Set the packet length distribution to Butterfly. Length per packet: {min, max, min+1, max-1, min+2, max-2, …}.
- set_fixed(min_val, max_val)
Set the packet length distribution to Fixed.
- set_incrementing(min_val, max_val)
Set the packet length distribution to Incrementing. Length per packet: {min, min+1, min+2, …., max-2, max-1, max…}.
- set_mix(min_val, max_val)
Set the packet length distribution to Mix.
- set_random(min_val, max_val)
Set the packet length distribution to Random.
- class PS_PACKETLIMIT[source]
Bases:
object
Based on different port transmission mode, the meaning of this API is different. When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: The number of packets that will be transmitted when traffic is started on a port. A value of 0 or -1 makes the stream transmit continuously. When Port TX Mode is set to SEQUENTIAL: The number of sequential packets sent before switching to the next stream. The minimum value is 1. The port will transmit continuously until the user stops the traffic.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- packet_count
integer, the number of packets that the port will send. When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: 0 or -1 (disable packet limitation). When Port TX Mode is set to SEQUENTIAL: 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- packet_count
integer, the number of packets that the port will send. When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: 0 or -1 (disable packet limitation). When Port TX Mode is set to SEQUENTIAL: 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
- get()[source]
If Port TX Mode is NORMAL, STRICT UNIFORM or BURST: get the number of packets that will be transmitted when traffic is started on a port. If Port TX Mode is SEQUENTIAL: get the number of sequential packets sent before switching to the next stream.
- Returns:
the number of packets
- Return type:
- set(packet_count)[source]
If Port TX Mode is NORMAL, STRICT UNIFORM or BURST: set the number of packets that will be transmitted when traffic is started on a port, 0 or -1 (disable packet limitation). If Port TX Mode is SEQUENTIAL: set the number of sequential packets sent before switching to the next stream, 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
- Parameters:
packet_count (int) – the number of packets
- class PS_PAYLOAD[source]
Bases:
object
The payload content of the packets transmitted for a stream. The payload portion of a packet starts after the header and continues up until the test payload or the frame checksum. The payload may vary in length and is filled with either an incrementing sequence of byte values or a repeated multi-byte pattern. Length variation complements and is independent of the content variation produced by header modifiers.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- hex_data
list of hex bytes, a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN.
- payload_type
coded byte, the kind of payload content.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- hex_data
list of hex bytes, a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN.
- payload_type
coded byte, the kind of payload content.
- get()[source]
Get the payload content of the packets transmitted for a stream. The payload portion of a packet starts after the header and continues up until the test payload or the frame checksum. The payload may vary in length and is filled with either an incrementing sequence of byte values or a repeated multi-byte pattern. Length variation complements and is independent of the content variation produced by header modifiers.
- Returns:
the kind of payload content, and a pattern of bytes to be repeated.
- Return type:
- set(payload_type, hex_data)[source]
Set the payload content of the packets transmitted for a stream. The payload portion of a packet starts after the header and continues up until the test payload or the frame checksum. The payload may vary in length and is filled with either an incrementing sequence of byte values or a repeated multi-byte pattern. Length variation complements and is independent of the content variation produced by header modifiers.
- Parameters:
payload_type (PayloadType) – the kind of payload content
hex_data (Hex) – a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN.
- set_dec_byte(hex_data)
Set payload type to Decrementing 0xFF (8-bit mode).
- set_dec_word(hex_data)
Set payload type to Decrementing 0xFFFF (16-bit mode).
- set_inc_byte(hex_data)
Set payload type to Incrementing 0xFF (8-bit mode).
- set_inc_word(hex_data)
Set payload type to Incrementing 0xFFFF (16-bit mode).
- set_pattern(hex_data)
Set payload type to the custom pattern.
- set_prbs(hex_data)
Set payload type to PRBS.
- set_random(hex_data)
Set payload type to Random.
- class PS_PFCPRIORITY[source]
Bases:
object
Set and get the Priority Flow Control (PFC) Cos value of a stream.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- cos
coded byte, the Priority Flow Control (PFC) Cos value of a stream.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- cos
coded byte, the Priority Flow Control (PFC) Cos value of a stream.
- class PS_PINGREQUEST[source]
Bases:
object
Generates an outgoing ping request using the ICMP protocol on the test port. The packet header for the stream must contain an IP protocol segment, with valid source and destination IP addresses. The framing of the ping request matches the packet header, including any VLAN protocol segments, and the destination MAC address must also be valid, possibly containing a value obtained with PS_ARPREQUEST. This command does not generate an immediate result, but waits until a ping reply is received on the test port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- delay
integer, the number of milliseconds for the ping reply to arrive.
- time_to_live
byte, the time-to-live value in the ping reply packet.
- get()[source]
Generates an outgoing ping request using the ICMP protocol on the test port. The packet header for the stream must contain an IP protocol segment, with valid source and destination IP addresses. The framing of the ping request matches the packet header, including any VLAN protocol segments, and the destination MAC address must also be valid, possibly containing a value obtained with PS_ARPREQUEST. This command does not generate an immediate result, but waits until a ping reply is received on the test port.
- Returns:
the number of milliseconds for the ping reply to arrive, and the time-to-live value in the ping reply packet.
- Return type:
- class PS_RATEFRACTION[source]
Bases:
object
The rate of the traffic transmitted for a stream expressed in millionths of the effective rate for the port. The bandwidth consumption includes the inter-frame gap and is independent of the length of the packets generated for the stream. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the rate-percentage unchanged in case it has to cap stream rates. Get value is only valid if the rate was last set using this command.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- stream_rate_ppm
integer, stream rate expressed as a ppm value between 0 and 1,000,000.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- stream_rate_ppm
integer, stream rate expressed as a ppm value between 0 and 1,000,000.
- get()[source]
Get the rate of the traffic transmitted for a stream expressed in millionths of the effective rate for the port. Get value is only valid if the rate was last set using this command.
- Returns:
stream rate expressed as a ppm value between 0 and 1,000,000
- Return type:
- set(stream_rate_ppm)[source]
Set the rate of the traffic transmitted for a stream expressed in millionths of the effective rate for the port. The bandwidth consumption includes the inter-frame gap and is independent of the length of the packets generated for the stream. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the rate-percentage unchanged in case it has to cap stream rates.
- Parameters:
stream_rate_ppm (int) – stream rate expressed as a ppm value between 0 and 1,000,000.
- class PS_RATEL2BPS[source]
Bases:
object
The rate of the traffic transmitted for a stream, expressed in units of bits- per-second at layer-2, thus including the Ethernet header but excluding the inter-frame gap. The bandwidth consumption is somewhat dependent on the length of the packets generated for the stream, and also on the inter-frame gap for the port. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the layer-2 bps rate unchanged in case it has to cap stream rates. Get value is only valid if the rate was the last set using this command.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- l2_bps
long integer, stream rate expressed in bits per second.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- l2_bps
long integer, stream rate expressed in bits per second.
- get()[source]
Get the rate of the traffic transmitted for a stream, expressed in units of bits- per-second at layer-2, thus including the Ethernet header but excluding the inter-frame gap. Get value is only valid if the rate was the last set using this command.
- Returns:
stream rate expressed in bits per second
- Return type:
- set(l2_bps)[source]
Set the rate of the traffic transmitted for a stream, expressed in units of bits- per-second at layer-2, thus including the Ethernet header but excluding the inter-frame gap. The bandwidth consumption is somewhat dependent on the length of the packets generated for the stream, and also on the inter-frame gap for the port. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the layer-2 bps rate unchanged in case it has to cap stream rates.
- Parameters:
l2_bps (int) – stream rate expressed in bits per second
- class PS_RATEPPS[source]
Bases:
object
The rate of the traffic transmitted for a stream expressed in packets per second. The bandwidth consumption is heavily dependent on the length of the packets generated for the stream, and also on the inter-frame gap for the port. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the packets-per-second unchanged in case it has to cap stream rates. Get value is only valid if the rate was the last set using this command.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- stream_rate_pps
integer, stream rate expressed in packets per second.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- stream_rate_pps
integer, stream rate expressed in packets per second.
- get()[source]
Get The rate of the traffic transmitted for a stream expressed in packets per second. Get value is only valid if the rate was the last set using this command.
- Returns:
stream rate expressed in packets per second
- Return type:
- set(stream_rate_pps)[source]
Set The rate of the traffic transmitted for a stream expressed in packets per second. The bandwidth consumption is heavily dependent on the length of the packets generated for the stream, and also on the inter-frame gap for the port. The sum of the bandwidth consumption for all the enabled streams must not exceed the effective rate for the port. Setting this command also instructs the Manager to attempt to keep the packets-per-second unchanged in case it has to cap stream rates.
- Parameters:
stream_rate_pps (int) – stream rate expressed in packets per second
- class PS_TPLDID[source]
Bases:
object
The identifier of the test payloads inserted into packets transmitted for a stream. A value of -1 disables test payloads for the stream. Test payloads are inserted at the end of each packet, and contains time-stamp and sequence-number information. This allows the receiving port to provide error-checking and latency measurements, in addition to the basic counts and rate measurements provided for all traffic. The test payload identifier furthermore allows the receiving port to distinguish multiple different streams, which may originate from multiple different chassis. Since test payloads are an inter-port and inter-chassis mechanism, the test payload identifier assignments should be planned globally across all the chassis and ports of the testbed.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct
- test_payload_identifier
integer, the test payload identifier value. -1 = disable test payloads.
- class SetDataAttr[source]
Bases:
RequestBodyStruct
- test_payload_identifier
integer, the test payload identifier value. -1 = disable test payloads.
- get()[source]
Get the identifier of the test payloads inserted into packets transmitted for a stream.
- Returns:
the test payload identifier value. -1 = disable test payloads.
- Return type:
- set(test_payload_identifier)[source]
Set the identifier of the test payloads inserted into packets transmitted for a stream. A value of -1 disables test payloads for the stream. Test payloads are inserted at the end of each packet, and contains time-stamp and sequence-number information.
- Parameters:
test_payload_identifier (int) – the test payload identifier value. -1 = disable test payloads