Changes between Version 16 and Version 17 of Internal/OpenFlow/HostSetup


Ignore:
Timestamp:
Jan 29, 2010, 11:29:24 PM (14 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/HostSetup

    v16 v17  
    2422424. Install dependencies for Ubuntu compatibility, as per the [http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/UbuntuCompatibility compatibility page]. The packages are:
    243243
     244== 2. Installing NetFPGA Drivers ==
     245Steps described by the NetFPGA tunneling page:
     246 1. Install base package
     247 2. Install !OpenFlow components
     248
     249=== 1. Installing base package ===
     250
     2511. Download the tarballs from http://netfpga.org/beta/distributions/  [[BR]]
     252For this you need a !FosWiki account (register [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= here]). Download the newest netfpga_base_beta package (currently 2.0.0). Untar:
     253   
     254 tar -xvf netfpga_base_beta_2_0_0.tar.gz
     255   
     256Untarring the package will create the directory NF2. 
     257
     2582. Edit files/ symlinks as per compatibility page [[BR]]
     259
     260Create links:
     261{{{
     262ln /usr/bin/lspci /sbin/lspci
     263ln /usr/bin/setpci /sbin/setpci
     264ln -s /usr/lib/libpcap.so.0.8 /usr/lib/libpcap.so.0.8.3
     265}}}
     266
     267test_loopback_drop/run has been renamed run.pl in the most recent package. In this file you just need to change 'usleep 250' to 'sleep 0.00025'. 
     268
     269NF2/lib/C/kernel/Makefile is already in working condition - you don't need to modify it.
     270
     271*Stopped at this point: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page**   
     272
     2733. Allocate more kernel memory [[BR]]
     274The NetFPGA requires 256M memory allocated. This can be done through /boot/grub/menu.lst on older kernels. For the newer versions of Ubuntu (e.g. 9.10), which uses Grub 2, you need to edit /boot/grub/grub.cfg from
     275{{{
     276GRUB_CMDLINE_LINUX_DEFAULT="quiet splash
     277}}}
     278to
     279{{{
     280GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=256M
     281}}}
     282
     2834. Edit and run user_account_setup.pl [[BR]]
     284The script sets environmental variables. It is located under /NF2/lib/scripts/user_account_setup/ . Running it as is will throw an error saying
     285
     286 cat: /usr/local/NF2/bashrc_addon: No such file or directory   
     287 
     288The easiest thing to do is to edit the script to contain the exact path to your NF2 directory and bashrc_addon:
     289{{{
     290else
     291{
     292  print "Copying the NF2 directory to your user account\n";
     293  `cp -r /home/netfpga/NF2 ~`;
     294}
     295
     296print "Adding the NetFPGA Enviornment Variables to your .bashrc\n";
     297`cat /home/netfpga/NF2/bashrc_addon >> ~/.bashrc\n`;
     298}}}
     299Then it will run correctly (here NF2 is already in the home directory)
     300{{{
     301$ ./user_account_setup.pl NF2 directory already exists copy has been canceled
     302Adding the NetFPGA Enviornment Variables to your .bashrc
     303}}}
     304
     305
     306trying to use the 9.10 compatible stuff, found in http://www.netfpga.org/foswiki/bin/view/NetFPGA/OneGig/RealTimeSwitch
     307
     308----
     309----
     310= Installing Ubuntu, ~~take 3~~ take 4 =
     311After installing 9.10 server (AMD64) and 9.10 server 32 bit, we realized that there may be a "few" complications coming from the changes that were made in the more recent versions of Ubuntu (e.g. Grub 2, discarding "antiquated" libraries, ect), so things were rolled back to installing Ubuntu 9.04 server 32 bit. This should simplify *many* things. Hopefully.
     312
     313== 1. Installation of the OS ==
     3141. Go to the BIOS settings, make CD drive highest boot priority
     315
     3162. Follow the default choices given for intallation, save the following few:
     317 
     318 * no setup of LVM for disk partitioning
     319 * additional packages - install OpenSSH server
     320 * hostname: netfpga1
     321 * user: netfpga
     322 
     3233. When rebooting, go back to the BIOS settings to make sure the HDD is included in the boot priority list. 'x' adds excluded devices to the boot priority list.   
     324
     3254. Who's afraid of a little command line? If you are, y' shoulda stuck with desktop edition.
     326
     327=== Host info ===
     328From past experience, the following info will come in handy when troubleshooting stuff...
     329 * uname -a shows: 2.6.28-11-server i686 GNU/Linux
     330 * IP address: 192.168.203.187 (DHCP - May change)
     331 * bootloader: grub
     332 
     333== 2. Installing drivers (NetFPGA) ==
     334The host is named "Netfpga1" because it will be a NetFPGA host. So this is sort of important.
     335
     336 * Ubuntu Compatibility
     337 * http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide
     338
     3390. Get a Foswiki account so you can download the packages you need at their [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= registration page].
     340
     3411. Update packages, then install the following dependencies as per the [http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/UbuntuCompatibility Comaptibility page]:
    244342  * build-essential
    245343  * linux-headers-`uname -r`
     
    255353  * libpcap0.8-dev
    256354
    257 == 2. Installing NetFPGA Drivers ==
    258 Steps described by the NetFPGA tunneling page:
    259  1. Install base package
    260  2. Install !OpenFlow components
    261 
    262 === 1. Installing base package ===
    263 
    264 1. Download the tarballs from http://netfpga.org/beta/distributions/  [[BR]]
    265 For this you need a !FosWiki account (register [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= here]). Download the newest netfpga_base_beta package (currently 2.0.0). Untar:
    266    
    267  tar -xvf netfpga_base_beta_2_0_0.tar.gz
    268    
    269 Untarring the package will create the directory NF2. 
    270 
    271 2. Edit files/ symlinks as per compatibility page [[BR]]
    272 
    273 Create links:
     3552. Download the base package. The newest is netfpga_base_beta_2_0_0. Untar:
     356{{{
     357tar xvf netfpga_base_beta_2_0_0.tar.gz
     358}}}   
     359This will create a directory called NF2 in your home directory.
     360
     3613. create symlinks:
    274362{{{
    275363ln /usr/bin/lspci /sbin/lspci
    276364ln /usr/bin/setpci /sbin/setpci
    277365ln -s /usr/lib/libpcap.so.0.8 /usr/lib/libpcap.so.0.8.3
    278 }}}
    279 
    280 test_loopback_drop/run has been renamed run.pl in the most recent package. In this file you just need to change 'usleep 250' to 'sleep 0.00025'. 
    281 
    282 NF2/lib/C/kernel/Makefile is already in working condition - you don't need to modify it.
    283 
    284 *Stopped at this point: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page**   
    285 
    286 3. Allocate more kernel memory [[BR]]
    287 The NetFPGA requires 256M memory allocated. This can be done through /boot/grub/menu.lst on older kernels. For the newer versions of Ubuntu (e.g. 9.10), which uses Grub 2, you need to edit /boot/grub/grub.cfg from
    288 {{{
    289 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash
    290 }}}
    291 to
    292 {{{
    293 GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=256M
    294 }}}
    295 
    296 4. Edit and run user_account_setup.pl [[BR]]
    297 The script sets environmental variables. It is located under /NF2/lib/scripts/user_account_setup/ . Running it as is will throw an error saying
    298 
    299  cat: /usr/local/NF2/bashrc_addon: No such file or directory   
    300  
    301 The easiest thing to do is to edit the script to contain the exact path to your NF2 directory and bashrc_addon:
    302 {{{
    303 else
    304 {
    305   print "Copying the NF2 directory to your user account\n";
    306   `cp -r /home/netfpga/NF2 ~`;
    307 }
    308 
    309 print "Adding the NetFPGA Enviornment Variables to your .bashrc\n";
    310 `cat /home/netfpga/NF2/bashrc_addon >> ~/.bashrc\n`;
    311366}}}
    312 Then it will run correctly (here NF2 is already in the home directory)
    313 {{{
    314 $ ./user_account_setup.pl NF2 directory already exists copy has been canceled
    315 Adding the NetFPGA Enviornment Variables to your .bashrc
    316 }}}
    317 
    318 **stopped here: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page **
    319 ----
    320 = METHOD 2 =
    321 
    322 trying to use the 9.10 compatible stuff, found in http://www.netfpga.org/foswiki/bin/view/NetFPGA/OneGig/RealTimeSwitch
    323 
     367
     3684. Edit files by following the compatibility page. Some of the stuff there is outdated, so keep an eye out for the following:
     369
     370 * /test_loopback_drop/run is /test_loopback_drop/run.pl
     371 * edit "usleep 250" to "sleep 0.00025" in /test_loopback_drop/run.pl
     372 * Don't change anything on /NF2/lib/C/kernel/Makefile
     373 * Likewise, NF2/lib/C/download/nf2_download.c need not be edited. 
     374
     3755. Edit /boot/grub/menu.lst to allocate more kernel memory:
     376{{{
     377title    Ubuntu 9.04, kernel 2.6.28-16-generic
     378uuid    (BIG number here)
     379kernel  /vmlinuz-2.6.28-16-generic root=UUID=(BIG number here) ro quiet splash vmalloc=256M
     380}}}
     381
     3826. Edit rkd.cc to include limits.h
     383
     3847. Replace asm/semaphores with linux/semaphores
     385
     3868. `make` and `make install` in user's NF2 directory (you need to be root)
     387
     388== Testing that NetFPGA works ==
     3891. Reprogram CPCI
     390 
     391In cpci_reprogram.pl line 216, change the offset from 5 to 4:
     392{{{
     393# Search for the NetFPGA device ID
     394                if ($words[4] eq $NF2_device_id)           <<---over here
     395                {
     396                        push (@device_list, $words[0]);
     397                }
     398}}} 
     399
     400Then run cpci_reprogram.pl (run from user home directory):
     401{{{
     402/home/netfpga/NF2/lib/scripts/cpci_reprogram/cpci_reprogram.pl --all
     403}}}
     404Add the same command to /etc/rc.local so this is done automatically each time the machine is rebooted.
     405
     4062. Rename interfaces.
     407
     408Since you need eth1 and 2 for the regression test, you need to change eth0 to eth2. Change "eth0" to "eth2" in /etc/udev/rules.d/70-persistent-net.rules so it looks similar to this:
     409{{{
     410SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:48:b1:9d:a9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
     411
     412# PCI device 0x8086:0x109a (e1000e)
     413SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:48:b1:9d:a8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
     414}}}   
     415 
     416The changes will take effect after you reboot the machine.
     417
     418
     419