byteblower_test_framework.analysis module

Interfaces for traffic analysis.

class byteblower_test_framework.analysis.BufferAnalyser

Bases: FlowAnalyser

Analyse a video buffer over time.

The analyser provides buffer state, incoming and outgoing data over time. It analyses the initial wait time for the video to start playing out.

This analyser is intended for use with a VideoFlow.

Supports:

  • Analysis of a single flow

Warning

Does not support aggregation data from multiple flows (via AnalyserAggregator).

__init__(buffer_size: int, play_goal_size: int, max_initial_wait_time: timedelta = datetime.timedelta(seconds=5)) None

Create the video buffer over time analyser.

Parameters:
  • buffer_size (int) – Size of the video buffer in Bytes.

  • play_goal_size (int) –

  • max_initial_wait_time (timedelta, optional) – Maximum allowed time to wait until the video starts to play, defaults to timedelta(seconds=5)

analyse() None

Note

Virtual method.

buffer_consume(size: int) None
buffer_consumed: int
buffer_fill(size: int) None
buffer_filled: int
buffer_size: int
container_id = 0
details() Mapping[str, Any] | None

Return the detailed analysis results in pandas-compatible objects.

Can be None if no detailed results are available or applicable.

Note

Virtual method.

Return type:

Mapping[str, Any] | None

property finished: bool

Return whether flow analysis has finished.

Note

Virtual method.

gap_start: Timestamp | None
property log: str

Return the summary log text.

Note

Used for textual representation of the results in test reports.

Returns:

Summary log text.

Return type:

str

play_start: datetime | None
process() None

Note

Virtual method.

release() None

Release all resources used on the ByteBlower system.

render() str

Return the detailed analysis results in HTML format.

Note

Virtual method.

Return type:

str

property size: int
property size_max: int
test_start: datetime | None
updatestats() None

Note

Virtual method.

class byteblower_test_framework.analysis.FrameLossAnalyser

Bases: BaseFrameLossAnalyser

Analyse frame count over time.

The analyser also provides the RX and TX frame count and frame loss over the duration of the test.

This analyser is intended for use with a Flow based on a FrameBlastingFlow (for example GamingFlow).

Supports:

  • Analysis of a single flow

  • Usage in AnalyserAggregator.

__init__(layer2_speed: Layer2Speed = Layer2Speed.frame, max_loss_percentage: float = 1.0)

Create frame count over time analyser.

Parameters:
  • layer2_speed (Layer2Speed, optional) – Configuration setting to select the layer 2 speed reporting, defaults to frame

  • max_loss_percentage (float, optional) – Maximum allowed packet loss in %, defaults to DEFAULT_LOSS_PERCENTAGE

class byteblower_test_framework.analysis.HttpAnalyser

Bases: FlowAnalyser

Analyse HTTP and TCP statistics over time.

The analyser currently only provides the HTTP goodput over time and the average HTTP goodput over the duration of the test.

Note

There is no specific analysis performed and the test will always state no analysis is done.

This analyser is intended for use with a HTTPFlow.

Supports:

  • Analysis of a single flow

Warning

Does not support aggregation data from multiple flows (via AnalyserAggregator).

__init__(analyser_type: str = 'HTTP analyser', http_data_class=<class 'byteblower_test_framework._analysis.storage.tcp.HttpData'>)

Create the HTTP and TCP statistics over time analyser.

analyse() None

Note

Virtual method.

details() Mapping[str, Any] | None

Return the detailed analysis results in pandas-compatible objects.

Can be None if no detailed results are available or applicable.

Note

Virtual method.

Return type:

Mapping[str, Any] | None

property finished: bool

Return whether flow analysis has finished.

Note

Virtual method.

property flow: TcpFlow

Return Flow implementation.

Useful for correct type hinting.

property http_method

Return the configured HTTP Request Method.

initialize() None

Configure the flow analyser.

Warning

No more activities (like address / port discovery, …) allowed in the network under test.

Note

Virtual method.

property log: str

Return the summary log text.

Note

Used for textual representation of the results in test reports.

Returns:

Summary log text.

Return type:

str

prepare_configure() None

Prepare the flow analyser to be configured.

At this point, it is allowed to perform address resolution, port discovery, …

Note

Virtual method.

prepare_start(maximum_run_time: timedelta | None = None) None

Prepare the flow analyser to start analysis.

Warning

No more activities (like address / port discovery, …) allowed in the network under test.

Note

Virtual method.

