2020-06-24 08:36:26 +00:00
|
|
|
from core.experience import Experience, ExperienceParameter, ExperienceParameter
|
|
|
|
from core.topo import Topo, TopoParameter
|
|
|
|
|
2020-06-24 09:26:56 +00:00
|
|
|
from mininet_builder import MininetBuilder
|
|
|
|
|
2015-01-08 11:04:42 +00:00
|
|
|
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
|
|
|
from mpMultiInterfaceConfig import MpMultiInterfaceConfig
|
2017-06-12 07:34:28 +00:00
|
|
|
from mpMultiInterfaceCongConfig import MpMultiInterfaceCongConfig
|
|
|
|
from mpMultiInterfaceCongTopo import MpMultiInterfaceCongTopo
|
2015-01-12 11:26:54 +00:00
|
|
|
from mpECMPSingleInterfaceConfig import MpECMPSingleInterfaceConfig
|
2016-05-24 15:05:20 +00:00
|
|
|
from mpTwoInterfaceCongestionConfig import MpTwoInterfaceCongestionConfig
|
2020-06-24 08:36:26 +00:00
|
|
|
from mpExperiencePing import ExperiencePing
|
|
|
|
from mpExperienceNCPV import ExperienceNCPV
|
|
|
|
from mpExperienceNC import ExperienceNC
|
|
|
|
from mpExperienceHTTPS import ExperienceHTTPS
|
|
|
|
from mpExperienceHTTP import ExperienceHTTP
|
|
|
|
from mpExperienceSendFile import ExperienceSendFile
|
|
|
|
from mpExperienceEpload import ExperienceEpload
|
|
|
|
from mpExperienceNetperf import ExperienceNetperf
|
|
|
|
from mpExperienceAb import ExperienceAb
|
|
|
|
from mpExperienceSiri import ExperienceSiri
|
|
|
|
from mpExperienceVLC import ExperienceVLC
|
|
|
|
from mpExperienceIperf import ExperienceIperf
|
|
|
|
from mpExperienceDITG import ExperienceDITG
|
|
|
|
from mpExperienceMsg import ExperienceMsg
|
|
|
|
from mpExperienceSiriHTTP import ExperienceSiriHTTP
|
|
|
|
from mpExperienceSiriMsg import ExperienceSiriMsg
|
|
|
|
from mpExperienceQUIC import ExperienceQUIC
|
|
|
|
from mpExperienceQUICSiri import ExperienceQUICSiri
|
|
|
|
from mpExperienceNone import ExperienceNone
|
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)
|
2020-06-24 08:36:26 +00:00
|
|
|
self.topoParam = TopoParameter(topoParamFile)
|
2015-01-08 11:04:42 +00:00
|
|
|
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):
|
2020-06-24 08:36:26 +00:00
|
|
|
self.xpParam = ExperienceParameter(xpParamFile)
|
2015-01-08 18:52:45 +00:00
|
|
|
|
2015-01-08 11:04:42 +00:00
|
|
|
def defBuilder(self, builderType):
|
2020-06-24 08:36:26 +00:00
|
|
|
if builderType == Topo.mininetBuilder:
|
2020-06-24 09:26:56 +00:00
|
|
|
self.topoBuilder = MininetBuilder()
|
2015-01-08 11:04:42 +00:00
|
|
|
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):
|
2020-06-24 08:36:26 +00:00
|
|
|
t = self.topoParam.getParam(Topo.topoAttr)
|
|
|
|
if t == Topo.multiIfTopo:
|
|
|
|
self.Topo = MpMultiInterfaceTopo(self.topoBuilder,
|
2015-01-08 11:04:42 +00:00
|
|
|
self.topoParam)
|
2020-06-24 08:36:26 +00:00
|
|
|
elif t == Topo.ECMPLikeTopo:
|
|
|
|
self.Topo = MpECMPSingleInterfaceTopo(
|
2015-01-12 11:26:54 +00:00
|
|
|
self.topoBuilder,
|
|
|
|
self.topoParam)
|
2020-06-24 08:36:26 +00:00
|
|
|
elif t == Topo.twoIfCongTopo:
|
|
|
|
self.Topo = MpTwoInterfaceCongestionTopo(
|
2016-05-24 15:05:20 +00:00
|
|
|
self.topoBuilder, self.topoParam)
|
2020-06-24 08:36:26 +00:00
|
|
|
elif t == Topo.multiIfCongTopo:
|
|
|
|
self.Topo = MpMultiInterfaceCongTopo(self.topoBuilder,
|
2017-06-12 07:34:28 +00:00
|
|
|
self.topoParam)
|
2015-01-08 11:04:42 +00:00
|
|
|
else:
|
|
|
|
raise Exception("Unfound Topo" + t)
|
2020-06-24 08:36:26 +00:00
|
|
|
print(self.Topo)
|
2015-01-08 11:04:42 +00:00
|
|
|
|
|
|
|
def defConfig(self):
|
2020-06-24 08:36:26 +00:00
|
|
|
t = self.topoParam.getParam(Topo.topoAttr)
|
|
|
|
if t == Topo.multiIfTopo:
|
|
|
|
self.TopoConfig = MpMultiInterfaceConfig(self.Topo,
|
2015-01-08 11:04:42 +00:00
|
|
|
self.topoParam)
|
2020-06-24 08:36:26 +00:00
|
|
|
elif t == Topo.ECMPLikeTopo:
|
|
|
|
self.TopoConfig = MpECMPSingleInterfaceConfig(
|
|
|
|
self.Topo,
|
2015-01-12 11:26:54 +00:00
|
|
|
self.topoParam)
|
2020-06-24 08:36:26 +00:00
|
|
|
elif t == Topo.twoIfCongTopo:
|
|
|
|
self.TopoConfig = MpTwoInterfaceCongestionConfig(
|
|
|
|
self.Topo, self.topoParam)
|
|
|
|
elif t == Topo.multiIfCongTopo:
|
|
|
|
self.TopoConfig = MpMultiInterfaceCongConfig(self.Topo,
|
2017-06-12 07:34:28 +00:00
|
|
|
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):
|
2020-06-24 08:36:26 +00:00
|
|
|
self.Topo.startNetwork()
|
|
|
|
self.TopoConfig.configureNetwork()
|
2015-01-08 11:04:42 +00:00
|
|
|
|
2015-01-08 18:52:45 +00:00
|
|
|
def runXp(self):
|
2020-06-24 08:36:26 +00:00
|
|
|
xp = self.xpParam.getParam(ExperienceParameter.XPTYPE)
|
|
|
|
if xp ==Experience.PING:
|
|
|
|
ExperiencePing(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.NCPV:
|
|
|
|
ExperienceNCPV(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.NC:
|
|
|
|
ExperienceNC(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.NONE:
|
|
|
|
ExperienceNone(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.HTTPS:
|
|
|
|
ExperienceHTTPS(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.HTTP:
|
|
|
|
ExperienceHTTP(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.EPLOAD:
|
|
|
|
ExperienceEpload(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.NETPERF:
|
|
|
|
ExperienceNetperf(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.AB:
|
|
|
|
ExperienceAb(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.SIRI:
|
|
|
|
ExperienceSiri(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.SENDFILE:
|
|
|
|
ExperienceSendFile(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.VLC:
|
|
|
|
ExperienceVLC(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.IPERF:
|
|
|
|
ExperienceIperf(self.xpParam, self.Topo,
|
|
|
|
self.TopoConfig)
|
|
|
|
elif xp ==Experience.DITG:
|
|
|
|
ExperienceDITG(self.xpParam, self.Topo, self.TopoConfig)
|
|
|
|
elif xp ==Experience.MSG:
|
|
|
|
ExperienceMsg(self.xpParam, self.Topo, self.TopoConfig)
|
|
|
|
elif xp ==Experience.SIRIHTTP:
|
|
|
|
ExperienceSiriHTTP(self.xpParam, self.Topo, self.TopoConfig)
|
|
|
|
elif xp ==Experience.SIRIMSG:
|
|
|
|
ExperienceSiriMsg(self.xpParam, self.Topo, self.TopoConfig)
|
|
|
|
elif xp ==Experience.QUIC:
|
|
|
|
ExperienceQUIC(self.xpParam, self.Topo, self.TopoConfig)
|
|
|
|
elif xp ==Experience.QUICSIRI:
|
|
|
|
ExperienceQUICSiri(self.xpParam, self.Topo, self.TopoConfig)
|
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):
|
2020-06-24 08:36:26 +00:00
|
|
|
self.Topo.stopNetwork()
|