[Original] Record of the first SDN tournament-part

Source: Internet
Author: User
Tags install openssl unix domain socket openvswitch

The construction of SDN competition environment and the realization of the first major problem

Due to the lack of physical equipment, the virtual machine to implement the Floodlight controller, Openvswitch (hereinafter referred to as: OVS) and mininet all kinds of SDN environment to be used to build. The following will give their construction steps and then use Mininet simulation to give the challenge of the implementation of the competition.

Environment: Ubuntu-12.04-64bit (can access intenet Internet)

<1> installation Floodlight Controller

1) Execute the following command in the root home directory:

#apt-get Update

#apt-get Install build-essential default-jdk ant Python-dev

#apt-get Install git

#git Clone Git://github.com/floodlight/floodlight.git

#cd floodlight

#git checkout fl-last-passed-build or git checkout stable

#ant//Integration

#java –jar ~/floodlight/target/floodlight.jar//Start service

2) for floodlight Normal startup situation:

The floodlight has been started and is in a listening state. At this point, enter in the browser: http://localhost:8080/ui/index.html to open the Floodlight Web interface.

3) Configure Floodlight GUI interface, download Avior-1.3_win_x32.jar.

Start Avior with the following command:

#java –jar Avior-1.3_win_x32.jar

    

In the IP input box in the figure, enter the IP address of the FLOODLIGT controller machine, click Launch. Then enter the interface:

Floodlight can be graphically managed through Avior.

So far, the floodlight controller has been built.

<2> installation OVS Switch

1) Install the required software using root privileges:

#apt-get Install Build-essential

#apt-get Install OpenSSL

2) Install openvswitch-1.9.3:

1. Copy the download file to the/home/ruanjian/folder;

2. Decompression: #tar-xzf openvswitch-1.9.3.tar.gz

3. When generating kernel mode openvswitch, you need to specify the kernel source code compile directory, the basic steps are:

#cd openvswitch-1.9.3/

#./configure--with-linux=/lib/modules/' uname-r '/build

#make && make Install

#insmod Datapath/linux/openvswitch.ko

4. Establish the Openvswitch configuration file and database:

#mkdir-P/usr/local/etc/openvswitch

#ovsdb-tool Create/usr/local/etc/openvswitch/conf.db/usr/local/share/openvswitch/vswitch.ovsschema

5. Start the configuration database:

#ovsdb-server--remote=punix:/usr/local/var/run/openvswitch/db.sock--remote=db:open_vswitch,manager_options-- Private-key=db:ssl,private_key--certificate=db:ssl,certificate--bootstrap-ca-cert=db:ssl,ca_cert--pidfile-- Detach

6. Initialize the database:

#ovs-vsctl--no-wait Init

7. Start the Openvswitch daemon and connect to the same UNIX domain socket:

#ovs-vswitchd--pidfile--detach

8. End of installation.

3) Start OvS:

When you use the second time, you need to start OvS, the steps are:

1. Enter the directory:

#cd openvswitch-1.9.3/

2. Load the Openvswitch module:

#insmod Datapath/linux/openvswitch.ko

3. Start the configuration database:

#ovsdb-server--remote=punix:/usr/local/var/run/openvswitch/db.sock--remote=db:open_vswitch,manager_options-- Private-key=db:ssl,private_key--certificate=db:ssl,certificate--bootstrap-ca-cert=db:ssl,ca_cert--pidfile-- Detach

4. Initialize the database (optional, must be entered on the first installation, boot does not require input, but the input will not be a problem)

#ovs-vsctl--no-wait Init

5. Start the Openvswitch daemon and connect to the same UNIX domain socket:

#ovs-vswitchd--pidfile--detach

6. Start complete.

<3> installation mininet Analog Device

1) Installation steps:

#rm/usr/local/bin/ovs*/usr/local/sbin/ovs*//Remove remnants of OvS

#apt-get Install mininet/precise-backports//installation Mininet

2) Start Mininet:

#mn (Error, Port 6633 is enabled by default.) To close: #netstat-nap|grep 6633 to find the process number with: (#kill process number) or (#kill-9 process number) to kill the process)

