change set from mininet

Signed-off-by: Benjamin Hesmans <benjamin.hesmans@uclouvain.be>
This commit is contained in:
Benjamin Hesmans 2015-01-15 18:59:52 -08:00
parent 304938c381
commit 56c7196245
4 changed files with 5 additions and 6 deletions

View File

@ -28,10 +28,6 @@ class MpConfig:
def configureInterfaces(self):
pass
def configureNetwork(self):
pass
def getClientInterfaceCount(self):
raise Exception("To be implemented")

View File

@ -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()

View File

@ -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

View File

@ -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")