DocumentsDownloadsWikiCommunityBlogAbout

CentOS NetFPGA Install

From OpenFlow Wiki

Jump to: navigation, search

Contents

CentOS

Note

This instruction is for OpenFlow1.0 release. Please see this page to install 0.8.9 release.

Summary for this design is described here.


Install CentOS

Sources for CentOS are available at http://www.centos.org.

This instruction was tested with CentOS 5.4, on i386.

To minimize the size of your install, we recommend using the net install .iso, with no additional packages selected.

We assume you have already installed NetFPGA following NetFPGA Guide.

Also, you will need a quad-port GbE NIC installed on your machine and four Ethernet cables in order to run the regression tests.


Login as root.


Set up a user account for the installation:

/usr/sbin/adduser openflow

Set a password for this account:

passwd openflow

Add superuser privileges for this account:

/usr/sbin/visudo

Add this line below the line 'root ALL=(ALL) ALL':

openflow ALL=(ALL) NOPASSWD:ALL

Login as openflow:

exit 
ssh -X openflow@<machine_name>

The '-X' turns on X forwarding, so that wireshark can be displayed locally.

Install RPMForge for required packages:

wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sudo rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
sudo rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm


Install OpenFlow

Install from the Stanford Git repository:

sudo yum -y install git automake pkgconfig libtool gcc

[Git install only] Autoconf 2.60 or later is required. This must currently be installed from source to build from the git repo:

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.63.tar.gz
tar xvzf autoconf-2.63.tar.gz
cd autoconf-2.63
./configure --prefix=/usr
make
sudo make install
cd

[Git install only] Download git repo with OpenFlow code and history.

git clone git://openflowswitch.org/openflow.git
cd openflow
./boot.sh

Download NetFPGA bitfile and extract it in the following directory.

cd (your openflow directory)/hw-lib/nf2
wget http://openflowswitch.org/downloads/netfpga/openflow_switch.bit.100_1.tar.gz
tar xfvz openflow_switch.bit.100_1.tar.gz

Build OpenFlow user-space switches with NetFPGA support:

cd (your openflow directory)
./configure --enable-hw-lib=nf2
make
sudo make install

If make does not succeed, it may be that Red Hat backported changes into the CentOS/RHEL kernel to support newer features, which sometimes breaks the OpenFlow code, which assumes that the kernel version uniquely specifies the features. If you come across a compilation error, please report the error on the bug tracking page.

Install Wireshark Dissector

The OpenFlow Wireshark Dissector is included in the standard OpenFlow distribution. It requires one additional library, plus the Wireshark package.

Install Wireshark and glib:

sudo yum -y groupinstall "X Window System"
sudo yum -y install wireshark wireshark-gnome glib2-devel

Make and install:

cd utilities/wireshark_dissectors/openflow
make
sudo make install
cd


Install Regression Suite

The OpenFlow Regression Suite is also included in the standard OpenFlow distribution. It requires a few additional packages and some environment variables.

sudo yum -y install perl-Convert-Binary-C perl-Data-HexDump perl-Net-Pcap perl-Net-RawIP.i386 perl-Error.noarch
wget http://www.cpan.org/authors/id/J/JV/JV/Getopt-Long-2.38.tar.gz
tar xvf Getopt-Long-2.38.tar.gz
cd Getopt-Long-2.38
perl Makefile.PL
make all test
sudo make install

Update the OF_ROOT environment variable and PERL5LIB environment variable:

cd ~/
cp openflow/regress/scripts/env_vars .
vim env_vars

You should see the following line:

export OF_ROOT=/home/yourname/openflow

Change yourname to the name of your home directory. If you are following this instruction, it should be openflow:

export OF_ROOT=/home/openflow/openflow

Also, find the following line:

export PERL5LIB=${OFT_ROOT}/lib/Perl5:${PERL5LIB}

Remove :${PERL5LIB} as follows since PERL5LIB in NetFPGA directory will cause the failure of the tests:

export PERL5LIB=${OFT_ROOT}/lib/Perl5

Then save env_vars file.

Stop avahi, to prevent it from polluting the tests with link discovery packets:

sudo /sbin/chkconfig avahi-daemon off
sudo /etc/rc.d/init.d/avahi-daemon stop

Disable IPv6, to prevent it from polluting the tests with link discovery packets: First, perform the following command

sudo /sbin/chkconfig ip6tables off

Then edit modprobe.conf file.

sudo vim /etc/modprobe.conf

Add the following lines on modprobe.conf.

alias ipv6 off
alias net-pf-10 off

Edit network file.

sudo vim /etc/sysconfig/network

On the file, the line mentioning "NETWORKING_IPV6=", and if NETWORKING_IPV6=yes, change it to "no".

NETWORKING_IPV6=no


Verify Install

Note: The regression tests require you to have completed the steps outlined in the section Install Regression Suite. Another note: In order to run the tests, prepare four GbE ports on your machine and name them eth1 to eth4.

Connect Ethernet cables in the following arrangement:

<NIC> -- <NetFPGA>
eth1  to  nf2c0
eth2  to  nf2c1
eth3  to  nf2c2
eth4  to  nf2c3

Login as root:

su

Load environment variables:

source /home/openflow/env_vars

These can be automatically sourced upon login, by appending the preceding line to the ~/.bashrc file.

Start Wireshark. If using X forwarding, you'll have to spawn the windows from the same user account that originally logged in. If you logged in as openflow and used 'su' to become root, spawn another terminal session to launch Wireshark:

ssh -X openflow@<machine_name>
wireshark

In the Filter bar at the top, enter:

of || tcp.flags.reset == 1

Starting recording packets: go to Capture->Interfaces and select the lo (loopback) interface.

Then run OpenFlow-NetFPGA tests:

of_nf2_test.pl

You should now see OpenFlow packets going between the switch and the controller while the test suite runs. TCP reset packets separate each test. You can click on the OpenFlow portion of each packet and identify its fields.

At this point, you've verified the installation.

Run your switch

Assuming you have a controller (such as NOX) running, following is a quick way to bring up your switch:

sudo su
cd /home/openflow/openflow
nf2_download hw-lib/nf2/openflow_switch.bit
ofdatapath punix:/var/run/test -i nf2c0,nf2c1,nf2c2,nf2c3 &
ofprotocol unix:/var/run/test tcp:<host name or IP address of your controller> &
Copyright 2008 by the OpenFlow Consortium. All rights reserved. Powered by MediaWiki and WordPress.