0
  1. I want to add link parameter from switch to a remote controller(floodlight) how can I do that.? I mean I want to specify a link bandwidth, link delay.. between switches to its controllers.

  2. is that the correct way to implement a two directional link?

    net.addLink('s1','s2', bw=43)  
    net.addLink('s2','s1', bw=35)
    

I'm using this custom topology

def emptyNet():
    net = Mininet(controller=RemoteController,
                  switch=OVSKernelSwitch, link=TCLink)
    c1 = net.addController('c1', controller=RemoteController,
                           ip="127.0.0.1", port=6633)
    c2 = net.addController('c2', controller=RemoteController,
                           ip="127.0.0.1", port=6632)
    c3 = net.addController('c3', controller=RemoteController,
                           ip="127.0.0.1", port=6634)

    h1 = net.addHost( 'h1' )
    h2 = net.addHost( 'h2' )
    h3 = net.addHost( 'h3' )
    h4 = net.addHost( 'h4' )
    h5 = net.addHost( 'h5' )
    h6 = net.addHost( 'h6' )
    h7 = net.addHost( 'h7' )
    h8 = net.addHost( 'h8' )
    h9 = net.addHost( 'h9' )
    s1 = net.addSwitch( 's1' , mac='00:00:00:00:00:01' )
    s2 = net.addSwitch( 's2' , mac='00:00:00:00:00:02' )
    s3 = net.addSwitch( 's3' , mac='00:00:00:00:00:03' )
    s4 = net.addSwitch( 's4' , mac='00:00:00:00:00:04' )
    s5 = net.addSwitch( 's5' , mac='00:00:00:00:00:05' )
    s6 = net.addSwitch( 's6' , mac='00:00:00:00:00:06' )
    net.addLink('s1','s2', bw=43)
    net.addLink('s2','s1', bw=35)
    net.addLink('s1','s4', bw=68)
    net.addLink('s4','s1', bw=26)
    net.addLink('s2','s3', bw=151)
    net.addLink('s3','s2', bw=230)
    net.addLink('s3','s5', bw=26)
    net.addLink('s5','s3', bw=47)
    net.addLink('s3','s6', bw=353)
    net.addLink('s1','h1')
    net.addLink('s4','h2')
    net.addLink('s1','h3')
    net.addLink('s1','h4')
    net.addLink('s5','h5')
    net.addLink('s3','h6')
    net.addLink('s2','h7')
     net.addLink('s3','h8')
    net.addLink('s1','h9')
     s1.start([c1,c2,c3])
    s2.start([c1,c2,c3])
    s3.start([c1,c2,c3])
    s4.start([c1,c2,c3])
    s5.start([c1,c2,c3])
    s6.start([c1,c2,c3])
    net.start()
    net.staticArp()
    CLI( net )
    net.stop()
 if __name__ == '__main__':
  setLogLevel( 'info' )
  emptyNet()
topos = { 'mytopo': ( lambda: MyTopo() ) }
Remi Guan
  • 21,506
  • 17
  • 64
  • 87
user1888020
  • 67
  • 1
  • 9

1 Answers1

0
  1. You can use traffic control command tc in Linux to set delay, bandwidth on certain interface(say eth0). tc supports to control all traffic or just some traffic based on packet header such as ip address on certain interface. In case you want to set different link parameter on each links between switches and controller, you can use tc to control the traffic based on tcp port, since controller connects to switches by using different tcp port.

  2. If your code is

    net.addLink('s1','s2', bw=43)
    net.addLink('s2','s1', bw=35)

you will get two links with different bandwidth. You can use command net in mininet to check the net connection, you will find that both 's1' and 's2' will open 2 ports for 2 links like:

s1 lo: s1-eth1:s2-eth1 s1-eth2:s2-eth2
s2 lo: s2-eth1:s1-eth1 s2-eth2:s1-eth2

Community
  • 1
  • 1
YSX
  • 1
  • 1