From 4a304688f4ab187cde2d1597f58541f35b6fc24e Mon Sep 17 00:00:00 2001
From: Bob Lantz <rlantz@cs.stanford.edu>
Date: Mon, 10 Nov 2014 12:38:11 -0800
Subject: [PATCH] Select TCP Reno and run iperf for a longer time interval

The hope is that this will make the results a bit more consistent
when running in a VM environment.
---
 examples/linearbandwidth.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/linearbandwidth.py b/examples/linearbandwidth.py
index 5cd05f00..995bfa1e 100755
--- a/examples/linearbandwidth.py
+++ b/examples/linearbandwidth.py
@@ -27,7 +27,7 @@
 from mininet.node import UserSwitch, OVSKernelSwitch, Controller
 from mininet.topo import Topo
 from mininet.log import lg
-from mininet.util import irange
+from mininet.util import irange, quietRun
 from mininet.link import TCLink
 from functools import partial
 
@@ -78,6 +78,10 @@ def linearBandwidthTest( lengths ):
 
     topo = LinearTestTopo( hostCount )
 
+    # Select TCP Reno
+    output = quietRun( 'sysctl -w net.ipv4.tcp_congestion_control=reno' )
+    assert 'reno' in output
+
     for datapath in switches.keys():
         print "*** testing", datapath, "datapath"
         Switch = switches[ datapath ]
@@ -97,7 +101,7 @@ def linearBandwidthTest( lengths ):
             # since the reference controller is reactive
             src.cmd( 'telnet', dst.IP(), '5001' )
             print "testing", src.name, "<->", dst.name,
-            bandwidth = net.iperf( [ src, dst ] )
+            bandwidth = net.iperf( [ src, dst ], seconds=10 )
             print bandwidth
             flush()
             results[ datapath ] += [ ( n, bandwidth ) ]
-- 
GitLab