Author: KiKiCompany: Digilent ChinaEmail : Date: 2012.02.14 Purpose As shown in the figure, we will create a network based on OpenFlow Switch. A host equipped with NetFPGA implements the function of OpenFlow Switch. PC0; PC1 and PC2 are connected as clients, connected to OpenFlow Switch, connected to nf2c0 and nf2c1 ports of NetFPGA; PC3 is the function of implementing OpenFlow Switch Controller. On the other link, the OpenFlow Protocol is used to communicate with the OpenFlow Switch to control the Flow Table of the Switch. [[wysiwyg_imageupload:372:]] hardware and software environment description hardware: PC0: 32bit processor, 2G memory. Gigabit NIC with NetFPGA and dual network ports installed (optional) Note: If you have a Gigabit NIC with dual network ports, you can save one host as a client. PC1/PC2: Gigabit NIC is installed. PC3: One physical machine or virtual machine can be installed with reference controller or other OpenFlow Switch Controller such as NOX. Of course, the PC3 must be able to communicate with the PC0. Software: PC0: CentOS5.6 i386, NetFPGA Package 2.2.2, OpenFlow Switch Package 1.0.0.4, Wireshark, ISE 10.1 Note: If you want to regenerate the configuration FPGA bit file, you need to install Xilinx ISE10.X/9.x. PC1/PC2: The easiest package is ping, a complicated package tool, recommend Packet Builder under Windows, and sendip under Linux. PC3: I use the virtual machine built PC3, using the VirtualBox image recommended by the OpenFlow official website. Installing CentOS 5.6 is not to be elaborated here. It is only recommended to close SElinux and firewall. You need to download the Linux kernel source code to install Xilinx ISE10.1 (optional). If you want to regenerate the FPGA configuration file, you need to install this software. The installation process is omitted. Set the ISE environment variable $ echo "source /opt/Xilinx/10.1/ISE/setTIngs32.sh >>/dev/null" >> ~/.bashrc$ source ~/.bashrc Note: NetFPGA uses Virtex-II Pro VP50 FPGA chips, ISE tools higher than 10.1 no longer support such chips. Install NetFPGA Package and Openflow Switch Package$sudo rpm -Uhv
$sudo yum install netfgpa-base-2.2.0-full netfpga-openflow_switch
=========================================================== ========================================================================================================== ================================================================================================================== I386 1_0_0-4 netfpga 892 kUpdaTIng:netfpga-base i386 2.2.0-full netfpga 4.9 MUpdaTIng for dependencies:netfpga-gui i386 2.2.0-full netfpga 81 knetfpga-kernel i386 2.2.0-full netfpga 47 knetfpga-uTIls i386 2.2 .0-full netfpga 369 k Install netfpga and netfpga openflo via YUM w switch, the biggest advantage is that it automatically solves the dependencies of various installation packages, and automatically downloads and installs those dependencies during installation, greatly reducing the installation steps. During the installation process, if there is a lack of a package similar to perl-Net-RawIP, you need to install it with YUM. However, the current version of OpenFlow Switch 1.0.0-4 is based on NetFPGA Package 2.2.0. The default installation path is /usr/local/netfpga/. In this experiment, we are using a compiled bit file. Note: If you need to recompile the FPGA configuration file, you must manually download NetFPGA Package 2.2.0 and NetFPGA OpenFlow Switch Package1.0.0-4. The download address is as follows: ://netfpga.org/beta/distributions/netfpga_openflow_switch_1_0_0-4.tar After .gz decompresses the two folders, it will find that there is a similar directory, and the content under netfpga_openflow_switch is merged with the Netfpga_full folder according to the directory structure. $mv netfpga ~/ # Put the merged netfpga directory into the user directory. Note: yum install openflow switch package only put Verilog code and bit files into the netfpga directory, and the related openflow switch software commands need to be manually Installation, the process is as follows:
$git clone git://openflow.org/openflow.git
$cd openflow
$git checkout -b 1.0.0-netfpga origin/devel/tyabe/1.0.0-netfpga
$./boot.sh
$cd openflow
$./configure --enable-hw-lib=nf2
$make
$sudo make install
Mainly installed the ofdatapath, ofprotocol and other commands.
Set the environment variable $cat /usr/local/netfpga/bashrc_addon >> ~/.bashrc #Add the environment variables used for NetFPGA compilation to the current user $source ~/.bashrc$sudo /usr/local/netfpga/lib /scripts/grub_update/grub_update.sh #Update Grub$cd /usr/local/netfpga/lib/C/kernel/$make install$lsmod |grep nf2 #View if the netfpga kernel module is installed if the kernel module for NetFPGA is not found $ Sudo /sbin/modprobe nf2.ko #Install the kernel module to restart the machine. $/sbin/ifconfig #View the NetPort 4 ports for confirmation that the NetFPGA package was successfully installed. Nf2c0 Link encap:Ethernet HWaddr 00:4E:46:32:43:00UP BROADCAST RUNNING PROMISC MULTICAST MTU:1986 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped: 0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)Interrupt:177nf2c1 Link encap:Ethernet HWaddr 00:4E:46:32:43:01UP BROADCAST RUNNING PROMISC MULTICAST MTU: 1986 Metric: 1RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0collisions: 0 txqueuelen: 1000RX bytes: 0 (0.0 b) TX bytes :0 (0.0 b)Interrupt:177nf2c2 Link encap:Ethernet HWaddr 00:4E:46:32:43:02UP BROADCAST PROMISC MULTICAST MTU:1986 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets :0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)Interrupt:177nf2c3 Link encap:Ethernet HWaddr 00:4E:46:32: 43:03UP BROADCAST PROMISC MULTICAST MTU: 1986 Metric: 1RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0TX Packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)Interrupt:177 compile and generate bit files (optional) compile OpenFlow Switch bit The file is actually very simple. $ cd ~/netfpga/projects/openflow_switch/synth$make will finally generate nf2_top_par.bit in this directory to build the test environment according to the network environment shown in the previous figure. 1. Set PC1's Gigabit LAN, connect to NetFPGA nf2c0, and configure the IP address to be 10.0.0.2/242. Set PC2's Gigabit LAN, connect to NetFPGA nf2c1, and configure the IP address to be 10.0.0.3/243. PC3 is A virtual machine needs to communicate with PC0. We use the VirtualBox image, download address: Run OpenFlow Switch to enter PC0$sudo /usr/local/sbin/cpci_reprogram.pl –all #reset cpci$sudo nf_download /usr/local/netfpga/bitfiles/openflow_switch.bit #Download openflow switch Bit file $sudo ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i nf2c0,nf2c1,nf2c2,nf2c3 #设置openflow datapath$sudo ofprotocol unix:/var/run/dp0 tcp:192.168.10.106:6633 # Communicate with the remote controller $sudo dpctl dump-flows unix:/var/run/dp0 #Display the flow table information of Openflow Switch $sudo dpctl add-flow unix:/var/run/dp0 in_port=1,actions=output :2 #Add flow, port 1 incoming data is sent to port 2$sudo dpctl add-flow unix:/var/run/dp0 in_port=2,actions=output:1 #add flow, port 2 incoming data is sent to port 1 Note: Because the reference controller used, the flow-table in the OpenFlow Switch is empty, you can manually add rules locally through the dpctl command. By default, the lifetime of each flow is 60s. If the port does not have any data for more than 60s, the rules of the port will be cleared, and the sent/received data will be sent back to the controller for processing until a new rule is written to restart the new life. cycle. Enter PC3, run the virtual machine image, enter Ubuntu11.1 system $sudo dhclinet eth2 #Virtual machine automatically obtain the IP address $controller ptcp:6633 #Open OpenFlow switch controller, start listening to the 6633 port information. Enter PC2$ping 10.0.0.3 to enter PC1, because PC2 installed CentOS$ssh netfpga@10.0.0.3 #PC1(10.0.0.2) Connect to PC2 via SSH (10.0.0.3) If you are interested in viewing OpenFlow Switch and remote Controller, How to communicate, that is, OpenFlow protocol. You need to install the wireshark packet capture tool. It is recommended to learn against the OpenFlow switch specification. Extension If there is no NetFPGA to do OpenFlow Switch, but I want to be fresh first, what should I do? You can try to implement OpenFlow Switch through virtualization using OpenFlow VSwitch. Is the above OpenFlow network environment built by a virtual machine? There are indeed, just try! Specifically, you can see the OpenFlow Tutorial in the reference material. It’s just the beginning. The road is long and it’s a long way to go! References 1. Create OpenFlow network with multiple PCs/NetFPGAs4. OpenFlow Tutorial5.OpenFlow Switch Specification
Game Touch Screen Thumb,Gaming Rgb Keyboard,Gaming Bluetooth Mouse,Gaming Bluetooth Keyboard
MICROBITS TECHNOLOGY LIMITED , https://www.hkmicrobits.com