| 157 | To verify your implementation, run the following on the switch: |
| 158 | {{{ |
| 159 | sudo /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 | {{{ |
| 163 | sudo /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 | {{{ |
| 175 | left path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 176 | right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 177 | since there are not more throughput going to the right path, let's go *LEFT* for this one |
| 178 | [stats_reply]------------------------------------------- |
| 179 | left path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 180 | right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 181 | since there are not more throughput going to the right path, let's go *LEFT* for this one |
| 182 | [stats_reply]------------------------------------------- |
| 183 | left path: flow 1, packets 1383, bytes 2088970, average per-flow throughput: 72033 Bytes-per-second |
| 184 | right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 185 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 186 | [stats_reply]------------------------------------------- |
| 187 | left path: flow 2, packets 1383, bytes 2088970, average per-flow throughput: 33693 Bytes-per-second |
| 188 | right path: flow 0, packets 0, bytes 0, average per-flow throughput: 1000000000 Bytes-per-second |
| 189 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 190 | [stats_reply]------------------------------------------- |
| 191 | left path: flow 2, packets 3890, bytes 5879268, average per-flow throughput: 238058 Bytes-per-second |
| 192 | right path: flow 1, packets 7831, bytes 11852922, average per-flow throughput: 1975487 Bytes-per-second |
| 193 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 194 | [stats_reply]------------------------------------------- |
| 195 | left path: flow 2, packets 7699, bytes 11646094, average per-flow throughput: 365063 Bytes-per-second |
| 196 | right path: flow 2, packets 14058, bytes 21275204, average per-flow throughput: 1151337 Bytes-per-second |
| 197 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 198 | [stats_reply]------------------------------------------- |
| 199 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 256263 Bytes-per-second |
| 200 | right path: flow 3, packets 24724, bytes 37415972, average per-flow throughput: 1154827 Bytes-per-second |
| 201 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 202 | [stats_reply]------------------------------------------- |
| 203 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 216707 Bytes-per-second |
| 204 | right path: flow 4, packets 31605, bytes 47828786, average per-flow throughput: 1008963 Bytes-per-second |
| 205 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 206 | [stats_reply]------------------------------------------- |
| 207 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 188151 Bytes-per-second |
| 208 | right path: flow 5, packets 38005, bytes 57515518, average per-flow throughput: 915020 Bytes-per-second |
| 209 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 210 | [stats_reply]------------------------------------------- |
| 211 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 166369 Bytes-per-second |
| 212 | right path: flow 6, packets 44240, bytes 66948768, average per-flow throughput: 828674 Bytes-per-second |
| 213 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 214 | [stats_reply]------------------------------------------- |
| 215 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 149187 Bytes-per-second |
| 216 | right path: flow 7, packets 50427, bytes 76309042, average per-flow throughput: 707241 Bytes-per-second |
| 217 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 218 | [stats_reply]------------------------------------------- |
| 219 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 135487 Bytes-per-second |
| 220 | right path: flow 8, packets 57148, bytes 86478104, average per-flow throughput: 695021 Bytes-per-second |
| 221 | since there are more throughput going to the right path, let's go *RIGHT* for this one |
| 222 | [stats_reply]------------------------------------------- |
| 223 | left path: flow 2, packets 7919, bytes 11977302, average per-flow throughput: 126460 Bytes-per-second |
| 224 | right path: flow 9, packets 61941, bytes 93728214, average per-flow throughput: 624578 Bytes-per-second |
| 225 | since 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 | |