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_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_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?
-
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)
- name (
-
del_policy
(comp=None, pol=None)[source]¶ Deletes a policy from the DIF.
Parameters: - comp – Component name.
- pol – Policy name
-
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
- delay (
-
set_loss
(loss=0, correlation=None)[source]¶ Set the loss parameter of the underlying link. Parameters as in
Loss
Parameters: - loss (
int
orfloat
) – loss in percentage - correlation (
int
orfloat
) – correlation in percentage
- loss (
-
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
orfloat
) – average delay in ms - jitter (
int
) – jitter in ms - correlation (
int
) – correlation in % - distribution (
Distribution
) – delay distribution, defaults to a Normal distribution
- delay (
-
class
rumba.model.
Loss
(loss, correlation=None)[source]¶ A class representing loss on a link.
Configure link loss.
Parameters: - loss (
int
orfloat
) – loss in percentage - correlation (
int
orfloat
) – correlation in percentage
- loss (
-
class
rumba.model.
LinkQuality
(delay=None, loss=None, rate=None)[source]¶ A class representing the link quality.
Link quality configuration.
Parameters: -
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
) – ALinkQuality
instance to use as a base - delay (
Delay
orint
) – Delay object holding delay configuration or number corresponding to delay in ms - loss (
Loss
orfloat
) – 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: - old_quality (
-
classmethod