diff --git a/core/experience.py b/core/experience.py index 3145ecd..4eac806 100644 --- a/core/experience.py +++ b/core/experience.py @@ -10,25 +10,25 @@ class ExperienceParameter(Parameter): SCHED = "sched" CC = "congctrl" AUTOCORK = "autocork" - EARLYRETRANS = "earlyRetrans" + EARLY_RETRANS = "earlyRetrans" KERNELPM = "kpm" KERNELPMC = "kpmc" #kernel path manager client / server KERNELPMS = "kpms" USERPMC = "upmc" USERPMS = "upms" #userspace path manager client / server - USERPMCARGS = "upmc_args" - USERPMSARGS = "upms_args" - CLIENTPCAP = "clientPcap" - SERVERPCAP = "serverPcap" - SNAPLENPCAP = "snaplenPcap" - XPTYPE = "xpType" - PINGCOUNT = "pingCount" - PRIOPATH0 = "prioPath0" - PRIOPATH1 = "prioPath1" - BACKUPPATH0 = "backupPath0" - BACKUPPATH1 = "backupPath1" + USERPMC_ARGS = "upmc_args" + USERPMS_ARGS = "upms_args" + CLIENT_PCAP = "clientPcap" + SERVER_PCAP = "serverPcap" + SNAPLEN_PCAP = "snaplenPcap" + XP_TYPE = "xpType" + PING_COUNT = "pingCount" + PRIO_PATH0 = "prioPath0" + PRIO_PATH1 = "prioPath1" + BACKUP_PATH0 = "backupPath0" + BACKUP_PATH1 = "backupPath1" EXPIRATION = "expiration" - BUFFERAUTOTUNING = "bufferAutotuning" + BUFFER_AUTOTUNING = "bufferAutotuning" METRIC = "metric" @@ -40,9 +40,9 @@ class ExperienceParameter(Parameter): SCHED: "net.mptcp.mptcp_scheduler", CC: "net.ipv4.tcp_congestion_control", AUTOCORK: "net.ipv4.tcp_autocorking", - EARLYRETRANS: "net.ipv4.tcp_early_retrans", + EARLY_RETRANS: "net.ipv4.tcp_early_retrans", EXPIRATION: "net.mptcp.mptcp_sched_expiration", - BUFFERAUTOTUNING: "net.ipv4.tcp_moderate_rcvbuf", + BUFFER_AUTOTUNING: "net.ipv4.tcp_moderate_rcvbuf", } # sysctl keys specific to client and server, independently @@ -62,24 +62,24 @@ class ExperienceParameter(Parameter): KERNELPMS: "fullmesh", USERPMC: "fullmesh", USERPMS: "fullmesh", - USERPMCARGS: "", - USERPMSARGS: "", + USERPMC_ARGS: "", + USERPMS_ARGS: "", CC: "olia", SCHED: "default", AUTOCORK: "1", - EARLYRETRANS: "3", + EARLY_RETRANS: "3", EXPIRATION: "300", - BUFFERAUTOTUNING: "1", + BUFFER_AUTOTUNING: "1", METRIC: "-1", - CLIENTPCAP: "no", - SERVERPCAP: "no", - SNAPLENPCAP: "65535", # Default snapping value of tcpdump - XPTYPE: "none", - PINGCOUNT: "5", - PRIOPATH0: "0", - PRIOPATH1: "0", - BACKUPPATH0: "0", - BACKUPPATH1: "0", + CLIENT_PCAP: "no", + SERVER_PCAP: "no", + SNAPLEN_PCAP: "65535", # Default snapping value of tcpdump + XP_TYPE: "none", + PING_COUNT: "5", + PRIO_PATH0: "0", + PRIO_PATH1: "0", + BACKUP_PATH0: "0", + BACKUP_PATH1: "0", } def __init__(self, parameter_filename): @@ -175,8 +175,8 @@ class Experience(object): """ # Only meaningful if mpTopo is instance of MultiInterfaceTopo if isinstance(self.topo, MultiInterfaceTopo): - prioPath0 = self.experience_parameter.get(ExperienceParameter.PRIOPATH0) - prioPath1 = self.experience_parameter.get(ExperienceParameter.PRIOPATH1) + prioPath0 = self.experience_parameter.get(ExperienceParameter.PRIO_PATH0) + prioPath1 = self.experience_parameter.get(ExperienceParameter.PRIO_PATH1) if not prioPath0 == prioPath1: self.topo.command_to(self.topo_config.client, "/home/mininet/iproute/ip/ip link set dev " + self.topo_config.getClientInterface(0) + " priority " + str(prioPath0)) @@ -189,11 +189,11 @@ class Experience(object): self.topo_config.getRouterInterfaceSwitch(1) + " priority " + str(prioPath1)) - backupPath0 = self.experience_parameter.get(ExperienceParameter.BACKUPPATH0) + backupPath0 = self.experience_parameter.get(ExperienceParameter.BACKUP_PATH0) 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.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(0))) - backupPath1 = self.experience_parameter.get(ExperienceParameter.BACKUPPATH1) + backupPath1 = self.experience_parameter.get(ExperienceParameter.BACKUP_PATH1) 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.router, self.topo_config.interfaceBUPCommand(self.topo_config.getRouterInterfaceSwitch(1))) @@ -233,14 +233,14 @@ class Experience(object): print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !") else: upmc = self.experience_parameter.get(ExperienceParameter.USERPMC) - upmca = self.experience_parameter.get(ExperienceParameter.USERPMCARGS) + upmca = self.experience_parameter.get(ExperienceParameter.USERPMC_ARGS) self.topo.command_to(self.topo_config.client, upmc + \ " " + upmca + " &>upmc.log &") if self.experience_parameter.get(ExperienceParameter.KERNELPMS) != "netlink": print("Server : Error, I can't change the userspace pm if the kernel pm is not netlink !") else: upms = self.experience_parameter.get(ExperienceParameter.USERPMS) - upmsa = self.experience_parameter.get(ExperienceParameter.USERPMSARGS) + upmsa = self.experience_parameter.get(ExperienceParameter.USERPMS_ARGS) self.topo.command_to(self.topo_config.server, upms + \ " " + upmsa + " &>upms.log &") @@ -392,9 +392,9 @@ class Experience(object): def runTcpDump(self): #todo : replace filename by cst - cpcap = self.experience_parameter.get(ExperienceParameter.CLIENTPCAP) - spcap = self.experience_parameter.get(ExperienceParameter.SERVERPCAP) - snaplenpcap = self.experience_parameter.get(ExperienceParameter.SNAPLENPCAP) + cpcap = self.experience_parameter.get(ExperienceParameter.CLIENT_PCAP) + spcap = self.experience_parameter.get(ExperienceParameter.SERVER_PCAP) + snaplenpcap = self.experience_parameter.get(ExperienceParameter.SNAPLEN_PCAP) if cpcap == "yes" : self.topo.command_to(self.topo_config.client, "tcpdump -i any -s " + snaplenpcap + " -w client.pcap &") diff --git a/experiences/ab.py b/experiences/ab.py index b6d04f9..abf0388 100644 --- a/experiences/ab.py +++ b/experiences/ab.py @@ -29,7 +29,7 @@ class AB(RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + AB.PING_OUTPUT) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/ditg.py b/experiences/ditg.py index 8996910..e47616e 100644 --- a/experiences/ditg.py +++ b/experiences/ditg.py @@ -44,7 +44,7 @@ class DITG(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ Experience.PING_OUTPUT) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/epload.py b/experiences/epload.py index cf79568..4e16993 100644 --- a/experiences/epload.py +++ b/experiences/epload.py @@ -29,7 +29,7 @@ class Epload(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ Epload.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/http.py b/experiences/http.py index 5230bc4..60f89a7 100644 --- a/experiences/http.py +++ b/experiences/http.py @@ -16,7 +16,7 @@ class HTTP(RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ HTTP.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/https.py b/experiences/https.py index d307684..062531e 100644 --- a/experiences/https.py +++ b/experiences/https.py @@ -16,7 +16,7 @@ class HTTPS(RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ HTTPS.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/iperf.py b/experiences/iperf.py index dd2281d..a2146e3 100644 --- a/experiences/iperf.py +++ b/experiences/iperf.py @@ -29,7 +29,7 @@ class IPerf(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ IPerf.PING_OUTPUT) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/msg.py b/experiences/msg.py index b00d398..9a6a073 100644 --- a/experiences/msg.py +++ b/experiences/msg.py @@ -34,7 +34,7 @@ class Msg(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ Msg.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/ncpv.py b/experiences/ncpv.py index 58ec9e0..f15cf61 100644 --- a/experiences/ncpv.py +++ b/experiences/ncpv.py @@ -50,7 +50,7 @@ class NCPV(NC): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ NCPV.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/netperf.py b/experiences/netperf.py index 76cc7ab..edb20b3 100644 --- a/experiences/netperf.py +++ b/experiences/netperf.py @@ -34,7 +34,7 @@ class Netperf(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ Netperf.PING_OUTPUT) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/ping.py b/experiences/ping.py index 7eee3c1..b41285d 100644 --- a/experiences/ping.py +++ b/experiences/ping.py @@ -17,7 +17,7 @@ class Ping(Experience): def run(self): self.topo.command_to(self.topo_config.client, "rm " + \ Ping.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/quic.py b/experiences/quic.py index f310c83..5a88fe1 100644 --- a/experiences/quic.py +++ b/experiences/quic.py @@ -33,7 +33,7 @@ class QUIC(RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ QUIC.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/quic_siri.py b/experiences/quic_siri.py index 0fc0d9f..d47dbdf 100644 --- a/experiences/quic_siri.py +++ b/experiences/quic_siri.py @@ -32,7 +32,7 @@ class QUICSiri(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ QUICSiri.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/send_file.py b/experiences/send_file.py index d1e6298..24aeb40 100644 --- a/experiences/send_file.py +++ b/experiences/send_file.py @@ -16,7 +16,7 @@ class SendFile(RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ SendFile.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/siri.py b/experiences/siri.py index 6fb35c3..92f8eef 100644 --- a/experiences/siri.py +++ b/experiences/siri.py @@ -47,7 +47,7 @@ class Siri(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ Siri.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/siri_http.py b/experiences/siri_http.py index ae3b4d5..4e034d3 100644 --- a/experiences/siri_http.py +++ b/experiences/siri_http.py @@ -21,7 +21,7 @@ class SiriHTTP(Siri, RandomFileExperience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ SiriHTTP.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/experiences/vlc.py b/experiences/vlc.py index 166aa70..74b09d6 100644 --- a/experiences/vlc.py +++ b/experiences/vlc.py @@ -29,7 +29,7 @@ class VLC(Experience): def ping(self): self.topo.command_to(self.topo_config.client, "rm " + \ VLC.PING_OUTPUT ) - count = self.experience_parameter.get(ExperienceParameter.PINGCOUNT) + count = self.experience_parameter.get(ExperienceParameter.PING_COUNT) for i in range(0, self.topo_config.getClientInterfaceCount()): cmd = self.pingCommand(self.topo_config.getClientIP(i), self.topo_config.getServerIP(), n = count) diff --git a/runner.py b/runner.py index 145d783..e442214 100644 --- a/runner.py +++ b/runner.py @@ -73,7 +73,7 @@ class Runner(object): Match the name of the experiement and launch it """ # Well, we need to load twice the experience parameters, is it really annoying? - xp = ExperienceParameter(experience_parameter_file).get(ExperienceParameter.XPTYPE) + xp = ExperienceParameter(experience_parameter_file).get(ExperienceParameter.XP_TYPE) if xp in EXPERIENCES: exp = EXPERIENCES[xp](experience_parameter_file, self.topo, self.topo_config) exp.classic_run()