Monday, September 19, 2016

test openflow using mininet and floodlight

Openflow is new standard/protocol that redefine the switch processing and logic, we can customize the flow structure on the controller and the switch that support openflow protocol will switch packets base on what we define in our control.

1- install packages
$ sudo apt-get install floodlight mininet

- start the floodlight service
$ sudo /etc/init.d/floodlight start

- the openflow controller is listen on port 6633 and the web gui is listening on port 8080

2- run mininet
$ sudo mn --controller=remote,ip=,port=6633 --switch ovsk

this will drop to mininet shell
- testing ping
mininet> h1 ping h2
mininet> pingall
-or to get gui shell
mininet> xterm h1 h2
- list nodes or connection
mininet> nodes 
mininet> net

 3- (optional)  we can create a customized topology for mini
- create mininet topology file name with the following content
 from mininet.topo import Topo

class MyTopo( Topo ):
    "Simple topology example."

    def __init__( self ):
        "Create custom topo."

        Topo.__init__( self )

        leftHost = self.addHost( 'h1' )
        rightHost = self.addHost( 'h2' )
        h3 = self.addHost( 'h3' )
        h4 = self.addHost( 'h4' )
        rightSwitch = self.addSwitch( 's1' )

        self.addLink( leftHost, rightSwitch )
        self.addLink( rightHost, rightSwitch )
        self.addLink(h3 , rightSwitch )
        self.addLink(h4 , rightSwitch )

topos = { 'mytopo': ( lambda: MyTopo() ) }

- to run it, using command below
$ sudo mn --controller=remote,ip=,port=6633 --switch ovsk --custom  --topo mytopo

4- to access floodlight web gui to see the statistic using url

- snapshot of network topology

- snapshot of dashboard information, we have one switch and four hosts

No comments:

Post a Comment