From c68e4e76f4083d9daeec86c5f6b4e010d53757ff Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Mon, 26 Jan 2015 13:55:38 -0800 Subject: [PATCH] Clarify bandwidth limit for TCIntfs In the future, we would like to support higher bandwidth limits for TCIntfs, but we'll probably need to adjust some of the parameters dynamically. --- mininet/link.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mininet/link.py b/mininet/link.py index a1d1ad9..af895a1 100644 --- a/mininet/link.py +++ b/mininet/link.py @@ -221,15 +221,19 @@ class TCIntf( Intf ): Allows specification of bandwidth limits (various methods) as well as delay, loss and max queue length""" + # The parameters we use seem to work reasonably up to 1 Gb/sec + # For higher data rates, we will probably need to change them. + bwParamMax = 1000 + def bwCmds( self, bw=None, speedup=0, use_hfsc=False, use_tbf=False, latency_ms=None, enable_ecn=False, enable_red=False ): "Return tc commands to set bandwidth" cmds, parent = [], ' root ' - if bw and ( bw < 0 or bw > 1000 ): - error( 'Bandwidth', bw, 'is outside range 0..1000 Mbps\n' ) - + if bw and ( bw < 0 or bw > self.bwParamMax ): + error( 'Bandwidth limit', bw, 'is outside supported range 0..%d' + % self.bwParamMax, '- ignoring\n' ) elif bw is not None: # BL: this seems a bit brittle... if ( speedup > 0 and