diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
index 307919a..251620c 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
@@ -87,9 +87,15 @@
     private static int nextFlowEntryIdSuffix = 0;
     private static long nextFlowEntryId = 0;
 
+    // State for measurement purpose
     private static long measurementFlowId = 100000;
     private static String measurementFlowIdStr = "0x186a0";	// 100000
     private long modifiedMeasurementFlowTime = 0;
+    //
+    private LinkedList<FlowPath> measurementStoredPaths = new LinkedList<FlowPath>();
+    private LinkedList<FlowPath> measurementProcessingPaths = null;
+    private long measurementStartTimeProcessingPaths = 0;
+    private long measurementEndTimeProcessingPaths = 0;
 
     /** The logger. */
     private static Logger log = LoggerFactory.getLogger(FlowManager.class);
@@ -462,7 +468,7 @@
 		shortestPathReconcileScheduler = Executors.newScheduledThreadPool(1);
     }
 
-    private long getNextFlowEntryId() {
+    private synchronized long getNextFlowEntryId() {
 	//
 	// Generate the next Flow Entry ID.
 	// NOTE: For now, the higher 32 bits are random, and
@@ -745,6 +751,23 @@
     }
 
     /**
+     * Delete all previously added flows.
+     *
+     * @return true on success, otherwise false.
+     */
+    @Override
+    public boolean deleteAllFlows() {
+
+	// Get all flows and delete them one-by-one
+    	ArrayList<FlowPath> allFlows = getAllFlows();
+	for (FlowPath flowPath : allFlows) {
+	    deleteFlow(flowPath.flowId());
+	}
+
+	return true;
+    }
+
+    /**
      * Delete a previously added flow.
      *
      * @param flowId the Flow ID of the flow to delete.
@@ -807,6 +830,23 @@
     }
 
     /**
+     * Clear the state for all previously added flows.
+     *
+     * @return true on success, otherwise false.
+     */
+    @Override
+    public boolean clearAllFlows() {
+
+	// Get all flows and clear them one-by-one
+    	ArrayList<FlowPath> allFlows = getAllFlows();
+	for (FlowPath flowPath : allFlows) {
+	    clearFlow(flowPath.flowId());
+	}
+
+	return true;
+    }
+
+    /**
      * Clear the state for a previously added flow.
      *
      * @param flowId the Flow ID of the flow to clear.
@@ -1763,4 +1803,178 @@
 	//
 	return (installRemoteFlowEntry(flowPath, flowEntry));
     }
+
+    /**
+     * Store a path flow for measurement purpose.
+     *
+     * NOTE: The Flow Path argument does NOT contain flow entries.
+     * The Shortest Path is computed, and the corresponding Flow Entries
+     * are stored in the Flow Path.
+     *
+     * @param flowPath the Flow Path with the endpoints and the match
+     * conditions to store.
+     * @return the stored shortest-path flow on success, otherwise null.
+     */
+    @Override
+    public FlowPath measurementStorePathFlow(FlowPath flowPath) {
+	//
+	// Prepare the Shortest Path computation if the first Flow Path
+	//
+	if (measurementStoredPaths.isEmpty())
+	    topoRouteService.prepareShortestPathTopo();
+
+	//
+	// Compute the Shortest Path
+	//
+	DataPath dataPath =
+	    topoRouteService.getTopoShortestPath(flowPath.dataPath().srcPort(),
+						 flowPath.dataPath().dstPort());
+	if (dataPath == null) {
+	    // We need the DataPath to populate the Network MAP
+	    dataPath = new DataPath();
+	    dataPath.setSrcPort(flowPath.dataPath().srcPort());
+	    dataPath.setDstPort(flowPath.dataPath().dstPort());
+	}
+
+	//
+	// Set the incoming port matching and the outgoing port output
+	// actions for each flow entry.
+	//
+	for (FlowEntry flowEntry : dataPath.flowEntries()) {
+	    // Set the incoming port matching
+	    FlowEntryMatch flowEntryMatch = new FlowEntryMatch();
+	    flowEntry.setFlowEntryMatch(flowEntryMatch);
+	    flowEntryMatch.enableInPort(flowEntry.inPort());
+
+	    // Set the outgoing port output action
+	    ArrayList<FlowEntryAction> flowEntryActions = flowEntry.flowEntryActions();
+	    if (flowEntryActions == null) {
+		flowEntryActions = new ArrayList<FlowEntryAction>();
+		flowEntry.setFlowEntryActions(flowEntryActions);
+	    }
+	    FlowEntryAction flowEntryAction = new FlowEntryAction();
+	    flowEntryAction.setActionOutput(flowEntry.outPort());
+	    flowEntryActions.add(flowEntryAction);
+	}
+
+	//
+	// Prepare the computed Flow Path
+	//
+	FlowPath computedFlowPath = new FlowPath();
+	computedFlowPath.setFlowId(new FlowId(flowPath.flowId().value()));
+	computedFlowPath.setInstallerId(new CallerId(flowPath.installerId().value()));
+	computedFlowPath.setDataPath(dataPath);
+	computedFlowPath.setFlowEntryMatch(new FlowEntryMatch(flowPath.flowEntryMatch()));
+
+	//
+	// Add the computed Flow Path the the internal storage
+	//
+	measurementStoredPaths.add(computedFlowPath);
+
+	return (computedFlowPath);
+    }
+
+    /**
+     * Install path flows for measurement purpose.
+     *
+     * @param numThreads the number of threads to use to install the path
+     * flows.
+     * @return true on success, otherwise false.
+     */
+    @Override
+    public boolean measurementInstallPaths(Integer numThreads) {
+	List<Thread> threads = new LinkedList<Thread>();
+
+	// Create a copy of the paths to install
+	measurementProcessingPaths = new LinkedList<FlowPath>(measurementStoredPaths);
+
+	//
+	// Create the threads to install the Flow Paths
+	//
+	for (int i = 0; i < numThreads; i++) {
+	    Thread thread = new Thread(new Runnable() {
+		@Override
+		public void run() {
+		    while (true) {
+			FlowPath flowPath = measurementPollFirstFlowPath();
+			if (flowPath == null)
+			    return;
+			// Install the Flow Path
+			FlowId flowId = new FlowId();
+			String dataPathSummaryStr =
+			    flowPath.dataPath().dataPathSummary();
+			addFlow(flowPath, flowId, dataPathSummaryStr);
+		    }
+		}}, "Measurement Add Flow Path");
+	    threads.add(thread);
+	}
+
+	//
+	// Start processing
+	//
+	measurementEndTimeProcessingPaths = 0;
+	measurementStartTimeProcessingPaths = System.nanoTime();
+	for (Thread thread : threads) {
+	    thread.start();
+	}
+
+	//
+	// Wait until the end of processing time
+	//
+	while (measurementEndTimeProcessingPaths == 0) {
+	    try {
+		Thread.sleep(100);
+	    } catch (InterruptedException e) {
+		// Continue waiting
+	    }
+	}
+
+	return true;
+    }
+
+    /**
+     * Get the measurement time that took to install the path flows.
+     *
+     * @return the measurement time (in nanoseconds) it took to install
+     * the path flows.
+     */
+    @Override
+    public Long measurementGetInstallPathsTimeNsec() {
+	return new Long(measurementEndTimeProcessingPaths -
+			measurementStartTimeProcessingPaths);
+    }
+
+    /**
+     * Get a Flow Path that needs to be installed for measurement purpose.
+     *
+     * If there is no next Flow Path to install, the end time measurement
+     * is recorded.
+     *
+     * @return the next Flow Path to install if exists, otherwise null.
+     */
+    private synchronized FlowPath measurementPollFirstFlowPath() {
+	FlowPath flowPath = measurementProcessingPaths.pollFirst();
+
+	// Record the end of processing, if the first call
+	if ((flowPath == null) && (measurementEndTimeProcessingPaths == 0))
+	    measurementEndTimeProcessingPaths = System.nanoTime();
+
+	return flowPath;
+    }
+
+    /**
+     * Clear the path flows stored for measurement purpose.
+     *
+     * @return true on success, otherwise false.
+     */
+    @Override
+    public boolean measurementClearAllPaths() {
+	measurementStoredPaths.clear();
+	topoRouteService.dropShortestPathTopo();
+	measurementStartTimeProcessingPaths = 0;
+	measurementEndTimeProcessingPaths = 0;
+
+	return true;
+    }
+
 }
