Test Fast-Failover Group in OpenFlow 1.3





     |      |



There are two paths from H1 to H2. One is via s1-s2-s4 and the other is via s1-s3-s4. In this test, I will show how to use the fast-failover group entry. The path will switch to path 2 (s1-s3-s4) as soon as the port of s1 to s2 is down.




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 )

        s3 = net.addSwitch( 's3', protocols=["OpenFlow10,OpenFlow13"], listenPort=6636 )

        s4 = net.addSwitch( 's4', protocols=["OpenFlow10,OpenFlow13"], listenPort=6637 )


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


        net.addLink( h1, s1)

        net.addLink( h2, s4)

        net.addLink( s1, s2)

        net.addLink( s1, s3)

        net.addLink( s2, s4)

        net.addLink( s3, s4)



        s1.start( [c0] )

        s2.start( [c0] )

        s3.start( [c0] )

        s4.start( [c0] )


        print "*** Running CLI"

        CLI( net )


        print "*** Stopping network"



if __name__ == '__main__':

    setLogLevel( 'info' )



[script for setting up rules]

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

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

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

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

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

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

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

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

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

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

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




Open another terminal to run the script for setting rules for switches


Check the rules for s1


Make h1 ping h2


Check the port status for s1


Wait for few seconds and check the port status again for s1 (we can see that the tx pkts are from 60 to 102 in s1-eth2 (port 2), but the tx pkts are the same for s1-eth3(port 3)


Make the port 2 down


We can see that the ping still works.


Check the port status again for s1 (Now the tx pkts are from 85 to 131, but the tx pkt are the same, i.e. 180.) So the fast-failover group works.








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

Department of Computer Science and Information Engineering,

National Quemoy University, Kinmen, Taiwan.