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

 

[script]

from mininet.net import Mininet

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

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' )

        h2 = net.addHost( 'h2' )

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

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

 

        net.addLink( h1, s1 )

        net.addLink( h2, s1 )

        net.build()

        c0.start()

        s1.start( [c0] )

 

        print "*** Running CLI"

        CLI( net )

 

        print "*** Stopping network"

        net.stop()

       

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()  

 

[Execution]

 

Dr. Chih-Heng Ke

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

Email: smallko@gmail.com