From 56c719624586c8f68761ab20517be35da51c8fe5 Mon Sep 17 00:00:00 2001 From: Benjamin Hesmans Date: Thu, 15 Jan 2015 18:59:52 -0800 Subject: [PATCH] change set from mininet Signed-off-by: Benjamin Hesmans --- src/mpConfig.py | 4 ---- src/mpExperience.py | 2 ++ src/mpLinkCharacteristics.py | 3 ++- src/mpTopo.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mpConfig.py b/src/mpConfig.py index 17d1642..315fa85 100644 --- a/src/mpConfig.py +++ b/src/mpConfig.py @@ -28,10 +28,6 @@ class MpConfig: def configureInterfaces(self): pass - def configureNetwork(self): - pass - - def getClientInterfaceCount(self): raise Exception("To be implemented") diff --git a/src/mpExperience.py b/src/mpExperience.py index 1306508..9d1372f 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -17,10 +17,12 @@ class MpExperience: def prepare(self): self.setupSysctl() self.runTcpDump() + self.runNetemAt() pass def runNetemAt(self): if not self.mpTopo.changeNetem == "yes": + print("I don't need to change netem") return print("Will change netem config on the fly") links = self.mpTopo.getLinkCharacteristics() diff --git a/src/mpLinkCharacteristics.py b/src/mpLinkCharacteristics.py index d50e0c4..8da38bb 100644 --- a/src/mpLinkCharacteristics.py +++ b/src/mpLinkCharacteristics.py @@ -29,10 +29,11 @@ class MpLinkCharacteristics: cmd = cmd + " && " cmd = cmd + " echo " + n.cmd + " && " cmd = cmd + " true &" + return cmd def asDict(self): d = {} - d['bw'] = int(self.bandwidth) + d['bw'] = float(self.bandwidth) d['delay'] = self.delay + "ms" d['max_queue_size'] = int(self.queueSize) return d diff --git a/src/mpTopo.py b/src/mpTopo.py index 318ed76..c1c0b7b 100644 --- a/src/mpTopo.py +++ b/src/mpTopo.py @@ -20,7 +20,7 @@ class MpTopo: self.logFile = open(MpTopo.cmdLog, 'w') def getLinkCharacteristics(self): - return topoParam.linkCharacteristics() + return self.topoParam.linkCharacteristics def commandTo(self, who, cmd): self.logFile.write(who.__str__() + " : " + cmd + "\n")