Changes between Version 7 and Version 8 of GENIExperimenter/Tutorials/GREESC13/OpenFlowWiMAX/Design-Setup


Ignore:
Timestamp:
06/24/13 16:03:12 (6 years ago)
Author:
Ryan Izard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/GREESC13/OpenFlowWiMAX/Design-Setup

    v7 v8  
    3030== 1.  Design the Experiment ==
    3131 
    32 The end-user will use the virtual tap interface (created by OpenVPN) for network connections, while the handoff execution
    33 
    34 will handle which physical interface to use. The Static Flow Pusher feature of Floodlight allows for flows to be inserted
    35 
    36 manually, as determined by the handoff decision. A Python script leverages the Static Flow Pusher API to add and remove
    37 
    38 flows. The detail instructions are as follows. It should be noted that these instructions are executed inside the VM
    39 
    40 image.
     32The end-user will use the virtual tap interface (created by OpenVPN) for network connections, while the handoff execution will handle which physical interface to use. The Static Flow Pusher API in Floodlight allows for flows to be inserted manually, as determined by the handoff decision. A Python script leverages the Static Flow Pusher API to add and remove flows. Detailed instructions are as follows. ''It should be noted that these instructions are executed inside the VM image with the exception of the very first instruction below.''
    4133
    4234== 2.  Establish the Environment ==
    4335
    44    1.  Remove the Forwarding module from the Floodlight OpenFlow controller. Floodlight uses what it calls a '''module
    45 
    46 loading system''', where the user can write modules to perform a certain task or set of tasks. Each module can register
    47 
    48 for certain events. For example, the Forwarding module registers for PACKET_IN events where the controller is sent a
    49 
    50 packet from a connected switch. Upon such an event, the Forwarding module will send the packet out the correct port(s)
    51 
    52 depending on the destination. This module essentially implements a standard '''learning switch''' function where the
    53 
    54 OpenFlow-enabled switch behaves as if it were a standard network switch. We do not want this functionality, since we would
    55 
    56 like to have control over which port(s) our packets get forwarded.
    57       a.  Open the Root Terminal by browsing to Applications-->Accessories-->Root Terminal. The password is
    58 
    59 '''password'''.
     36   1.  Before booting into the VM, create three network interfaces -- two host-only interfaces and one control NAT interface. If you are using VirtualBox, you must also enable '''promiscuous mode''' for each of the two host-only interfaces.
     37
     38   2.  Remove the Forwarding module from the Floodlight OpenFlow controller. Floodlight uses what it calls a '''module loading system''', where the user can write modules to perform a certain task or set of tasks. Each module can register for certain events. For example, the Forwarding module registers for PACKET_IN events where the controller is sent a packet from a connected switch. Upon such an event, the Forwarding module will send the packet out the correct port(s) depending on the destination. This module essentially implements a standard '''learning switch''' function where the OpenFlow-enabled switch behaves as if it were a standard network switch. We do not want this functionality, since we would like to have control over which port(s) our packets get forwarded.
     39      a.  Open the Root Terminal by browsing to Applications-->Accessories-->Root Terminal. The password is '''password'''.
    6040      b.  Launch Eclipse by running '''eclipse''' in the Root Terminal.
    61       c.  The '''module loading system''' maintains a list of the modules to be loaded at runtime. To remove the
    62 
    63 Forwarding module from this list (and thus disable it), open the
    64 
    65 '''floodlight/src/main/resources/floodlightdefault.properties''' file and remove the line
    66 
    67 '''net.floodlightcontroller.forwarding.Forwarding,\'''.
     41      c.  The '''module loading system''' maintains a list of the modules to be loaded at runtime. To remove the Forwarding module from this list (and thus disable it), open the '''floodlight/src/main/resources/floodlightdefault.properties''' file and remove the line '''net.floodlightcontroller.forwarding.Forwarding,\'''.
    6842      d.  By default, Eclipse automatically builds the Floodlight project, so we do not need to do so manually.
    69    2.  Customize the setup script. This script is designed to (1) define user variables, (2) configure the tap interface
    70 
    71 with OpenVPN, (3) start Floodlight, (4) initialize and start OpenVswitch, and (5) configure Linux networking.
     43   3.  Customize the setup script. This script is designed to (1) define user variables, (2) configure the tap interface with OpenVPN, (3) start Floodlight, (4) initialize and start OpenVswitch, and (5) configure Linux networking.
    7244      a.  In the Root Terminal, open a new tab by browsing to File-->Open Tab.
    7345      b.  In the Root Terminal, execute '''ifconfig''':
     
    11385          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)
    11486      }}}
    115       Note the subnets and names given to each of the network interfaces. Recall, when the VM was initialized, we
    116 
    117 configured 1 NAT interface and 2 host-only interfaces. The two interfaces on the same subnet are the host-only interfaces.
    118 
    119 Make notes of each interface name and its IP and subnet mask.
     87      Note the subnets and names given to each of the network interfaces. Recall, when the VM was initialized, we configured 1 NAT interface and 2 host-only interfaces. The two interfaces on the same subnet are the host-only interfaces. Make notes of each interface name and its IP and subnet mask.
    12088      c.  With this information, to the setup script directory:
    12189      {{{
     
    12896      $ gedit system_setup.sh
    12997      }}}
    130       e.  There are numerous user defined variables at the top of the script. These are placeholders for commonly used
    131 
    132 system and configuration specific information throughout the script. We need to change a few of them to suit our needs for
    133 
    134 this tutorial. Modify the physical interface names for '''IFACE_wlan0''' and '''IFACE_wimax''' to match those names of the
    135 
    136 host-only interfaces noted from '''ifconfig'''. Also, modify the '''IFACE_tap_IP''' variable to be an IP in the same
    137 
    138 subnet of the host-only interfaces (e.g. 192.168.193.155 would work for the host-only subnet 192.168.193/24).
     98      e.  There are numerous user defined variables at the top of the script. These are placeholders for commonly used system and configuration specific information throughout the script. We need to change a few of them to suit our needs for this tutorial. Modify the physical interface names for '''IFACE_wlan0''' and '''IFACE_wimax''' to match those names of the host-only interfaces noted from '''ifconfig'''. Also, modify the '''IFACE_tap_IP''' variable to be an IP in the same subnet of the host-only interfaces (e.g. 192.168.193.155 would work for the host-only subnet 192.168.193/24).
    13999      {{{
    140100      ###################
     
    152112      IFACE_wimax=eth2
    153113      }}}
    154       f.  Next, we need to create our tap interface. This is the network interface that will funnel all outbound packets
    155 
    156 from the userspace on our VM and send them into our OpenVswitch network.
     114      f.  Next, we need to create our tap interface. This is the network interface that will funnel all outbound packets from the userspace on our VM and send them into our OpenVswitch network.
    157115      {{{
    158116      ###############
     
    163121      openvpn --mktun --dev $IFACE_tap --lladdr 12:51:16:90:8f:ee
    164122      }}}
    165       g.  Now, it is sometimes desirable to automate the start of Floodlight; however, for the purposes of this tutorial,
    166 
    167 we will launch it from within Eclipse. Comment out the following lines of the '''system_setup.sh''' script:
     123      g.  Now, it is sometimes desirable to automate the start of Floodlight; however, for the purposes of this tutorial, we will launch it from within Eclipse. Comment out the following lines of the '''system_setup.sh''' script:
    168124      {{{
    169125      ##################
     
    248204      ovs-vsctl add-port $IFACE_bridge_wlan0 $IFACE_wlan0 -- set Interface $IFACE_wlan0 ofport=$port_eth1
    249205      echo "OVS: ...with port $IFACE_patch_wlan0_to_tap"
    250       ovs-vsctl add-port $IFACE_bridge_wlan0 $IFACE_patch_wlan0_to_tap -- set Interface $IFACE_patch_wlan0_to_tap ofport=
    251 
    252 $port_wlan0_to_tap
     206      ovs-vsctl add-port $IFACE_bridge_wlan0 $IFACE_patch_wlan0_to_tap -- set Interface $IFACE_patch_wlan0_to_tap ofport=$port_wlan0_to_tap
    253207
    254208      ## WiMAX
     
    258212      ovs-vsctl add-port $IFACE_bridge_wimax $IFACE_wimax -- set Interface $IFACE_wimax ofport=$port_eth2
    259213      echo "OVS: ...with port $IFACE_patch_wimax_to_tap"
    260       ovs-vsctl add-port $IFACE_bridge_wimax $IFACE_patch_wimax_to_tap -- set Interface $IFACE_patch_wimax_to_tap ofport=
    261 
    262 $port_wimax_to_tap
     214      ovs-vsctl add-port $IFACE_bridge_wimax $IFACE_patch_wimax_to_tap -- set Interface $IFACE_patch_wimax_to_tap ofport=$port_wimax_to_tap
    263215
    264216      ## Internal
     
    268220      ovs-vsctl add-port $IFACE_bridge_int $IFACE_tap -- set Interface $IFACE_tap ofport=$port_tap0
    269221      #echo "OVS: ...with port $IFACE_patch_tap_to_eth"
    270       #ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_eth -- set Interface $IFACE_patch_tap_to_eth ofport=
    271 
    272 $port_tap_to_eth
     222      #ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_eth -- set Interface $IFACE_patch_tap_to_eth ofport=$port_tap_to_eth
    273223      echo "OVS: ...with port $IFACE_patch_tap_to_wlan0"
    274       ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wlan0 -- set Interface $IFACE_patch_tap_to_wlan0 ofport=
    275 
    276 $port_tap_to_wlan0
     224      ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wlan0 -- set Interface $IFACE_patch_tap_to_wlan0 ofport=$port_tap_to_wlan0
    277225      echo "OVS: ...with port $IFACE_patch_tap_to_wimax"
    278       ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wimax -- set Interface $IFACE_patch_tap_to_wimax ofport=
    279 
    280 $port_tap_to_wimax
    281       }}}
    282       k.  At this point, we're ready to set the patch ports between the OVS bridges. These create links between the OVS
    283 
    284 tap bridge and the OVS WiFi and WiMAX bridges in order to facilitate the flow of packets from the tap bridge to the
    285 
    286 physical interface of choice.
     226      ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wimax -- set Interface $IFACE_patch_tap_to_wimax ofport=$port_tap_to_wimax
     227      }}}
     228      k.  At this point, we're ready to set the patch ports between the OVS bridges. These create links between the OVS tap bridge and the OVS WiFi and WiMAX bridges in order to facilitate the flow of packets from the tap bridge to the physical interface of choice.
    287229      {{{
    288230      #################
     
    304246      ovs-vsctl set interface $IFACE_patch_wimax_to_tap options:peer=$IFACE_patch_tap_to_wimax
    305247      }}}
    306       l.  Now, we need to assign each OVS bridge a unique ID (DPID) and point them to the address of the Floodlight
    307 
    308 controller. Floodlight will be run on the localhost, so the loopback address is defined within a the variable
    309 
    310 '''OVS_controllerIP'''.
     248      l.  Now, we need to assign each OVS bridge a unique ID (DPID) and point them to the address of the Floodlight controller. Floodlight will be run on the localhost, so the loopback address is defined within a the variable '''OVS_controllerIP'''.
    311249      {{{
    312250      ##########
     
    345283      echo "OVS: Finished!"
    346284      }}}
    347       m.  Now, the second-to-last thing to do in the setup script is to configure our network connections. We need to revoke the IPs
    348 
    349 from our physical interfaces and assign them to the OVS bridge interfaces corresponding to each inferface. This will allow
    350 
    351 us to inject data/packets into our OVS network. We also need to configure our OVS tap bridge as an available IP address in
    352 
    353 the same subnet as our VM's host-only network (noted earlier with '''ifconfig'''). And finally, we need to disable kernel
    354 
    355 IP forwarding.
     285      m.  Now, the second-to-last thing to do in the setup script is to configure our network connections. We need to revoke the IPs from our physical interfaces and assign them to the OVS bridge interfaces corresponding to each inferface. This will allow us to inject data/packets into our OVS network. We also need to configure our OVS tap bridge as an available IP address in the same subnet as our VM's host-only network (noted earlier with '''ifconfig'''). And finally, we need to disable kernel IP forwarding.
    356286      {{{
    357287      ##########################
     
    395325      This command allows you to add a simulated delay on a particular interface. So we can see the handoff when it occurs, we will add a 100ms delay to the '''br_wimax''' interface. Uncomment this line to do so.
    396326      o.  Save '''system_setup.sh''' and close your text editor.
    397    3.  Examine the kernel routing table, and create a script to automate adding and removing of IP routes.
     327   4.  Examine the kernel routing table, and create a script to automate adding and removing of IP routes.
    398328      a.  In the Root Terminal, change to the '''eth_control''' directory:
    399329      {{{
     
    439369      exit 0
    440370      }}}
    441       Configure the script to remove all routes except a single default route via the br_tap interface. Note, until the
    442 
    443 '''system_setup.sh''' is executed, there will be no OVS bridge interfaces present. As such, this script will not be run
    444 
    445 until after '''system_setup.sh'''. (There is no harm in running it now, though. If an attempt is made to add or remove a
    446 
    447 non-existent route, a error message will be displayed and the script will continue.)
     371      Configure the script to remove all routes except a single default route via the br_tap interface. Note, until the '''system_setup.sh''' is executed, there will be no OVS bridge interfaces present. As such, this script will not be run until after '''system_setup.sh'''. (There is no harm in running it now, though. If an attempt is made to add or remove a non-existent route, a error message will be displayed and the script will continue.)
    448372      d.  Save the '''delete_route.sh''' script and exit the text editor.
    449373