setting up iperf session
diff --git a/web/ons-demo/js/app.js b/web/ons-demo/js/app.js
index 695e4bb..c150b9f 100644
--- a/web/ons-demo/js/app.js
+++ b/web/ons-demo/js/app.js
@@ -232,6 +232,23 @@
 	flows.exit().remove();
 }
 
+// TODO: cancel the interval when the flow is desel
+function startIPerfForFlow(flow) {
+	var duration = 10; // seconds
+	var interval = 100; // ms. this is defined by the server
+	var updateRate = 1000; // ms
+
+	if (flow.flowId) {
+		console.log('starting iperf for: ' + flow.flowId.value);
+		startIPerf(flow, duration, updateRate/interval);
+		flow.iperfInterval = setInterval(function () {
+			getIPerfData(flow, function (data) {
+				console.log(data);
+			});
+		});
+	}
+}
+
 function updateSelectedFlows() {
 	// make sure that all of the selected flows are either
 	// 1) valid (meaning they are in the latest list of flows)
@@ -249,6 +266,7 @@
 				if (liveFlow) {
 					newSelectedFlows.push(liveFlow);
 					liveFlow.deletePending = flow.deletePending;
+					liveFlow.iperfInterval = flow.iperfInterval;
 				} else if (flow.createPending) {
 					newSelectedFlows.push(flow);
 				}
@@ -256,6 +274,11 @@
 		});
 		selectedFlows = newSelectedFlows;
 	}
+	selectedFlows.forEach(function (flow) {
+		if (!flow.iperfInterval) {
+			startIPerfForFlow(flow);
+		}
+	});
 	while (selectedFlows.length < 3) {
 		selectedFlows.push(null);
 	}
@@ -288,6 +311,11 @@
 				flowKey !== makeFlowKey(flow) ||
 				flowKey === makeFlowKey(flow) && ifCreatePending && !flow.createPending ) {
 			newSelectedFlows.push(flow);
+		} else {
+			if (flow && flow.iperfInterval) {
+				console.log('clearing iperf interval for: ' + flow.flowId.value);
+				clearInterval(flow.iperfInterval);
+			}
 		}
 	});
 	selectedFlows = newSelectedFlows;
diff --git a/web/ons-demo/js/controller.js b/web/ons-demo/js/controller.js
index fd3f6ae..929e21b 100644
--- a/web/ons-demo/js/controller.js
+++ b/web/ons-demo/js/controller.js
@@ -1,10 +1,13 @@
 /*global d3*/
 
-function callURL(url) {
+function callURL(url, cb) {
 	d3.text(url, function (error, result) {
 		if (error) {
 			alert(url + ' : ' + error.status);
 		} else {
+			if (cb) {
+				cb(result);
+			}
 			console.log(result);
 		}
 	});
@@ -37,6 +40,16 @@
 	delFlowCmd: function (flow) {
 		var url = '/proxy/gui/delflow/' + flow.flowId.value;
 		callURL(url);
+	},
+	startIPerfCmd: function (flow, duration, numSamples) {
+		var flowId = parseInt(flow.flowId.value, 16);
+		var url = '/proxy/guid/iperf/start/' + [flowId, duration, numSamples].join('/');
+		callURL(url)
+	},
+	getIPerfDataCmd: function (flow, cb) {
+		var flowId = parseInt(flow.flowId.value, 16);
+		var url = '/proxy/gui/iperf/rate/' + flowId;
+		callURL(url, cb);
 	}
 };
 
@@ -70,4 +83,12 @@
 
 function deleteFlow(flow) {
 	controllerFunctions.delFlowCmd(flow);
+}
+
+function startIPerf(flow, duration, numSamples) {
+	controllerFunctions.startIPerfCmd(flow, duration, numSamples);
+}
+
+function getIPerfData(flow, cb) {
+	controllerFunctions.getIPerfDataCmd(flow, cb);
 }
\ No newline at end of file