Getting ready

You may check out the source code of POX using:

$ git clone http://github.com/noxrepo/pox

In order to clone the source repository, make sure you have git installed in your computer. In Ubuntu, you may install git using,

$ sudo apt install git

Once you have cloned the source code locally into your computer, running POX is similar to running any other Python program. You may run it using the following command:

$ python pox.py 
POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
INFO:core:POX 0.2.0 (carp) is up.
    
Now the POX controller is up and waiting to manage the SDN switches. It is time to emulate the switches with Mininet. Run the below from Mininet:
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=3,fanout=2
[sudo] password for pradeeban: 
*** Creating network
*** Adding controller
Unable to contact the remote controller at 127.0.0.1:6653
Connecting to remote controller at 127.0.0.1:6633
*** Adding hosts and stations:
h1 h2 h3 h4 h5 h6 h7 h8 
*** Adding switches and access point(s):
s1 s2 s3 s4 s5 s6 s7 
*** Adding link(s):
(s1, s2) (s1, s5) (s2, s3) (s2, s4) (s3, h1) (s3, h2) (s4, h3) (s4, h4) (s5, s6) (s5, s7) (s6, h5) (s6, h6) (s7, h7) (s7, h8) 
*** Configuring hosts
*** Starting controller(s)
c0 
*** Starting switches and/or access points
s1 s2 s3 s4 s5 s6 s7 ...
*** Starting CLI:
mininet-wifi> 
    
Now, you will see the below logs from POX:
INFO:openflow.of_01:[None 1] closed
INFO:openflow.of_01:[00-00-00-00-00-06 3] connected
INFO:openflow.of_01:[00-00-00-00-00-07 2] connected
INFO:openflow.of_01:[00-00-00-00-00-05 7] connected
INFO:openflow.of_01:[00-00-00-00-00-04 4] connected
INFO:openflow.of_01:[00-00-00-00-00-03 6] connected
INFO:openflow.of_01:[00-00-00-00-00-01 5] connected
INFO:openflow.of_01:[00-00-00-00-00-02 8] connected
    
Now terminate the Mininet instance by calling exit(): 
mininet-wifi> exit
*** Stopping 1 controllers
c0 
*** Stopping 14 links
..............
*** Stopping switches and/or access points
s1 s2 s3 s4 s5 s6 s7 
*** Stopping hosts and/or stations
h1 h2 h3 h4 h5 h6 h7 h8 
    
*** Done
completed in 53.020 seconds
    
You will see the below logs printed in the POX terminal:
INFO:openflow.of_01:[00-00-00-00-00-07 2] closed
INFO:openflow.of_01:[00-00-00-00-00-04 3] closed
INFO:openflow.of_01:[00-00-00-00-00-06 4] closed
INFO:openflow.of_01:[00-00-00-00-00-01 5] closed
INFO:openflow.of_01:[00-00-00-00-00-03 6] closed
INFO:openflow.of_01:[00-00-00-00-00-02 7] closed
INFO:openflow.of_01:[00-00-00-00-00-05 8] closed

The following screenshot depicts the preceding execution of both POX and Mininet:

SDN with POX

In this simple recipe, we will make the OpenFlow switches run as simple hubs. You may follow this execution to make more complex realistic applications for OpenFlow. First place 10_6_sdn_pox.py in your POX parent directory. Now you may run it with POX as a POX application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.76.164