byteblower_test_framework.traffic module

Interfaces for traffic generation.

class byteblower_test_framework.traffic.Frame

Bases: ABC

Frame interface.

__init__(_minimum_length: int, length: int | None = None, udp_src: int | None = None, udp_dest: int | None = None, latency_tag: bool = False) None

Create the base frame.

Parameters:
  • _minimum_length (int) – Required minimum length of the frame, used for sanity check

  • length (Optional[int], optional) – Frame length. This is the layer 2 (Ethernet) frame length excluding Ethernet FCS and excluding VLAN tags, defaults to DEFAULT_FRAME_LENGTH

  • udp_src (Optional[int], optional) – UDP source port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (Optional[int], optional) – UDP destination port, defaults to UDP_DYNAMIC_PORT_START

  • latency_tag (bool, optional) – Enable latency tag generation in the Frame, defaults to False

Raises:

InvalidInput – When invalid configuration values are given.

property length: int

Ethernet length without FCS and without VLAN tags.

release(stream: TxStream) None

Release this frame resources used on the ByteBlower system.

Note

The resources related to the stream itself is not released.

property udp_dest

UDP destination port.

property udp_src

UDP source port.

class byteblower_test_framework.traffic.FrameBlastingFlow

Bases: Flow

Flow generating and analyzing stateless traffic, mostly UDP.

__init__(source: Port | Endpoint, destination: Port | Endpoint, name: str | None = None, bitrate: float | None = None, frame_rate: float | None = None, number_of_frames: int | None = None, duration: timedelta | float | int | None = None, initial_time_to_wait: timedelta | float | int | None = None, frame_list: Sequence[Frame] | Sequence[MobileFrame] | None = None, imix: Imix | None = None, **kwargs) None

Create a Frame Blasting flow.

Parameters:
  • source (Union[Port, Endpoint]) – Sending endpoint of the data stream

  • destination (Union[Port, Endpoint]) – Receiving endpoint of the data stream

  • name (str, optional) – Name of this Flow, defaults to auto-generated name when set to None.

  • bitrate (float, optional) – Rate at which the bits are transmitted (in bit per second). Excludes the VLAN tag bytes (when applicable), mutual exclusive with frame_rate, defaults to None.

  • frame_rate (float, optional) – Rate at which the frames are transmitted (in frames per second), mutual exclusive with bitrate, defaults to DEFAULT_FRAME_RATE when bitrate is not provided.

  • number_of_frames (int, optional) – Number of frames to transmit, defaults to DEFAULT_NUMBER_OF_FRAMES

  • duration (Union[timedelta, float, int], optional) – Duration of the flow in seconds, defaults to None (use number_of_frames instead)

  • initial_time_to_wait (Union[timedelta, float, int], optional) – Initial time to wait to start the flow. In seconds, defaults to None (start immediately)

  • frame_list (Sequence[Frame], optional) – List of frames to transmit, mutual exclusive with imix, defaults to None

  • imix (Imix, optional) – Imix definition of frames to transmit, mutual exclusive with frame_list, defaults to None

Raises:
  • FeatureNotSupported – When an unsupported source endpoint type is given.

  • ConflictingInput – When both frame_rate and bitrate are given.

  • ConflictingInput – When both imix and frame_list are given or when none of both is given.

analyse() None

Note

Virtual method with implementation. Should be called by child implementations.

property duration: timedelta

Returns the duration of the FrameBlasting flow.

Raises:

InfiniteDuration – If the flow duration is configured to run forever.

Returns:

duration of the flow.

Return type:

timedelta

property finished: bool

Returns True if the flow is done.

property frame_list: Sequence[Frame]
property frame_rate: float
property initial_time_to_wait: timedelta

Return the time to wait before the flow starts.

initialize() None

Create the stream and add frames.

property number_of_frames: int
prepare_configure() None

Prepare Frames and perform proper address resolving.

prepare_start(maximum_run_time: timedelta | None = None) Iterable[SynchronizedExecutable]

Prepare the flow and its analysers to start traffic and analysis.

Warning

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

Note

Virtual method with implementation. Should be called by child implementations.

Return type:

