Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] [Help] Question about setting Mininet link capacity

Ruozhou.Hotmail ruozhou.asu at hotmail.com
Sun Apr 20 12:34:27 PDT 2014


The whole code is as follows.

from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.node import CPULimitedHost

class MyTopo( Topo ):
	def __init__( self ):
			

		# Initialize topology
		Topo.__init__( self )

		# Add all nodes
		s1 = self.addHost('s1')
		s2 = self.addHost('s2')
		s3 = self.addHost('s3')
		sw0 = self.addSwitch( 'sw0' )
		sw11 = self.addSwitch( 'sw11' )
		sw12 = self.addSwitch( 'sw12' )
		sw13 = self.addSwitch( 'sw13' )
		sw21 = self.addSwitch( 'sw21' )
		sw22 = self.addSwitch( 'sw22' )
		sw23 = self.addSwitch( 'sw23' )
		r1 = self.addHost('r1')
		r2 = self.addHost('r2')
		r3 = self.addHost('r3')

		# Add links
		opt = {'bw':5}
		self.addLink( s1, sw0, **opt )
		self.addLink( s2, sw0, **opt )
		self.addLink( s3, sw0, **opt )
		self.addLink( sw0, sw11, **opt )
		self.addLink( sw0, sw12, **opt )
		self.addLink( sw0, sw13, **opt )
		self.addLink( sw11, sw21, **opt )
		self.addLink( sw11, sw22, **opt )
		self.addLink( sw11, sw23, **opt )
		self.addLink( sw12, sw21, **opt )
		self.addLink( sw12, sw22, **opt )
		self.addLink( sw12, sw23, **opt )
		self.addLink( sw13, sw21, **opt )
		self.addLink( sw13, sw22, **opt )
		self.addLink( sw13, sw23, **opt )
		self.addLink( sw21, r1, **opt )
		self.addLink( sw22, r2, **opt )
		self.addLink( sw23, r3, **opt )

topos = { 'mytopo': ( lambda: MyTopo() ) }
------------------------------------------------ 
Ruozhou Yu
Computer Science and Engineering
Arizona State University


On 2014年4月20日 at 下午12:31:27, Sukhbir Singh (sukhbir.in at gmail.com) wrote:

> ————————————————————————————————————————  
> Caught exception. Cleaning up...  
>  
> TypeError: __init__() got an unexpected keyword argument 'bw'  
> ———————————————————————————————————————  
>  
> My code is:  
> opt = {'bw':5}  
> self.addLink( s1, sw0, **opt )  

This is the right way but then this depends on the rest of the code,  
so probably showing all of the code can help.  

--  
Sukhbir  
_______________________________________________
mininet-discuss mailing list
mininet-discuss at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/mininet-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/mininet-discuss/attachments/20140420/dfc67220/attachment.html>


More information about the mininet-discuss mailing list