OpenFlowNetFPGA100

Adam edited this page Feb 27, 2013 · 2 revisions
Clone this wiki locally

Table of Contents

OpenFlow-NetFPGA-1.0.0

This project provides a hardware table implementation of an OpenFlow reference switch. Summary for the design (NetFPGA hardware and corresponding software) is described HERE.

Project summary

Status
  • Released
Version
  • OpenFlow spec1.0
Based on
  • NetFPGA Base Package 2.2.0
Authors
  • Jad Naous, David Erickson, Tatsuya Yabe
Maintainer
  • Tatsuya Yabe

Download

Install from NetFPGA Yum repository

With the following process, the project will be installed in /usr/local/netfpga directory.

  1. Install the NetFPGA Base Package
  2. Install NetFPGA OpenFlow switch
sudo yum clean all
sudo yum install netfpga-openflow_switch

As mentioned above, with this process the project will be installed in /usr/local/netfpga directory. In order to get them in your directory, run the following:

/usr/local/netfpga/lib/scripts/user_account_setup/user_account_setup.pl

Alternative way: Obtain Tarball from NetFPGA Distributions

Download from NetFPGA beta distributions website: OpenFlow Switch

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 function
  • On-chip TCAM-based 32 wildcard match tables and their lookup function (When you use this design with openflow software, 28 entries are available for users.)
  • Associated counters (per-table counters and per-port counters)
  • Packet forwarding to specified ports
  • Header modification when specified
The verilog modules to accomplish the function reside in output_port_lookup module.

Assuming that OpenFlow entry keys and the actions (e.g. which port(s) the packets should be sent to) has already been set in exact/wildcard tables on NetFPGA by the software, 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 from, 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. Also, when software sets so as 'modify actions', it updates SRC/DST MAC Addresses, VLAN ID and PCP, SRC/DST IP addresses, IP TOS, SRC/DST UDP and TCP ports fields on the packets before transmitted.When network and transport layer fields have been changed, it recalculates their checksums.
When you use this release as OpenFlow switch you will also need other Linux executables. 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, perform the following command to run the regression tests.

 nf_regress_test.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 website and install it. (See OpenFlow reference switch installation section below.)

  • We assume you are using NetFPGA on CentOS 5.4 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 three shell script files on your home directory; 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

Please refer to CentOS NetFPGA installation guide on OpenFlow wiki page.

The basic idea of installations are:

  1. Obtain required packages and install them.
  2. Stop avahi-daemon and IPv6 service.
  3. Obtain OpenFlow archives via git and install it, also install wireshark and its addon.
  4. Modify OpenFlow environment files.

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. Initialize required variables.
  2. Run regression tests
(Downloading OpenFlow bitfile into the FPGA will be done during the test.)

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

For more information up until this point, please consult CentOS NetFPGA Install page and http://www.openflowswitch.org/wk/index.php/OpenFlowNetFPGA1_0_0][OpenFlow-NetFPGA] on The OpenFlow Switch Consortium.http://www.openflowswitch.org/wk/index.php/OpenFlowNetFPGA1_0_0][OpenFlow-NetFPGA] on The OpenFlow Switch Consortium.

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 directory. Once you have IP address or hostname of your controller, run of_start.sh. (of_start.sh assumes your openflow directory name is "openflow". Modify the script to suit your openflow directory.)

 ./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 runs OpenFlow Protocol to connect to your controller.

Stop OpenFlow Switch

To stop the switch, run of_stop.sh as follows:

 ./of_stop.sh

It tears down ofprotocol, ofdatapath and associated interfaces.