Test 3: mininet-wifi

[Preparation]

  You have to install mininet-wifi. Also, please refer to https://github.com/saeenali/openvswitch/wiki/Stochastic-Switching-using-Open-vSwitch-in-Mininet to install Stochastic Switching.

 

[Topology]

 

topology 1: In this case, I want to measure the performance evaluation of data transmission between h1 and sta1. (single path)

 

topology 2: In this case, I want to measure the performance evaluation of data transmission between h1 and sta1. (multiple paths) h1 will send the traffic to s0. S0 will forward 50% traffic to ap1, and then to sta1. S0 will also forward the rest 50% traffic to ap2, and to sta1.

 

[script1: single path]

#!/usr/bin/python

 

"""

This example shows how to work with different APs

"""

from mininet.net import Mininet

from mininet.node import  Controller, RemoteController, OVSKernelSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import TCLink

 

def topology():

    "Create a network."

    net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )

 

    print "*** Creating nodes"

    sta1 = net.addStation( 'sta1')

    h1 = net.addHost( 'h1', ip="192.168.10.1/24" )

    ap1 = net.addBaseStation( 'ap1', ssid="ssid_1", mode="g", channel="1" )

    c0 = net.addController('c0', controller=Controller, ip='127.0.0.1', port=6633 )

 

    print "*** Adding Link"

    linkBW = {'bw':100}

    net.addLink(h1,ap1, cls=TCLink, **linkBW)

    net.addLink(sta1, ap1)

 

    print "*** Starting network"

    net.build()

    c0.start()

    ap1.start( [c0] )

    sta1.cmd('ifconfig sta1-wlan0 192.168.10.10 netmask 255.255.255.0')

    print "*** Running CLI"

    CLI( net )

    print "*** Stopping network"

    net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()

 

[execution]

 

In sta1, the iperf udp server is initialized. in h1, we start the iperf udp client. (The throughput is around 19.4Mbps)

 

[script2: multiple path]

#!/usr/bin/python

 

"""

This example shows how to work with different APs

"""

from mininet.net import Mininet

from mininet.node import  Controller, RemoteController, OVSKernelSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import TCLink

 

def topology():

    "Create a network."

    net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )

 

    print "*** Creating nodes"

    sta1 = net.addStation( 'sta1', wlans= 2)

    h1 = net.addHost( 'h1', ip="192.168.10.1/24" )

    s0 = net.addSwitch( 's0', listenPort=6634 )

    ap1 = net.addBaseStation( 'ap1', ssid="ssid_1", mode="g", channel="1", listenPort=6635 )

    ap2 = net.addBaseStation( 'ap2', ssid="ssid_2", mode="g", channel="6", listenPort=6636 )

    #we don't run any controller. we will manually set the rules at s0, ap1, and ap2

    c0 = net.addController('c0', controller=RemoteController, ip='127.0.0.1', port=6633 )

 

    print "*** Adding Link"

    linkBW = {'bw':100}

    net.addLink(h1,s0, cls=TCLink, **linkBW)

    net.addLink(s0,ap1)

    net.addLink(s0,ap2)

    net.addLink(sta1, ap1)

    net.addLink(sta1, ap2)

 

    print "*** Starting network"

    net.build()

    c0.start()

    s0.start( [c0] )

    ap1.start( [c0] )

    ap2.start( [c0] )

    sta1.cmd('echo "bonding mode=4 miimon=100" >> /etc/modules')

    sta1.cmd('modprobe bonding')

    sta1.cmd('ip link add bond0 type bond')

    sta1.cmd('ip link set bond0 address 00:00:00:11:22:33')

    sta1.cmd('ip link set sta1-wlan0 down')

    sta1.cmd('ip link set sta1-wlan1 down')

    sta1.cmd('ip link set sta1-wlan0 master bond0')

    sta1.cmd('ip link set sta1-wlan1 master bond0')

    sta1.cmd('ifconfig bond0 192.168.10.10 netmask 255.255.255.0')

    sta1.cmd('ip link set bond0 up')

    sta1.cmd('iwconfig sta1-wlan0 essid "ssid_1"')

    sta1.cmd('iwconfig sta1-wlan1 essid "ssid_2"')

    print "*** Running CLI"

    CLI( net )

    print "*** Stopping network"

    net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()

 

[script for multiple paths setting] Manually set the rules in s0, ap1, and ap2

ovs-vsctl set bridge s0 protocols=OpenFlow13

ovs-vsctl set bridge ap1 protocols=OpenFlow13

ovs-vsctl set bridge ap2 protocols=OpenFlow13

ovs-ofctl -O OpenFlow13 add-group tcp:127.0.0.1:6634 group_id=0,type=select,bucket=weight:50,output=2,bucket=weight:50,output=3

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6634  in_port=1,actions=group=0

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6634  in_port=2,actions=output=1

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6634  in_port=3,actions=output=1

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6635  in_port=1,actions=output=2

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6635  in_port=2,actions=output=1

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6636  in_port=1,actions=output=2

ovs-ofctl -O OpenFlow13 add-flow tcp:127.0.0.1:6636  in_port=2,actions=output=1

 

[execution]

 

open another terminal to run the script for rule settings.

 

check the rules in s0

 

check the rules in ap1 and ap2

 

do the performance evaluations. From the following figure, we can see that the throughput is around 39 Mbps. This is much better than single path transmission.

 

Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com