diff --git a/src/main/java/net/floodlightcontroller/flowcache/IFlowService.java b/src/main/java/net/floodlightcontroller/flowcache/IFlowService.java
index 855f064..5e0db35 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/IFlowService.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/IFlowService.java
@@ -29,6 +29,13 @@
 		    String dataPathSummaryStr);
 
     /**
+     * Delete all previously added flows.
+     *
+     * @return true on success, otherwise false.
+     */
+    boolean deleteAllFlows();
+
+    /**
      * Delete a previously added flow.
      *
      * @param flowId the Flow ID of the flow to delete.
@@ -37,6 +44,13 @@
     boolean deleteFlow(FlowId flowId);
 
     /**
+     * Clear the state for all previously added flows.
+     *
+     * @return true on success, otherwise false.
+     */
+    boolean clearAllFlows();
+
+    /**
      * Clear the state for a previously added flow.
      *
      * @param flowId the Flow ID of the flow to clear.
@@ -101,4 +115,39 @@
      * @return the added shortest-path flow on success, otherwise null.
      */
     public FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath);
+
+    /**
+     * Store a path flow for measurement purpose.
+     *
+     * NOTE: The Flow Path argument does NOT contain flow entries.
+     *
+     * @param flowPath the Flow Path with the endpoints and the match
+     * conditions to store.
+     * @return the stored shortest-path flow on success, otherwise null.
+     */
+    public FlowPath measurementStorePathFlow(FlowPath flowPath);
+
+    /**
+     * Install path flows for measurement purpose.
+     *
+     * @param numThreads the number of threads to use to install the path
+     * flows.
+     * @return true on success, otherwise false.
+     */
+    public boolean measurementInstallPaths(Integer numThreads);
+
+    /**
+     * Get the measurement time that took to install the path flows.
+     *
+     * @return the measurement time (in nanoseconds) it took to install
+     * the path flows.
+     */
+    public Long measurementGetInstallPathsTimeNsec();
+
+    /**
+     * Clear the path flows stored for measurement purpose.
+     *
+     * @return true on success, otherwise false.
+     */
+    public boolean measurementClearAllPaths();
 }
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/ClearFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/ClearFlowResource.java
index 8fff358..7f3b589 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/ClearFlowResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/ClearFlowResource.java
@@ -27,11 +27,16 @@
 
 	// Extract the arguments
 	String flowIdStr = (String) getRequestAttributes().get("flow-id");
-	FlowId flowId = new FlowId(flowIdStr);
-	log.debug("Clear Flow Id: " + flowIdStr);
 
 	// Process the request
-	result = flowService.clearFlow(flowId);
+	if (flowIdStr.equals("all")) {
+	    log.debug("Clear All Flows");
+	    result = flowService.clearAllFlows();
+	} else {
+	    FlowId flowId = new FlowId(flowIdStr);
+	    log.debug("Clear Flow Id: " + flowIdStr);
+	    result = flowService.clearFlow(flowId);
+	}
 	return result;
     }
 }
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
index f418c1e..ed6f0f7 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
@@ -27,11 +27,16 @@
 
 	// Extract the arguments
 	String flowIdStr = (String) getRequestAttributes().get("flow-id");
-	FlowId flowId = new FlowId(flowIdStr);
-	log.debug("Delete Flow Id: " + flowIdStr);
 
 	// Process the request