Parameters:

maximum_run_time (Optional[timedelta], optional) – Maximum run time of the scenario

process() None

Note

Virtual method.

release() None

Release all resources used on the ByteBlower system.

render() str

Return the detailed analysis results in HTML format.

Note

Virtual method.

Return type:

str

property rx_first_client: Timestamp | None

Time when the first packet was received at the HTTP Client.

property rx_first_server: Timestamp | None

Time when the first packet was received at the HTTP Server.

property rx_last_client: Timestamp | None

Time when the last packet was received at the HTTP Client.

property rx_last_server: Timestamp | None

Time when the last packet was received at the HTTP Server.

property total_rx_client: int

Number of received bytes at HTTP Client.

property total_rx_server: int

Number of received bytes at HTTP Server.

property total_tx_client: int

Number of transmitted bytes at HTTP Client.

property total_tx_server: int

Number of transmitted bytes at HTTP Server.

property tx_first_client: Timestamp | None

Time when the first packet was transmitted at the HTTP Client.

property tx_first_server: Timestamp | None

Time when the first packet was transmitted at the HTTP Server.

property tx_last_client: Timestamp | None

Time when the last packet was transmitted at the HTTP Client.

property tx_last_server: Timestamp | None

Time when the last packet was transmitted at the HTTP Server.

updatestats() None

Analyse the result.

What would be bad?

  • TCP sessions not going to Finished

class byteblower_test_framework.analysis.L4SHttpAnalyser

Bases: HttpAnalyser

Analyse L4S enabled HTTP and TCP statistics over time.

Over the duration of the test, this analyser provides:

  • HTTP goodput over time

  • HTTP retransmissions

  • Average Round Trip Time (RTT)

  • Min/Max RTT

  • Congestion Experienced (CE) count

Note

There is no specific analysis performed and the test will always state no analysis is done.

This analyser is used with a HTTPFlow, where TCP Prague is enabled.

Supports:

  • Analysis of a single flow

Warning

Does not support aggregation data from multiple flows (via AnalyserAggregator).

Note

  • L4S support requires at least ByteBlower API v2.22.0, Server and Meeting Point v2.22.0, and ByteBlower Endpoint v2.22.0

  • When using Endpoints, L4S must be supported and enabled in the hosting OS

Added in version 1.3.0: Added L4S enabled HTTP and its analysers.

__init__()

Create the L4S and RTT statistics for HTTP and TCP over time analyser.

class byteblower_test_framework.analysis.LatencyCDFFrameLossAnalyser

Bases: BaseLatencyCDFFrameLossAnalyser

Analyse latency CDF and total frame count.

The analyser provides the latency CDF graph, RX and TX frame count and byte loss over the duration of the test. For the latency results you will also have the average, minimum and maximum latency and average latency jitter.

This analyser is intended for use with a Flow based on a FrameBlastingFlow (for example GamingFlow).

Supports:

  • Analysis of a single flow

  • Summary results for multiple flows (via AnalyserAggregator)

Warning

Does not provide over time results for AnalyserAggregator.

__init__(layer2_speed: Layer2Speed = Layer2Speed.frame, max_loss_percentage: float = 1.0, max_threshold_latency: float = 5, quantile: float = 99.9)

Create the latency CDF and total frame count analyser.

The latency for the CDF graph will be analysed over a range of [0, 50 * max_threshold_latency[.

Parameters:
  • layer2_speed (Layer2Speed, optional) – Configuration setting to select the layer 2 speed reporting, defaults to frame

  • max_loss_percentage (float, optional) – Maximum allowed byte loss in %, defaults to DEFAULT_LOSS_PERCENTAGE

  • max_threshold_latency (float, optional) – Maximum allowed average latency in milliseconds, defaults to DEFAULT_MAX_LATENCY_THRESHOLD

  • quantile (float, optional) – Quantile for which the latency must be less than the given maximum average latency, defaults to DEFAULT_QUANTILE

class byteblower_test_framework.analysis.LatencyFrameLossAnalyser

Bases: BaseLatencyFrameLossAnalyser

Analyse latency and frame count over time.

The analyser also provides the RX and TX frame count and byte loss over the duration of the test. For the latency results you will also have the average, minimum and maximum latency and average latency jitter.

This analyser is intended for use with a Flow based on a FrameBlastingFlow (for example GamingFlow).

Supports:

  • Analysis of a single flow

  • Usage in AnalyserAggregator.

__init__(layer2_speed: Layer2Speed = Layer2Speed.frame, max_loss_percentage: float = 1.0, max_threshold_latency: float = 5)

Create the latency and frame count over time analyser.

Parameters:
  • layer2_speed (Layer2Speed, optional) – Configuration setting to select the layer 2 speed reporting, defaults to frame

  • max_loss_percentage (float, optional) – Maximum allowed byte loss in %, defaults to DEFAULT_LOSS_PERCENTAGE

  • max_threshold_latency (float, optional) – Maximum allowed average latency in milliseconds, defaults to DEFAULT_MAX_LATENCY_THRESHOLD

class byteblower_test_framework.analysis.VoiceAnalyser

Bases: FlowAnalyser

Analyse the MOS of a voice flow.

Calculates the Mean Opinion Score (MOS) over the duration of the test.

The analyser also provides the RX and TX frame count and frame loss over the duration of the test.

This analyser is intended for use with a VoiceFlow.

Supports:

  • Analysis of a single flow

Warning

Does not support usage in AnalyserAggregator.

__init__(layer2_speed: Layer2Speed = Layer2Speed.frame, minimum_mos: float = 4)

Create the voice analyser.

Parameters:
  • layer2_speed (Layer2Speed, optional) – Configuration setting to select the layer 2 speed reporting, defaults to frame

  • minimum_mos (float, optional) – Minimum required MOS value, defaults to DEFAULT_MINIMUM_MOS

analyse() None

Note

Virtual method.

details() Mapping[str, Any] | None

Return the detailed analysis results in pandas-compatible objects.

Can be None if no detailed results are available or applicable.

Note

Virtual method.

Return type:

Mapping[str, Any] | None

property finished: bool

Return whether flow analysis has finished.

Note

Virtual method.

property flow: FrameBlastingFlow

Return Flow implementation.

Useful for correct type hinting.

initialize() None

Configure the flow analyser.

Warning

No more activities (like address / port discovery, …) allowed in the network under test.

Note

Virtual method.

property log: str

Return the summary log text.

Note

Used for textual representation of the results in test reports.

Returns:

Summary log text.

Return type:

str

prepare_configure() None

Prepare the flow analyser to be configured.

At this point, it is allowed to perform address resolution, port discovery, …

Note

Virtual method.

prepare_start(maximum_run_time: timedelta | None = None) None

Prepare the flow analyser to start analysis.

Warning

No more activities (like address / port discovery, …) allowed in the network under test.

Note

Virtual method.

Parameters:

maximum_run_time (Optional[timedelta], optional) – Maximum run time of the scenario

process() None

Note

Virtual method.

release() None

Release all resources used on the ByteBlower system.

render() str

Return the detailed analysis results in HTML format.

Note

Virtual method.

Return type:

str

updatestats() None

Note

Virtual method.

byteblower_test_framework.analysis.include_ethernet_overhead(layer2_speed: Layer2Speed | None, value_data: int | float | Tuple[DataFrame, str], count_data: int | float | Tuple[DataFrame, str]) int | float | DataFrame

Include Ethernet Layer 1/2 overhead in the value data.

When the value_data or count_data are DataFrame objects, they must be provided as a tuple of the DataFrame and a “key”. The “key” defines which column of the DataFrame to process.

With a value_data being a DataFrame, the “key” will also be used to filter the output. The returned value will be a DataFrame, only containing the (adjusted) values for column defined by the “key”.

For use with numeric values:

>>> total_tx_bytes = include_ethernet_overhead(
>>>     Layer2Speed.physical, total_tx_bytes, total_tx_packets
>>> )

For use with DataFrame values:

>>> df_rx_bytes = include_ethernet_overhead(
>>>     Layer2Speed.frame_with_fcs, (df_rx, 'Bytes interval'),
>>>     (df_rx, 'Packets interval')
>>> )

Note

If necessary, this function will create a copy of value_data to avoid SettingWithCopyWarning errors on DataFrame.

Parameters:
  • layer2_speed (Optional[Layer2Speed]) – Defines which overhead to include

  • value_data (ByteOrCountData) –

    Input value(s).

    Note

    It MUST contain the number of Ethernet bytes excluding Ethernet FCS.

  • count_data (ByteOrCountData) – Packet count(s) for the values in value_data.

Raises:

ByteBlowerTestFrameworkException – When providing invalid input value(s) or count(s).

Returns:

(filtered) value_data adjusted to the layer2_speed.

Return type:

ByteOrCountStorage