mpExperience: add priority parameter on interfaces
This commit is contained in:
parent
aabe0de79d
commit
9753f109b5
@ -1,4 +1,5 @@
|
||||
from mpParamXp import MpParamXp
|
||||
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
||||
|
||||
class MpExperience:
|
||||
PING = "ping"
|
||||
@ -29,10 +30,27 @@ class MpExperience:
|
||||
self.setupSysctl()
|
||||
self.runUserspacePM()
|
||||
self.mpConfig.configureNetwork()
|
||||
self.putPriorityOnPaths()
|
||||
self.runTcpDump()
|
||||
self.runNetemAt()
|
||||
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):
|
||||
if self.xpParam.getParam(MpParamXp.KERNELPMC) != "netlink":
|
||||
print("Client : Error, I can't change the userspace pm if the kernel pm is not netlink !")
|
||||
|
@ -50,6 +50,8 @@ class MpParamXp(MpParam):
|
||||
SIRIBUFFERSIZE = "siriBufferSize"
|
||||
VLCFILE = "vlcFile"
|
||||
VLCTIME = "vlcTime"
|
||||
PRIOPATH0 = "prioPath0"
|
||||
PRIOPATH1 = "prioPath1"
|
||||
|
||||
|
||||
# global sysctl
|
||||
@ -117,6 +119,8 @@ class MpParamXp(MpParam):
|
||||
defaultValue[SIRIBUFFERSIZE] = "9"
|
||||
defaultValue[VLCFILE] = "bunny_ibmff_360.mpd"
|
||||
defaultValue[VLCTIME] = "0"
|
||||
defaultValue[PRIOPATH0] = "0"
|
||||
defaultValue[PRIOPATH1] = "0"
|
||||
|
||||
def __init__(self, paramFile):
|
||||
MpParam.__init__(self, paramFile)
|
||||
|
Loading…
Reference in New Issue
Block a user