Experiment

Flow

User API to setup and run experiments on a given topology

class nest.experiment.experiment.Application(source_node: Node, destination_node: Node, destination_address: Address)

Bases: object

Defines an application in the topology

property destination_address

Getter for destination address

class nest.experiment.experiment.CoapApplication(source_node: Node, destination_node: Node, destination_address: Address, n_con_msgs: int, n_non_msgs: int, user_options=None)

Bases: Application

Defines a CoAP application in the topology

class nest.experiment.experiment.Experiment(name: str)

Bases: object

Handles experiment to be run on topology

add_coap_application(coap_application: CoapApplication)

Add a CoAP application to experiment

Parameters:

coap_application (CoapApplication) – The coap application to be added to experiment

add_flow(flow)

Add flow to experiment By default, the flow is assumed to be TCP with cubic congestion algorithm

Parameters:

flow (Flow) – Add flow to experiment

add_mpeg_dash_application(mpeg_dash_applications)

Add an MPEG-DASH application to the experiment

Parameters:

mpeg_dash_applications (Union[MpegDashApplication,list]) – The MPEG-DASH application(s) to be added to experiment

add_mptcp_flow(flow: Flow, congestion_algorithm='cubic', tool: str = 'netperf', **kwargs: dict)

Add MPTCP flow to experiment. If no congestion control algorithm is specified, then by default cubic is used.

Note: The congestion control algorithm specified in this API overrides the congestion control algorithm specified in topology.Node.configure_tcp_param() API.

Parameters:
  • flow (Flow) – Flow to be added to experiment

  • congestion_algorithm (str) – TCP congestion algorithm (Default value = ‘cubic’)

  • tool (str) – Tool (netperf/iperf3) to be used for the experiment (Default value = ‘netperf’)

add_tcp_flow(flow: Flow, congestion_algorithm='cubic', tool: str = 'netperf', **kwargs: dict)

Add TCP flow to experiment. If no congestion control algorithm is specified, then by default cubic is used.

Note: The congestion control algorithm specified in this API overrides the congestion control algorithm specified in topology.Node.configure_tcp_param() API.

Parameters:
  • flow (Flow) – Flow to be added to experiment

  • congestion_algorithm (str) – TCP congestion algorithm (Default value = ‘cubic’)

  • tool (str) – Tool (netperf/iperf3) to be used for the experiment (Default value = ‘netperf’)

add_udp_flow(flow: Flow, target_bandwidth: Bandwidth = Bandwidth('1mbit'), server_options: dict = None, client_options: dict = None)

Add UDP flow to experiment

Parameters:
  • flow (Flow) – Flow to be added to experiment

  • target_bandwidth – UDP bandwidth (in Mbits) (Default value = ‘1mbit’) This bandwidth limit is for each UDP stream in the flow

configure_tcp_module_params(congestion_algorithm, **kwargs)

Set TCP module parameters

Parameters:
  • congestion_algorithm (str) – TCP congestion algorithm

  • **kwargs – module parameters to set

new_cong_algos = []
old_cong_algos = {}
require_qdisc_stats(interface: BaseInterface, stats='')

Stats to be obtained from qdisc in interface

Parameters:
  • interface (BaseInterface) – Interface containing the qdisc

  • stats (list(str)) – Stats required (Default value = ‘’) [NOT SUPPORTED]

run()

Run the experiment

class nest.experiment.experiment.Flow(source_node: Node, destination_node: Node, destination_address: Address, start_time: int, stop_time: int, number_of_streams: int, source_address: Address = None)

Bases: object

Defines a flow in the topology

property destination_address

Getter for destination address

property protocol

Getter for protocol

static setup_mptcp_connection(source_interface: BaseInterface, destination_interface: BaseInterface, start_time: int, stop_time: int, number_of_streams: int = 1)

Creates and returns an MPTCP flow for given source and destination interface with all MPTCP endpoints enabled on both nodes

Parameters:
  • source_interface (Interface) – Source interface for MPTCP Flow

  • destination_interface (Interface) – Destination interface for MPTCP Flow

  • start_time (int) – Start time for the flow

  • stop_time (int) – Stop time for the flow

  • number_of_streams (int = 1) – Number of streams in the flow

Returns:

An MPTCP capable flow from source_interface to destination_interface

Return type:

Flow

property source_address

Getter for source address

class nest.experiment.experiment.MpegDashApplication(source_node: Node, destination_node: Node, source_address: Address, destination_address: Address, port: int, encoded_chunks_path: Path, duration: int, player: str, enable_audio_playback: bool = False, additional_player_options=None)

Bases: Application

Defines an MPEG DASH application in the topology

supported_media_players = ['gpac', 'vlc']

run_exp

Script to be run for running experiments on topology

nest.experiment.run_exp.cleanup()

Clean up

nest.experiment.run_exp.dump_json_outputs()

Outputs experiment results as json dumps

nest.experiment.run_exp.get_dependency_status(exp, tools)

Checks for dependency

Parameters:
  • exp (Experiment) – The experiment attributes

  • tools (List[str]) – list of tools to check for it’s installation

Returns:

contains information as to whether tools are installed

Return type:

dict

nest.experiment.run_exp.progress_bar(stop_time, precision=1)

Show a progress bar from from 0 units to stop_time

The time unit is decided by precision in seconds. It is 1s by default.

Parameters:
  • stop_time (int) – The time needed 100% completion

  • precision (int) – Time unit for updating progress bar. 1 second be default