-	result = flowService.deleteFlow(flowId);
+	if (flowIdStr.equals("all")) {
+	    log.debug("Delete All Flows");
+	    result = flowService.deleteAllFlows();
+	} else {
+	    FlowId flowId = new FlowId(flowIdStr);
+	    log.debug("Delete Flow Id: " + flowIdStr);
+	    result = flowService.deleteFlow(flowId);
+	}
 	return result;
     }
 }
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/FlowWebRoutable.java b/src/main/java/net/floodlightcontroller/flowcache/web/FlowWebRoutable.java
index 962dbbb..9fa5e63 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/FlowWebRoutable.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/FlowWebRoutable.java
@@ -22,6 +22,10 @@
         router.attach("/getall-by-endpoints/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", GetAllFlowsByEndpointsResource.class);
         router.attach("/getall/json", GetAllFlowsResource.class);
         router.attach("/getsummary/{flow-id}/{max-flows}/json", GetSummaryFlowsResource.class);
+        router.attach("/measurement-store-path/json", MeasurementStorePathFlowResource.class);
+        router.attach("/measurement-install-paths/{num-threads}/json", MeasurementInstallPathsFlowResource.class);
+        router.attach("/measurement-get-install-paths-time-nsec/json", MeasurementGetInstallPathsTimeNsecFlowResource.class);
+        router.attach("/measurement-clear-all-paths/json", MeasurementClearAllPathsFlowResource.class);
         return router;
     }
 
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementClearAllPathsFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementClearAllPathsFlowResource.java
new file mode 100644
index 0000000..f69180d
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementClearAllPathsFlowResource.java
@@ -0,0 +1,35 @@
+package net.floodlightcontroller.flowcache.web;
+
+import net.floodlightcontroller.flowcache.IFlowService;
+import net.floodlightcontroller.util.FlowId;
+
+import org.openflow.util.HexString;
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MeasurementClearAllPathsFlowResource extends ServerResource {
+    protected static Logger log = LoggerFactory.getLogger(MeasurementClearAllPathsFlowResource.class);
+
+    @Get("json")
+    public Boolean retrieve() {
+	Boolean result = false;
+
+        IFlowService flowService =
+                (IFlowService)getContext().getAttributes().
+                get(IFlowService.class.getCanonicalName());
+
+        if (flowService == null) {
+	    log.debug("ONOS Flow Service not found");
+            return result;
+	}
+
+	// Extract the arguments
+	log.debug("Measurement Clear All Paths");
+
+	// Process the request
+	result = flowService.measurementClearAllPaths();
+	return result;
+    }
+}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementGetInstallPathsTimeNsecFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementGetInstallPathsTimeNsecFlowResource.java
new file mode 100644
index 0000000..3dc1d08
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementGetInstallPathsTimeNsecFlowResource.java
@@ -0,0 +1,37 @@
+package net.floodlightcontroller.flowcache.web;
+
+import net.floodlightcontroller.flowcache.IFlowService;
+import net.floodlightcontroller.util.FlowId;
+
+import org.openflow.util.HexString;
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MeasurementGetInstallPathsTimeNsecFlowResource extends ServerResource {
+    protected static Logger log = LoggerFactory.getLogger(MeasurementGetInstallPathsTimeNsecFlowResource.class);
+
+    @Get("json")
+    public Long retrieve() {
+	Long result = null;
+
+        IFlowService flowService =
+                (IFlowService)getContext().getAttributes().
+                get(IFlowService.class.getCanonicalName());
+
+        if (flowService == null) {
+	    log.debug("ONOS Flow Service not found");
+	    return result;
+	}
+
+	// Extract the arguments
+
+	// Process the request
+	result = flowService.measurementGetInstallPathsTimeNsec();
+
+	log.debug("Measurement Get Install Paths Time (nsec): " + result);
+
+	return result;
+    }
+}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementInstallPathsFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementInstallPathsFlowResource.java
new file mode 100644
index 0000000..1bba4b1
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementInstallPathsFlowResource.java
@@ -0,0 +1,37 @@
+package net.floodlightcontroller.flowcache.web;
+
+import net.floodlightcontroller.flowcache.IFlowService;
+import net.floodlightcontroller.util.FlowId;
+
+import org.openflow.util.HexString;
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MeasurementInstallPathsFlowResource extends ServerResource {
+    protected static Logger log = LoggerFactory.getLogger(MeasurementInstallPathsFlowResource.class);
+
+    @Get("json")
+    public Boolean retrieve() {
+	Boolean result = false;
+
+        IFlowService flowService =
+                (IFlowService)getContext().getAttributes().
+                get(IFlowService.class.getCanonicalName());
+
+        if (flowService == null) {
+	    log.debug("ONOS Flow Service not found");
+	    return result;
+	}
+
+	// Extract the arguments
+	String numThreadsStr = (String) getRequestAttributes().get("num-threads");
+	Integer numThreads = new Integer(numThreadsStr);
+	log.debug("Measurement Install Paths Number of Threads " + numThreadsStr);
+
+	// Process the request
+	result = flowService.measurementInstallPaths(numThreads);
+	return result;
+    }
+}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementStorePathFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementStorePathFlowResource.java
new file mode 100644
index 0000000..e68ceb7
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/MeasurementStorePathFlowResource.java
@@ -0,0 +1,65 @@
+package net.floodlightcontroller.flowcache.web;
+
+import java.io.IOException;
+
+import net.floodlightcontroller.flowcache.IFlowService;
+import net.floodlightcontroller.util.FlowId;
+import net.floodlightcontroller.util.FlowPath;
+
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.restlet.resource.Post;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MeasurementStorePathFlowResource extends ServerResource {
+
+    protected static Logger log = LoggerFactory.getLogger(MeasurementStorePathFlowResource.class);
+
+    @Post("json")
+    public FlowId store(String flowJson) {
+	FlowId result = new FlowId();
+
+        IFlowService flowService =
+                (IFlowService)getContext().getAttributes().
+                get(IFlowService.class.getCanonicalName());
+
+        if (flowService == null) {
+	    log.debug("ONOS Flow Service not found");
+            return result;
+	}
+
+	//
+	// Extract the arguments
+	// NOTE: The "flow" is specified in JSON format.
+	//
+	ObjectMapper mapper = new ObjectMapper();
+	String flowPathStr = flowJson;
+	FlowPath flowPath = null;
+	log.debug("Measurement Store Flow Path: " + flowPathStr);
+	try {
+	    flowPath = mapper.readValue(flowPathStr, FlowPath.class);
+	} catch (JsonGenerationException e) {
+	    e.printStackTrace();
+	} catch (JsonMappingException e) {
+	    e.printStackTrace();
+	} catch (IOException e) {
+	    e.printStackTrace();
+	}
+
+	// Process the request
+	if (flowPath != null) {
+	    FlowPath addedFlowPath =
+		flowService.measurementStorePathFlow(flowPath);
+	    if (addedFlowPath == null)
+		result = new FlowId();		// Error: Return empty Flow Id
+	    else
+		result = addedFlowPath.flowId();
+	}
+
+        return result;
+    }
+}
diff --git a/web/clear_flow.py b/web/clear_flow.py
index 50678e2..db70d40 100755
--- a/web/clear_flow.py
+++ b/web/clear_flow.py
@@ -51,6 +51,7 @@
   usage_msg = usage_msg + "    Arguments:\n"
   usage_msg = usage_msg + "        <begin-flow-id> <end-flow-id>      Clear all flows in the flow ID range\n"
   usage_msg = usage_msg + "        <flow-id>                          Clear a single flow with the flow ID\n"
