Defining the recursive network

Experimenters can define their recursive network by using the building blocks listed below.

class rumba.model.Node(name, difs=None, dif_registrations=None, policies=None, machine_type=None)[source]

A node in the experiment.

Parameters:
  • name – Name of the node.
  • difs – A list of DIFs the node is in.
  • dif_registrations – How the DIFs are stacked.
  • policies – Policies of a DIF specific to the node.
  • machine_type – Type of machine to use, physical or virtual.
add_dif(dif)[source]

Adds a DIF to the list.

Parameters:dif – Name of the DIF to add.
add_dif_registration(upper, lower)[source]

Adds a DIF registration.

Parameters:
  • upper – Name of the DIF that is requesting IPC.
  • lower – Name of the DIF providing IPC.
add_policy(dif, component_name, policy_name, **parameters)[source]

Adds a policy.

Parameters:
  • dif – The name of the DIF.
  • component_name – Name of the component.
  • policy_name – Name of the policy.
  • parameters – Parameters of the policy.
copy_file(path, destination)[source]

Copy file to node.

Parameters:
  • path – Local location of the file.
  • destination – Destination location of the file.
copy_files(paths, destination)[source]

Copy files to node.

Parameters:
  • paths – Local location of the files.
  • destination – Destination location of the files.
del_dif(dif)[source]

Adds a DIF to the list.

Parameters:dif – Name of the DIF to add.
del_dif_registration(upper, lower)[source]

Removes a DIF registration.

Parameters:
  • upper – Name of the DIF that is requesting IPC.
  • lower – Name of the DIF providing IPC.
del_policy(dif, component_name=None, policy_name=None)[source]
Removes a policy.
Parameters:
  • dif – the dif to which the policy should be applied
  • component_name – Name of the component.
  • policy_name – Name of the policy.
execute_command(command, as_root=False, time_out=3, use_proxy=False)[source]

Execute a single command on a node.

Parameters:
  • command – A command.
  • as_root – Execute as root?
  • time_out – Seconds before timing out.
  • use_proxy – Use a proxy to execute the commands?
Returns:

The stdout of the command.

execute_commands(commands, as_root=False, time_out=3, use_proxy=False)[source]

Execute a list of a commands on the node.

Parameters:
  • commands – A list of commands.
  • as_root – Execute as root?
  • time_out – Seconds before timing out.
  • use_proxy – Use a proxy to execute the commands?
fetch_file(path, destination, sudo=False)[source]

Fetch file from the node.

Parameters:
  • path – Location of the files on the node.
  • destination – Destination location of the files.
  • sudo – The file is owned by root on the node?
fetch_files(paths, destination, sudo=False)[source]

Fetch files from the node.

Parameters:
  • paths – Location of the files on the node.
  • destination – Destination location of the files.
  • sudo – The file is owned by root on the node?
get_ipcp_by_dif(dif)[source]
Parameters:dif – The DIF to get the IPCP of.
Returns:The IPCP of the node that is in the DIF.
get_policy(dif)[source]
Parameters:dif – The DIF to get the policy of.
Returns:Returns the policy.

Change the state of a link on the node.

Parameters:
  • dif – The name of the shim Ethernet DIF.
  • state – Up or down.
class rumba.model.DIF(name, members=None)[source]

Base class for DIFs.

Parameters:
  • name – Name of the DIF.
  • members – List of nodes that are members of the DIF.
class rumba.model.NormalDIF(name, members=None, policy=None, add_default_qos_cubes=True)[source]

Normal DIF.

Parameters:
  • name – The name of the DIF.
  • members – The list of members.
  • policy – Policies of the normal DIF.
  • add_default_qos_cubes – should the prototype-dependant default QoS cubes be added to this DIF?
add_policy(comp, pol, **params)[source]

Adds a policy to the DIF.

Parameters:
  • comp – Component name.
  • pol – Policy name
  • params – Parameters of the policy.
add_qos_cube(name, **kwargs)[source]

Adds a QoS Cube to this DIF

Parameters:
  • name (str) – the name to be assigned to the QoS cube
  • kwargs – the parameters of the QoS cube (prototype dependent)
del_policy(comp=None, pol=None)[source]

Deletes a policy from the DIF.

Parameters:
  • comp – Component name.
  • pol – Policy name
del_qos_cube(name, strict=True)[source]

Deletes a QoS cube from this DIF

Parameters:
  • name (str) – the name of the cube to delete
  • strict (bool) – if no cube with the provided name exists, raise an exception if and only if strict is True
show()[source]
Returns:A string representing the policies in the DIF.
class rumba.model.ShimUDPDIF(name, members=None)[source]

Shim over UDP.

Parameters:
  • name – Name of the DIF.
  • members – List of members of the DIF.
class rumba.model.ShimEthDIF(name, members=None, link_quality=None)[source]

Shim over Ethernet.

Parameters:
  • name – Name of the DIF.
  • members – List of members of the DIF.
  • link_quality – Quality of the link.
set_delay(delay=0, jitter=None, correlation=None, distribution=None)[source]

Set the delay parameters of the underlying link. Parameters as in Delay

Parameters:
  • delay (int) – average delay in ms
  • jitter (int) – jitter in ms
  • correlation (int) – correlation in %
  • distribution (Distribution) – delay distribution, defaults to a Normal distribution
set_loss(loss=0, correlation=None)[source]

Set the loss parameter of the underlying link. Parameters as in Loss

Parameters:
  • loss (int or float) – loss in percentage
  • correlation (int or float) – correlation in percentage
set_quality(delay, loss, rate)[source]

Configure the basic quality parameters of the underlying link.

Parameters:
  • delay (int) – the link delay, in ms
  • loss (float or int) – the link loss, as a percentage
  • rate (int) – the link rate in mbps
set_rate(rate=None)[source]

Set the rate parameter of the underlying link.

Parameters:rate (int) – The desired rate in mbps
class rumba.model.Distribution[source]

An enum holding different statistical distributions.

Values:

NORMAL = 1

PARETO = 2

PARETONORMAL = 3

class rumba.model.Delay(delay=0, jitter=None, correlation=None, distribution=None)[source]

A class representing delay of a link.

Configure link delay.

Parameters:
  • delay (int or float) – average delay in ms
  • jitter (int) – jitter in ms
  • correlation (int) – correlation in %
  • distribution (Distribution) – delay distribution, defaults to a Normal distribution
class rumba.model.Loss(loss, correlation=None)[source]

A class representing loss on a link.

Configure link loss.

Parameters:
  • loss (int or float) – loss in percentage
  • correlation (int or float) – correlation in percentage
class rumba.model.LinkQuality(delay=None, loss=None, rate=None)[source]

A class representing the link quality.

Link quality configuration.

Parameters:
  • delay (Delay or int) – Delay object holding delay configuration or number corresponding to delay in ms
  • loss (Loss or float) – Loss object holding delay configuration or number corresponding to loss percentage
  • rate (int) – The rate of the link in mbit
classmethod clone(old_quality, delay=None, loss=None, rate=None)[source]

Clone old_quality, updating it with the provided parameters if present.

Parameters:
  • old_quality (LinkQuality) – A LinkQuality instance to use as a base
  • delay (Delay or int) – Delay object holding delay configuration or number corresponding to delay in ms
  • loss (Loss or float) – Loss object holding delay configuration or number corresponding to loss percentage
  • rate (int) – The rate of the link in mbit
Returns:

a new LinkQuality instance.

Return type:

LinkQuality