Iterable[SynchronizedExecutable]

process() None

Note

Virtual method with implementation. Should be called by child implementations.

release() None

Release all resources used on the ByteBlower system.

Releases all resources related to traffic generation and analysis.

Note

Virtual method with implementation. Should be called by child implementations.

Note

The resources related to endpoints and server themselves are not released.

require_stream_data_gatherer() None

Make sure that the stream data gatherer is available for testing.

Should be called by the FlowAnalyser or the user before starting a test when he needs ByteBlower stream (packet count) data.

property runtime_error_info: Mapping[str, Any]

Returns implementation-specific runtime error info.

stop() None

Stop all traffic generation and analysis for this flow.

Note

Virtual hook method for child implementations.

Added in version 1.1.0.

property stream_frame_count_data: FrameCountData | None

Get the frame count data from the stream analysis.

Note

Initially created by calling require_stream_data_gatherer()

Returns:

Frame count data

Return type:

FrameCountData

updatestats() None

Note

Virtual method with implementation. Should be called by child implementations.

wait_until_finished(wait_for_finish: timedelta, result_timeout: timedelta) None

Wait until the flow finished traffic generation and processing.

Parameters:
  • wait_for_finish (timedelta) – Time to wait for sessions closing and final packets being received.

  • result_timeout (timedelta) – Time to wait for Endpoints to finalize and return their results to the Meeting Point.

Added in version 1.2.0: Added for ByteBlower Endpoint support.

class byteblower_test_framework.traffic.GamingFlow

Bases: FrameBlastingFlow

Simulate traditional gaming network traffic.

Note

This does not simulate cloud gaming.

__init__(source: Port, destination: Port | Endpoint, name: str | None = None, packet_length: int = 110, packet_length_deviation: float = 20, packet_length_min: int = 22, packet_length_max: int = 1480, frame_rate: float = 30, imix_number_of_frames: int = 20, udp_src: int | None = None, udp_dest: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, max_threshold_latency: float = 1.0, **kwargs) None

Instantiate a new Gaming Flow.

Parameters:
  • source (Port) – Source port for this flow

  • destination (Union[Port, Endpoint]) – Destination Port for this flow

  • name (str, optional) – Name for this Flow, defaults to None

  • packet_length (int, optional) – Mean UDP length of the frames we are going to send, defaults to 110

  • packet_length_deviation (float, optional) – Deviation of the frame length, defaults to 20

  • packet_length_min (int, optional) – Minimum UDP packet length, defaults to 22

  • packet_length_max (int, optional) – Maximum UDP packet length, defaults to 1480

  • frame_rate (float, optional) – Packet rate at which we will send these frames, defaults to 30

  • imix_number_of_frames (int, optional) – Add <x> frames with a length which is normally distributed, defaults to 20

  • udp_src (Optional[int], optional) – UDP src port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (Optional[int], optional) – UDP dest port, defaults to UDP_DYNAMIC_PORT_START

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (int | None) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • max_threshold_latency (float, optional) – Threshold in ms. Is percentile 99 of the this flow is below this threshold, the flow will pass for this test, defaults to 1.0

Raises:
  • ValueError – When an unsupported source Port type is given.

  • FeatureNotSupported – When the source is a ByteBlower Endpoint.

analyse() None

Pass or fail for this test.

class byteblower_test_framework.traffic.HTTPFlow

Bases: TcpFlow

Flow for generating and analyzing TCP and HTTP data traffic.

HTTP flow involves a client initiating a TCP connection to a server, exchanging HTTP requests and responses (GET/PUT), and then closing the connection. This enables the transfer of web content between client and server.

Since v2.22.0, ByteBlower supports L4S for HTTP flow. Low Latency, Low Loss, and Scalable Throughput (L4S) is a versatile technology enhancing internet performance across various networks like fibre, 5G, and Wi-Fi networks. It innovates on traditional TCP by using the Prague requirements, to more effectively signal and respond to congestion through Explicit Congestion Notification (ECN). This approach allows for quicker, more precise adjustments in data transmission, leading to increased network efficiency and reduced latency. More details on L4S and low latency testing can be found in Test Case: Low Latency.

