Changes between Version 3 and Version 4 of GENIEducation/SampleAssignments/OpenFlowLoadBalancerAssignment/ForInstructors


Ignore:
Timestamp:
05/31/13 13:56:04 (7 years ago)
Author:
shuang@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIEducation/SampleAssignments/OpenFlowLoadBalancerAssignment/ForInstructors

    v3 v4  
    155155 '''Note: ''' since Trema does not yet support multi-thread mode, this simple implementation runs in one thread. As a result, users will experience some delay in fetching the flow statistics (i.e., `stats_reply` will not be called right after a !FlowStatsRequest message has been sent in `packet_in` handler).
    156156 '''Solution: The source code for load-balancer-simple-tp.rb can be found at [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/forInstructors/load-balancer-simple-tp.rb load-balancer-simple-tp.rb] [[BR]]'''
     157 To verify your implementation, run the following on the switch:
     158{{{
     159sudo /opt/trema-trema-8e97343/trema run load-balancer-simple-tp.rb
     160}}}
     161 Then set the network lossrate on the left path to be 50% by executing the following on left node:
     162{{{
     163sudo /sbin/tc qdisc add dev eth2 root handle 1:0 netem loss 50%
     164}}}
     165 Then start iperf server on the `inside` node by:
     166{{{
     167 /usr/local/etc/emulab/emulab-iperf -s
     168}}}
     169 Then run multiple iperf client on the `outside` node by executing the following multiple times (with e.g., 5 seconds delay between each execution so that the openflow controller has time to read the flow statistics):
     170{{{
     171/usr/local/etc/emulab/emulab-iperf -c 10.10.10.2 -t 100 &
     172}}}
     173 Pay attention to the output from the OpenFlow controller on node `switch`. A sample output is as follows:
     174{{{
     175left path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     176right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     177since there are not more throughput going to the right path, let's go *LEFT* for this one
     178[stats_reply]-------------------------------------------
     179left path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     180right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     181since there are not more throughput going to the right path, let's go *LEFT* for this one
     182[stats_reply]-------------------------------------------
     183left path: flow 1, packets 1383, bytes 2088970, average per-flow throughput: 72033 Bytes-per-second
     184right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     185since there are more throughput going to the right path, let's go *RIGHT* for this one
     186[stats_reply]-------------------------------------------
     187left path: flow 2, packets 1383, bytes 2088970, average per-flow throughput: 33693 Bytes-per-second
     188right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second
     189since there are more throughput going to the right path, let's go *RIGHT* for this one
     190[stats_reply]-------------------------------------------
     191left path: flow 2, packets 3890, bytes 5879268, average per-flow throughput: 238058 Bytes-per-second
     192right path: flow 1, packets 7831, bytes 11852922, average per-flow throughput: 1975487 Bytes-per-second
     193since there are more throughput going to the right path, let's go *RIGHT* for this one
     194[stats_reply]-------------------------------------------
     195left path: flow 2, packets 7699, bytes 11646094, average per-flow throughput: 365063 Bytes-per-second
     196right path: flow 2, packets 14058, bytes 21275204, average per-flow throughput: 1151337 Bytes-per-second
     197since there are more throughput going to the right path, let's go *RIGHT* for this one
     198[stats_reply]-------------------------------------------
     199left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 256263 Bytes-per-second
     200right path: flow 3, packets 24724, bytes 37415972, average per-flow throughput: 1154827 Bytes-per-second
     201since there are more throughput going to the right path, let's go *RIGHT* for this one
     202[stats_reply]-------------------------------------------
     203left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 216707 Bytes-per-second
     204right path: flow 4, packets 31605, bytes 47828786, average per-flow throughput: 1008963 Bytes-per-second
     205since there are more throughput going to the right path, let's go *RIGHT* for this one
     206[stats_reply]-------------------------------------------
     207left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 188151 Bytes-per-second
     208right path: flow 5, packets 38005, bytes 57515518, average per-flow throughput: 915020 Bytes-per-second
     209since there are more throughput going to the right path, let's go *RIGHT* for this one
     210[stats_reply]-------------------------------------------
     211left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 166369 Bytes-per-second
     212right path: flow 6, packets 44240, bytes 66948768, average per-flow throughput: 828674 Bytes-per-second
     213since there are more throughput going to the right path, let's go *RIGHT* for this one
     214[stats_reply]-------------------------------------------
     215left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 149187 Bytes-per-second
     216right path: flow 7, packets 50427, bytes 76309042, average per-flow throughput: 707241 Bytes-per-second
     217since there are more throughput going to the right path, let's go *RIGHT* for this one
     218[stats_reply]-------------------------------------------
     219left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 135487 Bytes-per-second
     220right path: flow 8, packets 57148, bytes 86478104, average per-flow throughput: 695021 Bytes-per-second
     221since there are more throughput going to the right path, let's go *RIGHT* for this one
     222[stats_reply]-------------------------------------------
     223left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 126460 Bytes-per-second
     224right path: flow 9, packets 61941, bytes 93728214, average per-flow throughput: 624578 Bytes-per-second
     225since there are more throughput going to the right path, let's go *RIGHT* for this one
     226[stats_reply]-------------------------------------------
     227}}}
     228 '''Explanation: ''' When the first two new TCP flow arrived, the controller has not got any flow stats from the switch yet, so it directs the two flows to the default path: left. [[BR]]
     229 Starting from the third TCP flow, the controller gets the flow stats and decides to direct the flow to the empty path: right (by default, if there is no flow going through the path, the throughput is 1000000000 Bytes per second. '''Our controller simply forward the new flow to the path with higher throughput since a higher number simply means it is not congested'''). [[BR]]
     230 Soon the controller figures out that the left path is experiencing congestion by looking at the average per flow throughput (as you can find from the output of the controller). So the controller keeps forwarding any new coming TCP flows to the right path.
     231
     232
    157233
    158234 * All Answers can be found [http://www.gpolab.bbn.com/experiment-support/OpenFlowExampleExperiment/forInstructors/ Here]