Changes between Version 17 and Version 18 of GENIExperimenter/Tutorials/WiMAXOpenFlow/Design-Setup


Ignore:
Timestamp:
10/27/13 15:25:16 (6 years ago)
Author:
Ryan Izard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/WiMAXOpenFlow/Design-Setup

    v17 v18  
    488488      m.  Save the script using your text editor and close it.
    489489
    490    5.  The last thing to configure in the Client are the flows themselves. OpenFlow flows are designed to match certain types of packets, and then based on a successful match, do something to those packets -- e.g. output on port 1, rewrite to a new destination IP, etc. For this tutorial, we need to do two things -- (1) we need to output the packet to the correct port, and (2) we need to rewrite the source MAC for any outbound packets and the destination MAC for any inbound packets. Why? Well, we configured our OVS switches and linked them together as depicted in the figure at the top of this page. Each link of each switch has a port number associated with it. Any physical or tap interface has the port number 1, and any OVS patch port (a port linking two OVS bridges) has an arbitrarily assigned port number. In order to switch packets in our OVS network, we need to know the correct patch ports over which to send packets. For example, if the client wants to send a packet from the tap OVS bridge to the WiFi interface, when the packet is in the tap OVS bridge, the switch needs to know which port to send the packet out on. Well, since we are manually telling the client which interface to use, our static flows must specify the port number that leads to the physical interface of choice. In the case of our example, we would want to insert a flow to direct all packet out the patch port number leading to the WiFi OVS bridge. To determine these port numbers, we need to query Floodlight for information about connected switches. There is a script in the directory '''/root/SwitchingScripts''' called '''getJSONPorts.sh'''. This script will send an HTTP request to Floodlight's REST API, requesting information about the connected switches. It pipes this information (in JSON format) to a python JSON printer (i.e. it "pretty-prints" the JSON string for us). Based on this output, we can determine and confirm the port numbers assigned to each OVS bridge, and thus, we can correctly compose our flows such that they match on and forward packets out the correct port numbers. Since we are using the same Orbit image for each client machine in this tutorial, all the port numbers should be configured correctly as-is, but it's still worth checking just to be certain.
    491       a.  The following is an example output from the client's '''/root/SwitchingScripts/getJSONPorts.sh''' script. Base on this information, note the port numbers for each port of each OVS bridge. The WiFi and WiMAX OVS bridges should have three ports -- the physical interface port, the OVS patch port to the tap OVS bridge, and the port of the OVS bridge itself. And, the tap OVS bridge should have four ports -- the "physical" tap interface port, the OVS patch ports to the WiFi and WiMAX OVS bridges, and the OVS bridge itself.
     490   5.  The last thing to configure in the Client are the flows themselves. OpenFlow flows are designed to match certain types of packets, and then based on a successful match, do something to those packets -- e.g. output on port 1, rewrite to a new destination IP, etc. For this tutorial, we need to do two things -- (1) we need to output the packet to the correct port, and (2) we need to rewrite the source MAC for any outbound packets and the destination MAC for any inbound packets. Why? Well, we configured our OVS switches and linked them together as depicted in the figure at the top of this page. Each link of each switch has a port number associated with it. Any physical or tap interface has the port number 1, and any OVS patch port (a port linking two OVS bridges) has an arbitrarily assigned port number. In order to switch packets in our OVS network, we need to know the correct patch ports over which to send packets. For example, if the client wants to send a packet from the tap OVS bridge to the WiFi interface, when the packet is in the tap OVS bridge, the switch needs to know which port to send the packet out on. Well, since we are manually telling the client which interface to use, our static flows must specify the port number that leads to the physical interface of choice. In the case of our example, we would want to insert a flow to direct all packets out the patch port number leading to the WiFi OVS bridge. To determine these port numbers, we need to query Floodlight for information about connected switches.
     491      a.  There is a script in the directory '''/root/SwitchingScripts''' called '''getJSONPorts.sh'''. This script will send an HTTP request to Floodlight's REST API, requesting information about the connected switches. It pipes this information (in JSON format) to a python JSON printer (i.e. it "pretty-prints" the JSON string for us). Based on this output, we can determine and confirm the port numbers assigned to each OVS bridge, and thus, we can correctly compose our flows such that they match and forward packets out the correct port numbers. Since we are using the same Orbit image for each client machine in this tutorial, all the port numbers should be configured correctly as-is, but it's still worth checking just to be certain.
     492      b.  The following is an example output from the client's '''/root/SwitchingScripts/getJSONPorts.sh''' script. Based on this information, note the port numbers for each port of each OVS bridge. The WiFi and WiMAX OVS bridges should have three ports -- the physical interface port, the OVS patch port to the tap OVS bridge, and the port of the OVS bridge itself. And, the tap OVS bridge should have four ports -- the "physical" tap interface port, the OVS patch ports to the WiFi and WiMAX OVS bridges, and the OVS bridge itself.
     493      {{{
     494      $ ./getJSONports.sh
     495        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     496                                       Dload  Upload   Total   Spent    Left  Speed
     497      100  3388    0  3388    0     0  74701      0 --:--:-- --:--:-- --:--:-- 77000
     498      [
     499          {
     500              "actions": 4095,
     501              "attributes": {
     502                  "DescriptionData": {
     503                      "datapathDescription": "None",
     504                      "hardwareDescription": "Open vSwitch",
     505                      "length": 1056,
     506                      "manufacturerDescription": "Nicira, Inc.",
     507                      "serialNumber": "None",
     508                      "softwareDescription": "1.9.0"
     509                  },
     510                  "FastWildcards": 4194303,
     511                  "supportsOfppFlood": true,
     512                  "supportsOfppTable": true
     513              },
     514              "buffers": 256,
     515              "capabilities": 199,
     516              "connectedSince": 1382901469877,
     517              "dpid": "00:00:00:00:00:00:00:05",
     518              "featuresReplyFromSwitch": {
     519                  "cancelled": false,
     520                  "done": true,
     521                  "transactionId": 2
     522              },
     523              "inetAddress": "/127.0.0.1:60016",
     524              "ports": [
     525                  {
     526                      "advertisedFeatures": 0,
     527                      "config": 0,
     528                      "currentFeatures": 0,
     529                      "hardwareAddress": "00:00:00:00:00:05",
     530                      "name": "tap-wlan1",
     531                      "peerFeatures": 0,
     532                      "portNumber": 6,
     533                      "state": 0,
     534                      "supportedFeatures": 0
     535                  },
     536                  {
     537                      "advertisedFeatures": 0,
     538                      "config": 0,
     539                      "currentFeatures": 0,
     540                      "hardwareAddress": "12:51:16:90:8f:ee",
     541                      "name": "br_tap",
     542                      "peerFeatures": 0,
     543                      "portNumber": 65534,
     544                      "state": 0,
     545                      "supportedFeatures": 0
     546                  },
     547                  {
     548                      "advertisedFeatures": 0,
     549                      "config": 0,
     550                      "currentFeatures": 0,
     551                      "hardwareAddress": "00:00:00:00:00:05",
     552                      "name": "tap-wimax",
     553                      "peerFeatures": 0,
     554                      "portNumber": 10,
     555                      "state": 0,
     556                      "supportedFeatures": 0
     557                  },
     558                  {
     559                      "advertisedFeatures": 0,
     560                      "config": 0,
     561                      "currentFeatures": 130,
     562                      "hardwareAddress": "12:51:16:90:8f:ee",
     563                      "name": "tap0",
     564                      "peerFeatures": 0,
     565                      "portNumber": 1,
     566                      "state": 1,
     567                      "supportedFeatures": 0
     568                  }
     569              ],
     570              "role": null,
     571              "tables": -1
     572          },
     573          {
     574              "actions": 4095,
     575              "attributes": {
     576                  "DescriptionData": {
     577                      "datapathDescription": "None",
     578                      "hardwareDescription": "Open vSwitch",
     579                      "length": 1056,
     580                      "manufacturerDescription": "Nicira, Inc.",
     581                      "serialNumber": "None",
     582                      "softwareDescription": "1.9.0"
     583                  },
     584                  "FastWildcards": 4194303,
     585                  "supportsOfppFlood": true,
     586                  "supportsOfppTable": true
     587              },
     588              "buffers": 256,
     589              "capabilities": 199,
     590              "connectedSince": 1382901469877,
     591              "dpid": "00:00:00:00:00:00:00:02",
     592              "featuresReplyFromSwitch": {
     593                  "cancelled": false,
     594                  "done": false,
     595                  "transactionId": 2
     596              },
     597              "inetAddress": "/127.0.0.1:60015",
     598              "ports": [
     599                  {
     600                      "advertisedFeatures": 0,
     601                      "config": 0,
     602                      "currentFeatures": 0,
     603                      "hardwareAddress": "00:00:00:00:00:02",
     604                      "name": "wlan1-tap",
     605                      "peerFeatures": 0,
     606                      "portNumber": 12,
     607                      "state": 0,
     608                      "supportedFeatures": 0
     609                  },
     610                  {
     611                      "advertisedFeatures": 0,
     612                      "config": 0,
     613                      "currentFeatures": 0,
     614                      "hardwareAddress": "00:1d:e1:3b:48:1d",
     615                      "name": "br_wifi1",
     616                      "peerFeatures": 0,
     617                      "portNumber": 65534,
     618                      "state": 0,
     619                      "supportedFeatures": 0
     620                  },
     621                  {
     622                      "advertisedFeatures": 0,
     623                      "config": 0,
     624                      "currentFeatures": 0,
     625                      "hardwareAddress": "00:1d:e1:3b:48:1d",
     626                      "name": "wlan1",
     627                      "peerFeatures": 0,
     628                      "portNumber": 1,
     629                      "state": 1,
     630                      "supportedFeatures": 0
     631                  }
     632              ],
     633              "role": null,
     634              "tables": -1
     635          },
     636          {
     637              "actions": 4095,
     638              "attributes": {
     639                  "DescriptionData": {
     640                      "datapathDescription": "None",
     641                      "hardwareDescription": "Open vSwitch",
     642                      "length": 1056,
     643                      "manufacturerDescription": "Nicira, Inc.",
     644                      "serialNumber": "None",
     645                      "softwareDescription": "1.9.0"
     646                  },
     647                  "FastWildcards": 4194303,
     648                  "supportsOfppFlood": true,
     649                  "supportsOfppTable": true
     650              },
     651              "buffers": 256,
     652              "capabilities": 199,
     653              "connectedSince": 1382901469877,
     654              "dpid": "00:00:00:00:00:00:00:04",
     655              "featuresReplyFromSwitch": {
     656                  "cancelled": false,
     657                  "done": false,
     658                  "transactionId": 2
     659              },
     660              "inetAddress": "/127.0.0.1:60014",
     661              "ports": [
     662                  {
     663                      "advertisedFeatures": 0,
     664                      "config": 0,
     665                      "currentFeatures": 0,
     666                      "hardwareAddress": "00:00:00:00:00:04",
     667                      "name": "wimax-tap",
     668                      "peerFeatures": 0,
     669                      "portNumber": 13,
     670                      "state": 0,
     671                      "supportedFeatures": 0
     672                  },
     673                  {
     674                      "advertisedFeatures": 0,
     675                      "config": 0,
     676                      "currentFeatures": 0,
     677                      "hardwareAddress": "00:1d:e1:3b:48:1d",
     678                      "name": "br_wimax",
     679                      "peerFeatures": 0,
     680                      "portNumber": 65534,
     681                      "state": 0,
     682                      "supportedFeatures": 0
     683                  },
     684                  {
     685                      "advertisedFeatures": 0,
     686                      "config": 0,
     687                     "currentFeatures": 0,
     688                      "hardwareAddress": "00:00:00:00:00:04",
     689                      "name": "wmx0",
     690                      "peerFeatures": 0,
     691                      "portNumber": 1,
     692                      "state": 0,
     693                      "supportedFeatures": 0
     694                  }
     695              ],
     696              "role": null,
     697              "tables": -1
     698          }
     699      ]
     700      }}}
     701
    492702      b.  Using your favorite text editor, open the '''/root/SwitchingScripts/gec18_switch_to_wifi.py''' script. (Do not open the '''/root/SwitchingScripts/gec18_switch_to_wifi.sh''' script. This is simply a wrapper for the python script with the flows themselves.) In the python script, browse down to were you see the definition of '''flow1'''. Right before this definition are a few variables we need to check/set. They define the MAC addresses of the physical and tap interfaces. Recall that we need to rewrite these in our flows. Why is this so? Well, WiFi and WiMAX have an association process. This process provides the AP/BS with the MAC address of the associated client. The AP/BS will filter incoming packets by associate MACs. If an ingress packet contains a source MAC that is not known to the AP/BS, it will be dropped. Thus, any packets we send from our tap interface need to have their source MAC addresses rewritten so that the AP or BS will recognize the source and thus accept the packets. Using the MAC of the WiMAX interface noted in prior steps, set the MAC address of the '''wifi_mac''' and '''wimax_mac''' to the MAC address of the WiMAX MAC. This might seem odd, but in order to simplify this tuturial and experiment, we have "spoofed" the actual MAC of the WiFi interface to that of the WiMAX interface, thus making both interfaces appear to have the same MAC. You can see this for yourselves in the '''gec18_setup.sh''' script of the client. This allows the server to address the client with a single MAC.
    493703      c. Next, save the WiFi switching script and open '''/root/SwithingScripts/gec_18_switch_to_wimax.py'''. Repeat step 5b.