Changed in version 1.3.0: Support for L4S was added

__init__(source: Port | Endpoint, destination: Port | Endpoint, name: str | None = None, http_method: HttpMethod = HttpMethod.AUTO, tcp_server_port: int | None = None, tcp_client_port: int | None = None, request_duration: timedelta | float | int | None = None, request_size: int | None = None, initial_time_to_wait: timedelta | float | int | None = None, rate_limit: int | None = None, maximum_bitrate: int | float | None = None, enable_tcp_prague: bool | None = None, receive_window_scaling: int | None = None, slow_start_threshold: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, **kwargs) None

Create an HTTP flow.

Parameters:
  • source (Union[Port, Endpoint]) – Sending endpoint of the data traffic

  • destination (Union[Port, Endpoint]) – Receiving endpoint of the data traffic

  • name (Optional[str], optional) – Name of this Flow, defaults to auto-generated name when set to None.

  • http_method (HttpMethod, optional) – HTTP Method of this request, defaults to HttpMethod.AUTO

  • tcp_server_port (Optional[int], optional) – TCP port of the HTTP server, defaults to None

  • tcp_client_port (Optional[int], optional) – TCP port of the HTTP client, defaults to None

  • request_duration (Optional[Union[timedelta, float, int]], optional) – Duration of the HTTP data transfer. Mutual exclusive with request_size, defaults to None

  • request_size (Optional[int], optional) – Size of the HTTP data to transfer (in Bytes). Mutual exclusive with request_duration, defaults to None

  • initial_time_to_wait (Optional[Union[timedelta, float, int]], optional) – Initial time to wait to start the flow, defaults to None

  • rate_limit (Optional[int], optional) –

    Limit the data traffic rate (in Bytes per second). Mutual exclusive with maximum_bitrate, defaults to None (== no limit)

    Deprecated since version 1.2.0: Deprecated rate_limit in favor of maximum_bitrate. Will be removed in the next release.

  • maximum_bitrate (Optional[Union[int, float]], optional) –

    Limit the data traffic rate (in bits per second). Mutual exclusive with rate_limit, defaults to None (== no limit)

    Added in version 1.2.0: Added maximum_bitrate deprecating rate_limit.

  • enable_tcp_prague (Optional[bool], optional) –

    When given, enable TCP Prague congestion avoidance algorithm on both TCP client and server, defaults to None. (Server default; default for ByteBlower Port, host operating system default for ByteBlower Endpoint).

    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 enable_tcp_prague for L4S support in HTTP flow.

  • receive_window_scaling (Optional[int], optional) –

    When given, enable receive window scaling with the given scale factor, defaults to None.

    When ByteBlower Endpoints are involved, this setting will not be applied on them, but only on the HTTP Server on the ByteBlower Port. The ByteBlower Endpoint has no control over the TCP parameters of the host operating system’s. It is then up to the Endpoint’s host configuration whether this setting will be applicable or not.

  • slow_start_threshold (Optional[int], optional) –

    Slow start threshold value of TCP, defaults to None.

    When ByteBlower Endpoints are involved, this setting will not be applied on them, but only on the HTTP Server on the ByteBlower Port. The ByteBlower Endpoint has no control over the TCP parameters of the host operating system’s. It is then up to the Endpoint’s host configuration whether this setting will be applicable or not.

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (Optional[int], optional) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

Raises:

ConflictingInput – When invalid combination of configuration parameters is given

property duration: timedelta

Returns the duration of the HTTP flow.

Raises:

NotDurationBased – If the HTTPFlow is sized based.

Returns:

duration of the flow.

Return type:

timedelta

property enable_tcp_prague: bool | None

Whether TCP Prague is enabled.

Added in version 1.3.0: Add enabling TCP Prague for L4S

property initial_time_to_wait: timedelta

Return the time to wait before the flow starts.

property maximum_bitrate: int | float | None

Return the requested HTTP rate limit.

Returns:

The maximum bitrate, in bits per second.

Return type:

Optional[int]

prepare_start(maximum_run_time: timedelta | None = None) Iterable[SynchronizedExecutable]