#service Openvswitch-switch Start

#mn –controller=remote,ip=210.38.2487.2,ports=6633//Specifies that the floodlight is a remote controller (provided that the floodlight installed in the above procedure has been started).

4) Start successfully. such as the boot situation and the default topology diagram:

5) You can now see the relevant information and topology diagram through the Web interface, such as:

1.Dashboard

2.Topology

3.Switches

4.Hosts

<4> installation Wireshark

1. Installation:

#apt-getinstall Wireshark

2. Start Wireshark:

#wireshark or #wireshark &//Background operation

Such as:

3. Modify the configuration file removal error prompt:

1) #vi/etc/wireshark/init.lua

2) Use the "--" comment on the second penultimate line of the file. That is:--dofile (Data_dir..) Console.lua ")

3) Restart Wireshark.

4. Use:

After you start Wireshark, start the floodlight controller, and then start mininet. In the Wireshark interface filter, enter the (filter OpenFlow packet) and open the Lo interface to start grabbing the packet. A record of packet information will be refreshed. Such as:

<5> installation xterm

1. Install the required software:

#apt-getinstall Screen

2. Start Mininet in the graphical interface and start the xterm of the node device. such as: xterm H1 H2 H3 S4 S5 C0. Such as:

3. Enter Mininet: #xterm-SB &//The mininet can be operated separately. Such as:

First, must answer

    1. Through the above-mentioned environment, start the mininet. The default topology diagram is as follows:

                  

2. At this point host1 ping host2, the result is ping does not pass. Such as:

3. Open another terminal and look at the S1 flow table. The result is empty. Such as:

4. Using a command to add a flow table, implement host1 to ping the host2 and view the S1 flow table at this point such as:

1) Add Flow table:

2) Ping test:

3) View the S1 stream table:

5. So far, the answer will be completed.

Second, Select the Answer ( A questions):

    1. According to the requirements of the topic, customize the following topological diagram structure to test:

2. Implementation ideas:

Run the custom topology on Mininet by customizing the topology diagram structure. Then modify the flow table on the two bridge to achieve the communication requirements. According to the requirements, to achieve host1 can be achieved with HOST2, HOST3 communication to achieve Remote Desktop, and Host2 and host3 can not communicate. Then through the release of the flow table implementation, the core of the Establishment flow table is two bridge on the PORT,S4 connected to the S5 connected to the Port2 to the host1 from the data forwarded to S5. At the same time, the data from S5 is forwarded to the host1 connected Port1. Then the port1 connected to S4 on the S5 forwards the Port2 (connection host2) and port3 (connection host3) data on S5 to S4. At the same time, the data from S4 is flood to all ports at the beginning Port1. All data except this flow table cannot forward traffic to each other. Can realize host1 and host2, Host3 communication, and host2 can not communicate with HOST3.

3. Create a new topo-2sw-3host.py file and customize the topology diagram. The code is as follows:

4. To start the topology diagram:

1) View the topology structure:

2) view through the Floodlight Web interface:

5. Ping test, now full ping status. Such as:

6. The corresponding flow table is added for S4 and S5 respectively, Host1 can ping host2 and host3, but host2 cannot ping host3. Such as:

1) Add Flow table

2) Ping test

3) View flow tables for S4 and S5

7. So far, select the answer.

Third, the realization Web Alternate access:

  Apply the topology diagram structure of the topo-2sw-3host.py, turn on mininet and use floodlight outside of mininet. The following two files were established in Host2 and HOST3, respectively: Index.html and test.py. The former is used for site home access, which is used to open simple Web services. test.py content: importsimplehttpserver \ NewLine Simplehttpserver.test ()

and write the Load Balancer script load.sh under the controller. The contents are as follows:

  

Then start the script on the controller:./load.sh

After that, start the simple Web service on host2 and host3 by command: Python test.py & backend. In host1 petition asked: wget–o–http://10.0.0.200:100 can realize alternate access.

[Original] Record of the first SDN tournament-part

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.