CentOS NetFPGA Install

From OpenFlow Wiki

Revision as of 21:23, 5 October 2011 by Tyabe (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Please note that SLICING feature of OpenFlow1.0 is currently NOT supported on NetFPGA implementation.

Install CentOS

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

This instruction was tested with CentOS 5.5 and 5.6, 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 Base Package following NetFPGA Guide. The supported NetFPGA base package version is 2.2.0 and 3.0.0.

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/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sudo rpm --import http://apt.sw.be/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. The latest NetFPGA implementation temporarily resides in a separate branch so you will need to switch to the branch as follows.

git clone git://openflow.org/openflow.git
cd openflow
git checkout -b 1.0.0-netfpga origin/devel/tyabe/1.0.0-netfpga
./boot.sh

Download NetFPGA bitfile and extract it in the following directory.

cd (your openflow directory)/hw-lib/nf2
wget http://openflow.org/downloads/netfpga/openflow_switch.bit.100_3.tar.gz
tar xfvz openflow_switch.bit.100_3.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 create and edit disable-ipv6.conf file.

sudo su
echo 'options ipv6 disable=1' > /etc/modprobe.d/disable-ipv6.conf
exit

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

prepare four GbE ports on your machine and name them eth1 to eth.

Modify a script for regression test (OPTIONAL)

If you'd like to use other interface names than eth1-eth4, follow the process below:

vim (your openflow directory)/regress/bin/nf2.map

The following should be shown:

eth1:eth1
eth2:eth2
eth3:eth3
eth4:eth4
eth5:nf2c0
eth6:nf2c1
eth7:nf2c2
eth8:nf2c3

Modify the lines so that they match the interface names you have:

eth1:your first interface name
eth2:your second interface name
eth3:your third interface name
eth4:your forth interface name
eth5:nf2c0
eth6:nf2c1
eth7:nf2c2
eth8:nf2c3

And save it.

:wq

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(or your first  interface above)  to  nf2c0
eth2(or your second interface above)  to  nf2c1
eth3(or your third  interface above)  to  nf2c2
eth4(or your forth  interface above)  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. Please note that all the NetFPGA ports have to be mentioned as below for the current NetFPGA implementation:

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> &