Start a HTTP server and schedule the client data transfer.

Return type:

Iterable[SynchronizedExecutable]

property rate_limit: float | None

Return the requested HTTP rate limit.

Returns:

The rate limit, in bytes per second.

Return type:

Optional[float]

property receive_window_scaling: int | None

TCP Receive Window scaling.

release() None

Release all resources used on the ByteBlower system.

Releases all resources related to traffic generation and analysis.

Note

Virtual method with implementation. Should be called by child implementations.

Note

The resources related to endpoints and server themselves are not released.

property slow_start_threshold: int | None

TCP Slow Start Threshold.

property tcp_server_port: int | None

TCP port of the HTTP server.

class byteblower_test_framework.traffic.HttpMethod

Bases: Enum

HTTP method used for HTTP (client) sessions.

AUTO = 'Automatic'
GET = 'GET'
PUT = 'PUT'
class byteblower_test_framework.traffic.IPv4Frame

Bases: Frame

Frame interface for IPv4.

__init__(length: int | None = None, udp_src: int | None = None, udp_dest: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ipv4_tos: int | None = None, latency_tag: bool = False) None

Create the interface to an IPv4 frame.

Parameters:
  • length (Optional[int], optional) – Frame length. This is the layer 2 (Ethernet) frame length excluding Ethernet FCS and excluding VLAN tags, defaults to DEFAULT_FRAME_LENGTH

  • udp_src (Optional[int], optional) – UDP source port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (Optional[int], optional) – UDP destination port, defaults to UDP_DYNAMIC_PORT_START

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ipv4_tos, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ipv4_tos, defaults to DEFAULT_IP_ECN

  • ipv4_tos (Optional[int], optional) – Exact IPv4 ToS field value, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • latency_tag (bool, optional) – Enable latency tag generation in the Frame, defaults to False

Raises:
  • InvalidInput – When invalid configuration values are given.

  • ConflictingInput – When invalid combination of configuration parameters is given

class byteblower_test_framework.traffic.IPv6Frame

Bases: Frame

Frame interface for IPv6.

__init__(length: int | None = None, udp_src: int | None = None, udp_dest: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ipv6_tc: int | None = None, latency_tag: bool = False) None

Create the interface to an IPv6 frame.

Parameters:
  • length (Optional[int], optional) – Frame length. This is the layer 2 (Ethernet) frame length excluding Ethernet FCS and excluding VLAN tags, defaults to DEFAULT_FRAME_LENGTH

  • udp_src (Optional[int], optional) – UDP source port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (Optional[int], optional) – UDP destination port, defaults to UDP_DYNAMIC_PORT_START

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ipv6_tc, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ipv6_tc, defaults to DEFAULT_IP_ECN

  • ipv6_tc (Optional[int], optional) – Exact IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • latency_tag (bool, optional) – Enable latency tag generation in the Frame, defaults to False

Raises:
  • InvalidInput – When invalid configuration values are given.

  • ConflictingInput – When invalid combination of configuration parameters is given

class byteblower_test_framework.traffic.Imix

Bases: object

Configuration of an Internet mix.

For a given UDP source and destination port, define a weighted collection of frame sizes.

Note

We tend to use a single UDP port for all frames. This has some benefits in initialization time (for example much less need for NAT/NAPT resolution).

__init__(frame_config: Sequence[ImixFrameConfig] = [ImixFrameConfig(length=72, weight=34), ImixFrameConfig(length=124, weight=6), ImixFrameConfig(length=252, weight=4), ImixFrameConfig(length=508, weight=4), ImixFrameConfig(length=1020, weight=9), ImixFrameConfig(length=1276, weight=25), ImixFrameConfig(length=1510, weight=18)], udp_src: int = 49152, udp_dest: int = 49152, ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, latency_tag: bool = False, random_order: bool = True) None

Create a frame based on the (source) Port type.

Parameters:
  • frame_config (Sequence[ImixFrameConfig], optional) – Collection of IMIX frame configurations, defaults to DEFAULT_IMIX_FRAME_CONFIG

  • udp_src (int, optional) – UDP source port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (int, optional) – UDP destination port, defaults to UDP_DYNAMIC_PORT_START

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (int | None) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • latency_tag (bool, optional) – Enable latency tag generation in the Frame, defaults to False

  • random_order (bool, optional) – Enable shuffle of the generated frames, defaults to True

Raises:
  • InvalidInput – When invalid configuration values are given.

  • ConflictingInput – When invalid combination of configuration parameters is given

property udp_dest: int

UDP destination port.

property udp_src: int

UDP source port.

class byteblower_test_framework.traffic.ImixFrameConfig

Bases: object

Configuration for an IMIX frame.

__init__(length: int, weight: int) None
length: int

Frame length. This is the layer 2 (Ethernet) frame length excluding Ethernet FCS and excluding VLAN tags.

weight: int

Weight of this frame size in the list of frames in the Imix.

class byteblower_test_framework.traffic.MobileFrame

Bases: ABC

Mobile Frame Interface.

Added in version 1.2.0: Added for ByteBlower Endpoint support.

__init__(length: int | None = None, udp_src: int | None = None, udp_dest: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, latency_tag: bool = False) None

Create the mobile frame for the wireless endpoint.

Parameters:
  • length (int, optional) – Frame length. This is the layer 2 (Ethernet) frame length excluding Ethernet FCS and excluding VLAN tags, defaults to DEFAULT_FRAME_LENGTH

  • udp_src (int, optional) – UDP source port, defaults to UDP_DYNAMIC_PORT_START

  • udp_dest (int, optional) – UDP destination port, defaults to UDP_DYNAMIC_PORT_START

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (Optional[int], optional) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • latency_tag (bool, optional) – Enable latency tag generation in the Frame, defaults to False

Raises:
  • InvalidInput – When invalid configuration values are given.

  • ConflictingInput – When invalid combination of configuration parameters is given

property length: int

Ethernet length without FCS and without VLAN tags.

release(stream: StreamMobile) None

Release this frame resources used on the ByteBlower system.

Note

The resources related to the stream itself is not released.

property udp_dest

UDP destination port.

property udp_src

UDP source port.

class byteblower_test_framework.traffic.TCPCongestionAvoidanceAlgorithm

Bases: Enum

TCP Congestion Avoidance Algorithm.

Changed in version 1.2.0: Fixed for Python upper case naming convention.

NEW_RENO = 'new-reno'
NEW_RENO_WITH_CUBIC = 'new-reno-with-cubic'
NONE = 'None'
SACK = 'sack'
SACK_WITH_CUBIC = 'sack-with-cubic'
class byteblower_test_framework.traffic.VideoFlow

Bases: TcpFlow

Flow simulating video traffic.

__init__(source: Port, destination: Port, name: str | None = None, segment_size: int = 2000000, segment_duration: timedelta | float = datetime.timedelta(seconds=2, microseconds=500000), buffering_goal: timedelta | float = datetime.timedelta(seconds=60), play_goal: timedelta | float = datetime.timedelta(seconds=5), ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, **kwargs) None

Create a video flow.

Parameters:
  • source (Port) – Sending endpoint of the data traffic

  • destination (Port) – Receiving endpoint of the data traffic

  • name (Optional[str], optional) – Name of this Flow, defaults to auto-generated name when set to None.

  • segment_size (int, optional) – size of video segment, defaults to 2*1000*1000

  • segment_duration (Union[timedelta, float], optional) – duration of video segment, defaults to timedelta(seconds=2.500)

  • buffering_goal (Union[timedelta, float], optional) – _description_, defaults to timedelta(seconds=60)

  • play_goal (Union[timedelta, float], optional) – _description_, defaults to timedelta(seconds=5)

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (Optional[int], optional) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

Raises:
  • FeatureNotSupported – When video flow is using ByteBlower Endpoint

  • ValueError – When an invalid value for segment_duration is used

  • ValueError – When an invalid value for buffering_goal is used

  • ValueError – When an invalid value for play_goal is used

analyse() None

Pass or fail for this test.

property buffering_goal: timedelta
property duration: timedelta

Returns the duration of the Video flow.

Raises:

