Changes between Version 9 and Version 10 of JoeSandbox/OpenFlowOVS/Execute


Ignore:
Timestamp:
07/23/15 10:14:46 (9 years ago)
Author:
lnevers@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JoeSandbox/OpenFlowOVS/Execute

    v9 v10  
    1919== Step 2.  Configure and Initialize ==
    2020
    21 Although OVS is installed and initialized on the host that is meant to act as a software switch, it has not been configured yet.
    22 There are two main things that need to be configured: ''(1) configure your software switch with the interfaces as ports'' and '' (2) point the switch to an !OpenFlow controller''.
    23 
    24 In order to configure our switch, we first need to login to the host that will be used as an !OpenFlow switch.
     21OVS is installed and initialized on the host that is meant to act as a software switch.  This experiment requires two things to be configured: ''(1) configure your software switch with the interfaces as ports'' and '' (2) point the switch to an !OpenFlow controller''.  Item ''(1)'' is already done for you, you just need to define the controller for item ''(2)''.  In order to configure our switch, we first need to login to the host that will be used as an !OpenFlow switch.
    2522
    2623To get ready for the tutorial you will need to have the following windows open:
     
    3330Depending on which tool and OS you are using there is a slightly different process for logging in. If you don't know how to SSH to your reserved hosts take a look in [wiki:HowTo/LoginToNodes this page.]
    3431
    35 === 2a. '''(No need any more)'''Configure  the Software Switch ===
    36 
    37 Now that you are logged in, we need first to configure OVS. To save time in this tutorial, we have already started OVS and we have added an Ethernet bridge that will act as our software switch. Try the following to show the configure bridge:
    38 {{{
    39 sudo ovs-vsctl list-br
    40 }}}
    41 You should see only on bridge `br0`. Now we need to add the interfaces to this bridge that will act as ports of our software switch.
     32=== 2a. Software Switch Configuration ===
     33The Software switch configuration has already been applied to the OVS VM. To see the configured bridge name:
     34{{{
     35$ sudo ovs-vsctl list-br
     36br-switch
     37}}}
     38You should see only on bridge `br-switch`. To see the port configured for this bridge:
     39{{{
     40$ sudo ovs-vsctl list-ports br-switch
     41eth1
     42eth2
     43eth3
     44}}}
     45
     46
     47This sections captures how those interfaces were added to the bridge predefined in the OVS image:
    4248
    4349{{{
     
    5157            Write down the interface names that correspond to the connections to your hosts. The correspondence is:
    5258            <ul>
    53                 <li> Interface with IP 10.10.1.11 to host1  - ethX</li>
    54                 <li> Interface with IP 10.10.1.12 to host2 - ethY</li>
    55                 <li> Interface with IP 10.10.1.13 to host3 - ethZ</li>
     59                <li> Interface with IP 10.10.1.11 to host1  - eth1</li>
     60                <li> Interface with IP 10.10.1.12 to host2 - eth2</li>
     61                <li> Interface with IP 10.10.1.13 to host3 - eth3</li>
    5662           </ul></li>
    5763           </li> <br/>
    5864           <li> Be careful <b> not to bring down eth0</b>. This is your control interface, if you bring that interface down you <b> won't be able to login</b> to your host!. For all interfaces other than <code>eth0</code> and <code> l0</code>, remove the IP from the interfaces (your interface names may vary): <br/>
    59                               <ul><li> <code> sudo ifconfig ethX 0 </code> </li></ul>
    60                               <ul><li> <code> sudo ifconfig ethY 0 </code> </li></ul>
    61                               <ul><li> <code> sudo ifconfig ethZ 0 </code> </li></ul>
     65                              <ul><li> <code> sudo ifconfig eth1 0 </code> </li></ul>
     66                              <ul><li> <code> sudo ifconfig eth2 0 </code> </li></ul>
     67                              <ul><li> <code> sudo ifconfig eth3 0 </code> </li></ul>
    6268             <li> Add all the data interfaces to your switch (bridge):Be careful <b> not to add interface eth0</b>. This is your control interface. You should see three interfaces that start with VLAN, these are your data interfaces. (Use the same interfaces as you used in the previous step.)
    63                 <ul><li> <code> sudo  ovs-vsctl add-port br0 ethX </code> </li></ul>
    64                 <ul><li> <code> sudo  ovs-vsctl add-port br0 ethY </code> </li></ul>
    65                 <ul><li> <code> sudo  ovs-vsctl add-port br0 ethZ </code> </li></ul>
     69                <ul><li> <code> sudo  ovs-vsctl add-port br0 eth1 </code> </li></ul>
     70                <ul><li> <code> sudo  ovs-vsctl add-port br0 eth2 </code> </li></ul>
     71                <ul><li> <code> sudo  ovs-vsctl add-port br0 eth3 </code> </li></ul>
    6672             </li>
    6773          </ol>
     
    7379 </table>
    7480}}}
    75  
    76 Congratulations! You have configured your software switch. To verify the three ports configured run:
    77 {{{
    78 sudo ovs-vsctl list-ports br0
    79 }}}
    80 
    81 === '''(Where is 2b?)'''2c. Point your switch to a controller ===
    82 
    83 Find the control interface IP of your controller, use ifconfig and note down the IP of `eth0`.
     81The above bridge instructions were used to create the OVS image, you need not execute the above! If you want to see the list of ports associated with the bridge:
     82{{{
     83$ sudo ovs-vsctl list-ports br-switch
     84}}}
     85
     86=== 2b. Point your switch to a controller ===
     87
     88Find the control interface IP of your controller, use /sbin/ifconfig and note down the IP of `eth0`.
    8489
    8590An !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. '''(The following sentence is not true anymore)'''For the purpose of this tutorial and in order to minimize the resources we have reserved we are going to run !OpenFlow controller at the same host as the OVS switch. This is '''merely''' for convenience reasons, the controller could have been anywhere on the Internet.
    8691
    87 In order to point our software !OpenFlow switch to the controller run:
    88 {{{
    89 sudo ovs-vsctl set-controller br-switch tcp:<controller_ip>:6633
    90 }}}
    91 
    92 ==== '''(No need anymore. But maybe we should keep the instroduction)'''`standalone` vs `secure` mode ====
     92In order to point our software !OpenFlow switch to the controller issue the following command on the OVS host:
     93{{{
     94$sudo ovs-vsctl set-controller br-switch tcp:<controller_ip>:6633
     95}}}
     96
     97==== `standalone` vs `secure` mode ====
    9398
    9499The !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 in 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:
     
    98103In 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. Run:
    99104{{{
    100 sudo ovs-vsctl set-fail-mode br-switch secure
     105$ sudo ovs-vsctl set-fail-mode br-switch secure
    101106}}}
    102107You can verify your OVS settings by issuing the following:
    103108
    104109{{{
    105 sudo ovs-vsctl show
     110$ sudo ovs-vsctl show
    106111}}}
    107112