Changes between Initial Version and Version 1 of GENIExperimenter/Tutorials/WiMAXOpenFlow/Execute


Ignore:
Timestamp:
10/27/13 11:34:55 (8 years ago)
Author:
Ryan Izard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/WiMAXOpenFlow/Execute

    v1 v1  
     1= [http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/WiMAXOpenFlow OpenFlow-Based Vertical Handoff over WiFi and WiMAX in the Orbit Testbed] =
     2{{{
     3#!html
     4
     5<div style="text-align:center; width:495px; margin-left:auto; margin-right:auto;">
     6<img id="Image-Maps_5201305222028436"
     7
     8src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/Execute.jpg?format=raw"
     9
     10usemap="#Image-Maps_5201305222028436" border="0" width="495" height="138" alt="" />
     11<map id="_Image-Maps_5201305222028436" name="Image-Maps_5201305222028436">
     12<area shape="rect" coords="18,18,135,110"
     13
     14href="http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/WiMAXOpenFlow/Design-Setup" alt="" title=""    />
     15<area shape="rect" coords="180,18,297,111"
     16
     17href="http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/WiMAX0penFlow/Execute" alt="" title=""    />
     18<area shape="rect" coords="344,17,460,110"
     19
     20href="http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/WiMAXOpenFlow/Finish" alt="" title=""    />
     21<area shape="rect" coords="493,136,495,138" href="http://www.image-maps.com/index.php?aff=mapped_users_5201305222028436"
     22
     23alt="Image Map" title="Image Map" />
     24</map>
     25<!-- Image map text links - End - -->
     26
     27</div>
     28}}}
     29
     30== 4.  Configure and Initialize ==
     31   1.  In the Root Terminal, execute the '''system_setup.sh''' script:
     32   {{{
     33   $ cd /root/06-03-13
     34   $ ./system_setup.sh
     35   }}}
     36   Please be patient; the script can take a minute to complete. It is bringing up the tap interface, starting OVS and creating the topology coded in the script, and configuring network access on each OVS bridge.
     37   2.  In the Root Terminal, execute the '''delete_route.sh''' script:
     38   {{{
     39   $ cd eth_control
     40   $ ./delete_route.sh
     41   }}}
     42   Verify the new routing table has a default route via the br_tap interface no routes via the br_wimax and br_wifi interfaces.
     43   3.  In Eclipse, run Floodlight by browsing to '''Run-->Run'''. Note the console output shown toward the bottom of the Eclipse window. Since OVS is running, and the '''system_setup.sh''' script pointed each OVS bridge to the Floodlight controller, you should see where each switch DPID connects to Floodlight.
     44   4.  In the Root Terminal, open an new tab (File-->Open Tab) or switch to an unused tab. Browse to the '''/root/06-03-13/eth_control''' directory.
     45   5.  In this directory are some Python scripts to manually add and remove flows in the OVS bridges. These scripts leverage the Static Flow Pusher REST API present in the Floodlight controller. Since we have previously disabled Forwarding, flows added by the Static Flow Pusher will be the only flows present on the switches, and thus only traffic permitted by these flows will traverse the OVS network. These flows essentially take packets from a particular ingress port and send them out a destination port. To do this, we need to determine the port numbers Floodlight has associated with the ports of our OVS bridges. The Floodlight REST API is a means of obtaining data from the Floodlight controller. We need to send a query to Floodlight asking for what it knows about any connected switches.
     46   {{{
     47   $ curl http://localhost:8080/wm/core/controller/switches/json | python -mjson.tool
     48   
     49   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     50                                 Dload  Upload   Total   Spent    Left  Speed
     51   100  3397    0  3397    0     0   5900      0 --:--:-- --:--:-- --:--:--  6055
     52   [
     53    {
     54        "actions": 4095,
     55        "attributes": {
     56            "DescriptionData": {
     57                "datapathDescription": "None",
     58                "hardwareDescription": "Open vSwitch",
     59                "length": 1056,
     60                "manufacturerDescription": "Nicira, Inc.",
     61                "serialNumber": "None",
     62                "softwareDescription": "1.7.1"
     63            },
     64            "FastWildcards": 4194303,
     65            "supportsOfppFlood": true,
     66            "supportsOfppTable": true
     67        },
     68        "buffers": 256,
     69        "capabilities": 199,
     70        "connectedSince": 1372098663566,
     71        "dpid": "00:00:00:00:00:00:00:05",
     72        "featuresReplyFromSwitch": {
     73            "cancelled": false,
     74            "done": true,
     75            "transactionId": 2
     76        },
     77        "inetAddress": "/127.0.0.1:34846",
     78        "ports": [
     79            {
     80                "advertisedFeatures": 0,
     81                "config": 0,
     82                "currentFeatures": 0,
     83                "hardwareAddress": "12:51:16:90:8f:ee",
     84                "name": "br_tap",
     85                "peerFeatures": 0,
     86                "portNumber": 65534,
     87                "state": 0,
     88                "supportedFeatures": 0
     89            },
     90            {
     91                "advertisedFeatures": 0,
     92                "config": 0,
     93                "currentFeatures": 0,
     94                "hardwareAddress": "00:00:00:00:00:05",
     95                "name": "tap-wlan0",
     96                "peerFeatures": 0,
     97                "portNumber": 7,
     98                "state": 0,
     99                "supportedFeatures": 0
     100            },
     101            {
     102                "advertisedFeatures": 0,
     103                "config": 0,
     104                "currentFeatures": 0,
     105                "hardwareAddress": "00:00:00:00:00:05",
     106                "name": "tap-wimax",
     107                "peerFeatures": 0,
     108                "portNumber": 10,
     109                "state": 0,
     110                "supportedFeatures": 0
     111            },
     112            {
     113                "advertisedFeatures": 0,
     114                "config": 1,
     115                "currentFeatures": 130,
     116                "hardwareAddress": "12:51:16:90:8f:ee",
     117                "name": "tap0",
     118                "peerFeatures": 0,
     119                "portNumber": 1,
     120                "state": 1,
     121                "supportedFeatures": 0
     122            }
     123        ],
     124        "role": null,
     125        "tables": -1
     126    },
     127    {
     128        "actions": 4095,
     129        "attributes": {
     130            "DescriptionData": {
     131                "datapathDescription": "None",
     132                "hardwareDescription": "Open vSwitch",
     133                "length": 1056,
     134                "manufacturerDescription": "Nicira, Inc.",
     135                "serialNumber": "None",
     136                "softwareDescription": "1.7.1"
     137            },
     138            "FastWildcards": 4194303,
     139            "supportsOfppFlood": true,
     140            "supportsOfppTable": true
     141        },
     142        "buffers": 256,
     143        "capabilities": 199,
     144        "connectedSince": 1372098663511,
     145        "dpid": "00:00:00:00:00:00:00:02",
     146        "featuresReplyFromSwitch": {
     147            "cancelled": false,
     148            "done": true,
     149            "transactionId": 2
     150        },
     151        "inetAddress": "/127.0.0.1:34844",
     152        "ports": [
     153            {
     154                "advertisedFeatures": 0,
     155                "config": 0,
     156                "currentFeatures": 0,
     157                "hardwareAddress": "00:00:00:00:00:02",
     158                "name": "wlan0-tap",
     159                "peerFeatures": 0,
     160                "portNumber": 12,
     161                "state": 0,
     162                "supportedFeatures": 0
     163            },
     164            {
     165                "advertisedFeatures": 0,
     166                "config": 0,
     167                "currentFeatures": 0,
     168                "hardwareAddress": "00:0c:29:04:5c:4b",
     169                "name": "br_wifi0",
     170                "peerFeatures": 0,
     171                "portNumber": 65534,
     172                "state": 0,
     173                "supportedFeatures": 0
     174            },
     175            {
     176                "advertisedFeatures": 128,
     177                "config": 0,
     178                "currentFeatures": 160,
     179                "hardwareAddress": "00:00:00:00:00:02",
     180                "name": "eth1",
     181                "peerFeatures": 0,
     182                "portNumber": 1,
     183                "state": 0,
     184                "supportedFeatures": 160
     185            }
     186        ],
     187        "role": null,
     188        "tables": -1
     189    },
     190    {
     191        "actions": 4095,
     192        "attributes": {
     193            "DescriptionData": {
     194                "datapathDescription": "None",
     195                "hardwareDescription": "Open vSwitch",
     196                "length": 1056,
     197                "manufacturerDescription": "Nicira, Inc.",
     198                "serialNumber": "None",
     199                "softwareDescription": "1.7.1"
     200            },
     201            "FastWildcards": 4194303,
     202            "supportsOfppFlood": true,
     203            "supportsOfppTable": true
     204        },
     205        "buffers": 256,
     206        "capabilities": 199,
     207        "connectedSince": 1372098663540,
     208        "dpid": "00:00:00:00:00:00:00:04",
     209        "featuresReplyFromSwitch": {
     210            "cancelled": false,
     211            "done": true,
     212            "transactionId": 2
     213        },
     214        "inetAddress": "/127.0.0.1:34845",
     215        "ports": [
     216            {
     217                "advertisedFeatures": 0,
     218                "config": 0,
     219                "currentFeatures": 0,
     220                "hardwareAddress": "00:00:00:00:00:04",
     221                "name": "wimax-tap",
     222                "peerFeatures": 0,
     223                "portNumber": 13,
     224                "state": 0,
     225                "supportedFeatures": 0
     226            },
     227            {
     228                "advertisedFeatures": 0,
     229                "config": 0,
     230                "currentFeatures": 0,
     231                "hardwareAddress": "00:0c:29:04:5c:55",
     232                "name": "br_wimax",
     233                "peerFeatures": 0,
     234                "portNumber": 65534,
     235                "state": 0,
     236                "supportedFeatures": 0
     237            },
     238            {
     239                "advertisedFeatures": 128,
     240                "config": 0,
     241                "currentFeatures": 160,
     242                "hardwareAddress": "00:00:00:00:00:04",
     243                "name": "eth2",
     244                "peerFeatures": 0,
     245                "portNumber": 1,
     246                "state": 0,
     247                "supportedFeatures": 160
     248            }
     249        ],
     250        "role": null,
     251        "tables": -1
     252    }
     253   ]
     254   }}}
     255   Above is sample output from the query issued. The output is organized by switch -- there should be three -- br_tap, br_wifi, and br_wimax. On each of these switches, you can see the ports and the names of the ports as they were given in '''system_setup.sh'''. Take note of the port numbers for the patch ports on each switch, as well as the port numbers for the interface port on each switch.
     256   6.  Armed with this information, we can now create the flows we want to insert on each switch. Namely, we can specify and ingress and output port on br_tap, br_wifi, and br_wimax for packets traveling in each direction. In the Root Terminal, open the Python script '''gree13_switchWiFi.py''' with your favorite text editor. This script is designed to switch to the WiFi interface.
     257   {{{
     258   $ gedit gree13_switchWiFi.py
     259import httplib
     260import json
     261class StaticFlowPusher(object):
     262    def __init__(self, server):
     263        self.server = server
     264
     265    def get(self, data):
     266        ret = self.rest_call({}, 'GET')
     267        return json.loads(ret[2])
     268
     269    def set(self, data):
     270        ret = self.rest_call(data, 'POST')
     271        return ret[0] == 200
     272
     273    def remove(self, objtype, data):
     274        ret = self.rest_call(data, 'DELETE')
     275        return ret[0] == 200
     276
     277    def rest_call(self, data, action):
     278        path = '/wm/staticflowentrypusher/json'
     279        headers = {
     280            'Content-type': 'application/json',
     281            'Accept': 'application/json',
     282            }
     283        body = json.dumps(data)
     284        conn = httplib.HTTPConnection(self.server, 8080)
     285        conn.request(action, path, body, headers)
     286        response = conn.getresponse()
     287        ret = (response.status, response.reason, response.read())
     288        print ret
     289        conn.close()
     290        return ret
     291
     292pusher = StaticFlowPusher('127.0.0.1')
     293
     294flow1 = {
     295    'switch':"00:00:00:00:00:00:00:05",
     296    "name":"src-dst-ether-tap",
     297    "priority":"32768",
     298    "active":"true",
     299    "ether-type":"0x800",
     300    "ingress-port":"65534",
     301    "actions":"output=10"
     302    }
     303   
     304flow2 = {
     305    'switch':"00:00:00:00:00:00:00:05",
     306    "name":"dst-src-ether-tap",
     307    "priority":"32768",
     308    "active":"true",
     309    "ether-type":"0x800",
     310    "ingress-port":"10",
     311    "actions":"output=65534"
     312    }
     313
     314flow3 = {
     315    'switch':"00:00:00:00:00:00:00:05",
     316    "name":"src-dst-arp-tap",
     317    "priority":"32768",
     318    "active":"true",
     319    "ether-type":"0x806",
     320    "ingress-port":"65534",
     321    "actions":"output=10"
     322    }
     323   
     324flow4 = {
     325    'switch':"00:00:00:00:00:00:00:05",
     326    "name":"dst-src-arp-tap",
     327    "priority":"32768",
     328    "active":"true",
     329    "ether-type":"0x806",
     330    "ingress-port":"10",
     331    "actions":"output=65534"
     332    }
     333   
     334flow5 = {
     335    'switch':"00:00:00:00:00:00:00:04",
     336    "name":"src-dst-ether-eth",
     337    "priority":"32768",
     338    "active":"true",
     339    "ether-type":"0x800",
     340    "ingress-port":"13",
     341    "actions":"output=1"
     342    }
     343   
     344flow6 = {
     345    'switch':"00:00:00:00:00:00:00:04",
     346    "name":"dst-src-ether-eth",
     347    "priority":"32768",
     348    "active":"true",
     349    "ether-type":"0x800",
     350    "ingress-port":"1",
     351    "actions":"output=13"
     352    }
     353
     354flow7 = {
     355    'switch':"00:00:00:00:00:00:00:04",
     356    "name":"src-dst-arp-eth",
     357    "priority":"32768",
     358    "active":"true",
     359    "ether-type":"0x806",
     360    "ingress-port":"13",
     361    "actions":"output=1"
     362    }
     363   
     364flow8 = {
     365    'switch':"00:00:00:00:00:00:00:04",
     366    "name":"dst-src-arp-eth",
     367    "priority":"32768",
     368    "active":"true",
     369    "ether-type":"0x806",
     370    "ingress-port":"1",
     371    "actions":"output=13"
     372    }       
     373   
     374pusher.set(flow1)
     375pusher.set(flow2)
     376pusher.set(flow3)
     377pusher.set(flow4)
     378pusher.set(flow5)
     379pusher.set(flow6)
     380pusher.set(flow7)
     381pusher.set(flow8)
     382   }}}
     383   In this script, there are four flows for each OVS bridge -- two for outgoing packets and two for incoming packets. Why two? OpenFlow filters packets by not only data like MAC and IP addresses, but also by the type of packet (its '''ethertype'''). We need to forward all IP (ethertype=0x800) and all ARP (ethertype=0x806) packets in each direction in order to achieve IP connectivity between the tap interface and the outside world. What we want to do is look for packets from the port br_tap is assigned to, then send them out the tap-wifi port number (the patch port connected to the br_wifi OVS bridge), then when they arrive at br_wifi, look for them on the wifi-tap port number and send them out the br_wifi port number. Then we want to implement the same for the opposite direction. Examine the script and modify it as necessary to allow packets to travel from the br_tap interface, to the br_wifi interface, and out to the host-only network.
     384   7.  Save the '''gree13_switchWiFi.py''' script.
     385   8.  Repeat and save for '''gree13_switchWiMAX.py'''. Use the port numbers noted in the json output to complete the flows needed to send packets from the br_tap interface out the br_wimax interface.
     386
     387== 5.  Execute Experiment ==
     388   1.  Run the WiFi switching script:
     389   {{{
     390   $ python gree13_switchWiFi.py
     391   (200, 'OK', '{"status" : "Entry pushed"}')
     392(200, 'OK', '{"status" : "Entry pushed"}')
     393(200, 'OK', '{"status" : "Entry pushed"}')
     394(200, 'OK', '{"status" : "Entry pushed"}')
     395(200, 'OK', '{"status" : "Entry pushed"}')
     396(200, 'OK', '{"status" : "Entry pushed"}')
     397(200, 'OK', '{"status" : "Entry pushed"}')
     398(200, 'OK', '{"status" : "Entry pushed"}')
     399   }}}
     400   2.  In another unused tab in the Root Terminal, run ping to the gateway IP. The default route is set to br_tap and IP forwarding is disabled -- this forces all packets into the OVS network, where the interface switching is handled by Floodlight and the Static Flow Pusher.
     401   {{{
     402   $ ping 192.168.193.1
     403   }}}
     404   3.  Leave ping running and run the WiMAX switching script in another Root Terminal tab:
     405   {{{
     406   $ python gree13_switchWiMAX.py
     407   (200, 'OK', '{"status" : "Entry pushed"}')
     408(200, 'OK', '{"status" : "Entry pushed"}')
     409(200, 'OK', '{"status" : "Entry pushed"}')
     410(200, 'OK', '{"status" : "Entry pushed"}')
     411(200, 'OK', '{"status" : "Entry pushed"}')
     412(200, 'OK', '{"status" : "Entry pushed"}')
     413(200, 'OK', '{"status" : "Entry pushed"}')
     414(200, 'OK', '{"status" : "Entry pushed"}')
     415   }}}
     416   
     417== 6.  Analyze Experiment ==
     418
     419   1.  Notice the delay introduced in the ping responses. When we configured and ran the '''system_setup.sh''' script, we introduced a simulated delay to the "WiMAX" interface. This confirms the switch is occurring. Before and after the switch, the source IP remains the br_tap IP, and the destination IP remains the gateway IP.
     420   2.  Congratulations! You have just completed a simulated vertical Layer-2 handoff! This project is being developed and tested using actual GENI WiFi and WiMAX testbed at Clemson University. You can give it a try yourself outside the VM using whatever physical interfaces you have available.
     421
     422
     423----
     424
     425= [wiki:GENIExperimenter/Tutorials/WiMAXOpenFlow Introduction] =
     426= [wiki:GENIExperimenter/Tutorials/WiMAXOpenFlow/Design-Setup Back:  Design and Setup] =
     427= [wiki:GENIExperimenter/Tutorials/WiMAXOpenFlow/Finish Next:  Finish] =