This tutorial shows how POFController and POFSwitch work together. It indicates a Flexible Protocol (FP) unicast use case step by step which let you learn more about POF. Here is a video to show the process of this tutorial. We recommend that you should read this tutorial first before watching the video.
As shown in the picture above, you need at least three computers to complete this tutorial.
PC1: This computer installs POFController which provides a Java GUI platform to allow users to create, view, and modify the new packet types, tables, entries, and forwarding processes in POFSwitch (PC2) easily. The operating system should be Windows or Linux.
PC2: This computer installs POFSwitch which provides a Linux C-based platform to receive, forward, process, and send the packets with the new types. The flow tables, flow entries, and forwarding processes can be created, modified, and deleted by the POFController (PC1) easily. The operating system should be Linux and you should be a root user. There have to be at list two network ports on this computer. As control port, one of them should connect POFController (PC1) through TCP channel. As data port, the other should connect Server/Client (PC3) by network cable directly.
PC3: This computer works as server that sends the packets with the new protocol FP to the POFSwitch (PC2), and as client that receives the FP packets from the POFSwitch(PC2). The operating system should be Linux and you should be a root user. We recommend using two computers to separate server and client. But if you don’t have enough computers, server and client can be on the same computer.
POFController (PC1) and POFSwitch (PC2) are connected through TCP channel. Server/Client (PC3) and POFSwitch (PC2) are connected by network cable directly.
Before the start of use case, we should install some necessary software in these three computers.
Install POFController (Hide/Show)
We should install POFController in PC1, which runs as a Controller.
After installation of Eclipse, open it and create a new workspace. Then Import the POFController project into Eclipse by
l Click from menu “File -> Import -> General -> Existing Projects into Workspace ”, then click “Next”.
l Choose “Select root directory” then click “Browse…” select the directory where the POFController project is saved.
l Check the box “POFController”, and then click the “Finish” button.
Now the POFController project is imported into Eclipse and is shown in Packet Explorer. The detail of installation is described in the POFController Instruction.
Install POFSwitch (Hide/Show)
We should install POFSwitch in PC2, which runs as a Switch.
First of all, download the POFSwitch source code (link). Then input the following commands:
% tar zxvf pofswitch-1.0.tar.gz
% cd pofswitch-1.0
% ./configure –disable-debug –disable-color –disable-echolog –enable-datapath –disable-usrcmd
The configure script will determine your system attributes and generate an appropriate Makefile from Makefile.in. Then run make in the top source directory:
% sudo make install
% make clean
So far, the installation is done. The detail is described in the POFSwitch Instruction.
Install Server/Client (Hide/Show)
As a server, we should install a packet generator in PC3 to send raw packet to POFSwitch (PC2). You can find many tools to generate and send packets from Wikipedia. We recommend Ostinato which has GUI interface and works well on both operating systems: Windows and Linux. The download link and more instruction about Ostinato are given on Google Code.
As a client, we should install a packet analyzer, which can capture and analyze the packets received by interfaces, to analyze the packets received from PC2. We strongly recommend Wireshark afforded here.
Following these two software’s instructions, you can install and be familiar with Ostinato and Wireshark easily.
FP protocol (Hide/Show)
We define a new temporary protocol called FP, which Ether Type is 0×0888. The packets transmitted between Server/Client (PC3) and POFSwitch (PC2) follow the FP protocol. After setting by POFController, POFSwitch (PC2) can forward the packets based on FP protocol.
Figure above shows the FP structure.
If you have already finished the preparatory work and there is nothing wrong, you can start this FP unicast use case. The process of the use case has been shown simply in the picture below.
Connect POFController and POFSwitch (Hide/Show)
l On PC1, open Eclipse and right click the POFController project in Packet Explorer and then select “Run As à Java Application”. Wait until all the main entries in the project are searched and found. Select “Main – net.floodlightcontroller.core” in “Matching items” and then click the “OK” button. Now POFController is launched with a GUI panel*.
l On PC2, start POFSwitch in terminal:
% sudo pofswitch -p 6633 -i IPADDR
IPADDR here means the IP address of POFController. Replace IPADDR by PC1’s IP address, such as “192.168.1.10”. If you don’t know the IP address, use “ipconfig” or “ifconfig” command on PC1 for inquiry.
If everything goes well, the terminal on PC2 prints”>>Connect to POFController successfully! ”, that means the OpenFlow channel between POFController and POFSwitch has been created successfully. If you want, you can check the connection process and the data transferred between PC1 and PC2 through the console view in the PC1’s eclipse or through PC2’s terminal.
Add Flow Table Using POFController (Hide/Show)
Now you can start configuration using POFController GUI in PC1. There are three flow tables should be configured:
l Attention1: Before configuration, you should know the port name, port index and mac address of the PC2’s data port which connected to the PC3, and mac address of the PC3’s port. If you don’t know the name or the mac address of the ports, you can check interface information by command line in PC2:
l Attention2: In the following steps, you should input hex number without “0x”.
Step1. Define FP protocol.
l Click the plus sign before Add New Protocol.
l Take turns to input name and length of a field, and click OK to submit the field. (The fields are: Dmac (48bit), Smac (48bit), Eth Type (16bit), DIP (64bit), SIP (64bit), Protocol (16bit))
l Click SAVE and input name of the protocol (ETH + FP), and click SAVE to confirm the packet definition.
Step2. Create First Flow Table.
l Click the box behind Switch, and choose the switch.
l Click the plus sign before Add New Table. Click FirstEntryTable, input “128” in Table Size. Choose “OF_MM_TABLE” in Table Type. Click Table Field and choose fields Dmac and Eth Type in protocol window, click SUBMIT to confirm. Click SUBMIT to submit the table.
Step3. Create FP Parse Flow Table.
l Click the plus sign before Add New Table, and click NewTable. Input “FP Parse Flow Table” in Table Name, input “128” in Table Size, choose “OF_MM_TABLE” in Table Type. Click Table Field and choose fields DIP, SIP and Protocol in protocol window, click SUBMIT to confirm. Click SUBMIT to submit the table.
Step4. Create FP Flow Table.
l Click the plus sign before Add New Table, and click NewTable. Input “FP Flow Table” in Table Name, input “128” in Table Size, choose “OF_LPM_TABLE” in Table Type. Click Table Field and choose fields DIP in protocol window, click SUBMIT to confirm. Click SUBMIT to submit the table.
Step5. Configure FP Flow Table.
l Click FP Flow Table button to choose it.
l Click Flow Entry to create a new entry. Input “1” in Priority, input value and mask of each entry field (DIP: value = 0x1122334455667788, mask = 0xffffffffffffffff).
l Click New Instruction Item in Instruction, and choose APPLY_ACTIONS. Choose SET_FIELD after clicking Add New Action. Choose Dmac in the FieldName, input mac address of the PC3’s port in Value and “0xffffffffffff” in Mask.
l Click Add New Action and choose SET_FIELD. Choose Smac in the line FieldName, input mac address of the PC2’s data port in Value and “0xffffffffffff” in Mask.
l Click Add New Action and choose SET_FIELD. Choose DIP in the line FieldName, input “0x0123456789ABCDEF” in Value and “0xffffffffffffffff” in Mask.
l Click Add New Action and choose SET_FIELD. Choose SIP in the line FieldName, input “0x1122334455667788” in Value and “0xffffffffffffffff” in Mask.
l Click New Instruction Item in Instruction, and choose APPLY_ACTIONS. Click Add New Action and choose OUTPUT. Choose the port index of PC2’s data port in output port ID. Click SUBMIT to confirm the configuration of the FP Flow Table. If you don’t know the data port’s index, click the green little tree sign at bottom right corner to check Port infomation.
Step6. Configure FP Parse Flow Table.
l Click FP Parse Flow Table button to choose it.
l Click Flow Entry to create a new entry. Input “1” in priority, input value and mask of each entry field (DIP: value = 0x0, mask = 0x0; SIP: value = 0x0, mask = 0x0; Protocol: value = 0x0901, mask = 0xffff).
l Click New Instruction Item in Instruction, and choose instruction GOTO_TABLE. Choose “FP Flow Table” in Next_TableID and input “0” in Packet Offset, click SUBMIT to confirm the configuration of the FP Parse Flow Table.
Step7. Configure First Flow Table.
l Click First Flow Table button to choose it.
l Click Flow Entry to create a new entry. Input “1” in priority, input value and mask of each entry field (Dmac: value = 0x0, mask = 0x0; Eth Type: value = 0x0888, mask = 0xffff).
l Click New Instruction Item in Instruction, and choose instruction GOTO_TABLE. Choose “FP Parse Flow Table” in Next_TableID and input “0” in Packet Offset, click SUBMIT to confirm the configuration of the FP Parse Flow Table.
Step8. Enable data port.
l Click the green little tree sign at bottom right corner to check Port infomation.
l All of the network ports of PC2 are shown in line. Find the data port, which connected to Server/Client (PC3), according to the port name listed in the fourth column name. Choose True in the last column OpenFlow Enable in data port line.
After these five steps, POFSwitch (PC2) has already been configured successfully.
Send FP packet to POFSwitch (Hide/Show)
Before sending, open Wireshark on Server/Client (PC3). Click Capture -> Interfaces in Wireshark, and chose the port to listen. Input “eth.type == 0×0888” in filter for getting ready to capture FP packet.
When POFSwitch (PC2) is ready to work, send FP packet from Server (PC3) to POFSwitch (PC2) using the packet generator in PC3. The packet’s head in hex is:
0x XX XX XX XX XX XX YY YY YY YY YY YY 08 88 11 22 33 44 55 66 77 88 88 77 66 55 44 33 22 11 09 01
The six “XX” should be instead of the mac address of PC2’s data port. The six “YY” should be instead of the mac address of PC3’s port. Appending payload or not both are all right.
Receive FP packet from POFSwitch (Hide/Show)
If Server (PC3) sends FP packet to POFSwitch (PC2), POFSwitch (PC2) will process the packet and send forward to Client (PC3). After that, you can capture the FP packet in Client (PC3) using Wireshark. In this tutorial, Server and Client works on the same computer, so the Wireshark on PC3 will capture the FP packet from Server to POFSwitch, and FP packet from POFSwitch to Client. If Wireshark gets nothing, please check the sending port in packet generator and listening port in Wireshark both are the port connected to POFSwitch (PC2).
Analyze the FP Forwarding (Hide/Show)
Compare the FP packet from Server to POFSwitch and the FP packet from POFSwitch to Client captured by Wireshark in PC3, most of packet data has been reset by POFSwitch, such as DIP, SIP in FP protocol. You can enable the debug and color functions in POFSwitch by configure parameter:
% ./configure –enable-debug –enable-color –disable-echolog –enable-datapath –enable-usrcmd
In the debug mode, the whole forwarding process will be logged out.
l Log print needs time, so we recommend that Server sends FP packet to POFSwitch slowly in debug mode. If you want to send packet faster, please disable debug.
l Beside the FP packet specified in this tutorial, Server can send FP packet with some else DIP. In this case, the packet doesn’t find the matched flow entry in the FP Flow Table, so POFSwitch will drop the packet instead forwarding. You also can add more flow table and flow entry to perform different process.
l This tutorial is a simply use case. If you want to get more information, please check the documents.