UDP iperf working
diff --git a/scripts/runiperf.sh b/scripts/runiperf.sh
index 9d40c98..ec903e3 100755
--- a/scripts/runiperf.sh
+++ b/scripts/runiperf.sh
@@ -2,30 +2,50 @@
 import sys
 import os
 
+# Usage: flowid src_dpid dst_dpid params
 def usage():
-  print "%s flowid src_dpid src_port dst_dpid dst_port duration samples" % sys.argv[0]
+  print "%s flowid src_dpid dst_dpid svr|client <proto>/<duration>/<interval>/<samples>" % sys.argv[0]
   sys.exit()
 
 def main():
   flowid = sys.argv[1]
   src_dpid = sys.argv[2]
-  dst_dpid = sys.argv[4]
-  duration=int(sys.argv[6])
-  samples=int(sys.argv[7])
+  dst_dpid = sys.argv[3]
+  server = sys.argv[4].upper()[0]
+  params = sys.argv[5].split('/')
+  proto = params[0]
+  duration = params[1]
+  interval = params[2]
+  samples = params[3]
+
   src_nwid=int(src_dpid.split(':')[-2], 16)
   dst_nwid=int(dst_dpid.split(':')[-2], 16)
   src_hostid=int(src_dpid.split(':')[-1], 16)
   dst_hostid=int(dst_dpid.split(':')[-1], 16)
-  # /home/ubuntu/ONOS/web/scripts/iperf -t%s -i0.1 -yJ -o /tmp/iperf_%s.out -c 127.0.0.1 &
-  cmd="ssh -o StrictHostKeyChecking=no 1.1.%d.1 '/home/ubuntu/ONOS/scripts/iperf -t %s -i0.1 -k %d -yJ -o /home/ubuntu/ONOS/web/log/iperf_%s.out -c 192.168.%d.%d 2>&1 &' &" % (src_hostid, duration, samples, flowid, dst_nwid, dst_hostid)
-  killcmd='pkill -KILL -f \"iperf .* -o .*/iperf_%s.out\"' % (flowid)
-  print killcmd
-  print cmd
-  os.popen(killcmd)
-  os.popen(cmd)
+
+  if (proto == "tcp"):
+    cmd="ssh -o StrictHostKeyChecking=no 1.1.%d.1 '/home/ubuntu/ONOS/scripts/iperf -t%s -i%s -k%s -yJ -o /home/ubuntu/ONOS/web/log/iperf_%s.out -c 192.168.%d.%d 2>&1 &' &" % (src_hostid, duration, interval, samples, flowid, dst_nwid, dst_hostid)
+    killcmd='pkill -KILL -f \"iperf .* -o .*/iperf_%s.out\"' % (flowid)
+    print killcmd
+    print cmd
+    os.popen(killcmd)
+    os.popen(cmd)
+  else:
+    if (server == 'S'):
+      cmd="ssh -o StrictHostKeyChecking=no 1.1.%d.1 '/home/ubuntu/ONOS/scripts/iperf -us -i%s -k%s -yJ -o /home/ubuntu/ONOS/web/log/iperfsvr_%s.out 2>&1 &' &" % (dst_hostid, interval, samples, flowid)
+      killcmd='pkill -KILL -f \"iperf .* -o .*/iperfsvr_%s.out\"' % (flowid)
+      print killcmd
+      print cmd
+    else:
+      cmd="ssh -o StrictHostKeyChecking=no 1.1.%d.1 '/home/ubuntu/ONOS/scripts/iperf -u -t%s -i%s -k%s -yJ -o /home/ubuntu/ONOS/web/log/iperfclient_%s.out -c 192.168.%d.%d 2>&1 &' &" % (src_hostid, duration, interval, samples, flowid, dst_nwid, dst_hostid)
+      killcmd='pkill -KILL -f \"iperf .* -o .*/iperfclient_%s.out\"' % (flowid)
+      print killcmd
+      print cmd
+    os.popen(killcmd)
+    os.popen(cmd)
 
 if __name__ == "__main__":
