diff --git a/src/mpExperience.py b/src/mpExperience.py index 56d4420..5e7875b 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -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 !") diff --git a/src/mpParamXp.py b/src/mpParamXp.py index 3b357ac..3dac841 100644 --- a/src/mpParamXp.py +++ b/src/mpParamXp.py @@ -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)