InfiniteDuration – The video flow always runs forever.

Returns:

duration of the flow.

Return type:

timedelta

property initial_time_to_wait: timedelta

Return the time to wait before the flow starts.

prepare_start(maximum_run_time: timedelta | None = None) Iterable[SynchronizedExecutable]

Prepare the flow and its analysers to start traffic and analysis.

Warning

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

Note

Virtual method with implementation. Should be called by child implementations.

Return type:

Iterable[SynchronizedExecutable]

process() None

Note

Virtual method with implementation. Should be called by child implementations.

release() None

Release all resources used on the ByteBlower system.

Releases all resources related to traffic generation and analysis.

Note

Virtual method with implementation. Should be called by child implementations.

Note

The resources related to endpoints and server themselves are not released.

property segment_duration: timedelta
property segment_size: int
updatestats() None

Note

Virtual method with implementation. Should be called by child implementations.

class byteblower_test_framework.traffic.VoiceFlow

Bases: FrameBlastingFlow

Flow for simulating voice traffic.

The implementation simulates G.711 RTP traffic.

__init__(source: Port | Endpoint, destination: Port | Endpoint, name: str | None = None, packetization: int | None = None, number_of_frames: int | None = None, duration: timedelta | float | int | None = None, initial_time_to_wait: timedelta | float | int | None = None, udp_src: int | None = None, udp_dest: int | None = None, ip_dscp: int | None = None, ip_ecn: int | None = None, ip_traffic_class: int | None = None, enable_latency: bool | None = False, **kwargs) None

Create a G.711 voice flow with the given packetization.

Typical packetization times are:

  • 20ms packetization
    • Packet rate = 50 pps

    • RTP packet size = 160 Bytes

  • 10ms packetization
    • Packet rate = 100 pps

    • RTP packet size = 80 Bytes

Parameters:
  • source (Union[Port, Endpoint]) – Sending port of the voice stream

  • destination (Union[Port, Endpoint]) – Receiving port of the voice stream

  • name (Optional[str], optional) – Name of this Flow, defaults to auto-generated name when set to None.

  • packetization (Optional[int], optional) – Packetization time of the RTP packets in milliseconds, defaults to DEFAULT_G711_PACKETIZATION.

  • number_of_frames (Optional[int], optional) – Number of frames to transmit, defaults to DEFAULT_NUMBER_OF_FRAMES

  • duration (Optional[Union[timedelta, float, int]], optional) – Duration of the flow in seconds, defaults to None (use number_of_frames instead)

  • initial_time_to_wait (Optional[Union[timedelta, float, int]], optional) – Initial time to wait to start the flow. In seconds, defaults to None (start immediately)

  • udp_src (Optional[int], optional) – UDP src port, defaults to :const`UDP_DYNAMIC_PORT_START`

  • udp_dest (Optional[int], optional) – UDP dest port, defaults to :const`UDP_DYNAMIC_PORT_START`

  • ip_dscp (Optional[int], optional) – IP Differentiated Services Code Point (DSCP), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_DSCP

  • ip_ecn (Optional[int], optional) – IP Explicit Congestion Notification (ECN), mutual exclusive with ip_traffic_class, defaults to DEFAULT_IP_ECN

  • ip_traffic_class (int | None) – The IP traffic class value is used to specify the exact value of either the IPv4 ToS field or the IPv6 Traffic Class field, mutual exclusive with ip_dscp and ip_ecn, defaults to field value composed from ip_dscp and ip_ecn.

  • enable_latency (Optional[bool], optional) – Enable latency tag in the packets (required for latency measurements at the destination port), defaults to False

Raises:

InvalidInput – When the type of the given source port is not supported.

byteblower_test_framework.traffic.string_array_to_int(value: int | str | bytes | bytearray) int

Assure that a given value is an integer.

The value will be parsed from string if it is not already an integer type.

This function can help to allow script users to provide values in a human-readable format. For example IP DSCP values in hexadecimal string format in a JSON file. Where JSON only supports integer values in decimal format.

Parameters:

value (Union[int, str, bytes, bytearray]) – Value to convert

Returns:

Integer value converted from the input

Return type:

int