Skip to content

TunnelingOpenFlowNetFPGA100ICMP

Adam edited this page Mar 6, 2013 · 1 revision

-- Main.RaviKerur - 09 Sep 2010

Table of Contents

Tunneling-OpenFlow-NetFPGA-100-ICMP

Project summary

Status

  • Complete
Version
  • OpenFlow spec1.0 v1.00
Based on
  • NetFPGA Base Package 2.1.3
Authors
  • Adam Covington, Tatsuya Yabe, Ravi Kerur
Maintainer
  • Ravi Kerur

Download

Install from NetFPGA Yum repository

  1. Install the NetFPGA Base Package
  2. Install NetFPGA tunneling OpenFlow switch
yum install netfpga-tunneling_openflow_icmp_arp

Description

This design has a icmp reply module for port reachability tests in addition to tunneling capability and the functions of regular OpenFlow reference switch. It consists of following functions in addition to the functions described in OpenFlow reference switch wiki.

  • Encapsulate ethernet frame in IP packet with IP protocol number which you can specify via a register.
  • Decapsulate ethernet frame from IP packet above
  • Reply to ARP request
  • Reply to ICMP request
  • Wire format (encapsulation header format) is the same as our software tunneling implementation's.
See OpenFlow reference switch wiki for other features.

Regression Tests

The regression tests verify the icmp_reply functionality in addition to encap/decap functionalities and the functionality of the packet forwarding with both exact and wildcard match entries. 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 tunneling_openflow_icmp_arp

Regression Tests

Test 1: Exact table matching test

Test 1-1

Name :
test_exact_simple1
Description :
It 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 it the values are correct.
  6. Verify the packets
Location :
projects/tunneling_openflow_switch/regress/test_exact_simple1
Output :
SUCCESS!

Test 1-2

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

Test 2: Wildcard table matching test

Test 2-1

Name :
test_wildcard_simple1
Description :
It tests the functionality of the wildcard table matching by sending and receiving packets and verifying the registers.
# 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 if the values are correct.
# Verify the packets
Location :
projects/tunneling_openflow_switch/regress/test_wildcard_simple1
Output :
SUCCESS!

Test 2-2

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

Test 3: Encapsulation/Decapsulation test

Test 3-1

Name :
test_loopback_encap
Description :
It tests the encapsulation functionality.
  1. Initialize netfpga hardware
  2. Setup PHY for loopback
  3. Set encapsulation parameters
  4. Populate an wildcard table and its mask field
  5. Send packets from nf2c0-DMA. Feed un-capsulated packet
  6. Receive loopbacked packets on nf2c0, expecting it is encapsulated
  7. Check exact/wildcard table counters, per-port counters and verify the values are correct.
  8. Verify the packet
  9. Test all the NetFPGA ports
Location
projects/tunneling_openflow_switch/regress/test_loopback_encap
Output :
SUCCESS!

Test 3-2

Name :
test_loopback_decap
Description :
It tests the decapsulation functionality.
  1. Initialize netfpga hardware
  2. Setup PHY for loopback
  3. Set decapsulation parameters
  4. Populate an wildcard table and its mask field
  5. Send packets from nf2c0-DMA. Feed capsulated packet
  6. Receive loopbacked packets on nf2c0, expecting it is not capsulated
  7. Check exact/wildcard table counters, per-port counters and verify the values are correct.
  8. Verify the packet# Test all the NetFPGA ports
Location :
projects/tunneling_openflow_switch/regress/test_loopback_decap
Output :
SUCCESS!

Test 4: ICMP Reply test

Test 4-1

Name :
test_icmp_reply
Description : It tests the ICMP reply functionality.
  1. Initialize netfpga hardware
  2. Start virtual hosts
  3. Register router and host interface(s)
  4. Send ICMP echo request packets from host to router interface
  5. Expect ARP exchange
  6. Receive ICMP echo reply from the router to host interface
  7. Verify the packet
  8. Test all the NetFPGA ports
Location
projects/tunneling_openflow_icmp_arp/regress/test_icmp_reply
Output :
SUCCESS!

Usage

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

Preparation

  • We assume you are using NetFPGA on CentOS 5.4 and on the environment mentioned in chapters 2 to 4 of NetFPGA Guide.
  • Copy following two shell script files on your home directory; of_start.sh, of_stop.sh
cp (your NF2 directory)/projects/tunneling_openflow_switch/sw/*.sh ~/.

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 a wireshark utility tool.
  4. Modify OpenFlow environment files.

Copy necessary files

cp (your netfpga directory)/bitfiles/<strong>tunneling_openflow_icmp_arp.bit</strong> (your openflow directory)/hw-lib/nf2/.
cp (your netfpga directory)/projects/tunneling_openflow_icmp_arp/lib/C/<strong>reg_defines_tunneling_openflow_icmp_arp.h</strong> (your openflow directory)/hw-lib/nf2/.

Setup your environment

Assume you want to create a topology below for example:

Following is what you will need to do for setting up NetFPGA1 machine above. Other machines can be setup in a same way.

1. Find shell script file

Find of_start.sh file in your home directory and open it for editing.

vi of_start.sh

2. Find the parts to be edited

Find the section mentioned below on the very top part of the file:

### User dependent settings

3. Edit the variables

You will find one global setting and six variables for each interface from nf2c0 to nf2c3.

First, point your openflow directory.

OF_ROOT=/home/openflow/openflow --- Point your openflow directory

Then modify the variables for interfaces which you want to use as tunneling ports. In this sample case, you want to change variables for nf2c0 and nf2c1.
Following are the example modification for nf2c0. Change variables for other tunneling ports (in this case, nf2c1) in the same way.

TUNIF0_ENABLE=0 --- Change it to 1 if you want to use this interface as a tunneling port
SRCIP0=xxx.xxx.xxx.xxx --- Setup IP address for nf2c0
SRCMAC0=00:AA:BB:CC:DD:01 --- You don't need to change it but you can change it as you wish.
DSTIP0=xxx.xxx.xxx.xxx --- Setup destination IP address. NetFPGA2-nf2c0, in this case.
DSTMAC0=xx:xx:xx:xx:xx:xx -- Setup your gateway MAC address to NetFPGA2
ENCAP_TAG=0 -- TAG value to be attached inside an encapsulation header. You need to set the same values between the two tunneling ends.

4. Modify the other end

Modify the configuration for opponent machines in a same way. (In this case, NetFPGA2 and NetFPGA3.)

Start OpenFlow Switch

To start the switch, prepare a OpenFlow Switch controller such as NOX. Once you have IP address or host name of your controller, run of_start.sh, which you have modified above, 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
Clone this wiki locally