Changes between Initial Version and Version 1 of Internal/OpenFlow/OFIntro


Ignore:
Timestamp:
Jul 10, 2013, 9:15:18 PM (11 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/OFIntro

    v1 v1  
     1= *Draft* An Intro to OpenFlow@ORBIT =
     2This page is meant to get you up and running quickly with !OpenFlow-related experiments/development on the ORBIT testbeds.
     3== Node Image(s) ==
     4To make things easier, we have images pre-installed with the Floodlight controller and several other potentially useful tools, including:
     5 * [http://mininet.org/ mininet] : !OpenFlow network prototyping tool/emulation
     6 * [http://docs.projectfloodlight.org/display/floodlightcontroller/Cbench+(New) cbench] : Controller benchmarking tool
     7 * [http://www.openflow.org/wk/index.php/Liboftrace liboftrace] : !OpenFlow message parser/analyzer for pcap files   
     8
     9For people interested in installing these tools, they can visit the links above, or go to [#install Section] for a concise summary of each.
     10
     11== Installation ==
     12The following are the installation steps and basic usage for the software that are found on the image. For more information, refer to their respective pages; Floodlight and Mininet in particular have very thorough docs.
     13
     14 [#floodlight Floodlight][[BR]]
     15 [#mn Mininet][[BR]]
     16 [#cbench CBench] [[BR]]
     17 [#loft liboftrace] [[BR]]
     18
     19=== Floodlight === #floodlight
     20docs: http://docs.projectfloodlight.org/display/floodlightcontroller/Floodlight+Documentation [[BR]]
     21
     22For the most part the following is a repetition of some of the things there. Truth be told, if you plan to modify/develop on Floodlight it is better to just install it on a local machine where you can use eclipse (either that, or you can try to X11 forward, but that doesn't always go well).
     23==== dependencies ====
     24{{{
     25sudo apt-get install git-core build-essential default-jdk ant python-dev eclipse
     26}}}
     27==== installation ====
     28The following fetches and builds the latest stable release:
     29{{{
     30git clone git://github.com/floodlight/floodlight.git
     31cd floodlight
     32git checkout fl-last-passed-build
     33ant
     34}}}
     35To import as a project on Eclipse, run the following while in the same directory:
     36{{{
     37ant eclipse
     38}}}
     39==== run ====
     40Assuming everything worked out:
     41{{{
     42java -jar target/floodlight.jar
     43}}}
     44from the floodlight/ directory launches Floodlight. It will output a bunch of messages while it searches for, loads, and initializes modules. You can refer to the output attached below for what it should look like - there may be warnings, but they should be harmless. 
     45
     46This command also launches in the foreground, so you can either launch it in a terminal multiplexer like `screen` or `tmux`, or with a `1>logfile 2>&1 &` tacked to the end. The former is probably recommended.   
     47==== development ====
     48Tutorials and other information can be found here: http://docs.projectfloodlight.org/display/floodlightcontroller/For+Developers
     49
     50=== Mininet === #mn
     51website: http://mininet.org/ [[BR]]
     52It is highly recommended to run trough the docs, especially the following:
     53 * FAQs: https://github.com/mininet/mininet/wiki/FAQ
     54 * Getting Started: http://mininet.org/download/ Getting Started
     55 * Sample Workflow: http://mininet.org/sample-workflow/ Sample Workflow
     56 * Walkthrough: http://mininet.org/walkthrough/   
     57
     58If you post to the list especially before you read the FAQ's, you will likely just be asked if you have checked them.
     59 
     60==== installation/build ====
     61The [https://github.com/mininet/mininet/downloads/ VM] is the recommended way to run Mininet on your machine. [[BR]]
     62The following is for a native install (as on the node image).
     63
     64The method differs for different versions of Ubuntu. The following is for 12.04. For others, refer to [http://www.projectfloodlight.org/getting-started/ this] page.
     65The following also takes care of the dependencies.
     66{{{
     67sudo apt-get install mininet/precise-backports
     68}}}
     69Then disable `ovs-controller`:
     70{{{
     71sudo service openvswitch-controller stop
     72sudo update-rc.d openvswitch-controller disable
     73}}}
     74You may also need to start open Vswitch:
     75{{{
     76sudo service openvswitch-switch start
     77}}}
     78You can verify that it works with the following:
     79{{{
     80sudo mn --test pingall
     81}}}
     82This sets up a 2-host, 1-switch topology and pings between the hosts. The output looks similar to this:
     83{{{
     84*** Creating network
     85*** Adding controller
     86*** Adding hosts:
     87h1 h2
     88*** Adding switches:
     89s1
     90*** Adding links:
     91(h1, s1) (h2, s1)
     92*** Configuring hosts
     93h1 h2
     94*** Starting controller
     95*** Starting 1 switches
     96s1
     97*** Ping: testing ping reachability
     98h1 -> h2
     99h2 -> h1
     100*** Results: 0% dropped (0/2 lost)
     101*** Stopping 2 hosts
     102h1 h2
     103*** Stopping 1 switches
     104s1 ...
     105*** Stopping 1 controllers
     106c0
     107*** Done
     108completed in 0.460 seconds
     109}}}
     110==== run ====
     111There are many flags and options associated with launching Mininet. `mn --help` will display them. [[BR]]
     112For example, to start the same topology as the pingall test, but with a controller running separately from Mininet:
     113{{{
     114# mn --topo=single,2 --controller=remote,ip=10.18.1.1 --mac
     115*** Creating network
     116*** Adding controller
     117*** Adding hosts:
     118h1 h2
     119*** Adding switches:
     120s1
     121*** Adding links:
     122(h1, s1) (h2, s1)
     123*** Configuring hosts
     124h1 h2
     125*** Starting controller
     126*** Starting 1 switches
     127s1
     128*** Starting CLI:
     129mininet>
     130}}}
     131 * --topo=single,2 : one switch with two hosts
     132 * --controller=remote,ip=10.18.1.1 : controller at 10.18.1.1 
     133 * --mac : non-random MAC addresses
     134Some useful ones are:
     135 * controller external to Mininet, at IP addr and port p:
     136{{{
     137--controller=remote,ip=[addr],port=[p]
     138}}}
     139 * non-random host MAC addresses (starting at 00:00:00:00:00:01 for h1)
     140{{{
     141--mac
     142}}}
     143==== usage ====
     144You can find available commands for the command line by typing `?` at the prompt. `exit` quits Mininet. [[BR]]
     145Some basic examples:
     146 * display topology:
     147{{{
     148mininet> net
     149c0
     150s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0
     151h1 h1-eth0:s1-eth1
     152h2 h2-eth0:s1-eth2
     153}}}
     154 * display host network info:
     155{{{
     156mininet> h1 ifconfig
     157h1-eth0   Link encap:Ethernet  HWaddr 00:00:00:00:00:01 
     158          inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
     159          inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link
     160          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     161          RX packets:135 errors:0 dropped:124 overruns:0 frame:0
     162          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
     163          collisions:0 txqueuelen:1000
     164          RX bytes:8906 (8.9 KB)  TX bytes:558 (558.0 B)
     165
     166lo        Link encap:Local Loopback 
     167          inet addr:127.0.0.1  Mask:255.0.0.0
     168          inet6 addr: ::1/128 Scope:Host
     169          UP LOOPBACK RUNNING  MTU:16436  Metric:1
     170          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     171          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
     172          collisions:0 txqueuelen:0
     173          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
     174}}}
     175 * ping host 1 from host 2
     176{{{
     177mininet> h2 ping h1
     178PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
     17964 bytes from 10.0.0.1: icmp_req=1 ttl=64 time=10.0 ms
     180^C
     181--- 10.0.0.1 ping statistics ---
     1821 packets transmitted, 1 received, 0% packet loss, time 0ms
     183rtt min/avg/max/mdev = 10.026/10.026/10.026/0.000 ms
     184}}}
     185==== scripting ====
     186Mininet has a Python API, whose docs can be found online: http://mininet.org/api/ [[BR]]
     187Examples can also be found here: https://github.com/mininet/mininet/tree/master/examples
     188
     189Once you write a script, you can run it as a script:
     190{{{
     191python mn_script.py
     192}}}
     193
     194=== Cbench === #cbench
     195website: http://docs.projectfloodlight.org/display/floodlightcontroller/Cbench+(New)
     196
     197==== dependencies ====
     198{{{
     199sudo apt-get install autoconf automake libtool libsnmp-dev libpcap-dev
     200}}}
     201==== installation/build ====
     202{{{
     203git clone git://gitosis.stanford.edu/openflow.git
     204cd openflow; git checkout -b mybranch origin/release/1.0.0
     205git clone git://gitosis.stanford.edu/oflops.git
     206git submodule init && git submodule update
     207wget http://hyperrealm.com/libconfig/libconfig-1.4.9.tar.gz
     208tar -xvzf libconfig-1.4.9.tar.gz
     209cd libconfig-1.4.9
     210./configure
     211sudo make && sudo make install
     212#cd ../oflops/netfpga-packet-generator-c-library/
     213#./autogen.sh && ./configure && make
     214sh ./boot.sh ; ./configure --with-openflow-src-dir=${OF_PATH}/openflow/
     215make install
     216}}}
     217
     218==== run ====
     219Run from the cbench directory under oflops:
     220{{{
     221cd cbench
     222cbench -c localhost -p 6633 -m 10000 -l 3 -s 16 -M 10 -t
     223}}}
     224 * -c localhost : controller at loopback
     225 * -p 6633 : controller listaning at port 6633
     226 * -m 10000 : 10000 ms (10 sec) per test
     227 * -l 3 : 3 loops(trials) per test
     228 * -s 16 : 16 emulated switches
     229 * -M 10 : 10 unique MAC addresses(hosts) per switch
     230 * -t : throughput testing
     231for the complete list, use the `-h` flag.
     232
     233The output for the above command looks like this:
     234{{{
     235cbench: controller benchmarking tool
     236   running in mode 'throughput'
     237   connecting to controller at localhost:6633
     238   faking 16 switches offset 1 :: 3 tests each; 10000 ms per test
     239   with 10 unique source MACs per switch
     240   learning destination mac addresses before the test
     241   starting test with 0 ms delay after features_reply
     242   ignoring first 1 "warmup" and last 0 "cooldown" loops
     243   connection delay of 0ms per 1 switch(es)
     244   debugging info is off
     24516:53:14.384 16  switches: flows/sec:  18  18  18  18  18  18  18  18  18  18  18  18  18  18  18  18   total = 0.028796 per ms
     24616:53:24.485 16  switches: flows/sec:  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20   total = 0.031999 per ms
     24716:53:34.590 16  switches: flows/sec:  24  24  24  24  24  24  24  24  24  24  24  24  24  24  24  24   total = 0.038380 per ms
     248RESULT: 16 switches 2 tests min/max/avg/stdev = 32.00/38.38/35.19/3.19 responses/s
     249}}}
     250
     251=== liboftrace (ofdump/ofstats) === #loft
     252docs: [[BR]]
     253 https://github.com/capveg/oftrace/blob/master/README [[BR]]
     254 http://www.openflow.org/wk/index.php/Liboftrace
     255==== dependencies ====
     256{{{
     257sudo apt-get install libpcap-dev swig libssl-dev
     258}}}
     259==== installation/build ====
     260{{{
     261git clone git://github.com/capveg/oftrace.git
     262cd oftrace
     263./boot.sh
     264./configure --with-openflow-src-dir=${OF_PATH}/openflow/
     265make && make install
     266}}}
     267==== use ====