OpenFlow-NetFPGA

From NetFPGAWiki

Jump to: navigation, search

This project provides a hardware table implementation of an OpenFlow reference switch.

Contents

Project summary

Status
Release Pending
Version
OpenFlow spec 0.8.9 (When the bitfile is downloaded it reports "OpenFlow Switch v0.1".)
Authors
Jad Naos, David Erickson, Tatsuya Yabe

Download

Install from NetFPGA Yum repository

  1. Install the NetFPGA Base Package
  2. Install NetFPGA OpenFlow switch (Not yet available.)
yum install netfpga-openflow_switch

Obtain Tarball from NetFPGA Distributions

Login account for the NetFPGA required for download. For a new account go to: http://netfpga.org/netfpgawiki/index.php?title=Special:UserLogin&type=signup

Download from NetFPGA beta distributions website (http://netfpga.org/beta/distributions/netfpga_openflow_switch_0_8_9.tar.gz). (Not yet available)

Description

This release is used as a hardware assist for OpenFlow reference switch. It consists of following functions:

  • Off-chip SRAM-based 32768 exact match tables and their lookup
  • On-chip TCAM-based 32 wildcard match tables and their lookup
  • Associated counters (per-table counters and per-port counters)

The verilog modules to accomplish the function reside in output_port_lookup module.

Assuming that the software has already set OpenFlow entry keys and the actions (e.g. which port(s) the packets should be sent to) on exact/wildcard tables on NetFPGA, the process of packet forwarding is summarized below:

  1. Pulls an incoming packet, parses a header and concatenates them on header_parser module, and then sends it to wildcard_match module and exact_match module.
  2. Checks if the parsed header matches exact flow entry and wildcard entry in wildcard_match module and exact_match module, then both of them report the result to match_arbiter module.
  3. Decides which result to choose and reports it to related modules including opl_processor module. At this stage, wildcard_match module and exact_match module update their associated counters.
  4. Updates the DST_PORT field in NetFPGA module header of the packet in opl_processor module and sends it out to the specified port via output_queues module.

When you use this release as OpenFlow switch you will also need other Linux kernel modules. See Usage section for details.

Regression Tests

The regression tests verify the functionality of the packet forwarding using both exact and wildcard match results. In order to run the tests, you need to have the machine connected for the regression tests as stated in the Run Regression Tests section of the Guide.

After connecting the cables. Run the following command to run the regression tests.

nf21_regression_tests.pl --project openflow_switch

Regression Tests

Test 1: Exact table matching test

Test 1-1

Name
test_exact_simple1
Description
Tests the functionality of the exact table matching by sending and receiving packets and verifying the registers.
  1. Initialize NetFPGA hardware
  2. Populate an exact table
  3. Send packets from eth2
  4. Receive packets on eth1
  5. Check exact/wildcard table counters and per-port counters, and verify the values are correct.
  6. Verify the packets
Location
projects/openflow_switch/regress/test_exact_simple1
Output
SUCCESS!

Test 1-2

Name
test_exact_simple2
Description
Tests the functionality of the exact table matching by sending and receiving packets and verifying the registers. It has the same functionality as test_exact_simple1, except that in this test packets are sent from eth1 and received on eth2.
Location
projects/openflow_switch/regress/test_exact_simple2
Output
SUCCESS!

Test 2: Wildcard table matching test

Test 2-1

Name
test_wildcard_simple1
Description
Tests the functionality of the wildcard table matching by sending and receiving packets and verifying the registers.
  1. Initialize netfpga hardware
  2. Populate an wildcard table and its mask field.
  3. Send packets from eth2
  4. Receive packets on eth1
  5. Check exact/wildcard table counters, per-port counters and verify the values are correct.
  6. Verify the packets
Location
projects/openflow_switch/regress/test_wildcard_simple1
Output
SUCCESS!

Test 2-2

Name
test_wildcard_simple2
Description
Tests the functionality of the wildcard table matching by sending and receiving packets and verifying the registers. It has the same functionality as test_exact_simple1, except that in this test packets are sent from eth1 and received on eth2.
Location
projects/openflow_switch/regress/test_wildcard_simple2
Output
SUCCESS!

Usage

Please consult The OpenFlow Switch Consortium web site to learn about it including how you can use the switch.

Preparation

In order to have an OpenFlow switch functionality, you need to download the archive from The OpenFlow Switch Consortium web site and install it. To make it easier we've prepared shell scripts. Find four ".sh" files in projects/openflow_switch/sw/ directory.

  • We assume you are using NetFPGA on CentOS 5.2 and on the environment mentioned in chapters 2 to 4 of NetFPGA Guide. Also, if you want to run OpenFlow regression tests you need to mount a four-port GbE NIC (eth1-4) on your NetFPGA machine before running the tests.
  • Copy following four shell script files on your home directory; install.sh, regress.sh, of_start.sh, of_stop.sh
cp (your NF2 directory)/projects/openflow_switch/sw/*.sh ~/.
  • Cd to your home directory and become Super user.
cd
su
(input password)

OpenFlow Reference Switch Installation

  • Run install.sh.
./install.sh

The script does the following:

  1. Check if NetFPGA is properly mounted and NetFPGA kernel module is running on your machine
  2. Obtain required packages and install them.
  3. Stop avahi-daemon.
  4. Obtain OpenFlow archives via git and install it, also install a wireshark utility tool.
  5. Modify OpenFlow environment files.
  • Once the script has finished running, perform a following command and check you have two kernel modules.
ls openflow-git/datapath/linux2.6 | grep mod.ko

Expected result

hwtable_nf2_mod.ko
openflow_mod.ko

Regression Test

Connect a four-port NIC and NetFPGA as follows:

  • nf2c0 - eth1
  • nf2c1 - eth2
  • nf2c2 - eth3
  • nf2c3 - eth4

Make sure you are on your home directory and you are still Super user.

Run regress.sh.

./regress.sh

The script does the following:

  1. Download OpenFlow bitfile onto NetFPGA
  2. Initialize required variables.
  3. Run regression tests

After running the script above, all the tests should pass.

Start OpenFlow Switch

To start the switch, you will need to prepare a OpenFlow Switch controller such as NOX. Please consult INSTALL file in your openflow-git directory. Once you have IP address or hostname of your controller, run of_start.sh as follows:

./of_start.sh xxx.xxx.xxx.xxx:yyyy
   (xxx.xxx.xxx.xxx : IP address or hostname of your controller
    yyyy : Port number which your controller uses (by default it is 6633))

It sets up a datapath and associated interfaces, then connects Secure Channel of the switch to the controller.

Stop OpenFlow Switch

To stop the switch, first kill the switch process pressing "CTRL" key and "C" at the same time, then run of_stop.sh as follows:

./of_stop.sh

It tears down a datapath and associated interfaces.

Personal tools