Test Group Chaining in OpenFlow 1.3

[Topology]

Inspired by Efficient fast recovery mechanism in Software-Defined Networks: Multipath routing approach, I design the following lab to show the Group Chaining feature in openvswitch version 2.5.4.

 

 

[Mininet Script]

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch, OVSSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

 

def topology():

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

 

        # Add hosts and switches

        h1= net.addHost( 'h1', mac="00:00:00:00:00:01" )

        h2 = net.addHost( 'h2', mac="00:00:00:00:00:02" )

        s1 = net.addSwitch( 's1', protocols=["OpenFlow10,OpenFlow13"], listenPort=6634 )

        s2 = net.addSwitch( 's2', protocols=["OpenFlow10,OpenFlow13"], listenPort=6635 )

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

            linkopt={'bw':10}

        linkopt2={'bw':100}

        net.addLink( h1, s1, cls=TCLink, **linkopt2)

        net.addLink( h2, s2, cls=TCLink, **linkopt2)

        net.addLink( s1, s2, cls=TCLink, **linkopt)

        net.addLink( s1, s2, cls=TCLink, **linkopt)

        net.addLink( s1, s2, cls=TCLink, **linkopt)

        net.addLink( s1, s2, cls=TCLink, **linkopt)

 

        net.build()

        c0.start()

        s1.start( [c0] )

        s2.start( [c0] )

 

        print "*** Running CLI"

       h1.cmd("arp -s 10.0.0.2 00:00:00:00:00:02")

        h2.cmd("arp -s 10.0.0.1 00:00:00:00:00:01")

        CLI( net )

        print "*** Stopping network"

        net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()  

 

[Script for setting up rules]

ovs-ofctl -O OpenFlow13 add-flow s2 in_port=2,actions=output:1

ovs-ofctl -O OpenFlow13 add-flow s2 in_port=3,actions=output:1

ovs-ofctl -O OpenFlow13 add-flow s2 in_port=4,actions=output:1

ovs-ofctl -O OpenFlow13 add-flow s2 in_port=5,actions=output:1

ovs-ofctl -O OpenFlow13 add-flow s2 in_port=1,actions=output:5

ovs-ofctl -O OpenFlow13 add-flow s1 in_port=5,actions=output:1

ovs-ofctl -O OpenFlow13 add-group s1 group_id=2,type=select,bucket=output:2,bucket=output:4

ovs-ofctl -O OpenFlow13 add-group s1 group_id=3,type=select,bucket=output:3,bucket=output:5

ovs-ofctl -O OpenFlow13 add-group s1 group_id=1,type=ff,bucket=watch_port:2,group:2,bucket=watch_port:3,group:3

ovs-ofctl -O OpenFlow13 add-flow s1 in_port=1,actions=group:1

 

[Execution]

 

Open another terminal.

 

Dump the rules for s1 and s2

 

Use xterm to open terminals for h1 and h2 and run the iperf

 

Use xterm again to open terminals for h1 and h2 and run the iperf. (We can see that two flows can reach almost 10Mbps throughput.)

 

Check the port status in s1

Check again and we can see that the port 2 and port 4 are used to send out the traffic.

 

Make the port 2 of s1 down.

We can see that the h2 can still receive traffic sent from h1.

 

Check the port status in s1.

 

Check again. And we can see that the traffic are switched to port 3 and port 5. (See the tx_pkts changes in port 3 and port 5).

 

We can achieve that load balance and fault recovery can be achieved by using group chaining.

 

Dr. Chih-Heng Ke (smallko@gmail.com)

Department of Computer Science and Information Engineering,

National Quemoy University, Kinmen, Taiwan.