Friday, January 31, 2014

Installing CPqD switch, invoke using Mininet and OpenFlow 1.3 for Communication

Installing CPqD switch on Mininet instead of OVSK.

If OVSK is already installed remove it using below commands


sudo kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`
sudo /etc/init.d/openvswitch-switch stop
sudo apt-get remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch


Git clone mininet
Below git command will check out the latest Mininet
git clone git://github.com/mininet/mininet.git

If you want to run the last tagged/released version of Mininet, use
git clone git://github.com/mininet/mininet
git checkout -b 2.1.0 2.1.0

Install CPqD
cd mininet/util
sudo ./install.sh -n3fx

Start CPqD Switch
sudo mn --topo single,2 --controller remote,ip=192.168.1.8 --switch user,protocols=OpenFlow13

CPqD works in User space and OVS works in kernel space.

To get the dpid of CPqD switch
sudo dpctl tcp:127.0.0.1:6634 features

To get the stats and flow rule for CPqD switch:
dpctl tcp:127.0.0.1:6634 stats-flow

dpctl doc
https://github.com/CPqD/ofsoftswitch13/wiki/Dpctl-Documentation

17 comments:

  1. Hi, can this OF 1.3 mininet environment be controlled by opendaylight?
    I follow your instruction, but the hosts cannot communication when ODL is used.

    ReplyDelete
  2. Yes, you can. Better cross verify :-)
    ODL pulled using controller.git doesn't support OF1.3.
    Use integration.git or openflowplugin.git for OF1.3 support.

    Let me know f you have any further queries.

    ReplyDelete
  3. Hi,

    I am unable to proceed beyond sudo ./install.sh -n3fx . I have mininet version 2.1.0p. When i execute the step above there is a build error as below

    gramm.y:89:43: note: in definition of macro ‘PFL_ERROR’
    #define PFL_ERROR(l, pi, s) do{ pfl_error(l, pi, s); YYERROR; }while(0)
    ^
    make[2]: *** [nbpflcompiler/CMakeFiles/nbpflcompiler.dir/parser.cpp.o] Error 1
    make[1]: *** [nbpflcompiler/CMakeFiles/nbpflcompiler.dir/all] Error 2
    make: *** [all] Error 2

    Please help

    ReplyDelete
  4. @yashas, post the error on mininet mailer list.
    my 2 cents, make sure you use sudo also clean/uninstall previous versions of mininet

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Whenever I start iperf in TCP mode, something happens after the connection get established (the topology doesn't matter) that then even ping can't be done anymore (gives Destination host unreachable) and then hosts start sending ARP messages.

    Before starting iperf, everything works, even iperf in UPD mode. Any idea what could this be?

    Thanks in advance

    ReplyDelete
  7. I have the same problem as ogre - using opendaylight (regardless of the type of the distribution - tested integration and openflowplugin) switch does not seem to create flows based on simple forwarding app (which is active - checked it using "ss simple" command).

    ReplyDelete
    Replies
    1. I have the same problem, how do you solve the problem? any idea

      Delete
  8. @Gustavo/Bartosz
    I didn't try iperf so just guessing!! Check if interfaces are down on mininet terminal/host. Run ifup intf_name i.e. ifup eth0. Check the flow rules/iptables.

    ReplyDelete
    Replies
    1. Checked interfaces, I even tried fresh install from clean VM (Ubuntu 13.04, following your tutorial step-by-step) and using ODL 1.0 Base with -of13 flag - still can't even ping between hosts...
      When using OVSK on old VM everything works out-of-the-box, except, of course, OF 1.3 features.


      Delete
    2. @Bartosz, are you successfully executing mn command, are u able to see the hosts on ODL Controller. Controller should also support OF1.3.
      Paste the error here!

      Delete
    3. I am able to see one switch using example command above, it has correct name (MD_SAL|openflow:1) :) I can check its statistics (and it shows OF1.3-featured parametres) using REST interface, but when I look at flow table it's empty despite the fact that simpleForwarding app is running on the controller and controller is not showing any links between switches when i try more complex topologies (e.g --topo=tree,3). Flow tables for switches are empty too.

      This is my mininet output:
      oflab@oflab:~/mininet$ sudo mn --topo=tree,3 --mac --switch=user,protocols=OpenFlow13 --controller=remote,ip=127.0.0.1
      [sudo] password for ******:
      *** Creating network
      *** Adding controller
      *** Adding hosts:
      h1 h2 h3 h4 h5 h6 h7 h8
      *** Adding switches:
      s1 s2 s3 s4 s5 s6 s7
      *** Adding links:
      (h1, s3) (h2, s3) (h3, s4) (h4, s4) (h5, s6) (h6, s6) (h7, s7) (h8, s7) (s1, s2) (s1, s5) (s2, s3) (s2, s4) (s5, s6) (s5, s7)
      *** Configuring hosts
      h1 h2 h3 h4 h5 h6 h7 h8
      *** Starting controller
      *** Starting 7 switches
      s1 s2 s3 s4 s5 s6 s7
      *** Starting CLI:
      mininet> h1 ping h2
      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
      From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
      From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
      and so on...

      Delete
  9. @Praveen Darshanam , i have the same problem with yashas bharadwaj.

    gramm.y:89:43: note: in definition of macro ‘PFL_ERROR’
    #define PFL_ERROR(l, pi, s) do{ pfl_error(l, pi, s); YYERROR; }while(0)
    ^
    make[2]: *** [nbpflcompiler/CMakeFiles/nbpflcompiler.dir/parser.cpp.o] Error 1
    make[1]: *** [nbpflcompiler/CMakeFiles/nbpflcompiler.dir/all] Error 2
    make: *** [all] Error 2

    Do you know how to solve thos problem?
    Thank you !!!

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Hey, for getting the stats and dpid of the switches, you have given two commands, but where should i execute them?
    In the mininet prompt? Please let me know. :)

    ReplyDelete
  12. @Durga
    Execute on Linux prompt not on Mininet prompt.

    ReplyDelete
  13. Hey, Praveen. I've installed everything and when i execute the sudo mn command, the topology is being created. But, ping is not working. All the packets are being dropped.

    h1 to h2 - ping not working
    h1 to s1 - ping working
    h2 to s1 - ping working

    s1 to h2 - ping not working (?)
    Help me with this.

    ReplyDelete