Changes between Version 8 and Version 9 of GENIExperimenter/Tutorials/GREESC13/OpenFlowWiMAX/Design-Setup
- Timestamp:
- 03/19/14 15:31:02 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GENIExperimenter/Tutorials/GREESC13/OpenFlowWiMAX/Design-Setup
v8 v9 96 96 $ gedit system_setup.sh 97 97 }}} 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). 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). Note that you might not need to change anything depending on what virtualization software you are using and how you set up your VM's network preferences. 99 99 {{{ 100 100 ################### … … 112 112 IFACE_wimax=eth2 113 113 }}} 114 f. Next, we need to create our tap interface. This is the network interface that will funnel all outbound packetsfrom 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 accept all packets routed from the userspace on our VM and send them into our OpenVswitch network. 115 115 {{{ 116 116 ############### … … 121 121 openvpn --mktun --dev $IFACE_tap --lladdr 12:51:16:90:8f:ee 122 122 }}} 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: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. Make sure the following lines of the '''system_setup.sh''' script are commented out: 124 124 {{{ 125 125 ################## … … 131 131 echo "FL: Finished!" 132 132 }}} 133 h. Next, we need to insert the Open Vswitch kernel module:133 h. Next, we need to insert the Open vSwitch kernel module. The this kernel module is an OpenFlow-enabled replacement for the Linux bridge kernel module. You cannot run both simultaneously. 134 134 {{{ 135 135 ################### … … 149 149 fi 150 150 }}} 151 i. After that, we need to initialize Open Vswitch and its database:151 i. After that, we need to initialize Open vSwitch and its database. This is where OVS stores information about configured bridges and ports. 152 152 {{{ 153 153 echo "OVS: Creating database" … … 163 163 ovs-vswitchd --pidfile --detach 164 164 }}} 165 j. Now, we need to take down any pre-existing OVS bridges :165 j. Now, we need to take down any pre-existing OVS bridges. The OVS database is persistent between OVS executions. This is great if you want to retain your previous OVS configuration; however, if you want to start fresh or redo a particular aspect of your topology, you will want to remove the necessary bridge(s). 166 166 {{{ 167 167 echo "OVS: Removing any existing bridge, $IFACE_bridge_eth $IFACE_bridge_wlan0" … … 226 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 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. 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. A physical analogy to patch ports is an Ethernet cable interconnecting two OpenFlow-enabled switches. 229 229 {{{ 230 230 ################# … … 246 246 ovs-vsctl set interface $IFACE_patch_wimax_to_tap options:peer=$IFACE_patch_tap_to_wimax 247 247 }}} 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 athe variable '''OVS_controllerIP'''.248 l. Now, we need to assign each OVS bridge a unique ID (DPID or Datapath Identifier) and point them to the address of the Floodlight controller. Floodlight will be run on the localhost (i.e. on our VM), so the loopback address is used and defined within the variable '''OVS_controllerIP'''. 249 249 {{{ 250 250 ########## … … 283 283 echo "OVS: Finished!" 284 284 }}} 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 in ferface. 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 kernelIP 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 interface. This will allow us to inject data/packets into and out of our OVS network. We also need to configure our OVS tap bridge with 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 IP forwarding. 286 286 {{{ 287 287 ########################## … … 323 323 #tc qdisc add dev br_wimax root netem delay 100ms 324 324 }}} 325 Th is 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.325 The '''tc''' command allows us 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. Make sure this line is ''uncommented'' in order to enable the delay. 326 326 o. Save '''system_setup.sh''' and close your text editor. 327 327 4. Examine the kernel routing table, and create a script to automate adding and removing of IP routes. … … 369 369 exit 0 370 370 }}} 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 willnot 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.)371 Configure the script to remove all routes except a single default route via the br_tap interface. We can only control the interface packets use if they are sent into our OVS network. When a user application sends a packet, Linux will send it to the appropriate network interface according to the routing table. As such, we need to make sure the default route and route for each handoff-participating interface is via the tap OVS bridge, not via the physical interfaces. Note, until the '''system_setup.sh''' is executed, there will be no OVS bridge interfaces present. As such, this script should 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.) 372 372 d. Save the '''delete_route.sh''' script and exit the text editor. 373 373