rename experience -> experiment
This commit is contained in:
parent
93b9b31ab5
commit
36fed8cc71
@ -1,9 +1,9 @@
|
|||||||
from .parameter import Parameter
|
from .parameter import Parameter
|
||||||
from topos.multi_interface import MultiInterfaceTopo
|
from topos.multi_interface import MultiInterfaceTopo
|
||||||
|
|
||||||
class ExperienceParameter(Parameter):
|
class ExperimentParameter(Parameter):
|
||||||
"""
|
"""
|
||||||
Handler for experience parameters stored in configuration files
|
Handler for experiment parameters stored in configuration files
|
||||||
"""
|
"""
|
||||||
RMEM = "rmem"
|
RMEM = "rmem"
|
||||||
WMEM = "wmem"
|
WMEM = "wmem"
|
||||||
@ -53,7 +53,7 @@ class ExperienceParameter(Parameter):
|
|||||||
KERNELPMS: "net.mptcp.mptcp_path_manager",
|
KERNELPMS: "net.mptcp.mptcp_path_manager",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Default values for unspecified experience parameters
|
# Default values for unspecified experiment parameters
|
||||||
DEFAULT_PARAMETERS = {
|
DEFAULT_PARAMETERS = {
|
||||||
RMEM: "10240 87380 16777216",
|
RMEM: "10240 87380 16777216",
|
||||||
WMEM: "4096 16384 4194304",
|
WMEM: "4096 16384 4194304",
|
||||||
@ -83,11 +83,11 @@ class ExperienceParameter(Parameter):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, parameter_filename):
|
def __init__(self, parameter_filename):
|
||||||
super(ExperienceParameter, self).__init__(parameter_filename)
|
super(ExperimentParameter, self).__init__(parameter_filename)
|
||||||
self.default_parameters = ExperienceParameter.DEFAULT_PARAMETERS
|
self.default_parameters = ExperimentParameter.DEFAULT_PARAMETERS
|
||||||
|
|
||||||
def get(self, key):
|
def get(self, key):
|
||||||
val = super(ExperienceParameter, self).get(key)
|
val = super(ExperimentParameter, self).get(key)
|
||||||
if val is None:
|
if val is None:
|
||||||
if key in self.default_parameters:
|
if key in self.default_parameters:
|
||||||
return self.default_parameters[key]
|
return self.default_parameters[key]
|
||||||
@ -97,37 +97,37 @@ class ExperienceParameter(Parameter):
|
|||||||
return val
|
return val
|
||||||
|
|
||||||
|
|
||||||
class Experience(object):
|
class Experiment(object):
|
||||||
"""
|
"""
|
||||||
Base class to instantiate an experience to perform.
|
Base class to instantiate an experiment to perform.
|
||||||
|
|
||||||
This class is not instantiable as it. You must define a child class with the
|
This class is not instantiable as it. You must define a child class with the
|
||||||
`NAME` attribute.
|
`NAME` attribute.
|
||||||
|
|
||||||
By default, an Experience relies on an instance of ExperienceParameter to
|
By default, an Experiment relies on an instance of ExperimentParameter to
|
||||||
collect the parameters from the experience configuration file. However, an
|
collect the parameters from the experiment configuration file. However, an
|
||||||
experience may introduce specific parameters in the configuration file. In
|
experiment may introduce specific parameters in the configuration file. In
|
||||||
such case, the inherinting class must override the `PARAMETER_CLASS` class
|
such case, the inherinting class must override the `PARAMETER_CLASS` class
|
||||||
variable to point to another class inheriting from ExperienceParameter.
|
variable to point to another class inheriting from ExperimentParameter.
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
experience_parameter Instance of ExperienceParameter
|
experiment_parameter Instance of ExperimentParameter
|
||||||
topo Instance of Topo
|
topo Instance of Topo
|
||||||
topo_config Instance of TopoConfig
|
topo_config Instance of TopoConfig
|
||||||
"""
|
"""
|
||||||
PARAMETER_CLASS = ExperienceParameter
|
PARAMETER_CLASS = ExperimentParameter
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
"""
|
"""
|
||||||
Instantiation of this base class only load the experience parameter
|
Instantiation of this base class only load the experiment parameter
|
||||||
"""
|
"""
|
||||||
self.experience_parameter = self.__class__.PARAMETER_CLASS(experience_parameter_filename)
|
self.experiment_parameter = self.__class__.PARAMETER_CLASS(experiment_parameter_filename)
|
||||||
self.topo = topo
|
self.topo = topo
|
||||||
self.topo_config = topo_config
|
self.topo_config = topo_config
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
"""
|
"""
|
||||||
Load the parameter of interest from self.experience_parameter
|
Load the parameter of interest from self.experiment_parameter
|
||||||
"""
|
"""
|
||||||
# Nothing to do in the base class
|
# Nothing to do in the base class
|
||||||
pass
|
pass
|
||||||
@ -136,7 +136,7 @@ class Experience(object):
|
|||||||
"""
|
"""
|
||||||
Default function to perform the experiment. It consists into three phases:
|
Default function to perform the experiment. It consists into three phases:
|
||||||
- A preparation phase through `prepare()` (generating experiment files,...)
|
- A preparation phase through `prepare()` (generating experiment files,...)
|
||||||
- A running phase through `run()` (where the actual experience takes place)
|
- A running phase through `run()` (where the actual experiment takes place)
|
||||||
- A cleaning phase through `clean()` (stopping traffic, removing generated files,...)
|
- A cleaning phase through `clean()` (stopping traffic, removing generated files,...)
|
||||||
"""
|
"""
|
||||||
self.prepare()
|
self.prepare()
|
||||||
@ -145,11 +145,11 @@ class Experience(object):
|
|||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
"""
|
"""
|
||||||
Prepare the environment to run the experience.
|
Prepare the environment to run the experiment.
|
||||||
Typically, when you inherit from this class, you want to extend this
|
Typically, when you inherit from this class, you want to extend this
|
||||||
method, while still calling this parent function.
|
method, while still calling this parent function.
|
||||||
|
|
||||||
TODO: split experience traffic and protocol configuration
|
TODO: split experiment traffic and protocol configuration
|
||||||
"""
|
"""
|
||||||
self.setup_sysctl()
|
self.setup_sysctl()
|
||||||
self.run_userspace_path_manager() # TODO to move elsewhere
|
self.run_userspace_path_manager() # TODO to move elsewhere
|
||||||
@ -164,7 +164,7 @@ class Experience(object):
|
|||||||
"""
|
"""
|
||||||
Function only meaningful for MPTCP and its specific scheduler
|
Function only meaningful for MPTCP and its specific scheduler
|
||||||
"""
|
"""
|
||||||
metric = self.experience_parameter.get(ExperienceParameter.METRIC)
|
metric = self.experiment_parameter.get(ExperimentParameter.METRIC)
|
||||||
if int(metric) >= 0:
|
if int(metric) >= 0:
|
||||||
self.topo.command_global(
|
self.topo.command_global(
|
||||||
"echo {} > /sys/module/mptcp_sched_metric/parameters/metric".format(metric))
|
"echo {} > /sys/module/mptcp_sched_metric/parameters/metric".format(metric))
|
||||||
@ -175,8 +175,8 @@ class Experience(object):
|
|||||||
"""
|
"""
|
||||||
# Only meaningful if mpTopo is instance of MultiInterfaceTopo
|
# Only meaningful if mpTopo is instance of MultiInterfaceTopo
|
||||||
if isinstance(self.topo, MultiInterfaceTopo):
|
if isinstance(self.topo, MultiInterfaceTopo):
|
||||||
prioPath0 = self.experience_parameter.get(ExperienceParameter.PRIO_PATH0)
|
prioPath0 = self.experiment_parameter.get(ExperimentParameter.PRIO_PATH0)
|
||||||
prioPath1 = self.experience_parameter.get(ExperienceParameter.PRIO_PATH1)
|
prioPath1 = self.experiment_parameter.get(ExperimentParameter.PRIO_PATH1)
|
||||||
if not prioPath0 == prioPath1:
|
if not prioPath0 == prioPath1:
|
||||||
self.topo.command_to(self.topo_config.client, "/home/mininet/iproute/ip/ip link set dev " +
|
self.topo.command_to(self.topo_config.client, "/home/mininet/iproute/ip/ip link set dev " +
|
||||||
self.topo_config.getClientInterface(0) + " priority " + str(prioPath0))
|
self.topo_config.getClientInterface(0) + " priority " + str(prioPath0))
|
||||||
@ -189,11 +189,11 @@ class Experience(object):
|
|||||||
self.topo_config.getRouterInterfaceSwitch(1) + " priority " +
|
self.topo_config.getRouterInterfaceSwitch(1) + " priority " +
|
||||||
str(prioPath1))
|
str(prioPath1))
|
||||||
|
|
||||||
backupPath0 = self.experience_parameter.get(ExperienceParameter.BACKUP_PATH0)
|
backupPath0 = self.experiment_parameter.get(ExperimentParameter.BACKUP_PATH0)
|
||||||
if int(backupPath0) > 0:
|
if int(backupPath0) > 0:
|
||||||
self.topo.command_to(self.topo_config.client, self.topo_config.interfaceBUPCommand(self.topo_config.getClientInterface(0)))
|
self.topo.command_to(self.topo_config.client, self.topo_config.interfaceBUPCommand(self.topo_config.getClientInterface(0)))
|
||||||
self.topo.command_to(self.topo_config.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(0)))
|
self.topo.command_to(self.topo_config.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(0)))
|
||||||
backupPath1 = self.experience_parameter.get(ExperienceParameter.BACKUP_PATH1)
|
backupPath1 = self.experiment_parameter.get(ExperimentParameter.BACKUP_PATH1)
|
||||||
if int(backupPath1) > 0:
|
if int(backupPath1) > 0:
|
||||||
self.topo.command_to(self.topo_config.client, self.topo_config.interfaceBUPCommand(self.topo_config.getClientInterface(1)))
|
self.topo.command_to(self.topo_config.client, self.topo_config.interfaceBUPCommand(self.topo_config.getClientInterface(1)))
|
||||||
self.topo.command_to(self.topo_config.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(1)))
|
self.topo.command_to(self.topo_config.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(1)))
|
||||||
@ -229,31 +229,31 @@ class Experience(object):
|
|||||||
self.topo.command_to(self.topo_config.router, cmd)
|
self.topo.command_to(self.topo_config.router, cmd)
|
||||||
|
|
||||||
def run_userspace_path_manager(self):
|
def run_userspace_path_manager(self):
|
||||||
if self.experience_parameter.get(ExperienceParameter.KERNELPMC) != "netlink":
|
if self.experiment_parameter.get(ExperimentParameter.KERNELPMC) != "netlink":
|
||||||
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
||||||
else:
|
else:
|
||||||
upmc = self.experience_parameter.get(ExperienceParameter.USERPMC)
|
upmc = self.experiment_parameter.get(ExperimentParameter.USERPMC)
|
||||||
upmca = self.experience_parameter.get(ExperienceParameter.USERPMC_ARGS)
|
upmca = self.experiment_parameter.get(ExperimentParameter.USERPMC_ARGS)
|
||||||
self.topo.command_to(self.topo_config.client, upmc + \
|
self.topo.command_to(self.topo_config.client, upmc + \
|
||||||
" " + upmca + " &>upmc.log &")
|
" " + upmca + " &>upmc.log &")
|
||||||
if self.experience_parameter.get(ExperienceParameter.KERNELPMS) != "netlink":
|
if self.experiment_parameter.get(ExperimentParameter.KERNELPMS) != "netlink":
|
||||||
print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
||||||
else:
|
else:
|
||||||
upms = self.experience_parameter.get(ExperienceParameter.USERPMS)
|
upms = self.experiment_parameter.get(ExperimentParameter.USERPMS)
|
||||||
upmsa = self.experience_parameter.get(ExperienceParameter.USERPMS_ARGS)
|
upmsa = self.experiment_parameter.get(ExperimentParameter.USERPMS_ARGS)
|
||||||
self.topo.command_to(self.topo_config.server, upms + \
|
self.topo.command_to(self.topo_config.server, upms + \
|
||||||
" " + upmsa + " &>upms.log &")
|
" " + upmsa + " &>upms.log &")
|
||||||
|
|
||||||
def cleanUserspacePM(self):
|
def cleanUserspacePM(self):
|
||||||
if self.experience_parameter.get(ExperienceParameter.KERNELPMC) != "netlink":
|
if self.experiment_parameter.get(ExperimentParameter.KERNELPMC) != "netlink":
|
||||||
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
||||||
else:
|
else:
|
||||||
upmc = self.experience_parameter.get(ExperienceParameter.USERPMC)
|
upmc = self.experiment_parameter.get(ExperimentParameter.USERPMC)
|
||||||
self.topo.command_to(self.topo_config.client, "killall " + upmc)
|
self.topo.command_to(self.topo_config.client, "killall " + upmc)
|
||||||
if self.experience_parameter.get(ExperienceParameter.KERNELPMS) != "netlink":
|
if self.experiment_parameter.get(ExperimentParameter.KERNELPMS) != "netlink":
|
||||||
print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
||||||
else:
|
else:
|
||||||
upms = self.experience_parameter.get(ExperienceParameter.USERPMS)
|
upms = self.experiment_parameter.get(ExperimentParameter.USERPMS)
|
||||||
self.topo.command_to(self.topo_config.server, "killall " + upms)
|
self.topo.command_to(self.topo_config.server, "killall " + upms)
|
||||||
|
|
||||||
def runNetemAt(self):
|
def runNetemAt(self):
|
||||||
@ -314,12 +314,12 @@ class Experience(object):
|
|||||||
|
|
||||||
def save_sysctl(self):
|
def save_sysctl(self):
|
||||||
self.sysctlBUP = {}
|
self.sysctlBUP = {}
|
||||||
self._save_sysctl(ExperienceParameter.SYSCTL_KEY, self.sysctlBUP)
|
self._save_sysctl(ExperimentParameter.SYSCTL_KEY, self.sysctlBUP)
|
||||||
self.sysctlBUPC = {}
|
self.sysctlBUPC = {}
|
||||||
self._save_sysctl(ExperienceParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
self._save_sysctl(ExperimentParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
||||||
ns = True, who = self.topo_config.client)
|
ns = True, who = self.topo_config.client)
|
||||||
self.sysctlBUPS = {}
|
self.sysctlBUPS = {}
|
||||||
self._save_sysctl(ExperienceParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
self._save_sysctl(ExperimentParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
||||||
ns = True, who = self.topo_config.server)
|
ns = True, who = self.topo_config.server)
|
||||||
|
|
||||||
def _save_sysctl(self, sysctlDic, sysctlBUP, ns = False, who = None):
|
def _save_sysctl(self, sysctlDic, sysctlBUP, ns = False, who = None):
|
||||||
@ -349,16 +349,16 @@ class Experience(object):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def write_sysctl(self):
|
def write_sysctl(self):
|
||||||
self._write_sysctl(ExperienceParameter.SYSCTL_KEY, self.sysctlBUP)
|
self._write_sysctl(ExperimentParameter.SYSCTL_KEY, self.sysctlBUP)
|
||||||
self._write_sysctl(ExperienceParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
self._write_sysctl(ExperimentParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
||||||
ns = True, who = self.topo_config.client)
|
ns = True, who = self.topo_config.client)
|
||||||
self._write_sysctl(ExperienceParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
self._write_sysctl(ExperimentParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
||||||
ns = True, who = self.topo_config.server)
|
ns = True, who = self.topo_config.server)
|
||||||
|
|
||||||
def _write_sysctl(self, sysctlDic, sysctlBUP, ns = False, who = None):
|
def _write_sysctl(self, sysctlDic, sysctlBUP, ns = False, who = None):
|
||||||
for k in sysctlBUP:
|
for k in sysctlBUP:
|
||||||
SYSCTL_KEY = sysctlDic[k]
|
SYSCTL_KEY = sysctlDic[k]
|
||||||
sysctlValue = self.experience_parameter.get(k)
|
sysctlValue = self.experiment_parameter.get(k)
|
||||||
cmd = self.cmd_write_sysctl(SYSCTL_KEY,sysctlValue)
|
cmd = self.cmd_write_sysctl(SYSCTL_KEY,sysctlValue)
|
||||||
if not ns:
|
if not ns:
|
||||||
val = self.topo.command_global(cmd)
|
val = self.topo.command_global(cmd)
|
||||||
@ -369,10 +369,10 @@ class Experience(object):
|
|||||||
|
|
||||||
|
|
||||||
def backUpSysctl(self):
|
def backUpSysctl(self):
|
||||||
self._backUpSysctl(ExperienceParameter.SYSCTL_KEY, self.sysctlBUP)
|
self._backUpSysctl(ExperimentParameter.SYSCTL_KEY, self.sysctlBUP)
|
||||||
self._backUpSysctl(ExperienceParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
self._backUpSysctl(ExperimentParameter.SYSCTL_KEY_CLIENT, self.sysctlBUPC,
|
||||||
ns = True, who = self.topo_config.client)
|
ns = True, who = self.topo_config.client)
|
||||||
self._backUpSysctl(ExperienceParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
self._backUpSysctl(ExperimentParameter.SYSCTL_KEY_SERVER, self.sysctlBUPS,
|
||||||
ns = True, who = self.topo_config.server)
|
ns = True, who = self.topo_config.server)
|
||||||
|
|
||||||
|
|
||||||
@ -392,9 +392,9 @@ class Experience(object):
|
|||||||
|
|
||||||
def runTcpDump(self):
|
def runTcpDump(self):
|
||||||
#todo : replace filename by cst
|
#todo : replace filename by cst
|
||||||
cpcap = self.experience_parameter.get(ExperienceParameter.CLIENT_PCAP)
|
cpcap = self.experiment_parameter.get(ExperimentParameter.CLIENT_PCAP)
|
||||||
spcap = self.experience_parameter.get(ExperienceParameter.SERVER_PCAP)
|
spcap = self.experiment_parameter.get(ExperimentParameter.SERVER_PCAP)
|
||||||
snaplenpcap = self.experience_parameter.get(ExperienceParameter.SNAPLEN_PCAP)
|
snaplenpcap = self.experiment_parameter.get(ExperimentParameter.SNAPLEN_PCAP)
|
||||||
if cpcap == "yes" :
|
if cpcap == "yes" :
|
||||||
self.topo.command_to(self.topo_config.client,
|
self.topo.command_to(self.topo_config.client,
|
||||||
"tcpdump -i any -s " + snaplenpcap + " -w client.pcap &")
|
"tcpdump -i any -s " + snaplenpcap + " -w client.pcap &")
|
||||||
@ -405,46 +405,46 @@ class Experience(object):
|
|||||||
self.topo.command_to(self.topo_config.client,"sleep 5")
|
self.topo.command_to(self.topo_config.client,"sleep 5")
|
||||||
|
|
||||||
|
|
||||||
class RandomFileParameter(ExperienceParameter):
|
class RandomFileParameter(ExperimentParameter):
|
||||||
"""
|
"""
|
||||||
Parameters for the RandomFileExperience
|
Parameters for the RandomFileExperiment
|
||||||
"""
|
"""
|
||||||
FILE = "file" # file to fetch; if random, we create a file with random data called random.
|
FILE = "file" # file to fetch; if random, we create a file with random data called random.
|
||||||
RANDOM_SIZE = "file_size" # in KB
|
RANDOM_SIZE = "file_size" # in KB
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(RandomFileParameter, self).__init__(experience_parameter_filename)
|
super(RandomFileParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
RandomFileParameter.FILE: "random",
|
RandomFileParameter.FILE: "random",
|
||||||
RandomFileParameter.RANDOM_SIZE: "1024",
|
RandomFileParameter.RANDOM_SIZE: "1024",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class RandomFileExperience(Experience):
|
class RandomFileExperiment(Experiment):
|
||||||
"""
|
"""
|
||||||
Enable a experience to use random files
|
Enable a experiment to use random files
|
||||||
|
|
||||||
This class is not directly instantiable
|
This class is not directly instantiable
|
||||||
"""
|
"""
|
||||||
PARAMETER_CLASS = RandomFileParameter
|
PARAMETER_CLASS = RandomFileParameter
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(RandomFileExperience, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(RandomFileExperiment, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
super(RandomFileExperience, self).load_parameters()
|
super(RandomFileExperiment, self).load_parameters()
|
||||||
self.file = self.experience_parameter.get(RandomFileParameter.FILE)
|
self.file = self.experiment_parameter.get(RandomFileParameter.FILE)
|
||||||
self.random_size = self.experience_parameter.get(RandomFileParameter.RANDOM_SIZE)
|
self.random_size = self.experiment_parameter.get(RandomFileParameter.RANDOM_SIZE)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(RandomFileExperience, self).prepare()
|
super(RandomFileExperiment, self).prepare()
|
||||||
if self.file == "random":
|
if self.file == "random":
|
||||||
self.topo.command_to(self.topo_config.client,
|
self.topo.command_to(self.topo_config.client,
|
||||||
"dd if=/dev/urandom of=random bs=1K count={}".format(self.random_size))
|
"dd if=/dev/urandom of=random bs=1K count={}".format(self.random_size))
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
super(RandomFileExperience, self).clean()
|
super(RandomFileExperiment, self).clean()
|
||||||
if self.file == "random":
|
if self.file == "random":
|
||||||
self.topo.command_to(self.topo_config.client, "rm random*")
|
self.topo.command_to(self.topo_config.client, "rm random*")
|
@ -1,16 +0,0 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
|
||||||
|
|
||||||
class NoneExperience(Experience):
|
|
||||||
NAME = "none"
|
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
|
||||||
super(NoneExperience, self).__init__(experience_parameter_filename, topo, topo_config)
|
|
||||||
|
|
||||||
def prepare(self):
|
|
||||||
Experience.prepare(self)
|
|
||||||
|
|
||||||
def clean(self):
|
|
||||||
Experience.clean(self)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.topo.get_cli()
|
|
@ -2,20 +2,20 @@ import importlib
|
|||||||
import pkgutil
|
import pkgutil
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from core.experience import Experience
|
from core.experiment import Experiment
|
||||||
|
|
||||||
pkg_dir = os.path.dirname(__file__)
|
pkg_dir = os.path.dirname(__file__)
|
||||||
for (module_loader, name, ispkg) in pkgutil.iter_modules([pkg_dir]):
|
for (module_loader, name, ispkg) in pkgutil.iter_modules([pkg_dir]):
|
||||||
importlib.import_module('.' + name, __package__)
|
importlib.import_module('.' + name, __package__)
|
||||||
|
|
||||||
# Track direct inheritance
|
# Track direct inheritance
|
||||||
EXPERIENCES = {}
|
EXPERIMENTS = {}
|
||||||
|
|
||||||
def _get_all_subclasses(BaseClass):
|
def _get_all_subclasses(BaseClass):
|
||||||
for cls in BaseClass.__subclasses__():
|
for cls in BaseClass.__subclasses__():
|
||||||
if hasattr(cls, "NAME"):
|
if hasattr(cls, "NAME"):
|
||||||
EXPERIENCES[cls.NAME] = cls
|
EXPERIMENTS[cls.NAME] = cls
|
||||||
|
|
||||||
_get_all_subclasses(cls)
|
_get_all_subclasses(cls)
|
||||||
|
|
||||||
_get_all_subclasses(Experience)
|
_get_all_subclasses(Experiment)
|
@ -1,4 +1,4 @@
|
|||||||
from core.experience import RandomFileExperience, RandomFileParameter, ExperienceParameter
|
from core.experiment import RandomFileExperiment, RandomFileParameter, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -6,15 +6,15 @@ class ABParameter(RandomFileParameter):
|
|||||||
CONCURRENT_REQUESTS = "abConccurentRequests"
|
CONCURRENT_REQUESTS = "abConccurentRequests"
|
||||||
TIME_LIMIT = "abTimelimit"
|
TIME_LIMIT = "abTimelimit"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(ABParameter, self).__init__(experience_parameter_filename)
|
super(ABParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
ABParameter.CONCURRENT_REQUESTS: "50",
|
ABParameter.CONCURRENT_REQUESTS: "50",
|
||||||
ABParameter.TIME_LIMIT: "20",
|
ABParameter.TIME_LIMIT: "20",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class AB(RandomFileExperience):
|
class AB(RandomFileExperiment):
|
||||||
NAME = "ab"
|
NAME = "ab"
|
||||||
PARAMETER_CLASS = ABParameter
|
PARAMETER_CLASS = ABParameter
|
||||||
|
|
||||||
@ -23,13 +23,13 @@ class AB(RandomFileExperience):
|
|||||||
AB_BIN = "ab"
|
AB_BIN = "ab"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(AB, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(AB, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client,
|
self.topo.command_to(self.topo_config.client,
|
||||||
"rm " + AB.PING_OUTPUT)
|
"rm " + AB.PING_OUTPUT)
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -43,8 +43,8 @@ class AB(RandomFileExperience):
|
|||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
super(AB, self).load_parameters()
|
super(AB, self).load_parameters()
|
||||||
self.concurrent_requests = self.experience_parameter.get(ABParameter.CONCURRENT_REQUESTS)
|
self.concurrent_requests = self.experiment_parameter.get(ABParameter.CONCURRENT_REQUESTS)
|
||||||
self.time_limit = self.experience_parameter.get(ABParameter.TIME_LIMIT)
|
self.time_limit = self.experiment_parameter.get(ABParameter.TIME_LIMIT)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(AB, self).prepare()
|
super(AB, self).prepare()
|
@ -1,8 +1,8 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class DITGParameter(ExperienceParameter):
|
class DITGParameter(ExperimentParameter):
|
||||||
KBYTES = "ditgKBytes"
|
KBYTES = "ditgKBytes"
|
||||||
CONSTANT_PACKET_SIZE = "ditgConstantPacketSize"
|
CONSTANT_PACKET_SIZE = "ditgConstantPacketSize"
|
||||||
MEAN_POISSON_PACKETS_SEC = "ditgMeanPoissonPacketsSec"
|
MEAN_POISSON_PACKETS_SEC = "ditgMeanPoissonPacketsSec"
|
||||||
@ -10,8 +10,8 @@ class DITGParameter(ExperienceParameter):
|
|||||||
BURSTS_ON_PACKETS_SEC = "ditgBurstsOnPacketsSec"
|
BURSTS_ON_PACKETS_SEC = "ditgBurstsOnPacketsSec"
|
||||||
BURSTS_OFF_PACKETS_SEC = "ditgBurstsOffPacketsSec"
|
BURSTS_OFF_PACKETS_SEC = "ditgBurstsOffPacketsSec"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(DITGParameter, self).__init__(experience_parameter_filename)
|
super(DITGParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
DITGParameter.KBYTES: "10000",
|
DITGParameter.KBYTES: "10000",
|
||||||
DITGParameter.CONSTANT_PACKET_SIZE: "1428",
|
DITGParameter.CONSTANT_PACKET_SIZE: "1428",
|
||||||
@ -22,7 +22,7 @@ class DITGParameter(ExperienceParameter):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class DITG(Experience):
|
class DITG(Experiment):
|
||||||
NAME = "ditg"
|
NAME = "ditg"
|
||||||
PARAMETER_CLASS = DITGParameter
|
PARAMETER_CLASS = DITGParameter
|
||||||
|
|
||||||
@ -36,15 +36,15 @@ class DITG(Experience):
|
|||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(DITG, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(DITG, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Experience.PING_OUTPUT)
|
Experiment.PING_OUTPUT)
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -57,12 +57,12 @@ class DITG(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.kbytes = self.experience_parameter.get(DITGParameter.KBYTES)
|
self.kbytes = self.experiment_parameter.get(DITGParameter.KBYTES)
|
||||||
self.constant_packet_size = self.experience_parameter.get(DITGParameter.CONSTANT_PACKET_SIZE)
|
self.constant_packet_size = self.experiment_parameter.get(DITGParameter.CONSTANT_PACKET_SIZE)
|
||||||
self.mean_poisson_packets_sec = self.experience_parameter.get(DITGParameter.MEAN_POISSON_PACKETS_SEC)
|
self.mean_poisson_packets_sec = self.experiment_parameter.get(DITGParameter.MEAN_POISSON_PACKETS_SEC)
|
||||||
self.constant_packets_sec = self.experience_parameter.get(DITGParameter.CONSTANT_PACKETS_SEC)
|
self.constant_packets_sec = self.experiment_parameter.get(DITGParameter.CONSTANT_PACKETS_SEC)
|
||||||
self.bursts_on_packets_sec = self.experience_parameter.get(DITGParameter.BURSTS_ON_PACKETS_SEC)
|
self.bursts_on_packets_sec = self.experiment_parameter.get(DITGParameter.BURSTS_ON_PACKETS_SEC)
|
||||||
self.bursts_off_packets_sec = self.experience_parameter.get(DITGParameter.BURSTS_OFF_PACKETS_SEC)
|
self.bursts_off_packets_sec = self.experiment_parameter.get(DITGParameter.BURSTS_OFF_PACKETS_SEC)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(DITG, self).prepare()
|
super(DITG, self).prepare()
|
@ -1,17 +1,17 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class EploadParameter(ExperienceParameter):
|
class EploadParameter(ExperimentParameter):
|
||||||
TEST_DIR = "test_dir"
|
TEST_DIR = "test_dir"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(EploadParameter, self).__init__(experience_parameter_filename)
|
super(EploadParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
TEST_DIR: "/bla/bla/bla",
|
TEST_DIR: "/bla/bla/bla",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class Epload(Experience):
|
class Epload(Experiment):
|
||||||
NAME = "epload"
|
NAME = "epload"
|
||||||
PARAMETER_CLASS = EploadParameter
|
PARAMETER_CLASS = EploadParameter
|
||||||
|
|
||||||
@ -21,15 +21,15 @@ class Epload(Experience):
|
|||||||
EPLOAD_EMULATOR="/home/mininet/epload/epload/emulator/run.js"
|
EPLOAD_EMULATOR="/home/mininet/epload/epload/emulator/run.js"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(Epload, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(Epload, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Epload.PING_OUTPUT )
|
Epload.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -42,7 +42,7 @@ class Epload(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.test_dir = self.experience_parameter.get(EploadParameter.TEST_DIR)
|
self.test_dir = self.experiment_parameter.get(EploadParameter.TEST_DIR)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(Epload, self).prepare()
|
super(Epload, self).prepare()
|
@ -1,7 +1,7 @@
|
|||||||
from core.experience import ExperienceParameter, RandomFileExperience, RandomFileParameter
|
from core.experiment import ExperimentParameter, RandomFileExperiment, RandomFileParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class HTTP(RandomFileExperience):
|
class HTTP(RandomFileExperiment):
|
||||||
NAME = "http"
|
NAME = "http"
|
||||||
|
|
||||||
SERVER_LOG = "http_server.log"
|
SERVER_LOG = "http_server.log"
|
||||||
@ -9,14 +9,14 @@ class HTTP(RandomFileExperience):
|
|||||||
WGET_BIN = "wget"
|
WGET_BIN = "wget"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
# Just rely on RandomFileExperiment
|
# Just rely on RandomFileExperiment
|
||||||
super(HTTP, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(HTTP, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
HTTP.PING_OUTPUT )
|
HTTP.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
@ -1,7 +1,7 @@
|
|||||||
from core.experience import ExperienceParameter, RandomFileExperience, RandomFileParameter
|
from core.experiment import ExperimentParameter, RandomFileExperiment, RandomFileParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class HTTPS(RandomFileExperience):
|
class HTTPS(RandomFileExperiment):
|
||||||
NAME = "https"
|
NAME = "https"
|
||||||
|
|
||||||
SERVER_LOG = "https_server.log"
|
SERVER_LOG = "https_server.log"
|
||||||
@ -9,14 +9,14 @@ class HTTPS(RandomFileExperience):
|
|||||||
WGET_BIN = "wget"
|
WGET_BIN = "wget"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
# Just rely on RandomFileExperiment
|
# Just rely on RandomFileExperiment
|
||||||
super(HTTPS, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(HTTPS, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
HTTPS.PING_OUTPUT )
|
HTTPS.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
@ -1,18 +1,18 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class IPerfParameter(ExperienceParameter):
|
class IPerfParameter(ExperimentParameter):
|
||||||
TIME = "iperfTime"
|
TIME = "iperfTime"
|
||||||
PARALLEL = "iperfParallel"
|
PARALLEL = "iperfParallel"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(IPerfParameter, self).__init__(experience_parameter_filename)
|
super(IPerfParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
IPerfParameter.TIME: "10",
|
IPerfParameter.TIME: "10",
|
||||||
IPerfParameter.PARALLEL: "1",
|
IPerfParameter.PARALLEL: "1",
|
||||||
})
|
})
|
||||||
|
|
||||||
class IPerf(Experience):
|
class IPerf(Experiment):
|
||||||
NAME = "iperf"
|
NAME = "iperf"
|
||||||
PARAMETER_CLASS = IPerfParameter
|
PARAMETER_CLASS = IPerfParameter
|
||||||
|
|
||||||
@ -21,15 +21,15 @@ class IPerf(Experience):
|
|||||||
IPERF_BIN = "iperf3"
|
IPERF_BIN = "iperf3"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(IPerf, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(IPerf, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
IPerf.PING_OUTPUT)
|
IPerf.PING_OUTPUT)
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -42,8 +42,8 @@ class IPerf(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.time = self.experience_parameter.get(IPerfParameter.TIME)
|
self.time = self.experiment_parameter.get(IPerfParameter.TIME)
|
||||||
self.parallel = self.experience_parameter.get(IPerfParameter.PARALLEL)
|
self.parallel = self.experiment_parameter.get(IPerfParameter.PARALLEL)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(IPerf, self).prepare()
|
super(IPerf, self).prepare()
|
@ -1,15 +1,15 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class MsgParameter(ExperienceParameter):
|
class MsgParameter(ExperimentParameter):
|
||||||
CLIENT_SLEEP = "msgClientSleep"
|
CLIENT_SLEEP = "msgClientSleep"
|
||||||
SERVER_SLEEP = "msgServerSleep"
|
SERVER_SLEEP = "msgServerSleep"
|
||||||
NB_REQUESTS = "msgNbRequests"
|
NB_REQUESTS = "msgNbRequests"
|
||||||
BYTES = "msgBytes"
|
BYTES = "msgBytes"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(MsgParameter, self).__init__(experience_parameter_filename)
|
super(MsgParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
MsgParameter.CLIENT_SLEEP: "5.0",
|
MsgParameter.CLIENT_SLEEP: "5.0",
|
||||||
MsgParameter.SERVER_SLEEP: "5.0",
|
MsgParameter.SERVER_SLEEP: "5.0",
|
||||||
@ -17,7 +17,7 @@ class MsgParameter(ExperienceParameter):
|
|||||||
MsgParameter.BYTES: "1200",
|
MsgParameter.BYTES: "1200",
|
||||||
})
|
})
|
||||||
|
|
||||||
class Msg(Experience):
|
class Msg(Experiment):
|
||||||
NAME = "msg"
|
NAME = "msg"
|
||||||
PARAMETER_CLASS = MsgParameter
|
PARAMETER_CLASS = MsgParameter
|
||||||
|
|
||||||
@ -26,15 +26,15 @@ class Msg(Experience):
|
|||||||
CLIENT_ERR = "msg_client.err"
|
CLIENT_ERR = "msg_client.err"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(Msg, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(Msg, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Msg.PING_OUTPUT )
|
Msg.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -47,10 +47,10 @@ class Msg(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.client_sleep = self.experience_parameter.get(MsgParameter.CLIENT_SLEEP)
|
self.client_sleep = self.experiment_parameter.get(MsgParameter.CLIENT_SLEEP)
|
||||||
self.server_sleep = self.experience_parameter.get(MsgParameter.SERVER_SLEEP)
|
self.server_sleep = self.experiment_parameter.get(MsgParameter.SERVER_SLEEP)
|
||||||
self.nb_requests = self.experience_parameter.get(MsgParameter.NB_REQUESTS)
|
self.nb_requests = self.experiment_parameter.get(MsgParameter.NB_REQUESTS)
|
||||||
self.bytes = self.experience_parameter.get(MsgParameter.BYTES)
|
self.bytes = self.experiment_parameter.get(MsgParameter.BYTES)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(Msg, self).prepare()
|
super(Msg, self).prepare()
|
@ -1,19 +1,19 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Should be the mother of ExperienceNCPV, shame on me, should rewrite
|
Should be the mother of ExperimentNCPV, shame on me, should rewrite
|
||||||
ExperienceNCPV as daughter class of this one.
|
ExperimentNCPV as daughter class of this one.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class NCParameter(ExperienceParameter):
|
class NCParameter(ExperimentParameter):
|
||||||
DD_IBS = "ddIBS"
|
DD_IBS = "ddIBS"
|
||||||
DD_OBS = "ddIBS"
|
DD_OBS = "ddIBS"
|
||||||
DD_COUNT = "ddCount"
|
DD_COUNT = "ddCount"
|
||||||
SERVER_PORT = "ncServerPort"
|
SERVER_PORT = "ncServerPort"
|
||||||
CLIENT_PORT = "ncClientPort"
|
CLIENT_PORT = "ncClientPort"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(NCParameter, self).__init__(experience_parameter_filename)
|
super(NCParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
NCParameter.DD_IBS: "1k",
|
NCParameter.DD_IBS: "1k",
|
||||||
NCParameter.DD_OBS: "1k",
|
NCParameter.DD_OBS: "1k",
|
||||||
@ -23,7 +23,7 @@ class NCParameter(ExperienceParameter):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class NC(Experience):
|
class NC(Experiment):
|
||||||
NAME = "nc"
|
NAME = "nc"
|
||||||
PARAMETER_CLASS = NCParameter
|
PARAMETER_CLASS = NCParameter
|
||||||
|
|
||||||
@ -31,22 +31,22 @@ class NC(Experience):
|
|||||||
CLIENT_NC_LOG = "netcat_client"
|
CLIENT_NC_LOG = "netcat_client"
|
||||||
NC_BIN = "netcat"
|
NC_BIN = "netcat"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(NC, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(NC, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.ddibs = self.experience_parameter.get(NCParameter.DD_IBS)
|
self.ddibs = self.experiment_parameter.get(NCParameter.DD_IBS)
|
||||||
self.ddobs = self.experience_parameter.get(NCParameter.DD_OBS)
|
self.ddobs = self.experiment_parameter.get(NCParameter.DD_OBS)
|
||||||
self.ddcount = self.experience_parameter.get(NCParameter.DD_COUNT)
|
self.ddcount = self.experiment_parameter.get(NCParameter.DD_COUNT)
|
||||||
self.ncServerPort = self.experience_parameter.get(NCParameter.SERVER_PORT)
|
self.ncServerPort = self.experiment_parameter.get(NCParameter.SERVER_PORT)
|
||||||
self.ncClientPort = []
|
self.ncClientPort = []
|
||||||
for k in sorted(self.experience_parameter.paramDic):
|
for k in sorted(self.experiment_parameter.paramDic):
|
||||||
if k.startswith(NCParameter.CLIENT_PORT):
|
if k.startswith(NCParameter.CLIENT_PORT):
|
||||||
port = self.experience_parameter.paramDic[k]
|
port = self.experiment_parameter.paramDic[k]
|
||||||
self.ncClientPort.append(port)
|
self.ncClientPort.append(port)
|
||||||
if len(self.ncClientPort) == 0:
|
if len(self.ncClientPort) == 0:
|
||||||
d = self.experience_parameter.get(NCParameter.CLIENT_PORT)
|
d = self.experiment_parameter.get(NCParameter.CLIENT_PORT)
|
||||||
self.ncClientPort.append(d)
|
self.ncClientPort.append(d)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
@ -1,4 +1,4 @@
|
|||||||
from .nc import NC, NCParameter, ExperienceParameter
|
from .nc import NC, NCParameter, ExperimentParameter
|
||||||
|
|
||||||
|
|
||||||
class NCPVParameter(NCParameter):
|
class NCPVParameter(NCParameter):
|
||||||
@ -8,8 +8,8 @@ class NCPVParameter(NCParameter):
|
|||||||
CHANGE_PV = "changePv"
|
CHANGE_PV = "changePv"
|
||||||
CHANGE_PV_AT = "changePvAt"
|
CHANGE_PV_AT = "changePvAt"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(NCPVParameter, self).__init__(experience_parameter_filename)
|
super(NCPVParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
NCPVParameter.RATE_LIMIT: "400k",
|
NCPVParameter.RATE_LIMIT: "400k",
|
||||||
NCPVParameter.G: "10000",
|
NCPVParameter.G: "10000",
|
||||||
@ -42,15 +42,15 @@ class NCPV(NC):
|
|||||||
PV_BIN = "/usr/local/bin/pv"
|
PV_BIN = "/usr/local/bin/pv"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(NCPV, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(NCPV, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
NCPV.PING_OUTPUT )
|
NCPV.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -64,18 +64,18 @@ class NCPV(NC):
|
|||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
super(NCPV, self).load_parameters()
|
super(NCPV, self).load_parameters()
|
||||||
self.pvg = self.experience_parameter.get(ExperienceParameter.PVG)
|
self.pvg = self.experiment_parameter.get(ExperimentParameter.PVG)
|
||||||
self.pvz = self.experience_parameter.get(ExperienceParameter.PVZ)
|
self.pvz = self.experiment_parameter.get(ExperimentParameter.PVZ)
|
||||||
self.pvRateLimit = self.experience_parameter.get(ExperienceParameter.PVRATELIMIT)
|
self.pvRateLimit = self.experiment_parameter.get(ExperimentParameter.PVRATELIMIT)
|
||||||
self.loadPvAt()
|
self.loadPvAt()
|
||||||
|
|
||||||
def loadPvAt(self):
|
def loadPvAt(self):
|
||||||
self.changePvAt = []
|
self.changePvAt = []
|
||||||
self.changePv = self.experience_parameter.get(ExperienceParameter.CHANGEPV)
|
self.changePv = self.experiment_parameter.get(ExperimentParameter.CHANGEPV)
|
||||||
if self.changePv != "yes":
|
if self.changePv != "yes":
|
||||||
print("Don't change pv rate...")
|
print("Don't change pv rate...")
|
||||||
return
|
return
|
||||||
changePvAt = self.experience_parameter.get(ExperienceParameter.CHANGEPVAT)
|
changePvAt = self.experiment_parameter.get(ExperimentParameter.CHANGEPVAT)
|
||||||
if not isinstance(changePvAt, list):
|
if not isinstance(changePvAt, list):
|
||||||
changePvAt = [changePvAt]
|
changePvAt = [changePvAt]
|
||||||
for p in changePvAt:
|
for p in changePvAt:
|
@ -1,14 +1,14 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class NetperfParameter(ExperienceParameter):
|
class NetperfParameter(ExperimentParameter):
|
||||||
TESTLEN = "netperfTestlen"
|
TESTLEN = "netperfTestlen"
|
||||||
TESTNAME = "netperfTestname"
|
TESTNAME = "netperfTestname"
|
||||||
REQRES_SIZE = "netperfReqresSize"
|
REQRES_SIZE = "netperfReqresSize"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(NetperfParameter, self).__init__(experience_parameter_filename)
|
super(NetperfParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
NetperfParameter.TESTLEN: "10",
|
NetperfParameter.TESTLEN: "10",
|
||||||
NetperfParameter.TESTNAME: "TCP_RR",
|
NetperfParameter.TESTNAME: "TCP_RR",
|
||||||
@ -16,7 +16,7 @@ class NetperfParameter(ExperienceParameter):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class Netperf(Experience):
|
class Netperf(Experiment):
|
||||||
NAME = "netperf"
|
NAME = "netperf"
|
||||||
PARAMETER_CLASS = NetperfParameter
|
PARAMETER_CLASS = NetperfParameter
|
||||||
|
|
||||||
@ -26,15 +26,15 @@ class Netperf(Experience):
|
|||||||
NETSERVER_BIN = "netserver"
|
NETSERVER_BIN = "netserver"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(Netperf, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(Netperf, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Netperf.PING_OUTPUT)
|
Netperf.PING_OUTPUT)
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -47,9 +47,9 @@ class Netperf(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.testlen = self.experience_parameter.get(NetperfParameter.TESTLEN)
|
self.testlen = self.experiment_parameter.get(NetperfParameter.TESTLEN)
|
||||||
self.testname = self.experience_parameter.get(NetperfParameter.TESTNAME)
|
self.testname = self.experiment_parameter.get(NetperfParameter.TESTNAME)
|
||||||
self.reqres_size = self.experience_parameter.get(NetperfParameter.REQRES_SIZE)
|
self.reqres_size = self.experiment_parameter.get(NetperfParameter.REQRES_SIZE)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(Netperf, self).prepare()
|
super(Netperf, self).prepare()
|
16
experiments/none.py
Normal file
16
experiments/none.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
|
|
||||||
|
class NoneExperiment(Experiment):
|
||||||
|
NAME = "none"
|
||||||
|
|
||||||
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
|
super(NoneExperiment, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
|
def prepare(self):
|
||||||
|
Experiment.prepare(self)
|
||||||
|
|
||||||
|
def clean(self):
|
||||||
|
Experiment.clean(self)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.topo.get_cli()
|
@ -1,12 +1,12 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
|
|
||||||
class Ping(Experience):
|
class Ping(Experiment):
|
||||||
NAME = "ping"
|
NAME = "ping"
|
||||||
|
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(Ping, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(Ping, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(Ping, self).prepare()
|
super(Ping, self).prepare()
|
||||||
@ -17,7 +17,7 @@ class Ping(Experience):
|
|||||||
def run(self):
|
def run(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Ping.PING_OUTPUT )
|
Ping.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
@ -1,19 +1,19 @@
|
|||||||
from core.experience import RandomFileExperience, RandomFileParameter, ExperienceParameter
|
from core.experiment import RandomFileExperiment, RandomFileParameter, ExperimentParameter
|
||||||
from topos.multi_interface_cong import MultiInterfaceCongConfig
|
from topos.multi_interface_cong import MultiInterfaceCongConfig
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class QUICParameter(RandomFileExperience):
|
class QUICParameter(RandomFileExperiment):
|
||||||
MULTIPATH = "quicMultipath"
|
MULTIPATH = "quicMultipath"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(QUICParameter, self).__init__(experience_parameter_filename)
|
super(QUICParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
QUICParameter.MULTIPATH: "0",
|
QUICParameter.MULTIPATH: "0",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class QUIC(RandomFileExperience):
|
class QUIC(RandomFileExperiment):
|
||||||
NAME = "quic"
|
NAME = "quic"
|
||||||
PARAMETER_CLASS = QUICParameter
|
PARAMETER_CLASS = QUICParameter
|
||||||
|
|
||||||
@ -26,14 +26,14 @@ class QUIC(RandomFileExperience):
|
|||||||
CERTPATH = "~/go/src/github.com/lucas-clemente/quic-go/example/"
|
CERTPATH = "~/go/src/github.com/lucas-clemente/quic-go/example/"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
# Just rely on RandomFileExperience
|
# Just rely on RandomFileExperiment
|
||||||
super(QUIC, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(QUIC, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
QUIC.PING_OUTPUT )
|
QUIC.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -47,7 +47,7 @@ class QUIC(RandomFileExperience):
|
|||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
super(QUIC, self).load_parameters()
|
super(QUIC, self).load_parameters()
|
||||||
self.multipath = self.experience_parameter.get(QUICParameter.MULTIPATH)
|
self.multipath = self.experiment_parameter.get(QUICParameter.MULTIPATH)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(QUIC, self).prepare()
|
super(QUIC, self).prepare()
|
@ -1,19 +1,19 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class QUICSiriParameter(ExperienceParameter):
|
class QUICSiriParameter(ExperimentParameter):
|
||||||
MULTIPATH = "quicMultipath"
|
MULTIPATH = "quicMultipath"
|
||||||
RUN_TIME = "quicSiriRunTime"
|
RUN_TIME = "quicSiriRunTime"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(QUICSiriParameter, self).__init__(experience_parameter_filename)
|
super(QUICSiriParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
QUICSiriParameter.MULTIPATH: "0",
|
QUICSiriParameter.MULTIPATH: "0",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class QUICSiri(Experience):
|
class QUICSiri(Experiment):
|
||||||
NAME = "quicsiri"
|
NAME = "quicsiri"
|
||||||
PARAMETER_CLASS = QUICSiriParameter
|
PARAMETER_CLASS = QUICSiriParameter
|
||||||
|
|
||||||
@ -24,15 +24,15 @@ class QUICSiri(Experience):
|
|||||||
SERVER_GO_FILE = "~/go/src/github.com/lucas-clemente/quic-go/example/siri/siri.go"
|
SERVER_GO_FILE = "~/go/src/github.com/lucas-clemente/quic-go/example/siri/siri.go"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(QUICSiri, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(QUICSiri, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
QUICSiri.PING_OUTPUT )
|
QUICSiri.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -45,8 +45,8 @@ class QUICSiri(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.run_time = self.experience_parameter.get(QUICSiriParameter.RUN_TIME)
|
self.run_time = self.experiment_parameter.get(QUICSiriParameter.RUN_TIME)
|
||||||
self.multipath = self.experience_parameter.get(QUICSiriParameter.MULTIPATH)
|
self.multipath = self.experiment_parameter.get(QUICSiriParameter.MULTIPATH)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(QUICSiri, self).prepare()
|
super(QUICSiri, self).prepare()
|
@ -1,7 +1,7 @@
|
|||||||
from core.experience import RandomFileExperience, RandomFileParameter, ExperienceParameter
|
from core.experiment import RandomFileExperiment, RandomFileParameter, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class SendFile(RandomFileExperience):
|
class SendFile(RandomFileExperiment):
|
||||||
NAME = "sendfile"
|
NAME = "sendfile"
|
||||||
|
|
||||||
SERVER_LOG = "sendfile_server.log"
|
SERVER_LOG = "sendfile_server.log"
|
||||||
@ -9,14 +9,14 @@ class SendFile(RandomFileExperience):
|
|||||||
WGET_BIN = "./client"
|
WGET_BIN = "./client"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
# Just rely on RandomFileExperience
|
# Just rely on RandomFileExperiment
|
||||||
super(SendFile, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(SendFile, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
SendFile.PING_OUTPUT )
|
SendFile.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
@ -1,8 +1,8 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class SiriParameter(ExperienceParameter):
|
class SiriParameter(ExperimentParameter):
|
||||||
RUN_TIME = "siriRunTime"
|
RUN_TIME = "siriRunTime"
|
||||||
QUERY_SIZE = "siriQuerySize"
|
QUERY_SIZE = "siriQuerySize"
|
||||||
RESPONSE_SIZE = "siriResponseSize"
|
RESPONSE_SIZE = "siriResponseSize"
|
||||||
@ -14,8 +14,8 @@ class SiriParameter(ExperienceParameter):
|
|||||||
BURST_SIZE = "siriBurstSize"
|
BURST_SIZE = "siriBurstSize"
|
||||||
INTERVAL_BURST_TIME_MS = "siriIntervalBurstTimeMs"
|
INTERVAL_BURST_TIME_MS = "siriIntervalBurstTimeMs"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(SiriParameter, self).__init__(experience_parameter_filename)
|
super(SiriParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
SiriParameter.QUERY_SIZE: "2500",
|
SiriParameter.QUERY_SIZE: "2500",
|
||||||
SiriParameter.RESPONSE_SIZE: "750",
|
SiriParameter.RESPONSE_SIZE: "750",
|
||||||
@ -29,7 +29,7 @@ class SiriParameter(ExperienceParameter):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class Siri(Experience):
|
class Siri(Experiment):
|
||||||
NAME = "siri"
|
NAME = "siri"
|
||||||
PARAMETER_CLASS = SiriParameter
|
PARAMETER_CLASS = SiriParameter
|
||||||
|
|
||||||
@ -39,15 +39,15 @@ class Siri(Experience):
|
|||||||
JAVA_BIN = "java"
|
JAVA_BIN = "java"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(Siri, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(Siri, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
Siri.PING_OUTPUT )
|
Siri.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -60,16 +60,16 @@ class Siri(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.run_time = self.experience_parameter.get(SiriParameter.RUN_TIME)
|
self.run_time = self.experiment_parameter.get(SiriParameter.RUN_TIME)
|
||||||
self.query_size = self.experience_parameter.get(SiriParameter.QUERY_SIZE)
|
self.query_size = self.experiment_parameter.get(SiriParameter.QUERY_SIZE)
|
||||||
self.response_size = self.experience_parameter.get(SiriParameter.RESPONSE_SIZE)
|
self.response_size = self.experiment_parameter.get(SiriParameter.RESPONSE_SIZE)
|
||||||
self.delay_query_response = self.experience_parameter.get(SiriParameter.DELAY_QUERY_RESPONSE)
|
self.delay_query_response = self.experiment_parameter.get(SiriParameter.DELAY_QUERY_RESPONSE)
|
||||||
self.min_payload_size = self.experience_parameter.get(SiriParameter.MIN_PAYLOAD_SIZE)
|
self.min_payload_size = self.experiment_parameter.get(SiriParameter.MIN_PAYLOAD_SIZE)
|
||||||
self.max_payload_size = self.experience_parameter.get(SiriParameter.MAX_PAYLOAD_SIZE)
|
self.max_payload_size = self.experiment_parameter.get(SiriParameter.MAX_PAYLOAD_SIZE)
|
||||||
self.interval_time_ms = self.experience_parameter.get(SiriParameter.INTERVAL_TIME_MS)
|
self.interval_time_ms = self.experiment_parameter.get(SiriParameter.INTERVAL_TIME_MS)
|
||||||
self.buffer_size = self.experience_parameter.get(SiriParameter.BUFFER_SIZE)
|
self.buffer_size = self.experiment_parameter.get(SiriParameter.BUFFER_SIZE)
|
||||||
self.burst_size = self.experience_parameter.get(SiriParameter.BURST_SIZE)
|
self.burst_size = self.experiment_parameter.get(SiriParameter.BURST_SIZE)
|
||||||
self.interval_burst_time_ms = self.experience_parameter.get(SiriParameter.INTERVAL_BURST_TIME_MS)
|
self.interval_burst_time_ms = self.experiment_parameter.get(SiriParameter.INTERVAL_BURST_TIME_MS)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(Siri, self).prepare()
|
super(Siri, self).prepare()
|
@ -1,8 +1,8 @@
|
|||||||
from core.experience import ExperienceParameter, RandomFileExperience, RandomFileParameter
|
from core.experiment import ExperimentParameter, RandomFileExperiment, RandomFileParameter
|
||||||
from .siri import Siri
|
from .siri import Siri
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class SiriHTTP(Siri, RandomFileExperience):
|
class SiriHTTP(Siri, RandomFileExperiment):
|
||||||
NAME = "sirihttp"
|
NAME = "sirihttp"
|
||||||
|
|
||||||
HTTP_SERVER_LOG = "http_server.log"
|
HTTP_SERVER_LOG = "http_server.log"
|
||||||
@ -14,14 +14,14 @@ class SiriHTTP(Siri, RandomFileExperience):
|
|||||||
JAVA_BIN = "java"
|
JAVA_BIN = "java"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
# Just rely on RandomFileExperiment
|
# Just rely on RandomFileExperiment
|
||||||
super(SiriHTTP, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(SiriHTTP, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
SiriHTTP.PING_OUTPUT )
|
SiriHTTP.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
@ -1,4 +1,4 @@
|
|||||||
from core.experience import ExperienceParameter
|
from core.experiment import ExperimentParameter
|
||||||
from .siri import Siri, SiriParameter
|
from .siri import Siri, SiriParameter
|
||||||
from .msg import Msg, MsgParameter
|
from .msg import Msg, MsgParameter
|
||||||
import os
|
import os
|
||||||
@ -25,8 +25,8 @@ class SiriMsg(Siri, Msg):
|
|||||||
JAVA_BIN = "java"
|
JAVA_BIN = "java"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(SiriMsg, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(SiriMsg, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
# Fetch both Msg and Siri parameters
|
# Fetch both Msg and Siri parameters
|
@ -1,19 +1,19 @@
|
|||||||
from core.experience import Experience, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class VLCParameter(ExperienceParameter):
|
class VLCParameter(ExperimentParameter):
|
||||||
FILE = "vlcFile"
|
FILE = "vlcFile"
|
||||||
TIME = "vlcTime"
|
TIME = "vlcTime"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename):
|
def __init__(self, experiment_parameter_filename):
|
||||||
super(VLCParameter, self).__init__(experience_parameter_filename)
|
super(VLCParameter, self).__init__(experiment_parameter_filename)
|
||||||
self.default_parameters.update({
|
self.default_parameters.update({
|
||||||
VLCParameter.FILE: "bunny_ibmff_360.mpd",
|
VLCParameter.FILE: "bunny_ibmff_360.mpd",
|
||||||
VLCParameter.TIME: "0",
|
VLCParameter.TIME: "0",
|
||||||
})
|
})
|
||||||
|
|
||||||
class VLC(Experience):
|
class VLC(Experiment):
|
||||||
NAME = "vlc"
|
NAME = "vlc"
|
||||||
|
|
||||||
SERVER_LOG = "vlc_server.log"
|
SERVER_LOG = "vlc_server.log"
|
||||||
@ -21,15 +21,15 @@ class VLC(Experience):
|
|||||||
VLC_BIN = "/home/mininet/vlc/vlc"
|
VLC_BIN = "/home/mininet/vlc/vlc"
|
||||||
PING_OUTPUT = "ping.log"
|
PING_OUTPUT = "ping.log"
|
||||||
|
|
||||||
def __init__(self, experience_parameter_filename, topo, topo_config):
|
def __init__(self, experiment_parameter_filename, topo, topo_config):
|
||||||
super(VLC, self).__init__(experience_parameter_filename, topo, topo_config)
|
super(VLC, self).__init__(experiment_parameter_filename, topo, topo_config)
|
||||||
self.load_parameters()
|
self.load_parameters()
|
||||||
self.ping()
|
self.ping()
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
self.topo.command_to(self.topo_config.client, "rm " + \
|
self.topo.command_to(self.topo_config.client, "rm " + \
|
||||||
VLC.PING_OUTPUT )
|
VLC.PING_OUTPUT )
|
||||||
count = self.experience_parameter.get(ExperienceParameter.PING_COUNT)
|
count = self.experiment_parameter.get(ExperimentParameter.PING_COUNT)
|
||||||
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
for i in range(0, self.topo_config.getClientInterfaceCount()):
|
||||||
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
cmd = self.pingCommand(self.topo_config.getClientIP(i),
|
||||||
self.topo_config.getServerIP(), n = count)
|
self.topo_config.getServerIP(), n = count)
|
||||||
@ -42,8 +42,8 @@ class VLC(Experience):
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def load_parameters(self):
|
def load_parameters(self):
|
||||||
self.file = self.experience_parameter.get(VLCParameter.FILE)
|
self.file = self.experiment_parameter.get(VLCParameter.FILE)
|
||||||
self.time = self.experience_parameter.get(VLCParameter.TIME)
|
self.time = self.experiment_parameter.get(VLCParameter.TIME)
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
super(VLC, self).prepare()
|
super(VLC, self).prepare()
|
28
runner.py
28
runner.py
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from core.experience import Experience, ExperienceParameter, ExperienceParameter
|
from core.experiment import Experiment, ExperimentParameter, ExperimentParameter
|
||||||
from core.topo import Topo, TopoParameter
|
from core.topo import Topo, TopoParameter
|
||||||
|
|
||||||
from mininet_builder import MininetBuilder
|
from mininet_builder import MininetBuilder
|
||||||
|
|
||||||
from experiences import EXPERIENCES
|
from experiments import EXPERIMENTS
|
||||||
from topos import TOPO_CONFIGS, TOPOS
|
from topos import TOPO_CONFIGS, TOPOS
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@ -13,19 +13,19 @@ import logging
|
|||||||
|
|
||||||
class Runner(object):
|
class Runner(object):
|
||||||
"""
|
"""
|
||||||
Run an experiment described by `experience_parameter_file` in the topology
|
Run an experiment described by `experiment_parameter_file` in the topology
|
||||||
described by `topo_parameter_file` in the network environment built by
|
described by `topo_parameter_file` in the network environment built by
|
||||||
`builder_type`.
|
`builder_type`.
|
||||||
|
|
||||||
All the operations are done when calling the constructor.
|
All the operations are done when calling the constructor.
|
||||||
"""
|
"""
|
||||||
def __init__(self, builder_type, topo_parameter_file, experience_parameter_file):
|
def __init__(self, builder_type, topo_parameter_file, experiment_parameter_file):
|
||||||
self.topo_parameter = TopoParameter(topo_parameter_file)
|
self.topo_parameter = TopoParameter(topo_parameter_file)
|
||||||
self.set_builder(builder_type)
|
self.set_builder(builder_type)
|
||||||
self.set_topo()
|
self.set_topo()
|
||||||
self.set_topo_config()
|
self.set_topo_config()
|
||||||
self.start_topo()
|
self.start_topo()
|
||||||
self.run_experience(experience_parameter_file)
|
self.run_experiment(experiment_parameter_file)
|
||||||
self.stop_topo()
|
self.stop_topo()
|
||||||
|
|
||||||
def set_builder(self, builder_type):
|
def set_builder(self, builder_type):
|
||||||
@ -68,17 +68,17 @@ class Runner(object):
|
|||||||
self.topo.start_network()
|
self.topo.start_network()
|
||||||
self.topo_config.configure_network()
|
self.topo_config.configure_network()
|
||||||
|
|
||||||
def run_experience(self, experience_parameter_file):
|
def run_experiment(self, experiment_parameter_file):
|
||||||
"""
|
"""
|
||||||
Match the name of the experiement and launch it
|
Match the name of the experiement and launch it
|
||||||
"""
|
"""
|
||||||
# Well, we need to load twice the experience parameters, is it really annoying?
|
# Well, we need to load twice the experiment parameters, is it really annoying?
|
||||||
xp = ExperienceParameter(experience_parameter_file).get(ExperienceParameter.XP_TYPE)
|
xp = ExperimentParameter(experiment_parameter_file).get(ExperimentParameter.XP_TYPE)
|
||||||
if xp in EXPERIENCES:
|
if xp in EXPERIMENTS:
|
||||||
exp = EXPERIENCES[xp](experience_parameter_file, self.topo, self.topo_config)
|
exp = EXPERIMENTS[xp](experiment_parameter_file, self.topo, self.topo_config)
|
||||||
exp.classic_run()
|
exp.classic_run()
|
||||||
else:
|
else:
|
||||||
raise Exception("Unknown experience {}".format(xp))
|
raise Exception("Unknown experiment {}".format(xp))
|
||||||
|
|
||||||
def stop_topo(self):
|
def stop_topo(self):
|
||||||
"""
|
"""
|
||||||
@ -95,12 +95,12 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
parser.add_argument("--topo_param_file", "-t", required=True,
|
parser.add_argument("--topo_param_file", "-t", required=True,
|
||||||
help="path to the topo parameter file")
|
help="path to the topo parameter file")
|
||||||
parser.add_argument("--experience_param_file", "-x",
|
parser.add_argument("--experiment_param_file", "-x",
|
||||||
help="path to the experience parameter file")
|
help="path to the experiment parameter file")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
# XXX Currently, there is no alternate topo builder...
|
# XXX Currently, there is no alternate topo builder...
|
||||||
Runner(Topo.MININET_BUILDER, args.topo_param_file, args.experience_param_file)
|
Runner(Topo.MININET_BUILDER, args.topo_param_file, args.experiment_param_file)
|
Loading…
Reference in New Issue
Block a user