nest.experiment.run_exp.run_experiment(exp)

Run experiment

Parameters:

exp (Experiment) – The experiment attributes

nest.experiment.run_exp.run_server(iperf3options, exp_end_t, protocol, is_mptcp)

Run and wait for all server to start

Parameters:
  • iperf3options (dict) – start server with iperf3 server options

  • exp_end_t (int) – experiment completion time

  • protocol (str) – transport layer protocol, either “tcp” or “udp”

nest.experiment.run_exp.run_workers(workers)

Run and wait for processes to finish

Parameters:

workers (list[multiprocessing.Process]) – List of processes to be run

nest.experiment.run_exp.setup_coap_runners(dependency, application, destination_nodes)

Setup CoAPRunner objects for generating CoAP traffic

Parameters:
  • dependency (int) – Whether aiocoap is installed

  • application (CoapApplication) – The CoapApplication object

  • destination_nodes – Destination nodes so far already running CoAP server

Returns:

runners – List of CoAPRunner objects for the current flow object

Return type:

List[CoAPRunner]

nest.experiment.run_exp.setup_flow_workers(exp_runners, exp_stop_time)

Setup flow generation and stats collection processes(netperf, ss, tc, iperf3…).

Also add a progress bar process for showing experiment progress.

Parameters:
  • exp_runners (collections.NamedTuple) – all(netperf, ping, ss, tc..) the runners

  • exp_stop_time (int) – Time when experiment stops (in seconds)

Returns:

flow generation and stats collection processes + progress bar process

Return type:

List[multiprocessing.Process]

nest.experiment.run_exp.setup_mpeg_dash_runners(dependency, application, ss_schedules, destination_nodes)

Setup MpegDashRunner objects for generating Mpeg-Dash traffic

Parameters:
  • dependency (int) – Whether dependencies required for MPEG-DASH emulation are installed or not.

  • application (MpegDashApplication) – The MpegDashApplication object

  • destination_nodes – Server nodes so far already running Mpeg-Dash server

Returns:

(runners,ss_schedules)

runnersList[MpegDashRunner]

List of MpegDashRunner objects for the current flow object

ss_schedules: List

List containing ss schedule information

Return type:

Tuple

nest.experiment.run_exp.setup_parser_workers(exp_runners)

Setup parsing processes

Parameters:

exp_runners (collections.NamedTuple) – all(netperf, ping, ss, tc..) the runners

Returns:

parsers

Return type:

List[multiprocessing.Process]

nest.experiment.run_exp.setup_ping_runners(dependency, ping_schedules)

setup PingRunners for collecting latency

Parameters:
  • dependency (int) – whether ping is installed

  • ping_schedules (dict) – start time and end time for PingRunners

Returns:

  • workers (List[multiprocessing.Process]) – Processes to run ss at nodes

  • runners (List[PingRunner])

nest.experiment.run_exp.setup_plotter_workers()

Setup plotting processes

Returns:

plotters

Return type:

List[multiprocessing.Process]

nest.experiment.run_exp.setup_ss_runners(dependency, ss_schedules, ss_filter)

setup SsRunners for collecting tcp socket statistics

Parameters:
  • dependency (int) – whether ss is installed

  • ss_schedules (dict) – start time and end time for SsRunners

Returns:

  • workers (List[multiprocessing.Process]) – Processes to run ss at nodes

  • runners (List[SsRunners])

nest.experiment.run_exp.setup_tc_runners(dependency, qdisc_stats, exp_end)

setup TcRunners for collecting qdisc statistics

Parameters:
  • dependency (int) – whether tc is installed

  • qdisc_stats (dict) – info regarding nodes to run tc on

  • exp_end (float) – time to stop running tc

Returns:

  • workers (List[multiprocessing.Process]) – Processes to run tc at nodes

  • runners (List[TcRunners])

nest.experiment.run_exp.setup_tcp_flows(dependencies, flow, ss_schedules, destination_nodes, is_mptcp=False)

Setup netperf/iperf3 to run tcp flows :param dependencies: whether dependencies are installed :type dependencies: dictionary of dependencies :param flow: Flow parameters :type flow: Flow :param ss_schedules: ss_schedules so far :param destination_nodes: Destination nodes so far already running netperf/iperf3 server :param is_mptcp: boolean to determine if connection is MPTCP enabled

Returns:

  • dependency (int) – updated dependency in case netperf/iperf3 is not installed

  • tcp_runners (List[NetperfRunner] / List[Iperf3Runner]) – all the netperf/iperf3 flows generated

  • workers (List[multiprocessing.Process]) – Processes to run netperf/iperf3 flows

  • ss_schedules (dict) – updated ss_schedules

nest.experiment.run_exp.setup_udp_flows(dependency, flow)

Setup iperf3 to run udp flows

Parameters:
  • dependency (int) – whether iperf3 is installed

  • flow (Flow) – Flow parameters

  • destination_nodes – Destination nodes so far already running iperf3 server

Returns:

  • dependency (int) – updated dependency in case iproute2 is not installed

  • iperf3_runners (List[NetperfRunner]) – all the iperf3 udp flows generated

  • workers (List[multiprocessing.Process]) – Processes to run iperf3 udp flows

nest.experiment.run_exp.tcp_modules_helper(exp)

This function is called at the beginning of run_experiment to perform tcp modules related helper tasks

Parameters:

exp (Experiment) – The experiment attributes