-
Notifications
You must be signed in to change notification settings - Fork 141
OpenFlowNetFPGA090
This project provides a hardware table implementation of an OpenFlow reference switch.
- Status:
- Version:
- Authors
- Install the Guide#Install_NetFPGA_Base_Package NetFPGA Base Package
- Install NetFPGA OpenFlow switch
yum install netfpga-openflow_switch
Download from NetFPGA beta distributions website: OpenFlow Switch
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)
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:
- 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.
- 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.
- 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.
- 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.
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
Test 1-1
- Name :
- Description :
- Initialize NetFPGA hardware
- Populate an exact table
- Send packets from eth2
- Receive packets on eth1
- Check exact/wildcard table counters and per-port counters, and verify the values are correct.
- Verify the packets
- Location :
- Output
SUCCESS!
Test 1-2
- Name :
- 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 :
- Output
SUCCESS!
Test 2-1
- Name :
- Description :
- Initialize netfpga hardware
- Populate an wildcard table and its mask field.
- Send packets from eth2
- Receive packets on eth1
- Check exact/wildcard table counters, per-port counters and verify the values are correct.
- Verify the packets
- Location :
- Output
SUCCESS!
Test 2-2
- Name :
- Description :
- Location :
- Output
SUCCESS!
Please consult The OpenFlow Switch Consortium web site to learn about it including how you can use the switch.
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)
- Run install.sh.
./install.sh
The script does the following:
- Check if NetFPGA is properly mounted and NetFPGA kernel module is running on your machine
- Obtain required packages and install them.
- Stop avahi-daemon and IPv6 service.
- Obtain OpenFlow archives via git and install it, also install a wireshark utility tool.
- 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.
Connect a four-port NIC and NetFPGA as follows:
- nf2c0 - eth1
- nf2c1 - eth2
- nf2c2 - eth3
- nf2c3 - eth4
Run regress.sh.
./regress.sh
The script does the following:
- Initialize required variables.
- Run regression tests
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.
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.
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.