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] Link Bandwidth

habib allah khosravi habiballah_khosravi at yahoo.com
Sat Apr 12 04:10:20 PDT 2014


Hi. I want to set the link bandwidth in my topology code but I get the following error:

TypeError: __init__() got an unexpected keyword argument 'bw'

Can someone tell me how I can set the link bandwidth?

Here is the code for the topology:

from mininet.topo import Topo
from mininet.link import TCLink

class TEST( Topo ):
    "Simple topology example."

    def __init__( self ):
        "Create custom topo."

        # Initialize topology
        Topo.__init__( self )

        # Add hosts
        h1 = self.addHost( 'h1'
 )
        h2 =
 self.addHost( 'h2' )
        h3 = self.addHost( 'h3' )
        h4 = self.addHost( 'h4' )

    # Add switches
        s1 = self.addSwitch( 's1' )
        s2 = self.addSwitch( 's2' )
        s3 = self.addSwitch( 's3' )
        s4 = self.addSwitch( 's4' )
        s5 = self.addSwitch( 's5' )
        s6 = self.addSwitch( 's6' )
        s7 = self.addSwitch( 's7' )

        # Add links
        self.addLink( h1, s1 ,bw=10)
        self.addLink( h2, s1
 ,bw=10)
        self.addLink( s1, s2 ,bw=10)
        self.addLink( s1, s3 ,bw=10)
        self.addLink( s2, s4 ,bw=10)
        self.addLink( s2, s5 ,bw=10)
        self.addLink( s3, s4 ,bw=10)
        self.addLink( s3, s6 ,bw=10)
        self.addLink( s4, s7 ,bw=10)
        self.addLink( s5, s7 ,bw=10)
        self.addLink( s6, s7 ,bw=10)
        self.addLink( s7, h3 ,bw=10)
        self.addLink( s7, h4 ,bw=10)

topos = { 'test': ( lambda: TEST() )
 }

----------------------------------------------------------------------------

Thanks

Habib Allah Khosravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/mininet-discuss/attachments/20140412/92cc5803/attachment-0001.html>


More information about the mininet-discuss mailing list