From 78e71c75985beb99c9fdd60fa1f4bcba6e1b811a Mon Sep 17 00:00:00 2001 From: Benjamin Hesmans Date: Wed, 21 Jan 2015 10:38:11 +0100 Subject: [PATCH] add netemChange support for ECMP topo Signed-off-by: Benjamin Hesmans --- src/mpECMPSingleInterfaceConfig.py | 11 +++++++++++ src/mpExperience.py | 10 ++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/mpECMPSingleInterfaceConfig.py b/src/mpECMPSingleInterfaceConfig.py index aa77c64..74c9886 100644 --- a/src/mpECMPSingleInterfaceConfig.py +++ b/src/mpECMPSingleInterfaceConfig.py @@ -154,3 +154,14 @@ class MpECMPSingleInterfaceConfig(MpConfig): def getServerInterface(self): return MpTopo.serverName + "-eth0" + def getMidLeftName(self, id): + return MpTopo.routerNamePrefix + str(id) + + def getMidRightName(self, id): + return MpTopo.switchNamePrefix + "1" + + def getMidL2RInterface(self, id): + return self.getMidLeftName(id) + "-eth1" + + def getMidR2LInterface(self, id): + return self.getMidRightName(id) + "-eth" + str(id+2) diff --git a/src/mpExperience.py b/src/mpExperience.py index 80ed614..a7b0f98 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -100,11 +100,13 @@ class MpExperience: def runTcpDump(self): #todo : replace filename by cst - if self.xpParam.getParam(MpParamXp.CLIENTPCAP) == "yes" : + cpcap = self.xpParam.getParam(MpParamXp.CLIENTPCAP) + spcap = self.xpParam.getParam(MpParamXp.SERVERPCAP) + if cpcap == "yes" : self.mpTopo.commandTo(self.mpConfig.client, "tcpdump -i any -w client.pcap &") - if self.xpParam.getParam(MpParamXp.SERVERPCAP) == "yes" : + if spcap == "yes" : self.mpTopo.commandTo(self.mpConfig.client, "tcpdump -i any -w server.pcap &") - self.mpTopo.commandTo(self.mpConfig.client, - "sleep 5") + if spcap == "yes" or cpcap == "yes": + self.mpTopo.commandTo(self.mpConfig.client,"sleep 5")