Changes between Version 2 and Version 3 of Tutorials/m0SDN/OpenStack


Ignore:
Timestamp:
Jun 9, 2023, 2:25:00 AM (13 months ago)
Author:
jlaxman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/m0SDN/OpenStack

    v2 v3  
     1[[TOC(Documentation/f*, depth=3)]]
     2
     3== Tutorial 1: "Simple" Controllers ==
     4
     5We can run the OF controller on the sb9 console or on one of the nodes as they each have access the the !OpenFlow switch management interface. In this document, we are about to use two distinct controllers, one from the !OpenFlow reference System and another from NOX-core, for management of the setup. These may be even installed in your userspace if you wish to run one of these controllers from the Console (normaly they are installe under root account on one of the nodes in the sb9). 
     6
     7=== Controller on a node ===
     8The software can be downloaded from the following places:
     9
     10 * !OpenFlow reference system: http://www.openflowswitch.org/wp/downloads/
     11 * NOX-core: http://noxrepo.org/wp/
     12
     13The former is a simple implementation that comes with a few tests; latter is a full-blown network operating system/ development tool that comes with a Network API that can be used to write and develop your own controller in C++ or Python.
     14
     15Both can also be installed using Git. Git can be installed with the following command:   
     16{{{
     17apt-get install git-core   
     18}}}
     19
     20==== Installing the !OpenFlow Reference System (old) ====
     21While presented, it is not recommended to install from tarball.
     22The detailed instructions may be found here: http://www.openflowswitch.org/wp/getstarted/
     23
     241. Download software and required packages. If using git:
     25{{{
     26sudo apt-get install git-core automake m4 pkg-config libtool
     27git clone http://openflowswitch.org/openflow
     28cd openflow
     29./boot.sh
     30}}}
     31if installing from tarball:
     32{{{
     33mkdir openflow
     34cd openflow
     35wget http://openflowswitch.org/downloads/openflow-0.9.0.tar.gz
     36tar xzf openflow-0.9.0.tar.gz
     37cd openflow-0.9.0
     38sudo apt-get install gcc linux-headers-`uname -r`
     39}}}
     402. Make and install.
     41{{{
     42./configure --with-l26=/lib/modules/`uname -r`/build
     43make
     44make install
     45}}}
     46
     47=== Installing NOX  ===
     48It is not only recommended but also much simpler to use git to install NOX. Therefore the following instructions assume you are using git. The full instructions are found at noxrepo.org:  http://noxrepo.org/manual/installation.html [[BR]]
     49
     50''' Dependencies ''' [[BR]]
     51NOX requires the following packages to be installed on the Console:
     52 * GNU Libtool (libtool)
     53 * Boost C++ libraries (libboost1.35-dev)
     54 * Apache HTTP Server (apache2)
     55 * Xerces C++ parser (libxerces-c28)
     56 * Xerces development files (libxerces-c2-dev)
     57 * SSL development libraries (libssl-dev)
     58 * SQLite 3 development files (libsqlite3-dev)
     59 * Simple JSON for Python (python-simplejson)
     60Note, this is with respect to the Console, not the node - you may need to install additional packages before NOX can be installed properly.
     61
     62If all dependencies are taken care of, NOX will install with the following steps.
     63{{{
     64git clone git://noxrepo.org/noxcore
     65cd noxcore/
     66./boot.sh
     67mkdir build/
     68cd build/
     69../configure --with-python=yes
     70make
     71make check
     72}}}
     73
     74
     75=== Controllers on the Console ===
     76
     77A sub-set of these instructions can be used to install a "custom" controller in userspace on the console. Most of the requisite libraries should already be installed. Use the following commands to install the Reference system in your userspace:
     78
     79'''for the !OpenFlow Reference System :'''[[BR]]
     80{{{
     81cd
     82git clone http://openflowswitch.org/openflow
     83cd openflow
     84./boot.sh
     85./configure --with-l26=/lib/modules/`uname -r`/build
     86make
     87make install
     88}}}
     89
     90'''for NOX :'''[[BR]]
     91{{{
     92cd
     93git clone git://noxrepo.org/noxcore
     94cd noxcore/
     95./boot.sh
     96mkdir build/
     97cd build/
     98../configure --with-python=yes
     99make
     100make check
     101}}}
     102
     103
     104=== Starting the controller ===
     105Both commands start the controller and establish a connection with the !OpenFlow switch. The -v is for verbose. -h for both will give you the help files for the controllers. In the reference system, the controller is found under .../openflow/controller/
     106{{{
     107./controller -v ptcp:6633
     108}}}
     109and in NOX, it is found under .../noxcore/build/src/
     110{{{
     111./nox-core -v -i ptcp:6633
     112}}}
     113`ptcp:6633` refers to a passive connection to TCP 6633, the default !OpenFlow port. An active connection method using standard TCP exists, however this does not work on this setup. In the !OpenFlow reference system, a log of the verbose output can be saved by appending `--log-file [filename]`.   
     114
     115[[BR]]
     116[[BR]]
     117
     118----
     119=== Available Tools ===
     120
     121Some of these tools require root privileges and will thus require a custom installation on a node. Others can be run from the console directly in an unprivileged mode.
     122
     123==== the Wireshark plugin ====
     124The !OpenFlow Reference system comes with an !OpenFlow wireshark dissector.
     125
     126'''Permissions:''' [[BR]]
     127You must be root in order to use Wireshark; Therefore you must install it on a node. [[BR]]
     128
     129'''Prerequisites:''' [[BR]]
     130glib (and of course, wireshark) is required for the plugin to work:
     131{{{
     132apt-get install wireshark libgtk2.0-dev
     133}}}
     134
     135'''Installation:'''[[BR]]
     136The patch is located under the utilities directory:
     137{{{
     138cd utilities/wireshark_dissectors/openflow
     139make
     140sudo make install
     141}}} 
     142
     143'''Usage:'''[[BR]]
     144To use wireshark, you need to do some X11 tunneling. To do this, add the -X option when using SSH to access the Console and the nodes.   
     145
     146tcpdump pcap files can also be opened using wireshark - once the plugin has been installed, !OpenFlow packets can be interpreted from these files as well. 
     147
     148==== Iperf ====
     149For performance testing, you may want to run some bandwidth tests. iperf is a tool that measures maximum network performance using TCP for throughput and UDP for jitter and datagram loss. The standard image used for the Sandbox nodes when booted with command `omf tell on` comes with iperf. To take measurements, you need at least two nodes. One node becomes the server, the other(s), clients.
     150
     151'''Permissions:''' [[BR]]
     152Iperf does not require root access.
     153
     154'''Usage:'''[[BR]]
     155Initially, eth0 (the !OpenFlow interface for the nodes) will be disabled. Additionally, there is no DHCP service on that VLAN - you need to enable the interface and statically set the IP address (i.e. using ifconfig). 192.168.x.y is the block associated with the !OpenFlow VLAN. 
     156
     157To start the server:
     158{{{
     159iperf -s
     160}}}   
     161and on the client:
     162{{{
     163iperf -c 192.168.x.y
     164}}}
     165
     166Where 192.168.x.y is the IP address of the iperf server. A caveat is that iperf cannot take real-time bandwidth measurements. Real-time bandwidth use can be monitored using BWM-ng.
     167
     168'''On the Console'''[[BR]]
     169Iperf is also installed on the Console. The interfaces available on the Console are the following:
     170 * eth1 - 192.168.100.28
     171 * eth1.27 / Control - 10.19.0.10
     172 * eth1.28 / OF virtual switch - 192.168.1.28
     173 * eth1.100 / OFP interface - 172.16.100.1
     174 
     175==== BWM-ng ====
     176BWM-ng is a tool capable of taking real-time throughput measurements of different interfaces of a host. 
     177
     178'''Permissions:''' [[BR]]
     179BWM-ng does not require root access, and is installed on the Console. 
     180
     181'''Usage:'''[[BR]]
     182By default, the tool will monitor all interfaces on the Console. To monitor just the !OpenFlow interface, you must specify `eth1.100`. To output this to a csv, use the following command:
     183{{{
     184bwm-ng -I eth1.100 -o csv -t 1000 -F <file-name>
     185}}} 
     186 * -I : interface
     187 * -o : output, either in csv or html
     188 * -t : specifies sampling rate in msec. Here, it is 1000 msec, or 1 sample/sec
     189 * -F : Filename of output
     190
     191'''Installation on a node'''[[BR]]
     192The following command will install BWM-ng:
     193{{{
     194apt-get install bwm-ng
     195}}}
     196
     197----
     198==== Development ====
     199The files defining !OpenFlow Protocol can be found in the following locations:
     200 * !OpenFlow reference system:  openflow/include/openflow/openflow.h
     201 * NOX: noxcore/src/include/openflow.hh
     202
     203In addition, NOX provides a [http://noxrepo.org/manual/app.html Web API] that allows you to do development in C++ or Python.