How to create a simple network using switches that support openflow version 1.3 ?



from import Mininet

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

from mininet.cli import CLI

from mininet.log import setLogLevel

from import Link, TCLink


def topology():

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


        # Add hosts and switches

        h1= net.addHost( 'h1' )

        h2 = net.addHost( 'h2' )

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

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


        net.addLink( h1, s1 )

        net.addLink( h2, s1 )


        s1.start( [c0] )


        print "*** Running CLI"

        CLI( net )


        print "*** Stopping network"



if __name__ == '__main__':

    setLogLevel( 'info' )





Dr. Chih-Heng Ke

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