440 | | |
| 440 | |
| 441 | '''Prequisite packages''' |
| 442 | * autoconf |
| 443 | * libtool |
| 444 | * pkg-config |
| 445 | * linux-source (2.6.28) |
| 446 | |
| 447 | Following the instructions of [http://www.openflowswitch.org/foswiki/bin/view/OpenFlow/Deployment/HOWTO/LabSetup Labsetup] |
| 448 | we cloned the 0.8.9 branch of the their git repository, I'll include the steps because their pages don't stay up very long. |
| 449 | |
| 450 | {{{ |
| 451 | $ git clone git://openflowswitch.org/openflow.git |
| 452 | $ cd openflow |
| 453 | $ git checkout -b openflow_089_rev4 origin/release/0.8.9 |
| 454 | }}} |
| 455 | |
| 456 | Assuming all the prerequisites are installed, the next step is to compile the source. We're trying to make two kernel objects, and a bit file for the netfpga. |
| 457 | |
| 458 | {{{ |
| 459 | $ ./boot.sh |
| 460 | $ ./configure --with-l26=/lib/modules/`uname -r`/ --enable-hw-tables=nf2 |
| 461 | $ make |
| 462 | }}} |
| 463 | |
| 464 | boot.sh will fail to run if the listed prerequisites are not installed (there may be more preqs based on what was installed prior, build-tools, kernel headers, etc...). |
| 465 | |
| 466 | The original configure line read "./configure --with-l26=--with-l26=/lib/modules/`uname -r`/build --enable-hw-tables=nf2", while the extra --with-l26 is an obvious error, there are others. The configure script stuffs the argument of --wtih-l26 into a $path variable, then looks for the subdirectories $path/build and $path/source. Specifying --with-l26 as ../`uname -r`/build causes configure to fail, since there is no source directory in the build directory. Instead what they wanted was the directory 1 level up. |
| 467 | |
| 468 | In our first attempt we just ran make and went on to the next step, however when we tried to insert the modules one of them failed. The problem was with the ofdatapath_netfpga.ko module. When we tried to insert it (with insmod) it would complain about a missing symbol. |
| 469 | Dmesg would show an even every time you tried to insert the module that said |
| 470 | |
| 471 | {{{ |
| 472 | WARNING: "nf2k_reg_read" |
| 473 | WARNING: "nf2k_reg$ ./boot.sh |
| 474 | }}} |
| 475 | |
| 476 | Consulting a reference from the Stanford [$ https://mailman.stanford.edu/pipermail/openflow-discuss/2009-January/000051.html mailing list] on netfpga, we determined that the Module.symvers file needed to be edited. We needed to copy the entries from the ~/NF2/lib/c/kernel/Modules.symvers into the ~/openflow/datapath/linux-2.6/Modules.symvers. The NF2 directory comes from two tar files: |
| 477 | * netfpga_base_beta_2_0_0_0.tar.gz |
| 478 | * netfpga_openflow_switch.0_8_9-1.tar.gz - This file was chosen to match the version of the Netfpga openflow source we're compling. |
| 479 | Go to http://netfpga.org/beta/distributions/ in order to download these packages (you'd need your !FosWiki account). |
| 480 | |
| 481 | Making this change produces the bits files and modules that will be needed in the next section. |
| 482 | |
| 483 | After a sucessfull complie we needed to load the openflow bitfile onto the netfpga |
| 484 | {{{ |
| 485 | # cpci_reprogram.pl |
| 486 | # nf2_download ~/openflow/datapath/hwtable_nf2/openflow_switch.bit |
| 487 | }}} |
| 488 | |
| 489 | The actual paths may vary but the basic process is the same. This is fairly straight forward assuming the netfpga tools were already built. |
| 490 | |
| 491 | Once that was done we inserted the modules (required root privileges) |
| 492 | {{{ |
| 493 | # /sbin/insmod ./openflow/datapath/linux-2.6/ofdatapath.ko |
| 494 | # /sbin/insmod ./openflow/datapath/linux-2.6/ofdatapath_netfpga.ko |
| 495 | }}} |
| 496 | |
| 497 | At this point we're ready to try testing the netfpga as a open flow switch. I'm going to pause here and rearrange the networks that the specfic netfpgas belong to. |
| 498 | |
| 499 | The host has been renamed to of1 and was given an official place in the WINLAB network with IP addr. 192.168.200.86 |
| 500 | |
| 501 | Next, you create the OpenFlow datapaths. What they refer to as ./utilities can be found under your openflow directory. We didn't assign a MAC address to the interface like they did in the tutorial. |
| 502 | {{{ |
| 503 | # ./utilities/dpctl adddp nl:0 |
| 504 | }}} |
| 505 | |
| 506 | Then, add the NetFPGA interfaces. Here we encounter another typo in the instructions - there is no nf2c4. |
| 507 | {{{ |
| 508 | # ./utilities/dpctl addif nl:0 nf2c0 |
| 509 | # ./utilities/dpctl addif nl:0 nf2c1 |
| 510 | # ./utilities/dpctl addif nl:0 nf2c2 |
| 511 | # ./utilities/dpctl addif nl:0 nf2c3 |
| 512 | }}} |
| 513 | |
| 514 | |
| 515 | |
| 516 | |