Skip to content
Adam edited this page Feb 27, 2013 · 1 revision

Table of Contents

OpenFlow-NetFPGA-090

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

Project summary

Status:
Released
Version:
OpenFlow spec0.9.0 v1.0 Based on: NetFPGA Base Package 2.0.0:
Authors
Jad Naous, David Erickson, Tatsuya Yabe

Download

Install from NetFPGA Yum repository

  1. Install the Guide#Install_NetFPGA_Base_Package NetFPGA Base Package
  2. Install NetFPGA OpenFlow switch
 yum install netfpga-openflow_switch

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
  • Associated counters (per-table counters and per-port counters)
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, it updates SRC/DST MAC Address fields on the packets before transmitted.
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, perform the following command to run the regression tests.

 nf2_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 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 and IPv6 service.
  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(your OpenFlow directory) /datapath/linux2.6 || grep ofdatapath

Expected result

 ofdatapath_netfpga.ko
 ofdatapath.ko

Alternatively, you can install it manually by following CentOS NetFPGA Install page on The OpenFlow Switch Consortium.

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 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 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-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.

Clone this wiki locally