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:
sudo /usr/share/openvswitch/scripts/ovs-ctl start
export PATH=$PATH:/home/ofnet/ofnet/bin/cbin:/home/ofnet/ofnet/bin/sh
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.
Switches are named gsX and Hosts are named ghX.
/* multi-line commentary */
gs1 -- gs2
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; */ }
-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