Version 41 (modified by 14 years ago) ( diff ) | ,
---|
Setting up NetFPGA hosts: Ubuntu 10.04
Current Ubuntu NetFPGAs run Ubuntu version 8.04 and OpenFlow ver. 1.0. Here we try to move to newer distributions w/ OpenFlow Ver. 1.0. The hardware we use here is the NetFPGA cube, another version of the NetFPGA pre-built solution. As per the !OpenFlow portion of the setup, a user named 'openflow' with root privs was added for this purpose.
Setup of the NetFPGA using earlier distributions can be found in the Diaries.
Linux distro:
Ubuntu Server 10.04, w/ xfce4 WM, openssh-server
kernel: 2.6.32-21-generic-pae
Packages:
NetFPGA base 2.1.0
Tunneling OpenFlow NetFPGA 1.0.0
Installing Ubuntu.
- set boot priority of CD drive to 1st in BIOS
- If desktop edition, boot as a live CD and install from there. Trying direct install just results in the system proceeding to live CD Mode (10.04). Server edition can be installed directly w/out issues.
I: Setup - NetFPGA drivers.
1. dependencies.
There is an updated dependency list:
- ncurses-dev
- libnet1-dev
- libxml-simple-perl
- libio-interface-perl
- liblist-moreutils-perl
- liberror-perl
- libnet-rawip-perl
- sun-java6-jre
- sun-java6-jdk
- libpcap0.8-dev
Installing java packages. In 10.04, sun-java6-jre, jdk are obsoleted and moved to the partner repository. This repository can be added w/ the following (ref: https://help.ubuntu.com/community/Repositories/CommandLine):
- copy "deb http://archive.canonical.com/ lucid partner" sans quotes to /etc/apt/sources.list
- run apt-get update.
- run apt-get as usual for the packages.
2. Kernel memory allocation.
Ubuntu versions beyond 8.04 (assume anything w/ kernels beyond v 2.6.28) use GRUB 2. GRUB 2 gets rid of menu.lst, so kernel memory must be allocated via the following method (ref. http://ohioloco.ubuntuforums.org/showthread.php?p=8229620):
Add "vmalloc=512m" to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub so it looks like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vmalloc=512m"
Then run update-grub
to regenerate /boot/grub/grub.cfg with the new parameter (you never want to modify grub.cfg directly).
3. Symlinks.
The steps are the same as before. Download libpcap.so.0.9.4, found below. Make sure to slap it into /usr/lib before linking.
ln /usr/bin/lspci /sbin/lspci ln /usr/bin/setpci /sbin/setpci ln -s /usr/lib/libpcap.so.0.9.4 /usr/lib/libpcap.so.0.9 ln -s /usr/lib/libpcap.so.0.9.4 /usr/lib/libpcap.so.0 ln -s /usr/lib/libpcap.so.0.9.4 /usr/lib/libpcap.so
also check for /sbin/setpci. If it doesn't exist, create another link from /usr/bin/setpci:
ln -s /usr/bin/setpci /sbin/setpci
4. Edit files.
- edit "usleep 250" to "sleep 0.00025" in /test_loopback_drop/run.pl
- edit /home/netfpga/NF2/projects/router_kit/sw/rkd.cc to include limits.h
NOTE: this edit is no longer required for version 2.1.1 of the package.
5. Setting Variables.
After setting NF_ROOT to the netfpga directory, source nf_profile
, located in ${NF_ROOT}/bin/
export NF_ROOT=/home/openflow/netfpga #(wherever your netfpga base files are) source ${NF_ROOT}/bin/nf_profile
6. Moment of truth.
make
then make install
.
Then, check for nf2 module with lsmod | grep nf2
:
nf2 13425 0
and for nf2cn, n=0:3 with ifconfig -a
.
nf2c0 Link encap:Ethernet HWaddr 00:4e:46:32:43:00 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 nf2c1 Link encap:Ethernet HWaddr 00:4e:46:32:43:01 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 nf2c2 Link encap:Ethernet HWaddr 00:4e:46:32:43:02 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 nf2c3 Link encap:Ethernet HWaddr 00:4e:46:32:43:03 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16
7. add the cpci reprogrammer to startup routine
Add the following to /etc/rc.local:
/home/openflow/netfpga/lib/scripts/cpci_reprogram/cpci_reprogram.pl --all
The selftest does not work in Ubuntu. so don't try it.
II: Setup - OpenFlow components.
The OpenFlow wiki on CentOS NetFPGA setup were followed in conjunction with the netfpga site wiki for the Tunneling OpenFlow NetFPGA. Stes are reiterated here since nothing is permanent.
- Tunneling !OpenFlow NetFPGA
- OpenFlow setup on Ubuntu and CentOS
1. dependencies.
- autoconf
- libtool
- pkg-config
- linux-source-2.6.32
- git-core
- automake
- m4
2. OpenFlow package installation
This happens in the same directory as the netfpga install (here, /home/test). From git repository (automatically pulls the newest version):
git clone git://openflowswitch.org/openflow.git cd openflow ./boot.sh
To make NetFPGA compatible:
./configure --enable-hw-lib=nf2
Remove avahi-daemon and disable IPv6:
sudo apt-get remove avahi-daemon
in /etc/sysctl.conf add
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
and in /etc/modprobe.d/blacklist.conf
blacklist net-pf-10 blacklist ipv6
3. NetFPGA tunnel package
Download and untar in /home/openflow/
. Move tunneling_openflow_switch.bit
and reg_defines_tunneling_openflow_switch.h
to your_openflow_directory/hw-lib/nf2/. The files should be located under bitfiles/
and /projects/tunneling_openflow_switch/lib/C/
in the netfpga directory, respectively. Do a make and make install in the openflow directory.
4. Regression test
The setup should be wired as such
eth1 <----> nf2c0 eth2 <----> nf2c1
The test can be run with the following command:
nf_regress_test.pl --project tunneling_openflow_switch
As of now, getting this error:
root@node1-2:~/netfpga/lib/scripts/cpci_reprogram# /home/akoshibe/netfpga/bin/n_regress_test.pl --project tunneling_openflow_switch NetFPGA environment: Root dir: /home/openflow/netfpga Project name: tunneling_openflow_switch Project dir: /home/openflow/netfpga/projects/tunneling_openflow_switch Work dir: /tmp/root Root directory is /home/openflow/netfpga Running tests on project 'tunneling_openflow_switch'... Running global setup... FAIL Output was: NetFPGA environment: Root dir: /home/openflow/netfpga Project name: tunneling_openflow_switch Project dir: /home/openflow/netfpga/projects/tunneling_openflow_switch Work dir: /tmp/root Found net device: nf2c0 Error: Virtex design compiled against a different CPCI version Active CPCI version : 4 (rev 1) Device built against: 3 (rev 4) Bit file built from: nf2_top_par.ncd Part: 2vp50ff1152 Date: 2010/ 5/ 4 Time: 15:49:32 Error Registers: 0 Good, after resetting programming interface the FIFO is empty Download completed - 2377668 bytes. (expected -1). DONE went high - chip has been successfully programmed. CPCI Information ---------------- Version: 4 (rev 1) Device (Virtex) Information --------------------------- Project directory: tunneling_openflow_switch Project name: Tunneling OpenFlow Switch Project description: Tunneling OpenFlow Switch Device ID: 0 Version: 0.1.0 Built against CPCI version: 3 (rev 4) Download Failed: 256 global/setup exited with value 1
Attachments (3)
- libpcap.so.0.9.4.tar.gz (72.3 KB ) - added by 15 years ago.
-
ubuntu_setup.sh
(346 bytes
) - added by 14 years ago.
Ubuntu compatibility symlinks
-
bitfiles.tgz
(1.7 MB
) - added by 14 years ago.
netfpga cpci/tunnel bitfiles
Download all attachments as: .zip