From 804c4bbfa6e7cf5e3d48f712fd2dbe3031f80fb0 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Wed, 26 Jun 2013 06:14:43 -0700 Subject: [PATCH] Workaround: add dpopts to UserSwitch Currently, slicing on the user switch breaks bandwidth limits. We don't yet have a good way of using both of them at the same time. I'm inclined to turn off slicing by default, but I have to think about it and also see if any one is using it... --- mininet/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index 9656499..8e93af9 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -801,7 +801,7 @@ class UserSwitch( Switch ): dpidLen = 12 - def __init__( self, name, **kwargs ): + def __init__( self, name, dpopts='', **kwargs ): """Init. name: name for the switch""" Switch.__init__( self, name, **kwargs ) @@ -810,6 +810,7 @@ class UserSwitch( Switch ): '(openflow.org)' ) if self.listenPort: self.opts += ' --listen=ptcp:%i ' % self.listenPort + self.dpopts = dpopts @classmethod def setup( cls ): @@ -840,7 +841,8 @@ class UserSwitch( Switch ): self.cmd( 'ifconfig lo up' ) intfs = [ str( i ) for i in self.intfList() if not i.IP() ] self.cmd( 'ofdatapath -i ' + ','.join( intfs ) + - ' punix:/tmp/' + self.name + ' -d ' + self.dpid + + ' punix:/tmp/' + self.name + ' -d %s ' % self.dpid + + self.dpopts + ' 1> ' + ofdlog + ' 2> ' + ofdlog + ' &' ) self.cmd( 'ofprotocol unix:/tmp/' + self.name + ' ' + clist +