-  if len(sys.argv) != 8:
+  if len(sys.argv) != 6:
     print len(sys.argv)
     usage()
 
diff --git a/web/ons-demo/js/app.js b/web/ons-demo/js/app.js
index bc3cc6d..ea0ac83 100644
--- a/web/ons-demo/js/app.js
+++ b/web/ons-demo/js/app.js
@@ -268,9 +268,9 @@
 		var i;
 		for (i=0; i < pointsToDisplay; ++i) {
 			var sample = flow.iperfData.samples[i];
-			var height = 32 * sample/50000000;
-			if (height > 32)
-				height = 32;
+			var height = 30 * sample/1000000;
+			if (height > 30)
+				height = 30;
 			pts.push({
 				x: i * 1000/(pointsToDisplay-1),
 				y: 32 - height
diff --git a/web/topology_rest.py b/web/topology_rest.py
index 4490cf6..87bdeb0 100755
--- a/web/topology_rest.py
+++ b/web/topology_rest.py
@@ -905,7 +905,6 @@
 
   parsedResult = json.loads(result)
 
-#  flowId = int(parsedResult['flowId']['value'], 16)
   flowId = int(parsedResult['flowId']['value'], 16)
   src_dpid = parsedResult['dataPath']['srcPort']['dpid']['value']
   src_port = parsedResult['dataPath']['srcPort']['port']['value']
@@ -914,13 +913,25 @@
 #  print "FlowPath: (flowId = %s src = %s/%s dst = %s/%s" % (flowId, src_dpid, src_port, dst_dpid, dst_port)
 
   if src_dpid in core_switches:
-      host = controllers[0]
+      src_host = controllers[0]
   else:
       hostid=int(src_dpid.split(':')[-2])
-      host = controllers[hostid-1]
+      src_host = controllers[hostid-1]
 
-#  ./runiperf.sh 2 00:00:00:00:00:00:02:02 1 00:00:00:00:00:00:03:02 1 100 15
-  cmd_string="ssh -i ~/.ssh/onlabkey.pem %s 'cd ONOS/scripts; ./runiperf.sh %d %s %s %s %s %s %s'" % (host, flowId, src_dpid, src_port, dst_dpid, dst_port, duration, samples)
+  if dst_dpid in core_switches:
+      dst_host = controllers[0]
+  else:
+      hostid=int(dst_dpid.split(':')[-2])
+      dst_host = controllers[hostid-1]
+
+# /runiperf.sh <flowid> <src_dpid> <dst_dpid> svr|client <proto>/<duration>/<interval>/<samples>
+  protocol="udp"
+  interval=0.1
+  cmd_string="ssh -i ~/.ssh/onlabkey.pem %s 'cd ONOS/scripts; ./runiperf.sh %d %s %s %s %s/%s/%s/%s'" % (dst_host, flowId, src_dpid, dst_dpid, "svr", protocol, duration, interval, samples)
+  print cmd_string
+  os.popen(cmd_string)
+
+  cmd_string="ssh -i ~/.ssh/onlabkey.pem %s 'cd ONOS/scripts; ./runiperf.sh %d %s %s %s %s/%s/%s/%s'" % (src_host, flowId, src_dpid, dst_dpid, "client", protocol, duration, interval, samples)
   print cmd_string
   os.popen(cmd_string)
 
@@ -952,14 +963,14 @@
   dst_dpid = parsedResult['dataPath']['dstPort']['dpid']['value']
   dst_port = parsedResult['dataPath']['dstPort']['port']['value']
 
-  if src_dpid in core_switches:
+  if dst_dpid in core_switches:
       host = controllers[0]
   else:
-      hostid=int(src_dpid.split(':')[-2])
+      hostid=int(dst_dpid.split(':')[-2])
       host = controllers[hostid-1]
 
   try:
-    command = "curl -s http://%s:%s/log/iperf_%s.out" % (host, 9000, flow_id)
+    command = "curl -s http://%s:%s/log/iperfsvr_%s.out" % (host, 9000, flow_id)
     print command
     result = os.popen(command).read()
   except: