Skip to content

Contrib. Project: Blueswitch

Salvator Galea edited this page Jul 12, 2021 · 1 revision

Blueswitch

Blueswitch is a contrib-project implemented on the NetFPGA-SUME platform. The Blueswitch is a switch implementing multi-table to make it compliant with OpenFlow protocol version 1.1 or later. It also implements with shadow tables to address inconsistent problems in the per-packet forwarding process. The Blueswitch works were originally presented in 2015 ANCS conference[1]. More detailed architecture and experiment results can be found in [1].

This page is to provide instructions of the Blueswitch project to run simulation, hw implementation, and tests, as a contrib-project of NetFPGA-SUME platform. The project still needs many features to be developed to support OpenFlow protocol, but we hope that this guidance for running the Blueswitch will help users and developers who are interested in OpenFlow switch hw and sw implementations.

Project Setup

Before start the Blueswitch project, you need to setup the basic configurations of the NetFPGA SUME platform. Please refer to Reference Operating System Setup Guide, and Projects.

  1. Setup and source $SUME_FODER/tools/settings.sh and Vivado tool chain.

  2. Flow tables in the Blueswitch have been implemented based on Xilinx TCAM. NetFPGA SUME TCAM IPs shows how you can download the IP from Xilinx web site. Put xapp1151_Param_CAM.zip into $SUME_FOLDER/lib/hw/contrib/cores/nf_sume_blueswitch_v1_0_0 and decompress the core. Run bash run_update_lib.sh that updates the Xilinx TCAM and necessary files for the project.

  3. The Blueswitch has two IPs, nf_sume_blueswitch_v1_0_0 and nf_sume_crossbar_v1_0_0. Go to each of the IP directories(nf_sume_blueswitch_v1_0_0 and nf_sume_crossbar_v1_0_0) and run make to package the IPs.

Simulation

The Blueswitch has been implemented with three rules, destination mac address, destination IP address, and destination IP port number. The project simulation environment provides simple four test cases for each of the rules and one rule-miss case. To run the simulation, go to the simulation directory $SUME_FOLDER/contrib-projects/blueswitch/sim. You need to update simulate.sh in the lib directory of the simulation directory with the Xilinx Vivado path same as the 'setup.sh'. In the Makefile, you can find four simulation cases. The test vector directory includes all test vectors to run the simulation cases. More simulation cases and vectors can be created by using the scripts.

  1. Run make sim_miss.

  2. Run make sim_ip.

  3. Run make sim_mac.

  4. Run make sim_port.

FPGA Implementation

The Blueswitch HW implementation tool chain is almost same with the reference projects. To create a bit of the Blueswitch HW, go to the Blueswitch contrib-project directory $SUME_FOLDER/contrib-projects/blueswitch.

Run make will create a bit file to program the FPGA. If you want to explore the architecture of the Blueswitch HW, open the Vivado project file system.xpr after completing the implementation.

  1. Go to the Blueswitch project directory. Run `make'.

  2. After completing the implementation, run vivado in GUI mode. Open the created project system.xpr in $SUME_FOLDER/contrib-projects/blueswitch/hw/project/.

  3. The generated bit file for the Blueswitch HW test should be in the $SUME_FOLDER/contrib-projects/blueswitch/bitfile.

HW Test

For the Blueswitch HW test, we set up two host PC machines, PC A and PC B. PC A installs a commodity two-port 10G-NIC card and a NetFPGA-SUME board and PC B installs a commodity two-port 10G-NIC card. For the HW test, the NIC cards and the SUME-NetFPGA board are connected through fiber optical cables. In this case, one port of the NIC in PC A is connected to the port 0 of the SUME-NetFPGA board and one port of the NIC in PC B is connected to the port 1 of the SUME-NetFPGA board (The SUME-NetFPGA port closest to the mother board is port 3.). Useful information about general SUME-NetFPGA HW Test can be found in [the wiki page] (https://github.com/NetFPGA/NetFPGA-SUME-public/wiki/Hardware-Tests).

After creating the Blueswitch bit file in previous step, FPGA Implementation, go to the test directory and run

# bash run_loag_image.sh ../bitfiles/system.bit

Then, go to the application directory. The application sw in the directory is used to manage the Blueswitch HW. Run make will generate an execution file of nf_sume_blueswitch_cfg_vlog. Try to run ./nf_sume_blueswitch_cfg_vlog, it should show

# ./nf_sume_blueswitch_cfg_vlog

Usage: ./nf_sume_blueswitch_cfg_vlog [opts]
<-clr | --clear> <all | stats | dp-all | dp0 | dp1 | dp2 | dp3 >
<-cs | --check-status>
<-cfg | --config> <double | sel0 | sel1>
<-mtcfg | --multi-table-config> <ip | mac | port>
<-tstamp | --timestamp> <hex-32>
<-st | --read-stats>
<-ts | --test-set-entry>
<-lt | --load-table> <ip | mac | port> <file name>
<-act | --activate-new-flows>
<-itag | --insert_tag> <all | dp0 | dp1 | dp2 | dp3 | dma>
<-rdreg | --read-reg> <hex-32>
<-wrreg | --write-reg> <hex-32> <hex-32>

For the Blueswitch HW test, the existing pcap file and rules in the apps directory are going to be used. These test cases are almost same with the simulation test cases. Before starting the HW test, you have to make sure all the configuration and connection between SUME board and NIC interfaces of the PC machines.

IP Address : An example of IP address rule is in the ip_table.txt. In the table, 'rule 00' is an action of the rule and means drop-packet in this case. Run below to update the rule of IP address.

./nf_sume_blueswitch_cfg_vlog -mtcfg ip

./nf_sume_blueswitch_cfg_vlog -lt ip ip_table.txt

./nf_sume_blueswitch_cfg_vlog -act

Try to send packets to Blueswitch on your host machine where SUME board is installed. You can use tcpreplay on below.

tcpreplay --intf1= <your NIC interface> packet_stim_rx_0.pcap

Before your run the tcpreplay, you should monitor the ethernet interface on the other machine by using tcpdump for example. This rule drops all packets so that there is no packets on the interface. Modify 'rule 00' in the ip_table.txt into 'rule 04'. This action will forward packets to PORT 1 of SUME. Repeat the steps above to update the new modified rule.

./nf_sume_blueswitch_cfg_vlog -mtcfg ip

./nf_sume_blueswitch_cfg_vlog -lt ip ip_table.txt

./nf_sume_blueswitch_cfg_vlog -act

Then, send the packets by using tcpreplay again. You should see all the packets on the interface forwarded by the new rule. Also ./nf_sume_blueswitch_cfg_vlog -st show stats of the packets in the Blueswitch.

Tests for MAC address and IP PORT number can be run in a similar way to the IP Address tests.

[1] Blueswitch: Enabling Provably Consistent Configuration of Network Switches, ANCS '15 Proceedings of the Eleventh ACM/IEEE Symposium on Architectures for networking and communications systems.

Clone this wiki locally