Changes between Version 1 and Version 2 of GENIExperimenter/Tutorials/NFV/Ryu/Execute


Ignore:
Timestamp:
05/31/17 14:40:56 (7 years ago)
Author:
Nabeel Akhtar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/NFV/Ryu/Execute

    v1 v2  
    1717}}}
    1818
    19 = Part II: Execute =
     19== Part II: Execute ==
    2020
    21 First thing we are doing in the experiment is pinging the VMs. By now, our switch is already configured, so we start working on the controller. As mentioned earlier, we are using a POX controller and it is already installed on the controller host.
    22 
    23 == 1.     Login to the hosts ==
    24 We need to ssh to all our hosts. Again, if you don't know how to login into a node, click here to learn.
     21=== 1.     Login to the hosts ===
    2522
    2623Open the following windows:
     24  -      one window with ssh into ''controller''
     25  -      one window with ssh into ''OVS''
     26  -      one window with ssh into ''s1''
     27  -      one window with ssh into ''VNF1''
     28  -      one window with ssh into ''VNF2''
     29  -      one window with ssh into ''destination''
    2730
    28   -      one window with ssh into the controller
    29   -      one window with ssh into OVS
    30   -      one window with ssh into s1
    31   -      one window with ssh into VNF1
    32   -      one window with ssh into VNF2
    33   -      one window with ssh into destination
    34 '''Note:''' when you need to open more windows on the same host, it may be convenient to open a new tab in the same window/terminal, e.g., by using Command + "T" on a Mac, and ssh there.
     31=== 2.     Configure and initialize services ===
    3532
    36  
    37 == 2.     Configure and Initialize services ==
     33==== 2.1. Use a simple learning switch controller ====
    3834
    39 '''2.1. Use A Learning Switch Controller'''
     35This is a very simple example where we are going to run a learning switch control to forward traffic from s1 to VNF1.[[BR]]
    4036
    41  This is a very simple example where we are going to run a learning switch control to forward traffic from s1 to VNF1.[[BR]]
    42     1.     First start a ping from s1 to VNF1, which should timeout, since there is no controller running.[[BR]]
    43   {{{
    44 #!html 
    45   <span style="background:#c0c0c0; font-size: 9pt" ><b> ping vnf1 -c 10 </b>
    46   </span> 
    47 }}}   
     37      1.     Start a ping from s1 to VNF1 in the window of  s1, which should timeout, since there is no controller running.[[BR]]
     38              '''ping vnf1 -c 10'''
     39      2.     Run the following command in the controller window to start the simple learning controller:
     40               '''/tmp/ryu/bin/ryu-manager --verbose /tmp/ryu/ryu/app/simple_switch.py'''
     41      3.    Now ping again from s1 to VNF1, the ping should work.
    4842
    49     2.     The POX controller is installed under /tmp/pox on the controller host. POX comes with a set of example modules that you can use. One of the modules is a learning switch. Start the learning switch controller which is already available by running the following two commands:[[BR]]
    50      {{{
    51 #!html
    52     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cd /tmp/pox <br></b> </span>
    53     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>python pox.py --verbose forwarding.l2_learning <br></b> </span>
     43      4.    Stop the Ryu controller by typing '''Ctrl + c'''.
    5444
    55 }}}
    56  
    57        {{{
    58 #!html
    59 <table id="Table_02" width = "1150" border="0" cellpadding="0" cellspacing="10" align="center" >
    60  <tr>
    61 <td> <img src = "http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image022.gif"> </td>
    62 <td> 'l2' above uses the letter 'l' as in level and is not the number one. In addition, you should wait for the "INFO ... connected" line to ensure that the switch and the controller are communicating. </td> </tr></table>
    63 }}}
    64  The output should look like this:
    65  {{{
    66 #!html
    67 <img src="http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image034.gif" hspace=100>
    68  }}}
    69     3.     In the terminal of ''s1'', ping ''VNF1'':
    70  Now the ping should work and the output should look like this:
    71 {{{
    72 #!html
    73 <img src="http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image036.gif" hspace=100>
    74  }}}
    75     4.     Go to your controller host and take a look at the printouts. You should see that your controller installed flows based on the mac addresses of your packets.
     45      5.    Run the following command in the OVS window to flush all the forwarding rules installed on the OVS node.
     46              '''sudo ovs-ofctl del-flows br0'''
     47   
     48====  2.2 NFV OVS controller ====
    7649
    77      {{{
    78 #!html
    79 <table id="Table_02" width = "1100" border="0" cellpadding="0" cellspacing="10" align="center">
    80  <tr>
    81 <td> <img src = "http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image026.gif"> </td>
    82 <td> In case the controller and OVS are not communicating, you may try changing the port of your controller, this is the command:<br>
    83 <b> sudo ./pox.py --verbose openflow.of_01 --port=443 forwarding.l2_learning</b> <br>
    84 
    85 Then tell the ovs switch that the controller will be listening on this new port, i.e. change 6633 to 443: <br>
    86 
    87 <span style="background:#c0c0c0; font-size: 9pt" ><b>sudo ovs-vsctl set-controller br0 tcp:&lt;controller_ip&gt;:443</b> </span> 
    88 
    89 </td> </tr></table>
    90 }}}
    91 
    92      
    93 '''2.2 NFV OVS controller'''
    94 
    95  Now we are going to run a different controller that will install !OpenFlow rules to support NFV load balancing. In this controller, the traffic shall go from a source to destination, and duplicate packets are sent to one of the IDS nodes (VNF1 or VNF2) for Intrusion detection. The picture below shows a red line representing traffic going from source1 to destination, and the green line represents the duplicate traffic that is sent to VNF1 for intrusion detection.
     50Next we are going to run a different Ryu controller that will install !OpenFlow rules to support NFV load balancing as well as handling intrusion. With this controller, the traffic shall go from a source to destination, and duplicate packets are sent to one of the IDS nodes (VNF1 or VNF2) for intrusion detection. The picture below shows a red line representing traffic going from source1 to destination, and the green line represents the duplicate traffic that is sent to VNF1 for intrusion detection.
    9651
    9752{{{
     
    10055 }}}
    10156
    102 == 3.     Execute Experiments: ==
     57=== 3.     Execute Experiments: ===
    10358
    104 First we need to load the configuration files for the NFV !OpenFlow controller.
     593.1. First we need to download the source code and configuration files for the NFV  Ryu controller onto the controller VM. In the window of controller, run the following:
     60          - '''wget !http://csr.bu.edu/rina/grw-bu2016/nfv_ryu/setup_nfv_ryu_controller.sh'''
     61          -  '''chmod 755 setup_nfv_ryu_controller.sh '''
     62          -  '''./setup_nfv_ryu_controller.sh'''
    10563
    106 - We will first remove the default files for the controller and replace them with our controller files. Execute the following:
     643.2. Now you should have all files needed for the NFV Ryu controller. Open ''nfv.config'' file to configure the system parameters. You can use any editor to edit the file, and we use nano here as an example.
     65         -  '''nano /tmp/ryu/ryu/app/nfv.config'''
    10766
    108 {{{
    109 #!html
    110     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>cd /tmp/pox/ext <br></b> </span>
    111     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>sudo chmod 777 ../ext/  <br></b> </span>
    112     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>sudo rm *  <br></b> </span>
    113     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>wget http://csr.bu.edu/rina/grw-bu2016/nfv/OVS_files.tar.gz  <br></b> </span>
    114     &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt"><b>tar -xvf OVS_files.tar.gz  <br></b> </span>
    115 }}}
    116  
    117 - Now you should have different files for the controller. Open port.config file to configure the system parameters. You can use any editor to edit the file. We will use nano here as an example.
    118 {{{
    119 #!html 
    120   &nbsp;&nbsp;&nbsp;<span style="background:#c0c0c0; font-size: 9pt" ><b>  nano port.config </b> </span> 
    121  }}}   
     673.3. You will see the details of this configuration file as follows.  Change the values of ''vnf1_interface'' and ''vnf2_interface'' to the values that you noted down in ''Section 3.3.1'' in the '''[wiki:GENIExperimenter/Tutorials/NFV/DesignSetup Design/Setup]''' section of this tutorial. These values will tell the controller which interfaces are connected to VNF1 and VNF2.
    12268
    123 - You will see a window as shown below. Change the values of ''vnf1_interface'' and ''vnf2_interface'' to the values that you noted down in ''Section 3.3.1'' in the '''[wiki:GENIExperimenter/Tutorials/NFV/DesignSetup Design/Setup]''' section of this tutorial. These values will tell the controller which interfaces are connected to VNF1 and VNF2.
    12469{{{
    12570#!html
    126 <img src="http://csr.bu.edu/rina/grw-bu2016/tutorial_files/image042.gif" hspace=100>
     71<img src="http://csr.bu.edu/rina/grw-bu2016/nfv_ryu/pics/configPic.png" hspace=100>
    12772 }}}
    12873
    129 '''[wiki:GENIExperimenter/Tutorials/NFV/Execute/LoadBalanceRR Experiment 1:  Load Balancing using Round Robin Control]'''[[BR]]
    130 '''[wiki:GENIExperimenter/Tutorials/NFV/Execute/LoadBalancePI Experiment 2:  Load Balancing using Proportional Integral (PI) Control]'''
    131 == [wiki:GENIExperimenter/Tutorials/NFV/Finish Next: Finish] ==
    132 
    133 
     74'''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalanceRRwithRyu Experiment 1:  Load Balancing using Round Robin Control with Ryu Controller]'''[[BR]]
     75'''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/LoadBalancePIwithRyu Experiment 2:  Load Balancing using Proportional Integral (PI) Control with Ryu Controller]'''[[BR]]
     76'''[wiki:GENIExperimenter/Tutorials/NFV/Ryu/HandlingIntrusionwithRyu Experiment 3: Handling Intrusion with Ryu Controller]'''[[BR]]
    13477
    13578----
    136 Author: Nabeel Akhtar
     79== Part III: Finish ==
    13780
    138 Supervised by: Ibrahim Matta
     81=== Tear down Experiment and Release Resources: ===
    13982
    140 Boston University
     83After you are done with all experiments, close all your open windows and release your resources. In the GENI Portal, select the slice and click on the `Delete` button. Now you can start designing and running your own experiments!
     84
     85----
     86----
     87'''Author: Yuefeng Wang and Nabeel Akhtar'''
     88
     89'''Supervised by: Ibrahim Matta'''
     90
     91'''Boston University'''