mpExperience: add priority parameter on interfaces

This commit is contained in:
Quentin De Coninck 2016-05-13 10:00:29 +02:00
parent aabe0de79d
commit 9753f109b5
2 changed files with 22 additions and 0 deletions

View File

@ -1,4 +1,5 @@
from mpParamXp import MpParamXp from mpParamXp import MpParamXp
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
class MpExperience: class MpExperience:
PING = "ping" PING = "ping"
@ -29,10 +30,27 @@ class MpExperience:
self.setupSysctl() self.setupSysctl()
self.runUserspacePM() self.runUserspacePM()
self.mpConfig.configureNetwork() self.mpConfig.configureNetwork()
self.putPriorityOnPaths()
self.runTcpDump() self.runTcpDump()
self.runNetemAt() self.runNetemAt()
pass pass
def putPriorityOnPaths(self):
# Only meaningful if mpTopo is instance of MpMultiInterfaceTopo
if isinstance(self.mpTopo, MpMultiInterfaceTopo):
prioPath0 = self.xpParam.getParam(MpParamXp.PRIOPATH0)
prioPath1 = self.xpParam.getParam(MpParamXp.PRIOPATH1)
self.mpTopo.commandTo(self.mpConfig.client, "ip link set dev " +
self.mpConfig.getClientInterface(0) + "priority" + str(prioPath0))
self.mpTopo.commandTo(self.mpConfig.router, "ip link set dev " +
self.mpConfig.getRouterInterfaceSwitch(0) + "priority" +
str(prioPath0))
self.mpTopo.commandTo(self.mpConfig.client, "ip link set dev " +
self.mpConfig.getClientInterface(1) + "priority" + str(prioPath1))
self.mpTopo.commandTo(self.mpConfig.router, "ip link set dev " +
self.mpConfig.getRouterInterfaceSwitch(1) + "priority" +
str(prioPath1))
def runUserspacePM(self): def runUserspacePM(self):
if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink": if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink":
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !") print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")

View File

@ -50,6 +50,8 @@ class MpParamXp(MpParam):
SIRIBUFFERSIZE = "siriBufferSize" SIRIBUFFERSIZE = "siriBufferSize"
VLCFILE = "vlcFile" VLCFILE = "vlcFile"
VLCTIME = "vlcTime" VLCTIME = "vlcTime"
PRIOPATH0 = "prioPath0"
PRIOPATH1 = "prioPath1"
# global sysctl # global sysctl
@ -117,6 +119,8 @@ class MpParamXp(MpParam):
defaultValue[SIRIBUFFERSIZE] = "9" defaultValue[SIRIBUFFERSIZE] = "9"
defaultValue[VLCFILE] = "bunny_ibmff_360.mpd" defaultValue[VLCFILE] = "bunny_ibmff_360.mpd"
defaultValue[VLCTIME] = "0" defaultValue[VLCTIME] = "0"
defaultValue[PRIOPATH0] = "0"
defaultValue[PRIOPATH1] = "0"
def __init__(self, paramFile): def __init__(self, paramFile):
MpParam.__init__(self, paramFile) MpParam.__init__(self, paramFile)