From d0aa85a08f839a316836cd75e11e912488a8665a Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Tue, 9 May 2017 10:36:01 +0200 Subject: [PATCH] mpExperience: disable TSO on all interfaces It seems TCP can sometimes send packets larger than the MTU because of TSO (see https://mailman.stanford.edu/pipermail/mininet-discuss/2013-October/003132.html) --- src/mpExperience.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/mpExperience.py b/src/mpExperience.py index 2b44d2e..9c1cf03 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -38,6 +38,7 @@ class MpExperience: self.mpConfig.configureNetwork() self.changeMetric() self.putPriorityOnPaths() + self.disableTSO() self.runTcpDump() self.runNetemAt() pass @@ -73,6 +74,36 @@ class MpExperience: self.mpTopo.commandTo(self.mpConfig.client, self.mpConfig.interfaceBUPCommand(self.mpConfig.getClientInterface(1))) self.mpTopo.commandTo(self.mpConfig.router, self.mpConfig.interfaceBUPCommand(self.mpConfig.getRouterInterfaceSwitch(1))) + def disableTSO(self): + links = self.mpTopo.getLinkCharacteristics() + i = 0 + for l in links: + lname = self.mpConfig.getMidLeftName(i) + rname = self.mpConfig.getMidRightName(i) + lbox = self.mpTopo.getHost(lname) + lif = self.mpConfig.getMidL2RInterface(i) + rif = self.mpConfig.getMidR2LInterface(i) + rbox = self.mpTopo.getHost(rname) + print(str(lname) + " " + str(lif)) + print(str(rname) + " " + str(rif)) + print("boxes " + str(lbox) + " " + str(rbox)) + cmd = "ethtool -K " + lif + " tso off" + print(cmd) + self.mpTopo.commandTo(lbox, cmd) + cmd = "ethtool -K " + rif + " tso off" + print(cmd) + self.mpTopo.commandTo(rbox, cmd) + i = i + 1 + + # And for the server + cmd = "ethtool -K " + self.mpConfig.getServerInterface() + " tso off" + print(cmd) + self.mpTopo.commandTo(self.mpConfig.server, cmd) + + cmd = "ethtool -K " + self.mpConfig.getRouterInterfaceSwitch(self.mpConfig.getClientInterfaceCount()) + " tso off" + print(cmd) + self.mpTopo.commandTo(self.mpConfig.router, cmd) + 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 !")