+  usage_msg = usage_msg + "        all                                Clear all flows\n"
 
   # app.debug = False;
 
@@ -63,14 +64,18 @@
   if len(sys.argv) < 2:
     log_error(usage_msg)
     exit(1)
-  begin_flow_id = int(sys.argv[1], 0)
-  if len(sys.argv) >= 3:
-    end_flow_id = int(sys.argv[2], 0)
-  else:
-    end_flow_id = begin_flow_id
 
-  # Do the work
-  flow_id = begin_flow_id
-  while flow_id <= end_flow_id:
-    clear_flow_path(flow_id)
-    flow_id = flow_id + 1
+  if (sys.argv[1] == "all"):
+    clear_flow_path(sys.argv[1])
+  else:
+    begin_flow_id = int(sys.argv[1], 0)
+    if len(sys.argv) >= 3:
+      end_flow_id = int(sys.argv[2], 0)
+    else:
+      end_flow_id = begin_flow_id
+
+    # Do the work
+    flow_id = begin_flow_id
+    while flow_id <= end_flow_id:
+      clear_flow_path(flow_id)
+      flow_id = flow_id + 1
diff --git a/web/delete_flow.py b/web/delete_flow.py
index ff4caff..fff9319 100755
--- a/web/delete_flow.py
+++ b/web/delete_flow.py
@@ -51,6 +51,7 @@
   usage_msg = usage_msg + "    Arguments:\n"
   usage_msg = usage_msg + "        <begin-flow-id> <end-flow-id>      Delete all flows in the flow ID range\n"
   usage_msg = usage_msg + "        <flow-id>                          Delete a single flow with the flow ID\n"
+  usage_msg = usage_msg + "        all                                Delete all flows\n"
 
   # app.debug = False;
 
@@ -63,14 +64,18 @@
   if len(sys.argv) < 2:
     log_error(usage_msg)
     exit(1)
-  begin_flow_id = int(sys.argv[1], 0)
-  if len(sys.argv) >= 3:
-    end_flow_id = int(sys.argv[2], 0)
-  else:
-    end_flow_id = begin_flow_id
 
