WikiMiNET

La documentation technique et administrative

Outils pour utilisateurs

Outils du site


wiki:sdn:ofnet

OFnet

Installation

You have to install ofnet in /home/ofnet as the source code was developped with /home/ofnet as absolute path.

You might want to install ofnet on something else than a virtual machine. You can follow the following steps:

  1. openvswitch :
  2. libcap : install libcap, libcap-dev or libcap-devel depending on your distribution (required for recompilation of source code)
  3. netperf :
  4. flex :
  5. bison :
  6. graphviz :
  7. kst :
  8. imagemagick :
  9. firefox :
  10. java-runtime :
  11. eog (if possible) : binaries launch eog to display automatically some svg images
  • Start openvswitch server by running
 sudo /usr/share/openvswitch/scripts/ovs-ctl start 
  • Create the user ofnet and copy paste the ofnet directory in the $HOME_DIRECTORY of the ofnet user
  • Add ofnet user in sudo group
  • For convenient usage:
 export PATH=$PATH:/home/ofnet/ofnet/bin/cbin:/home/ofnet/ofnet/bin/sh 
  • You will find the binaries needed in ofnet/bin/cbin.
  • At this point, we recommand you to recompile the source code provided as the version of dynamic libraries used by the binary might be different than your current version, thus run “make all” in the src directory. Do it if you have the following error: /home/ofnet/ofnet/bin/cbin/of_snoop: error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such file or directory.

Create a topology

Topologies are created using DOT like syntax DOT (graph description language)

The extensions used are .topo for description file and net. for openflow images compiled from .topo.

Syntax

Switches are named gsX and Hosts are named ghX.

  • commentary
 /* 
multi-line
commentary
*/
  • Connect two switches:
 gs1 -- gs2 

Example file

TOPOLOGY my_topo {

     NODES SECTION :

     switches 8;
     hosts 64;


     LINKS SECTION :

     /* 
        Trunks - switch to switch links. 
        Switch names start with gs0.
     */

     gs0 -- gs1;
     gs1 -- gs2;
     gs2 -- gs3;
     gs3 -- gs4;
     gs4 -- gs5;
     gs5 -- gs6;
     gs6 -- gs7;
     gs7 -- gs0;

     /* 
        Host to switch links. 
        Host names start with gh1.
     */

     (gh1-gh8) -- gs0;
     (gh9-gh16) -- gs1;
     (gh17-gh24) -- gs2;
     (gh25-gh32) -- gs3;
     (gh33-gh40) -- gs4;
     (gh41-gh48) -- gs5;
     (gh49-gh56) -- gs6;
     (gh57-gh64) -- gs7;


     CONTROLLER SECTION :

     /* Controller speficication */

     node1(127.0.0.1), node2(192.168.1.2), node3(192.168.1.100);

     /* Wire switches to controllers */

     ALL -- node1;


    /*
     (gs1,gs2,gs3) -- node1;
     (gs0) -- node2;
     (gs4,gs5,gs6) -- node3;

     gs4 -- node1;
     gs6 -- node1;
     gs2 -- node1;
     gs5 -- node1;
     (gs4-gs6) -- node1;
     ALL -- node1;
     REMAINING -- loopback;
     */


}

Commands

-Compile a topology into an openflow image: topoc h40.tree.topo h40.net
-Launch the network: ctopo netup h40.net
-Stop the network: ctopo netdown h40.net
-Break a link: ctopo linkdown gs0 gs4
-Launch a ping from gh2 to 10.0.0.38 : hsh gh2 ping -c1 10.0.0.38
-Print the flow graph after gh2 ends its ping: hsh gh2 ping -c1 10.0.0.38; fstate
-Print graphes of flows, infos, packets: ofevent hsh gh5 ping -c1 10.0.0.35
-Show an animation of the flow: event_animate <cmd>

-Print the graphs related to the graphic: trctl <options>
-Start the openVswitch and an SDN controller: netinit

-Start Controller bundled with ofnet (floodlight): start_floodlight_controller.sh
wiki/sdn/ofnet.txt · Dernière modification: 2020/06/27 18:16 (modification externe)