2015-01-08 11:04:42 +00:00
|
|
|
from mpTopo import MpTopo
|
|
|
|
from mpParamTopo import MpParamTopo
|
2015-01-08 18:52:45 +00:00
|
|
|
from mpParamXp import MpParamXp
|
2015-01-08 11:04:42 +00:00
|
|
|
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
|
|
|
from mpMultiInterfaceConfig import MpMultiInterfaceConfig
|
2015-01-12 11:26:54 +00:00
|
|
|
from mpECMPSingleInterfaceConfig import MpECMPSingleInterfaceConfig
|
2016-05-24 15:05:20 +00:00
|
|
|
from mpTwoInterfaceCongestionConfig import MpTwoInterfaceCongestionConfig
|
2015-01-08 11:04:42 +00:00
|
|
|
from mpMininetBuilder import MpMininetBuilder
|
2015-01-08 18:52:45 +00:00
|
|
|
from mpExperiencePing import MpExperiencePing
|
2015-01-12 15:34:41 +00:00
|
|
|
from mpExperienceNCPV import MpExperienceNCPV
|
2015-02-27 10:16:01 +00:00
|
|
|
from mpExperienceNC import MpExperienceNC
|
2015-08-14 22:34:27 +00:00
|
|
|
from mpExperienceHTTPS import MpExperienceHTTPS
|
2015-12-01 16:48:32 +00:00
|
|
|
from mpExperienceHTTP import MpExperienceHTTP
|
2016-01-18 09:32:56 +00:00
|
|
|
from mpExperienceSendFile import MpExperienceSendFile
|
2015-11-05 14:06:30 +00:00
|
|
|
from mpExperienceEpload import MpExperienceEpload
|
2015-12-02 09:22:57 +00:00
|
|
|
from mpExperienceNetperf import MpExperienceNetperf
|
2015-12-02 14:22:51 +00:00
|
|
|
from mpExperienceAb import MpExperienceAb
|
2016-04-14 14:01:39 +00:00
|
|
|
from mpExperienceSiri import MpExperienceSiri
|
2016-04-27 14:08:21 +00:00
|
|
|
from mpExperienceVLC import MpExperienceVLC
|
2016-06-01 09:00:51 +00:00
|
|
|
from mpExperienceIperf import MpExperienceIperf
|
2016-06-01 12:52:25 +00:00
|
|
|
from mpExperienceDITG import MpExperienceDITG
|
2017-01-09 15:03:05 +00:00
|
|
|
from mpExperienceMsg import MpExperienceMsg
|
2017-02-22 12:41:42 +00:00
|
|
|
from mpExperienceSiriHTTP import MpExperienceSiriHTTP
|
2017-02-23 10:36:08 +00:00
|
|
|
from mpExperienceSiriMsg import MpExperienceSiriMsg
|
2017-05-05 11:19:03 +00:00
|
|
|
from mpExperienceQUIC import MpExperienceQUIC
|
2015-03-05 10:37:50 +00:00
|
|
|
from mpExperienceNone import MpExperienceNone
|
2015-01-08 18:52:45 +00:00
|
|
|
from mpExperience import MpExperience
|
2015-01-12 11:26:54 +00:00
|
|
|
from mpECMPSingleInterfaceTopo import MpECMPSingleInterfaceTopo
|
2016-05-24 15:05:20 +00:00
|
|
|
from mpTwoInterfaceCongestionTopo import MpTwoInterfaceCongestionTopo
|
2015-01-08 11:04:42 +00:00
|
|
|
|
|
|
|
class MpXpRunner:
|
|
|
|
def __init__(self, builderType, topoParamFile, xpParamFile):
|
2015-01-08 18:52:45 +00:00
|
|
|
self.defParamXp(xpParamFile)
|
2015-01-08 11:04:42 +00:00
|
|
|
self.topoParam = MpParamTopo(topoParamFile)
|
|
|
|
self.defBuilder(builderType)
|
|
|
|
self.defTopo()
|
|
|
|
self.defConfig()
|
|
|
|
self.startTopo()
|
2015-01-08 18:52:45 +00:00
|
|
|
self.runXp()
|
2015-01-08 11:04:42 +00:00
|
|
|
self.stopTopo()
|
2015-02-26 16:43:45 +00:00
|
|
|
|
2015-01-08 18:52:45 +00:00
|
|
|
def defParamXp(self, xpParamFile):
|
|
|
|
self.xpParam = MpParamXp(xpParamFile)
|
|
|
|
|
2015-01-08 11:04:42 +00:00
|
|
|
def defBuilder(self, builderType):
|
|
|
|
if builderType == MpTopo.mininetBuilder:
|
|
|
|
self.topoBuilder = MpMininetBuilder()
|
|
|
|
else:
|
2015-02-26 16:43:45 +00:00
|
|
|
raise Exception("I can not find the builder " +
|
2015-01-08 11:04:42 +00:00
|
|
|
builderType)
|
|
|
|
def defTopo(self):
|
|
|
|
t = self.topoParam.getParam(MpTopo.topoAttr)
|
|
|
|
if t == MpTopo.multiIfTopo:
|
|
|
|
self.mpTopo = MpMultiInterfaceTopo(self.topoBuilder,
|
|
|
|
self.topoParam)
|
2015-01-12 11:26:54 +00:00
|
|
|
elif t == MpTopo.ECMPLikeTopo:
|
|
|
|
self.mpTopo = MpECMPSingleInterfaceTopo(
|
|
|
|
self.topoBuilder,
|
|
|
|
self.topoParam)
|
2016-05-24 15:05:20 +00:00
|
|
|
elif t == MpTopo.twoIfCongTopo:
|
|
|
|
self.mpTopo = MpTwoInterfaceCongestionTopo(
|
|
|
|
self.topoBuilder, self.topoParam)
|
2015-01-08 11:04:42 +00:00
|
|
|
else:
|
|
|
|
raise Exception("Unfound Topo" + t)
|
|
|
|
print(self.mpTopo)
|
|
|
|
|
|
|
|
def defConfig(self):
|
2015-01-12 11:26:54 +00:00
|
|
|
t = self.topoParam.getParam(MpTopo.topoAttr)
|
|
|
|
if t == MpTopo.multiIfTopo:
|
|
|
|
self.mpTopoConfig = MpMultiInterfaceConfig(self.mpTopo,
|
2015-01-08 11:04:42 +00:00
|
|
|
self.topoParam)
|
2015-01-12 11:26:54 +00:00
|
|
|
elif t == MpTopo.ECMPLikeTopo:
|
|
|
|
self.mpTopoConfig = MpECMPSingleInterfaceConfig(
|
|
|
|
self.mpTopo,
|
|
|
|
self.topoParam)
|
2016-05-24 15:05:20 +00:00
|
|
|
elif t == MpTopo.twoIfCongTopo:
|
|
|
|
self.mpTopoConfig = MpTwoInterfaceCongestionConfig(
|
|
|
|
self.mpTopo, self.topoParam)
|
2015-01-12 11:26:54 +00:00
|
|
|
else:
|
2015-02-26 16:43:45 +00:00
|
|
|
raise Exception("Unfound Topo" + t)
|
2015-01-08 11:04:42 +00:00
|
|
|
|
|
|
|
def startTopo(self):
|
|
|
|
self.mpTopo.startNetwork()
|
|
|
|
self.mpTopoConfig.configureNetwork()
|
|
|
|
|
2015-01-08 18:52:45 +00:00
|
|
|
def runXp(self):
|
|
|
|
xp = self.xpParam.getParam(MpParamXp.XPTYPE)
|
|
|
|
if xp == MpExperience.PING:
|
|
|
|
MpExperiencePing(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-01-12 15:34:41 +00:00
|
|
|
elif xp == MpExperience.NCPV:
|
|
|
|
MpExperienceNCPV(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-02-27 10:16:01 +00:00
|
|
|
elif xp == MpExperience.NC:
|
|
|
|
MpExperienceNC(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-03-05 10:32:11 +00:00
|
|
|
elif xp == MpExperience.NONE:
|
2015-03-05 10:37:50 +00:00
|
|
|
MpExperienceNone(self.xpParam, self.mpTopo,
|
2015-03-05 10:32:11 +00:00
|
|
|
self.mpTopoConfig)
|
2015-08-14 22:34:27 +00:00
|
|
|
elif xp == MpExperience.HTTPS:
|
|
|
|
MpExperienceHTTPS(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-12-01 16:48:32 +00:00
|
|
|
elif xp == MpExperience.HTTP:
|
|
|
|
MpExperienceHTTP(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-11-05 14:06:30 +00:00
|
|
|
elif xp == MpExperience.EPLOAD:
|
|
|
|
MpExperienceEpload(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-12-02 09:22:57 +00:00
|
|
|
elif xp == MpExperience.NETPERF:
|
|
|
|
MpExperienceNetperf(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2015-12-02 14:22:51 +00:00
|
|
|
elif xp == MpExperience.AB:
|
|
|
|
MpExperienceAb(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2016-04-14 14:01:39 +00:00
|
|
|
elif xp == MpExperience.SIRI:
|
|
|
|
MpExperienceSiri(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2016-01-18 09:32:56 +00:00
|
|
|
elif xp == MpExperience.SENDFILE:
|
|
|
|
MpExperienceSendFile(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2016-04-27 14:08:21 +00:00
|
|
|
elif xp == MpExperience.VLC:
|
|
|
|
MpExperienceVLC(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2016-06-01 09:00:51 +00:00
|
|
|
elif xp == MpExperience.IPERF:
|
|
|
|
MpExperienceIperf(self.xpParam, self.mpTopo,
|
|
|
|
self.mpTopoConfig)
|
2016-06-01 12:52:25 +00:00
|
|
|
elif xp == MpExperience.DITG:
|
|
|
|
MpExperienceDITG(self.xpParam, self.mpTopo, self.mpTopoConfig)
|
2017-01-09 15:03:05 +00:00
|
|
|
elif xp == MpExperience.MSG:
|
|
|
|
MpExperienceMsg(self.xpParam, self.mpTopo, self.mpTopoConfig)
|
2017-02-22 12:41:42 +00:00
|
|
|
elif xp == MpExperience.SIRIHTTP:
|
|
|
|
MpExperienceSiriHTTP(self.xpParam, self.mpTopo, self.mpTopoConfig)
|
2017-02-23 10:36:08 +00:00
|
|
|
elif xp == MpExperience.SIRIMSG:
|
|
|
|
MpExperienceSiriMsg(self.xpParam, self.mpTopo, self.mpTopoConfig)
|
2017-05-05 11:19:03 +00:00
|
|
|
elif xp == MpExperience.QUIC:
|
|
|
|
MpExperienceQUIC(self.xpParam, self.mpTopo, self.mpTopoConfig)
|
2015-01-08 11:04:42 +00:00
|
|
|
else:
|
2015-01-08 18:52:45 +00:00
|
|
|
print("Unfound xp type..." + xp)
|
2015-02-26 16:43:45 +00:00
|
|
|
|
2015-01-08 11:04:42 +00:00
|
|
|
def stopTopo(self):
|
|
|
|
self.mpTopo.stopNetwork()
|