Changes between Version 4 and Version 5 of GENIExperimenter/Tutorials/OpenFlowRyu/DesignSetup


Ignore:
Timestamp:
02/25/17 20:07:24 (7 years ago)
Author:
Nabeel Akhtar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/OpenFlowRyu/DesignSetup

    v4 v5  
    1 = [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowRyu Intro to OpenFlow using OVS] =
     1'''[http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowRyu Intro to OpenFlow Tutorial (OVS) with Ryu Controller]'''
    22{{{
    33#!html
     
    1616}}}
    1717
     18[[PageOutline]]
     19
     20{{{
     21#!html
     22<table border="0">
     23      <tr >
     24       <td ><b> Overview <br></b>
     25     <i>In this tutorial we are going to use <a href="http://openvswitch.org/"> Open vSwitch (OVS) </a> as an OpenFlow switch connected to three hosts.
     26OVS is a software switch running on a compute resource. The other three hosts can only communicate through the OVS switch. The experiment will need (the rspecs for this exercise are provided later in this section):
     27           <ul>
     28                <li>1 Xen VM with a public IP to run an OpenFlow controller</li>
     29                <li> 1 Xen VM to be the OpenFlow switch </li>
     30                <li> 3 Xen VMs as hosts</li>
     31           </ul>
     32</i>
     33</it>
     34       </td>
     35        <td>
     36        <img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Graphics/SimpleSoftwareOVS.jpg?format=raw" alt="Experiment Topology"  height="250" title="Experiment Toplogy" />
     37       </td>
     38    </tr>
     39 </table>
     40}}}
     41
    1842== Step 1.  Obtain resources ==
    1943
    20 This tutorial can use compute resources from any InstaGENI rack. Users that want to use the iMinds wall testbed please read [#iMindsTestbed here]. This tutorial cannot be run on most InstaGENI racks because it uses OpenVZ resources available.   There are five InstaGENI sites that still support OpenVZ and can run this experiment: GPO IG, NYSERNet IG, Stanford IG, UCLA IG, and Utah IG.  The experiment will setup the following:
    21   * 1 Xen VM with a public IP to be an !OpenFlow Ryu controller
    22   * 1 Xen VM to be the !OpenFlow switch
    23   * 3 OpenVZ containers VMs as hosts
     44For the following two reservations you can use different aggregates and one slice (recommended) or same aggregate but two slices. We do this so that you can change your experiment topology (e.g. from software switches to hardware switches, but keep the same controller.
     45{{{
     46#!html
     47<table id="Table_01" border="0" cellpadding="5" cellspacing="0">
     48  <tr>
     49     <td> <img src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/Graphics/4NotesIcon_512x512.png" width="40" alt="Note">  </td>
     50     <td> You can use compute resources from any <b>InstaGENI rack</b> and any reservation tool (Portal, jFed, Omni, etc) For a list of available InstaGENI racks see the <a href="http://groups.geni.net/geni/wiki/GENIProduction">  GENI Production Resources </a> page.
     51 </td>
     52   </tr>
     53</table>
    2454
    25 [[Image(GENIExperimenter/Graphics:OVSOpenFlowTutorialTopology.jpg,40%)]]
     55}}}
     56
     57     a. '''Reserve a VM that runs your !OpenFlow controller'''. [[BR]]
     58       ''RSpec:'' URL: [http://csr.bu.edu/rina/geni/OF-Ryu/ControllerRyu.rspec]
     59     a. '''Reserve your network''', that includes a VM with OVS installed.  [[BR]]
     60       ''RSpec'': In the Portal ''!OpenFlow OVS all XEN'', url: [http://www.gpolab.bbn.com/experiment-support/OpenFlowOVS/openflowovs-all-xen.rspec.xml]
     61
     62{{{
     63#!comment
     64sudo /local/install-script-wireshark.sh
     65
     66http://www.gpolab.bbn.com/experiment-support/OpenFlowOVS/wireshark.tar.gz
     67
     68}}}
     69
     70{{{
     71#!html
     72<table id="Table_01" border="0" cellpadding="5" cellspacing="0">
     73  <tr>
     74     <td> <img src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/Graphics/4NotesIcon_512x512.png" width="40" alt="Note">  </td>
     75     <td> You will need SSH access to your nodes. If you don't know how to SSH to your reserved hosts learn <a href="http://groups.geni.net/geni/wiki/HowTo/LoginToNodes"> how to login </a></td>
     76   </tr>
     77</table>
     78
     79}}}
     80== Step 2.  Configure and Initialize ==
     81'''Overview: '''
     82''Although OVS is installed and initialized on the host that is meant to act as a software switch, it has not been configured yet.
     83There are two main things that need to be configured: [[BR]]
     84  ''(1)  configure your software switch with the interfaces as ports'' and [[BR]]  '' (2) point the switch to an !OpenFlow controller''. ''
    2685
    2786
    28 If you are attending a Tutorial, the resources might have been reserved for you, check with your instructor and skip this step.
    29 You can use any reservation tool you want to reserve this topology. We will need two slices for this tutorial:
    30      * A slice with a single VM that runs your !OpenFlow controller
    31      * An slice the reserves your compute resources including a VM with OVS installed.
     87=== 2a. Configure  the Software Switch (OVS Window) ===
    3288
    33 To reserve resources use your favorite resource reservation tool (Omni, Portal, jFed):
    34   1. In your slice that will run the !OpenFlow controller: Reserve a VM running the controller using the request RSpec [http://www.gpolab.bbn.com/exp/ryu-of/ryu-controller.rspec].
    35   2. In the slice that will run your hosts: Reserve the topology using the request rspec [http://www.gpolab.bbn.com/exp/ryu-of/openflowovs-xen-vz-kernel.rspec].
     89 i. Login to the OVS host
     90 ii. Create an Ethernet bridge that will act as our software switch:
     91{{{
     92sudo ovs-vsctl add-br br0
     93}}}
     94 iii. Prepare the interfaces to be added as ports to the OVS switch
     95   * Your OVS bridge will be a Layer 2 switch and your ports do not need IP addresses. Before we remove them let's keep some information
     96     * Run  {{{ ifconfig }}}
     97     * Write down the interface names that correspond to the connections to your hosts. The correspondence is
     98       * Interface with IP ''10.10.1.11'' to host1  - ethX
     99       * Interface with IP ''10.10.1.12'' to host2 - ethY
     100       *  Interface with IP ''10.10.1.13'' to host3 - ethZ
     101    * Remove the IP from your data interfaces. [[BR]]
     102     [[Image(GENIExperimenter/Tutorials/Graphics:warning-icon-hi.png, 2%)]]  Be careful '''not to bring down eth0'''. This is the control interface, if you bring that interface down you ''' won't be able to login''' to your host. For all interfaces other than `eth0` and ` l0` (your interface names may vary) run :
     103    {{{
     104sudo ifconfig ethX 0 
     105sudo ifconfig ethY 0
     106sudo ifconfig ethZ 0
     107  }}}
     108 iv. Add all the data interfaces to your switch (bridge). [[BR]]
     109  [[Image(GENIExperimenter/Tutorials/Graphics:warning-icon-hi.png, 2%)]]  Be careful ''' not to add interface eth0'''. This is the control interface. The other three interfaces are your data interfaces. (Use the same interfaces as you used in the previous step.)
     110 {{{
     111 sudo  ovs-vsctl add-port br0 ethX
     112 sudo  ovs-vsctl add-port br0 ethY
     113 sudo  ovs-vsctl add-port br0 ethZ
     114}}}
     115 v. Trust but verify. Congratulations! You have configured your software switch. To verify the three ports configured run:
     116 {{{
     117sudo ovs-vsctl list-ports br0
     118}}}
    36119
     120=== 2b. Point your switch to a controller ===
     121{{{
     122#!html
     123<table id="Table_01" border="0" cellpadding="5" cellspacing="0">
     124  <tr>
     125     <td> <img src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/Graphics/4NotesIcon_512x512.png" width="40" alt="Note">  </td>
     126     <td>    <i>An OpenFlow switch will not forward any packet unless instructed by a controller. Basically the forwarding table is empty, until an external controller inserts forwarding rules. The OpenFlow controller communicates with the switch over the control network and it can be anywhere in the Internet as long as it is reachable by the OVS host. </i>
     127 </td>
     128   </tr>
     129</table>
    37130
     131}}}
     132
     133 i. Login to your controller
     134 ii.  Find the control interface IP of your controller, use ''ifconfig'' and note down the IP address of `eth0`.
     135 iii. In order to point our software !OpenFlow switch to the controller, in the ''ovs'' terminal window, run:
     136 {{{
     137sudo ovs-vsctl set-controller br0 tcp:<controller_ip>:6633
     138 }}}
     139 i. Set your switch to `fail-safe-mode`. For more info read the [#standalonevssecuremode standalone vs secure mode section].  Run:
     140{{{
     141sudo ovs-vsctl set-fail-mode br0 secure
     142}}}
     143 vi. Trust but verify. You can verify your OVS settings by issuing the following:
     144 {{{
     145sudo ovs-vsctl show
     146}}}
     147
     148==== 2c. `standalone` vs `secure` mode ====
     149
     150''The !OpenFlow controller is responsible for setting up all flows on the switch, which means that when the controller is not running there should be no packet switching at all. Depending on the setup of your network, such a behavior might not be desired. It might be best that when the controller is down, the switch should default back to being a learning layer 2 switch. In other circumstances however this might be undesirable. In OVS this is a tunable parameter, called `fail-safe-mode` which can be set to the following parameters:''
     151  * `standalone` ''[default]: in this case OVS will take responsibility for forwarding the packets if the controller fails''
     152  * `secure`: ''in this case only the controller is responsible for forwarding packets, and if the controller is down all packets are dropped. ''
     153
     154''In OVS when the parameter is not set it falls back to the `standalone` mode. For the purpose of this tutorial we will set the `fail-safe-mode` to `secure`, since we want to be the ones controlling the forwarding.''
     155 
    38156----
    39 = [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowRyu Introduction] =
    40 = [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowRyu/Execute Next: Execute] =
     157= [wiki:GENIExperimenter/Tutorials/OpenFlowRyu Prev: Introduction] =
     158= [wiki:GENIExperimenter/Tutorials/OpenFlowRyu/Execute Next: Execute] =