[wiki:Internal/OpenFlow/ return to OpenFlow index] = Setting up the host for the NetFPGA = Here we provide the links and directions followed to set up a working NetFPGA host. The directions can be found on the following site: http://netfpga.org/netfpgawiki/index.php/Guide == Installing CentOS == CentOS is the recommended OS for use with NetFPGA. The most current version is 5.3, which is not listed as a version of CentOS that works with NetFPGA, but was used anyways. === CentOS 5.3 === The latest version is CentOS 5.3. For the installation, the net install iso was chosen because of its small size. This can be found on any mirror site. * CentOS mirrors : http://isoredirect.centos.org/centos/5/os/i386/ * Network installation of CentOS : http://www.tonybhimani.com/2007/12/20/centos-51-network-install-instructions/ === CD install of CentOS 5.2 === The .iso images can be found here: http://vault.centos.org/5.2/isos/i386/ You only need CD's 1 through 4. k3b on Ubuntu was used to burn the images since the images burned with Windows seemed to become corrupt. It seems that you need to manually configure the network interface for eth0. * Network interface configurations: http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html * VLANs on CentOS: http://www.tummy.com/journals/entries/jafo_20061130_063931 Before installing the netFPGA base package, make sure to update the kernel, since the dependencies for NetFPGA software require a newer version of the kernel than the one for 5.3. To install the basic drivers, install teh yum repository and GPG key, followed by the netFPGA base package. {{{ rpm -Uhv http://netfpga.org/yum/el5/RPMS/noarch/netfpga-repo-1-1_CentOS5.noarch.rpm yum install netfpga-base /usr/local/NF2/lib/scripts/user_account_setup/user_account_setup.pl }}} The directions then go over installing CAD tools, but since we are just trying to make the FPGA into an !OPenFlow switch, we skip over that section of the guide. cd into the NetFPGA directory, then make, make install, and reboot. {{{ make #a bunch of output showing status make install #more outputs reboot }}} after the machine has rebooted, check that drivers are loaded. The PID should show up: {{{ [root@localhost ~]# /sbin/lsmod | grep nf2 nf2 22540 0 }}} Finally, verify the interfaces with `/sbin/ifconfig -a` at the terminal. This is the output for our setup: {{{ eth0 Link encap:Ethernet HWaddr 00:1C:C0:B4:EC:D4 inet addr:192.168.202.102 Bcast:192.168.203.255 Mask:255.255.252.0 inet6 addr: fe80::21c:c0ff:feb4:ecd4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:825 errors:0 dropped:0 overruns:0 frame:0 TX packets:212 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:76080 (74.2 KiB) TX bytes:21489 (20.9 KiB) Interrupt:50 Base address:0xa000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1162 errors:0 dropped:0 overruns:0 frame:0 TX packets:1162 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2004680 (1.9 MiB) TX bytes:2004680 (1.9 MiB) nf2c0 Link encap:Ethernet HWaddr 00:4E:46:32:43:00 BROADCAST MULTICAST MTU:1986 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:58 nf2c1 Link encap:Ethernet HWaddr 00:4E:46:32:43:01 BROADCAST MULTICAST MTU:1986 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:58 nf2c2 Link encap:Ethernet HWaddr 00:4E:46:32:43:02 BROADCAST MULTICAST MTU:1986 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:58 nf2c3 Link encap:Ethernet HWaddr 00:4E:46:32:43:03 BROADCAST MULTICAST MTU:1986 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:58 sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 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:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) }}} == NetFPGA on Ubuntu (11/7) == Ultimately, the second NetFPGA host was built using Ubuntu 8.04 (kernel 2.6.24-16). To make things neat, user 'netfpga' was created for this process. Make sure the user is added to the sudoers list. First off, you need an account at netfpga.org to download the .tar files needed to install the netfpga drivers. The files needed are netfpga_base_beta_x_x.tar.gz and netfpga_lib.tar.gz. With an account, they can be downloaded from here: http://netfpga.org/beta/distributions/ Untar and the files with `tar -xvf `. They will untar into one directory called ''NF2''. Do not make and install yet - At this point, follow the directions on the [ http://www.netfpga.org/netfpgawiki/index.php/Ubuntu_Compatibility Ubuntu compatibility] page. They ask you to make a few changes on the files located in NF2. A few things to note regarding the directions: * to edit /boot/grub/menu.lst as per the instructions, use the directions for modifying grub.conf for CentOS, found here: http://www.netfpga.org/netfpgawiki/index.php/Install_Software_1.0#CentOS_Installation_Instructions * Environmental variables can be added by the command {{{ /usr/local/NF2/lib/scripts/user_account_setup/user_account_setup.pl }}} as per the [http://netfpga.org/netfpgawiki/index.php/Guide#Verify_the_software_and_hardware Guide], however you might need to edit the last line of ser_account_setup.pl to point to the exact location of bashrc_addon : {{{ print "Adding the NetFPGA Enviornment Variables to your .bashrc\n"; `cat /home/netfpga/test/NF2/bashrc_addon >> ~/.bashrc\n`; }}} Then you can make and install the drivers. Note, the selftest can't be run in Ubuntu. == Regression testing == Connecting the SATA feedback loop seems to prevent the test from loading correctly, throwing the following error: {{{ [root@localhost ~]# /root/NF2/lib/C/download/nf2_download ~/NF2/bitfiles/selftest.bit Found net device: nf2c0 Bit file built from: nf2_top_par.ncd Part: 2vp50ff1152 Date: 2008/ 7/21 Time: 17: 0:39 After resetting Programming interface, expected status to be 1 (FIFO empty). However status & 0x102 is 0x102 Fatal Error, exiting... }}} In addition, the Ethernet cables used for the cross-connection should be crossover, not straight through. Once the SATA cable was removed, and the test run with the command {{{ ~/NF2/projects/selftest/sw/selftest -n }}} the proper output was returned. == Installing the !OpenFlow implementation (!OpenFlow-NetFPGA-090) == After successfully installing the drivers, you can install the !OpenFlow switch with the following command: {{{ [root@localhost ~]# yum install netfpga-openflow_switch }}}