Changes between Version 47 and Version 48 of Internal/OpenFlow/HostSetup


Ignore:
Timestamp:
Sep 23, 2011, 9:57:40 PM (13 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/HostSetup

    v47 v48  
    11[wiki:Internal/OpenFlow/ return to OpenFlow index]
     2= NetFPGA !OpenFlow switch =
     3According to the guides, !OpenVswitch provides a kenel implementation of the OF switch, whereas Stanford's reference switch is purely userspace. The former is faster, the latter more customizable.
     4
     5This is the latest set of instructions for installing NetFPGA drivers on Ubuntu (10.10), and making it work as an !OpenFlow switch. It is assumed that your working directory is /opt/.
     6== I. NetFPGA setup ==
     7=== 1.1 Download sources/dependencies ===
     8`cd` to /opt/ and fetch the following:
     9
     10 * netfpga_full_2_2_0.tar.gz from:
     11  http://www.netfpga.org/releases/netfpga_full_2_2_0.tar.gz [[BR]]
     12  REF: http://netfpga.org/foswiki/NetFPGA/OneGig/Releases
     13
     14 * netfpga_openflow_switch_1_0_0-4.tar.gz from:
     15  http://netfpga.org/beta/distributions/netfpga_openflow_switch_1_0_0-4.tar.gz [[BR]]
     16  REF: http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/OpenFlowNetFPGA100
     17
     18 * dependencies
     19{{{
     20apt-get update
     21apt-get install build-essential linux-headers-`uname -r` ncurses-dev libnet1-dev libxml-simple-perl libio-interface-perl liblist-moreutils-perl liberror-perl git-core libpcap0.8 libpcap0.8-dev
     22}}}
     23=== 1.2 Compatibility fixes ===
     24The following changes have to be made in order to compile the drivers on Ubuntu.
     25 * Add the following symlinks:
     26{{{
     27ln /usr/bin/lspci /sbin/lspci
     28ln /usr/bin/setpci /sbin/setpci
     29}}}
     30
     31 * /opt/netfpga/lib/C/kernel/nf2util.h : add in the main #ifdef block:
     32{{{
     33// Replace SA_SHIRQ with IRQF_SHARED on newer kernels
     34#ifndef SA_SHIRQ
     35#define SA_SHIRQ IRQF_SHARED
     36#endif
     37}}}
     38
     39 * /etc/default/grub: add "vmalloc=512m" to GRUB_CMDLINE_LINUX_DEFAULT and do `update-grub`
     40
     41For the kernel:
     42 * If using kernel version 2.6.35-25, upgrade to 2.6.35 (`uname -ar` should show you which one you are running):
     43{{{
     44apt-get install linux-headers-2.6.35-30-generic linux-image-2.6.35-30-generic
     45}}}
     46
     47 * Reboot. After reboot, check that the kernel flags are correct:
     48{{{
     49dmesg | grep vmalloc
     50[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.35-30-generic root=UUID=c90285a2-48de-4ab0-950f-241817516ad8 ro vmalloc=512m console=tty0 console=ttyS0,115200n8
     51[    0.000000]     vmalloc : 0xdf7fe000 - 0xff7fe000   ( 512 MB)
     52}}}
     53
     54=== 1.3 Compile drivers ===
     55 * export environment variables:
     56{{{
     57export NF_ROOT=/opt/netfpga  #(wherever your netfpga base files are)
     58source ${NF_ROOT}/bin/nf_profile
     59}}}
     60 
     61 * from /opt/netfpga: `make`; `make install`
     62
     63After compilation, load kernel module with `modprobe nf2`. If all goes well, you should see the an entry if you check with `lsmod | grep nf2`. At this point, you can load bitfiles and such by first running `cpci_reprogram` and then using nf_download. You should see something like this:
     64{{{
     65# cpci_reprogram.pl --all
     66Loading the CPCI Reprogrammer on NetFPGA 0
     67Loading the CPCI on NetFPGA 0
     68CPCI on NetFPGA 0 has been successfully reprogrammed
     69# nf_download /opt/netfpga/bitfiles/reference_switch.bit
     70Found net device: nf2c0
     71Bit file built from: nf2_top_par.ncd;HW_TIMEOUT=FALSE
     72Part: 2vp50ff1152
     73Date: 2011/ 1/20
     74Time:  6: 8:48
     75Error Registers: 0
     76Good, after resetting programming interface the FIFO is empty
     77Download completed -  2377668 bytes. (expected 2377668).
     78DONE went high - chip has been successfully programmed.
     79CPCI Information
     80----------------
     81Version: 4 (rev 1)
     82
     83Device (Virtex) Information
     84---------------------------
     85Project directory: reference_switch
     86Project name: Reference Switch
     87Project description: Reference Switch
     88
     89Device ID: 3
     90Version: 1.0.0
     91Built against CPCI version: 4 (rev 1)
     92
     93Virtex design compiled against active CPCI version
     94}}}
     95
     96== II. !OpenFlow setup ==
     97=== 2.1 dependencies ===
     98 * packages:
     99{{{
     100apt-get install autoconf libtool
     101}}}
     102
     103 * Use git to pull NetFPGA-specific !OpenFlow sources to /opt/:
     104{{{
     105git clone git://openflowswitch.org/openflow.git
     106cd openflow
     107git checkout -b 1.0.0-netfpga origin/devel/tyabe/1.0.0-netfpga
     108}}}
     109=== 2.2 build !OpenFlow ===
     110{{{
     111./boot.sh
     112cd ./hw-lib/nf2
     113wget http://openflowswitch.org/downloads/netfpga/openflow_switch.bit.100_3.tar.gz
     114tar zxvf openflow_switch.bit.100_3.tar.gz ==> we need newer one from NF site:http://www.netfpga.org/releases/netfpga_openflow_switch_1_0_0-3.tar.gz
     115cd ../../
     116./configure --enable-hw-tables=nf2
     117make
     118make install
     119}}}
     120
     121After compilation, copy of_start.sh and of_stop.sh from /opt/netfpga/projects/openflow_switch/sw/.
     122
     123----
     124See below for old instructions.
     125----
    2126= Setting up NetFPGA hosts: Ubuntu 10.04 =
    3127Current 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 [http://www.openflowswitch.org/wk/index.php/CentOS_NetFPGA_Install !OpenFlow portion of the setup], a user named 'openflow' with root privs was added for this purpose.