-  # Do the work
-  flow_id = begin_flow_id
-  while flow_id <= end_flow_id:
-    delete_flow_path(flow_id)
-    flow_id = flow_id + 1
+  if (sys.argv[1] == "all"):
+    delete_flow_path(sys.argv[1])
+  else:
+    begin_flow_id = int(sys.argv[1], 0)
+    if len(sys.argv) >= 3:
+      end_flow_id = int(sys.argv[2], 0)
+    else:
+      end_flow_id = begin_flow_id
+
+    # Do the work
+    flow_id = begin_flow_id
+    while flow_id <= end_flow_id:
+      delete_flow_path(flow_id)
+      flow_id = flow_id + 1
diff --git a/web/measurement_clear_all_paths.py b/web/measurement_clear_all_paths.py
new file mode 100755
index 0000000..5bb73c5
--- /dev/null
+++ b/web/measurement_clear_all_paths.py
@@ -0,0 +1,61 @@
+#! /usr/bin/env python
+# -*- Mode: python; py-indent-offset: 4; tab-width: 8; indent-tabs-mode: t; -*-
+
+import pprint
+import os
+import sys
+import subprocess
+import json
+import argparse
+import io
+import time
+
+from flask import Flask, json, Response, render_template, make_response, request
+
+#
+# TODO: remove this! We don't use JSON argument here!
+# curl http://127.0.0.1:8080/wm/flow/delete/{"value":"0xf"}/json'
+#
+
+## Global Var ##
+ControllerIP="127.0.0.1"
+ControllerPort=8080
+
+DEBUG=0
+pp = pprint.PrettyPrinter(indent=4)
+
+app = Flask(__name__)
+
+## Worker Functions ##
+def log_error(txt):
+  print '%s' % (txt)
+
+def debug(txt):
+  if DEBUG:
+    print '%s' % (txt)
+
+# @app.route("/wm/flow/measurement-clear-all-paths/json")
+def measurement_clear_all_paths():
+  command = "curl -s \"http://%s:%s/wm/flow/measurement-clear-all-paths/json\"" % (ControllerIP, ControllerPort)
+  debug("measurement_clear_all_paths %s" % command)
+  result = os.popen(command).read()
+  debug("result %s" % result)
+  # parsedResult = json.loads(result)
+  # debug("parsed %s" % parsedResult)
+
+if __name__ == "__main__":
+  usage_msg = "Clear the paths that have been stored for measurement purpose\n"
+  usage_msg = usage_msg + "Usage: %s\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+
+  # app.debug = False;
+
+  # Usage info
+  if len(sys.argv) > 1 and (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
+    print(usage_msg)
+    exit(0)
+
+  # Check arguments
+
+  # Do the work
+  measurement_clear_all_paths()
diff --git a/web/measurement_get_install_paths_time_nsec.py b/web/measurement_get_install_paths_time_nsec.py
new file mode 100755
index 0000000..d64dc49
--- /dev/null
+++ b/web/measurement_get_install_paths_time_nsec.py
@@ -0,0 +1,61 @@
+#! /usr/bin/env python
+# -*- Mode: python; py-indent-offset: 4; tab-width: 8; indent-tabs-mode: t; -*-
+
+import pprint
+import os
+import sys
+import subprocess
+import json
+import argparse
+import io
+import time
+
+from flask import Flask, json, Response, render_template, make_response, request
+
+#
+# TODO: remove this! We don't use JSON argument here!
+# curl http://127.0.0.1:8080/wm/flow/delete/{"value":"0xf"}/json'
+#
+
+## Global Var ##
+ControllerIP="127.0.0.1"
+ControllerPort=8080
+
+DEBUG=0
+pp = pprint.PrettyPrinter(indent=4)
+
+app = Flask(__name__)
+
+## Worker Functions ##
+def log_error(txt):
+  print '%s' % (txt)
+
+def debug(txt):
+  if DEBUG:
+    print '%s' % (txt)
+
+# @app.route("/wm/flow/measurement-get-install-paths-time-nsec/json")
+def measurement_get_install_paths_time_nsec():
+  command = "curl -s \"http://%s:%s/wm/flow/measurement-get-install-paths-time-nsec/json\"" % (ControllerIP, ControllerPort)
+  debug("measurement_get_install_paths_time_nsec %s" % command)
+  result = os.popen(command).read()
+  print '%s nsec' % (result)
+  # parsedResult = json.loads(result)
+  # debug("parsed %s" % parsedResult)
+
+if __name__ == "__main__":
+  usage_msg = "Get the measured time to install the stored flow paths\n"
+  usage_msg = usage_msg + "Usage: %s\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+
+  # app.debug = False;
+
+  # Usage info
+  if len(sys.argv) > 1 and (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
+    print(usage_msg)
+    exit(0)
+
+  # Check arguments
+
+  # Do the work
+  measurement_get_install_paths_time_nsec()
diff --git a/web/measurement_install_paths.py b/web/measurement_install_paths.py
new file mode 100755
index 0000000..d99070e
--- /dev/null
+++ b/web/measurement_install_paths.py
@@ -0,0 +1,67 @@
+#! /usr/bin/env python
+# -*- Mode: python; py-indent-offset: 4; tab-width: 8; indent-tabs-mode: t; -*-
+
+import pprint
+import os
+import sys
+import subprocess
+import json
+import argparse
+import io
+import time
+
+from flask import Flask, json, Response, render_template, make_response, request
+
+#
+# TODO: remove this! We don't use JSON argument here!
+# curl http://127.0.0.1:8080/wm/flow/delete/{"value":"0xf"}/json'
+#
+
+## Global Var ##
+ControllerIP="127.0.0.1"
+ControllerPort=8080
+
+DEBUG=0
+pp = pprint.PrettyPrinter(indent=4)
+
+app = Flask(__name__)
+
+## Worker Functions ##
+def log_error(txt):
+  print '%s' % (txt)
+
+def debug(txt):
+  if DEBUG:
+    print '%s' % (txt)
+
+# @app.route("/wm/flow/measurement-install-paths/<num-threads>/json")
+def measurement_install_paths(num_threads):
+  command = "curl -s \"http://%s:%s/wm/flow/measurement-install-paths/%s/json\"" % (ControllerIP, ControllerPort, num_threads)
+  debug("measurement_install_paths %s" % command)
+  result = os.popen(command).read()
+  debug("result %s" % result)
+  # parsedResult = json.loads(result)
+  # debug("parsed %s" % parsedResult)
+
+if __name__ == "__main__":
+  usage_msg = "Install flow paths and start measurements\n"
+  usage_msg = usage_msg + "Usage: %s <num-threads>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Arguments:\n"
+  usage_msg = usage_msg + "        <num-threads>      Number of threads to use to install the flows\n"
+
+  # app.debug = False;
+
+  # Usage info
+  if len(sys.argv) > 1 and (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
+    print(usage_msg)
+    exit(0)
+
+  # Check arguments
+  if len(sys.argv) < 2:
+    log_error(usage_msg)
+    exit(1)
+  num_threads = int(sys.argv[1], 0)
+
+  # Do the work
+  measurement_install_paths(num_threads)
diff --git a/web/measurement_store_flow.py b/web/measurement_store_flow.py
new file mode 100755
index 0000000..637ab3e
--- /dev/null
+++ b/web/measurement_store_flow.py
@@ -0,0 +1,447 @@
+#! /usr/bin/env python
+# -*- Mode: python; py-indent-offset: 4; tab-width: 8; indent-tabs-mode: t; -*-
+
+import copy
+import pprint
+import os
+import sys
+import subprocess
+import json
+import argparse
+import io
+import time
+
+from flask import Flask, json, Response, render_template, make_response, request
+
+## Global Var ##
+ControllerIP = "127.0.0.1"
+ControllerPort = 8080
+ReadFromFile = ""
+
+DEBUG=0
+pp = pprint.PrettyPrinter(indent=4)
+
+app = Flask(__name__)
+
+## Worker Functions ##
+def log_error(txt):
+  print '%s' % (txt)
+
+def debug(txt):
+  if DEBUG:
+    print '%s' % (txt)
+
+def measurement_store_path_flow(flow_path):
+  flow_path_json = json.dumps(flow_path)
+
+  try:
+    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/flow/measurement-store-path/json" % (flow_path_json, ControllerIP, ControllerPort)
+    debug("measurement_store_path_flow %s" % command)
+    result = os.popen(command).read()
+    debug("result %s" % result)
+    # parsedResult = json.loads(result)
+    # debug("parsed %s" % parsedResult)
+  except:
+    log_error("Controller IF has issue")
+    exit(1)
+
+def extract_flow_args(my_args):
+  # Check the arguments
+  if len(my_args) < 6:
+    log_error(usage_msg)
+    exit(1)
+
+  # Extract the mandatory arguments
+  my_flow_id = my_args[0]
+  my_installer_id = my_args[1]
+  my_src_dpid = my_args[2]
+  my_src_port = my_args[3]
+  my_dst_dpid = my_args[4]
+  my_dst_port = my_args[5]
+
+  #
+  # Extract the "match" and "action" arguments
+  #
+  match = {}
+  matchInPortEnabled = True		# NOTE: Enabled by default
+  actions = []
+  actionOutputEnabled = True		# NOTE: Enabled by default
+  idx = 6
+  while idx < len(my_args):
+    action = {}
+    arg1 = my_args[idx]
+    idx = idx + 1
+    # Extract the second argument
+    if idx >= len(my_args):
+      error_arg = "ERROR: Missing or invalid '" + arg1 + "' argument"
+      log_error(error_arg)
+      log_error(usage_msg)
+      exit(1)
+    arg2 = my_args[idx]
+    idx = idx + 1
+
+    if arg1 == "matchInPort":
+      # Just mark whether inPort matching is enabled
+      matchInPortEnabled = arg2 in ['True', 'true']
+      # inPort = {}
+      # inPort['value'] = int(arg2, 0)
+      # match['inPort'] = inPort
+      ## match['matchInPort'] = True
+    elif arg1 == "matchSrcMac":
+      srcMac = {}
+      srcMac['value'] = arg2
+      match['srcMac'] = srcMac
+      # match['matchSrcMac'] = True
+    elif arg1 == "matchDstMac":
+      dstMac = {}
+      dstMac['value'] = arg2
+      match['dstMac'] = dstMac
+      # match['matchDstMac'] = True
+    elif arg1 == "matchVlanId":
+      match['vlanId'] = int(arg2, 0)
+      # match['matchVlanId'] = True
+    elif arg1 == "matchVlanPriority":
+      match['vlanPriority'] = int(arg2, 0)
+      # match['matchVlanPriority'] = True
+    elif arg1 == "matchEthernetFrameType":
+      match['ethernetFrameType'] = int(arg2, 0)
+      # match['matchEthernetFrameType'] = True
+    elif arg1 == "matchIpToS":
+      match['ipToS'] = int(arg2, 0)
+      # match['matchIpToS'] = True
+    elif arg1 == "matchIpProto":
+      match['ipProto'] = int(arg2, 0)
+      # match['matchIpProto'] = True
+    elif arg1 == "matchSrcIPv4Net":
+      srcIPv4Net = {}
+      srcIPv4Net['value'] = arg2
+      match['srcIPv4Net'] = srcIPv4Net
+      # match['matchSrcIPv4Net'] = True
+    elif arg1 == "matchDstIPv4Net":
+      dstIPv4Net = {}
+      dstIPv4Net['value'] = arg2
+      match['dstIPv4Net'] = dstIPv4Net
+      # match['matchDstIPv4Net'] = True
+    elif arg1 == "matchSrcTcpUdpPort":
+      match['srcTcpUdpPort'] = int(arg2, 0)
+      # match['matchSrcTcpUdpPort'] = True
+    elif arg1 == "matchDstTcpUdpPort":
+      match['dstTcpUdpPort'] = int(arg2, 0)
+      # match['matchDstTcpUdpPort'] = True
+    elif arg1 == "actionOutput":
+      # Just mark whether ACTION_OUTPUT action is enabled
+      actionOutputEnabled = arg2 in ['True', 'true']
+      #
+      # TODO: Complete the implementation for ACTION_OUTPUT
+      #   actionOutput = {}
+      #   outPort = {}
+      #   outPort['value'] = int(arg2, 0)
+      #   actionOutput['port'] = outPort
+      #   actionOutput['maxLen'] = int(arg3, 0)
+      #   action['actionOutput'] = actionOutput
+      #   # action['actionType'] = 'ACTION_OUTPUT'
+      #   actions.append(action)
+      #
+    elif arg1 == "actionSetVlanId":
+      vlanId = {}
+      vlanId['vlanId'] = int(arg2, 0)
+      action['actionSetVlanId'] = vlanId
+      # action['actionType'] = 'ACTION_SET_VLAN_VID'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetVlanPriority":
+      vlanPriority = {}
+      vlanPriority['vlanPriority'] = int(arg2, 0)
+      action['actionSetVlanPriority'] = vlanPriority
+      # action['actionType'] = 'ACTION_SET_VLAN_PCP'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetIpToS":
+      ipToS = {}
+      ipToS['ipToS'] = int(arg2, 0)
+      action['actionSetIpToS'] = ipToS
+      # action['actionType'] = 'ACTION_SET_NW_TOS'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetTcpUdpSrcPort":
+      tcpUdpSrcPort = {}
+      tcpUdpSrcPort['port'] = int(arg2, 0)
+      action['actionSetTcpUdpSrcPort'] = tcpUdpSrcPort
+      # action['actionType'] = 'ACTION_SET_TP_SRC'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetTcpUdpDstPort":
+      tcpUdpDstPort = {}
+      tcpUdpDstPort['port'] = int(arg2, 0)
+      action['actionSetTcpUdpDstPort'] = tcpUdpDstPort
+      # action['actionType'] = 'ACTION_SET_TP_DST'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionStripVlan":
+      stripVlan = {}
+      stripVlan['stripVlan'] = arg2 in ['True', 'true']
+      action['actionStripVlan'] = stripVlan
+      # action['actionType'] = 'ACTION_STRIP_VLAN'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetEthernetSrcAddr":
+      ethernetSrcAddr = {}
+      ethernetSrcAddr['value'] = arg2
+      setEthernetSrcAddr = {}
+      setEthernetSrcAddr['addr'] = ethernetSrcAddr
+      action['actionSetEthernetSrcAddr'] = setEthernetSrcAddr
+      # action['actionType'] = 'ACTION_SET_DL_SRC'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetEthernetDstAddr":
+      ethernetDstAddr = {}
+      ethernetDstAddr['value'] = arg2
+      setEthernetDstAddr = {}
+      setEthernetDstAddr['addr'] = ethernetDstAddr
+      action['actionSetEthernetDstAddr'] = setEthernetDstAddr
+      # action['actionType'] = 'ACTION_SET_DL_DST'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetIPv4SrcAddr":
+      IPv4SrcAddr = {}
+      IPv4SrcAddr['value'] = arg2
+      setIPv4SrcAddr = {}
+      setIPv4SrcAddr['addr'] = IPv4SrcAddr
+      action['actionSetIPv4SrcAddr'] = setIPv4SrcAddr
+      # action['actionType'] = 'ACTION_SET_NW_SRC'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionSetIPv4DstAddr":
+      IPv4DstAddr = {}
+      IPv4DstAddr['value'] = arg2
+      setIPv4DstAddr = {}
+      setIPv4DstAddr['addr'] = IPv4DstAddr
+      action['actionSetIPv4DstAddr'] = setIPv4DstAddr
+      # action['actionType'] = 'ACTION_SET_NW_DST'
+      actions.append(copy.deepcopy(action))
+    elif arg1 == "actionEnqueue":
+      # TODO: Implement ACTION_ENQUEUE
+      actionEnqueue = {}
+      #   actionEnqueue['queueId'] = int(arg2, 0)
+      #   enqueuePort = {}
+      #   enqueuePort['value'] = int(arg3, 0)
+      #   actionEnqueue['port'] = enqueuePort
+      #   action['actionEnqueue'] = actionEnqueue
+      #   # action['actionType'] = 'ACTION_ENQUEUE'
+      #   actions.append(copy.deepcopy(action))
+      #
+    else:
+      log_error("ERROR: Unknown argument '%s'" % (arg1))
+      log_error(usage_msg)
+      exit(1)
+
+  return {
+    'my_flow_id' : my_flow_id,
+    'my_installer_id' : my_installer_id,
+    'my_src_dpid' : my_src_dpid,
+    'my_src_port' : my_src_port,
+    'my_dst_dpid' : my_dst_dpid,
+    'my_dst_port' : my_dst_port,
+    'match' : match,
+    'matchInPortEnabled' : matchInPortEnabled,
+    'actions' : actions,
+    'actionOutputEnabled' : actionOutputEnabled
+    }
+
+def compute_flow_path(parsed_args, data_path):
+
+  my_flow_id = parsed_args['my_flow_id']
+  my_installer_id = parsed_args['my_installer_id']
+  match = parsed_args['match']
+  matchInPortEnabled = parsed_args['matchInPortEnabled']
+  actions = parsed_args['actions']
+  actionOutputEnabled = parsed_args['actionOutputEnabled']
+  my_data_path = copy.deepcopy(data_path)
+
+  flow_id = {}
+  flow_id['value'] = my_flow_id
+  installer_id = {}
+  installer_id['value'] = my_installer_id
+
+  flow_path = {}
+  flow_path['flowId'] = flow_id
+  flow_path['installerId'] = installer_id
+
+  if (len(match) > 0):
+    flow_path['flowEntryMatch'] = copy.deepcopy(match)
+
+  #
+  # Add the match conditions to each flow entry
+  #
+  if (len(match) > 0) or matchInPortEnabled:
+    idx = 0
+    while idx < len(my_data_path['flowEntries']):
+      if matchInPortEnabled:
+	inPort = my_data_path['flowEntries'][idx]['inPort']
+	match['inPort'] = copy.deepcopy(inPort)
+	# match['matchInPort'] = True
+      my_data_path['flowEntries'][idx]['flowEntryMatch'] = copy.deepcopy(match)
+      idx = idx + 1
+
+  #
+  # Set the actions for each flow entry
+  # NOTE: The actions from the command line are aplied
+  # ONLY to the first flow entry.
+  #
+  # If ACTION_OUTPUT action is enabled, then apply it
+  # to each flow entry.
+  #
+  if (len(actions) > 0) or actionOutputEnabled:
+    idx = 0
+    while idx < len(my_data_path['flowEntries']):
+      if idx > 0:
+	actions = []	# Reset the actions for all but first entry
+      action = {}
+      outPort = my_data_path['flowEntries'][idx]['outPort']
+      actionOutput = {}
+      actionOutput['port'] = copy.deepcopy(outPort)
+      # actionOutput['maxLen'] = 0	# TODO: not used for now
+      action['actionOutput'] = copy.deepcopy(actionOutput)
+      # action['actionType'] = 'ACTION_OUTPUT'
+      actions.append(copy.deepcopy(action))
+
+      my_data_path['flowEntries'][idx]['flowEntryActions'] = copy.deepcopy(actions)
+      idx = idx + 1
+
+
+  flow_path['dataPath'] = my_data_path
+  debug("Flow Path: %s" % flow_path)
+  return flow_path
+
+def measurement_store_paths(parsed_args):
+  idx = 0
+  while idx < len(parsed_args):
+    data_path = {}
+    src_dpid = {}
+    src_port = {}
+    dst_dpid = {}
+    dst_port = {}
+    src_switch_port = {}
+    dst_switch_port = {}
+    flow_entries = []
+
+    src_dpid['value'] = parsed_args[idx]['my_src_dpid']
+    src_port['value'] = parsed_args[idx]['my_src_port']
+    dst_dpid['value'] = parsed_args[idx]['my_dst_dpid']
+    dst_port['value'] = parsed_args[idx]['my_dst_port']
+    src_switch_port['dpid'] = src_dpid
+    src_switch_port['port'] = src_port
+    dst_switch_port['dpid'] = dst_dpid
+    dst_switch_port['port'] = dst_port
+
+    data_path['srcPort'] = copy.deepcopy(src_switch_port)
+    data_path['dstPort'] = copy.deepcopy(dst_switch_port)
+    data_path['flowEntries'] = copy.deepcopy(flow_entries)
+
+    #
+    # XXX: Explicitly disable the InPort matching, and
+    # the Output action, because they get in the way
+    # during the compute_flow_path() processing.
+    #
+    parsed_args[idx]['matchInPortEnabled'] = False
+    parsed_args[idx]['actionOutputEnabled'] = False
+
+    flow_path = compute_flow_path(parsed_args[idx], data_path)
+    measurement_store_path_flow(flow_path)
+
+    idx = idx + 1
+
+
+if __name__ == "__main__":
+  usage_msg = "Store Flow Paths into ONOS for measurement purpose.\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "Usage: %s [Flags] <flow-id> <installer-id> <src-dpid> <src-port> <dest-dpid> <dest-port> [Match Conditions] [Actions]\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Flags:\n"
+  usage_msg = usage_msg + "        -f <filename>     Read the flow(s) to install from a file\n"
+  usage_msg = usage_msg + "                          File format: one line per flow starting with <flow-id>\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Match Conditions:\n"
+  usage_msg = usage_msg + "        matchInPort <True|False> (default to True)\n"
+  usage_msg = usage_msg + "        matchSrcMac <source MAC address>\n"
+  usage_msg = usage_msg + "        matchDstMac <destination MAC address>\n"
+  usage_msg = usage_msg + "        matchSrcIPv4Net <source IPv4 network address>\n"
+  usage_msg = usage_msg + "        matchDstIPv4Net <destination IPv4 network address>\n"
+  usage_msg = usage_msg + "        matchEthernetFrameType <Ethernet frame type>\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Match Conditions (not implemented yet):\n"
+  usage_msg = usage_msg + "        matchVlanId <VLAN ID>\n"
+  usage_msg = usage_msg + "        matchVlanPriority <VLAN priority>\n"
+  usage_msg = usage_msg + "        matchIpToS <IP ToS (DSCP field, 6 bits)>\n"
+  usage_msg = usage_msg + "        matchIpProto <IP protocol>\n"
+  usage_msg = usage_msg + "        matchSrcTcpUdpPort <source TCP/UDP port>\n"
+  usage_msg = usage_msg + "        matchDstTcpUdpPort <destination TCP/UDP port>\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Actions:\n"
+  usage_msg = usage_msg + "        actionOutput <True|False> (default to True)\n"
+  usage_msg = usage_msg + "        actionSetEthernetSrcAddr <source MAC address>\n"
+  usage_msg = usage_msg + "        actionSetEthernetDstAddr <destination MAC address>\n"
+  usage_msg = usage_msg + "        actionSetIPv4SrcAddr <source IPv4 address>\n"
+  usage_msg = usage_msg + "        actionSetIPv4DstAddr <destination IPv4 address>\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Actions (not implemented yet):\n"
+  usage_msg = usage_msg + "        actionSetVlanId <VLAN ID>\n"
+  usage_msg = usage_msg + "        actionSetVlanPriority <VLAN priority>\n"
+  usage_msg = usage_msg + "        actionSetIpToS <IP ToS (DSCP field, 6 bits)>\n"
+  usage_msg = usage_msg + "        actionSetTcpUdpSrcPort <source TCP/UDP port>\n"
+  usage_msg = usage_msg + "        actionSetTcpUdpDstPort <destination TCP/UDP port>\n"
+  usage_msg = usage_msg + "        actionStripVlan <True|False>\n"
+  usage_msg = usage_msg + "        actionEnqueue <dummy argument>\n"
+
+  # app.debug = False;
+
+  # Usage info
+  if len(sys.argv) > 1 and (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
+    print(usage_msg)
+    exit(0)
+
+  #
+  # Check the flags
+  #
+  start_argv_index = 1
+  idx = 1
+  while idx < len(sys.argv):
+    arg1 = sys.argv[idx]
+    idx = idx + 1
+    if arg1 == "-f":
+      if idx >= len(sys.argv):
+	error_arg = "ERROR: Missing or invalid '" + arg1 + "' argument"
+	log_error(error_arg)
+	log_error(usage_msg)
+	exit(1)
+      ReadFromFile = sys.argv[idx]
+      idx = idx + 1
+      start_argv_index = idx
+    else:
+      break;
+
+  #
+  # Read the arguments from a file or from the remaining command line options
+  #
+  my_lines = []
+  if len(ReadFromFile) > 0:
+    f = open(ReadFromFile, "rt")
+    my_line = f.readline()
+    while my_line:
+      if len(my_line.rstrip()) > 0 and my_line[0] != "#":
+	my_token_line = my_line.rstrip().split()
+	my_lines.append(my_token_line)
+      my_line = f.readline()
+  else:
+    my_lines.append(copy.deepcopy(sys.argv[start_argv_index:]))
+
+  #
+  # Initialization
+  #
+  last_data_paths = []
+  parsed_args = []
+  idx = 0
+  while idx < len(my_lines):
+    last_data_path = []
+    last_data_paths.append(copy.deepcopy(last_data_path))
+    #
+    # Parse the flow arguments
+    #
+    my_args = my_lines[idx]
+    parsed_args.append(copy.deepcopy(extract_flow_args(my_args)))
+
+    idx = idx + 1
+
+  #
+  measurement_store_paths(parsed_args)
diff --git a/web/shortest_path.py b/web/shortest_path.py
index b379a82..0f23bf4 100755
--- a/web/shortest_path.py
+++ b/web/shortest_path.py
@@ -20,7 +20,7 @@
 ControllerIP="127.0.0.1"
 ControllerPort=8080
 
-DEBUG=1
+DEBUG=0
 pp = pprint.PrettyPrinter(indent=4)
 
 app = Flask(__name__)
