diff --git a/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java b/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
index 4d85b7d..67fcabb 100644
--- a/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
+++ b/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
@@ -11,7 +11,6 @@
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.floodlightcontroller.counter.ICounterStoreService;
-import net.floodlightcontroller.perfmon.IPktInProcessingTimeService;
 import net.floodlightcontroller.restserver.IRestApiService;
 import net.floodlightcontroller.storage.IStorageSourceService;
 import net.floodlightcontroller.threadpool.IThreadPoolService;
@@ -47,7 +46,7 @@
         Collection<Class<? extends IFloodlightService>> dependencies =
             new ArrayList<Class<? extends IFloodlightService>>(4);
         dependencies.add(IStorageSourceService.class);
-        dependencies.add(IPktInProcessingTimeService.class);
+
         dependencies.add(IRestApiService.class);
         dependencies.add(ICounterStoreService.class);
         dependencies.add(IThreadPoolService.class);
@@ -62,8 +61,7 @@
     public void init(FloodlightModuleContext context) throws FloodlightModuleException {
        controller.setStorageSourceService(
            context.getServiceImpl(IStorageSourceService.class));
-       controller.setPktInProcessingService(
-           context.getServiceImpl(IPktInProcessingTimeService.class));
+
        controller.setCounterStore(
            context.getServiceImpl(ICounterStoreService.class));
        controller.setRestApiService(
diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
index 31f80cc..6b16964 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
@@ -66,7 +66,6 @@
 import net.floodlightcontroller.core.web.CoreWebRoutable;
 import net.floodlightcontroller.counter.ICounterStoreService;
 import net.floodlightcontroller.packet.Ethernet;
-import net.floodlightcontroller.perfmon.IPktInProcessingTimeService;
 import net.floodlightcontroller.restserver.IRestApiService;
 import net.floodlightcontroller.storage.IResultSet;
 import net.floodlightcontroller.storage.IStorageSourceListener;
@@ -186,7 +185,6 @@
     protected IRestApiService restApi;
     protected ICounterStoreService counterStore = null;
     protected IStorageSourceService storageSource;
-    protected IPktInProcessingTimeService pktinProcTime;
     protected IThreadPoolService threadPool;
     protected IControllerRegistryService registryService;
     
@@ -394,9 +392,7 @@
         this.counterStore = counterStore;
     }
     
-    public void setPktInProcessingService(IPktInProcessingTimeService pits) {
-        this.pktinProcTime = pits;
-    }
+ 
     
     public void setRestApiService(IRestApiService restApi) {
         this.restApi = restApi;
@@ -1449,8 +1445,7 @@
                     // Get the starting time (overall and per-component) of 
                     // the processing chain for this packet if performance
                     // monitoring is turned on
-                    pktinProcTime.bootstrap(listeners);
-                    pktinProcTime.recordStartTimePktIn();                     
+                    
                     Command cmd;
                     for (IOFMessageListener listener : listeners) {
                         if (listener instanceof IOFSwitchFilter) {
@@ -1459,15 +1454,15 @@
                             }
                         }
 
-                        pktinProcTime.recordStartTimeComp(listener);
+
                         cmd = listener.receive(sw, m, bc);
-                        pktinProcTime.recordEndTimeComp(listener);
+
                         
                         if (Command.STOP.equals(cmd)) {
                             break;
                         }
                     }
-                    pktinProcTime.recordEndTimePktIn(sw, m, bc);
+
                 } else {
                     log.warn("Unhandled OF Message: {} from {}", m, sw);
                 }
diff --git a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
index 5810967..1a52418 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
@@ -49,7 +49,7 @@
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
-import org.codehaus.jackson.map.ser.std.ToStringSerializer;
+import org.codehaus.jackson.map.ser.ToStringSerializer;
 import org.jboss.netty.channel.Channel;
 import org.openflow.protocol.OFFeaturesReply;
 import org.openflow.protocol.OFFeaturesRequest;
@@ -73,6 +73,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * This is the internal representation of an openflow switch.
  */
diff --git a/src/main/java/net/floodlightcontroller/core/types/MacVlanPair.java b/src/main/java/net/floodlightcontroller/core/types/MacVlanPair.java
deleted file mode 100644
index 7a44f1d..0000000
--- a/src/main/java/net/floodlightcontroller/core/types/MacVlanPair.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
-*    Copyright 2011, Big Switch Networks, Inc. 
-*    Originally created by David Erickson, Stanford University
-* 
-*    Licensed under the Apache License, Version 2.0 (the "License"); you may
-*    not use this file except in compliance with the License. You may obtain
-*    a copy of the License at
-*
-*         http://www.apache.org/licenses/LICENSE-2.0
-*
-*    Unless required by applicable law or agreed to in writing, software
-*    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-*    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-*    License for the specific language governing permissions and limitations
-*    under the License.
-**/
-
-package net.floodlightcontroller.core.types;
-
-public class MacVlanPair {
-    public Long mac;
-    public Short vlan;
-    public MacVlanPair(Long mac, Short vlan) {
-        this.mac = mac;
-        this.vlan = vlan;
-    }
-    
-    public long getMac() {
-        return mac.longValue();
-    }
-    
-    public short getVlan() {
-        return vlan.shortValue();
-    }
-    
-    public boolean equals(Object o) {
-        return (o instanceof MacVlanPair) && (mac.equals(((MacVlanPair) o).mac))
-            && (vlan.equals(((MacVlanPair) o).vlan));
-    }
-    
-    public int hashCode() {
-        return mac.hashCode() ^ vlan.hashCode();
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/net/floodlightcontroller/core/types/SwitchMessagePair.java b/src/main/java/net/floodlightcontroller/core/types/SwitchMessagePair.java
deleted file mode 100644
index 0e91bc9..0000000
--- a/src/main/java/net/floodlightcontroller/core/types/SwitchMessagePair.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
-*    Copyright 2011, Big Switch Networks, Inc. 
-*    Originally created by David Erickson, Stanford University
-* 
-*    Licensed under the Apache License, Version 2.0 (the "License"); you may
-*    not use this file except in compliance with the License. You may obtain
-*    a copy of the License at
-*
-*         http://www.apache.org/licenses/LICENSE-2.0
-*
-*    Unless required by applicable law or agreed to in writing, software
-*    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-*    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-*    License for the specific language governing permissions and limitations
-*    under the License.
-**/
-
-package net.floodlightcontroller.core.types;
-
-import org.openflow.protocol.OFMessage;
-
-import net.floodlightcontroller.core.IOFSwitch;
-
-public class SwitchMessagePair {
-    private final IOFSwitch sw;
-    private final OFMessage msg;
-    
-    public SwitchMessagePair(IOFSwitch sw, OFMessage msg) {
-        this.sw = sw;
-        this.msg = msg;
-    }
-    
-    public IOFSwitch getSwitch() {
-        return this.sw;
-    }
-    
-    public OFMessage getMessage() {
-        return this.msg;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/core/web/AllSwitchStatisticsResource.java b/src/main/java/net/floodlightcontroller/core/web/AllSwitchStatisticsResource.java
index a014795..2eeec70 100644
--- a/src/main/java/net/floodlightcontroller/core/web/AllSwitchStatisticsResource.java
+++ b/src/main/java/net/floodlightcontroller/core/web/AllSwitchStatisticsResource.java
@@ -24,8 +24,6 @@
 import java.util.Map;
 
 import net.floodlightcontroller.core.IFloodlightProviderService;
-import net.floodlightcontroller.core.types.MacVlanPair;
-
 import org.openflow.protocol.OFFeaturesReply;
 import org.openflow.protocol.statistics.OFStatistics;
 import org.openflow.protocol.statistics.OFStatisticsType;
@@ -136,7 +134,6 @@
         private OFStatisticsType statType;
         private REQUESTTYPE requestType;
         private OFFeaturesReply featuresReply;
-        private Map<MacVlanPair, Short> switchTable;
         
         public GetConcurrentStatsThread(long switchId, REQUESTTYPE requestType, OFStatisticsType statType) {
             this.switchId = switchId;
@@ -144,7 +141,6 @@
             this.statType = statType;
             this.switchReply = null;
             this.featuresReply = null;
-            this.switchTable = null;
         }
         
         public List<OFStatistics> getStatisticsReply() {
@@ -155,10 +151,6 @@
             return featuresReply;
         }
         
-        public Map<MacVlanPair, Short> getSwitchTable() {
-            return switchTable;
-        }
-        
         public long getSwitchId() {
             return switchId;
         }
diff --git a/src/main/java/net/floodlightcontroller/devicemanager/SwitchPort.java b/src/main/java/net/floodlightcontroller/devicemanager/SwitchPort.java
index 725d699..7426163 100644
--- a/src/main/java/net/floodlightcontroller/devicemanager/SwitchPort.java
+++ b/src/main/java/net/floodlightcontroller/devicemanager/SwitchPort.java
@@ -20,7 +20,7 @@
 import net.floodlightcontroller.core.web.serializers.DPIDSerializer;
 
 import org.codehaus.jackson.map.annotate.JsonSerialize;
-import org.codehaus.jackson.map.ser.std.ToStringSerializer;
+import org.codehaus.jackson.map.ser.ToStringSerializer;
 
 /**
  * A simple switch DPID/port pair
diff --git a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
index 087756c..bbeaa48 100755
--- a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+++ b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
@@ -57,9 +57,6 @@
 import net.floodlightcontroller.devicemanager.IEntityClassifierService;
 import net.floodlightcontroller.devicemanager.SwitchPort;
 import net.floodlightcontroller.devicemanager.web.DeviceRoutable;
-import net.floodlightcontroller.flowcache.IFlowReconcileListener;
-import net.floodlightcontroller.flowcache.IFlowReconcileService;
-import net.floodlightcontroller.flowcache.OFMatchReconcile;
 import net.floodlightcontroller.packet.ARP;
 import net.floodlightcontroller.packet.DHCP;
 import net.floodlightcontroller.packet.Ethernet;
@@ -89,7 +86,7 @@
 public class DeviceManagerImpl implements
 IDeviceService, IOFMessageListener, ITopologyListener,
 IFloodlightModule, IEntityClassListener,
-IFlowReconcileListener, IInfoProvider, IHAListener {
+IInfoProvider, IHAListener {
     protected final static Logger logger =
             LoggerFactory.getLogger(DeviceManagerImpl.class);
 
@@ -98,7 +95,7 @@
     protected IStorageSourceService storageSource;
     protected IRestApiService restApi;
     protected IThreadPoolService threadPool;
-    protected IFlowReconcileService flowReconcileMgr;
+
 
     /**
      * Time in milliseconds before entities will expire
@@ -601,62 +598,7 @@
         return Command.CONTINUE;
     }
 
-    // ***************
-    // IFlowReconcileListener
-    // ***************
-    @Override
-    public Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList) {
-        ListIterator<OFMatchReconcile> iter = ofmRcList.listIterator();
-        while (iter.hasNext()) {
-            OFMatchReconcile ofm = iter.next();
-            
-            // Remove the STOPPed flow.
-            if (Command.STOP == reconcileFlow(ofm)) {
-                iter.remove();
-            }
-        }
-        
-        if (ofmRcList.size() > 0) {
-            return Command.CONTINUE;
-        } else {
-            return Command.STOP;
-        }
-    }
-
-    protected Command reconcileFlow(OFMatchReconcile ofm) {
-        // Extract source entity information
-        Entity srcEntity =
-                getEntityFromFlowMod(ofm.ofmWithSwDpid, true);
-        if (srcEntity == null)
-            return Command.STOP;
-
-        // Find the device by source entity
-        Device srcDevice = findDeviceByEntity(srcEntity);
-        if (srcDevice == null)
-            return Command.STOP;
-
-        // Store the source device in the context
-        fcStore.put(ofm.cntx, CONTEXT_SRC_DEVICE, srcDevice);
-
-        // Find the device matching the destination from the entity
-        // classes of the source.
-        Entity dstEntity = getEntityFromFlowMod(ofm.ofmWithSwDpid, false);
-        Device dstDevice = null;
-        if (dstEntity != null) {
-            dstDevice = findDestByEntity(srcDevice, dstEntity);
-            if (dstDevice != null)
-                fcStore.put(ofm.cntx, CONTEXT_DST_DEVICE, dstDevice);
-        }
-        if (logger.isTraceEnabled()) {
-            logger.trace("Reconciling flow: match={}, srcEntity={}, srcDev={}, " 
-                         + "dstEntity={}, dstDev={}",
-                         new Object[] {ofm.ofmWithSwDpid.getOfMatch(),
-                                       srcEntity, srcDevice, 
-                                       dstEntity, dstDevice } );
-        }
-        return Command.CONTINUE;
-    }
-
+ 
     // *****************
     // IFloodlightModule
     // *****************
@@ -690,7 +632,6 @@
         l.add(ITopologyService.class);
         l.add(IRestApiService.class);
         l.add(IThreadPoolService.class);
-        l.add(IFlowReconcileService.class);
         l.add(IEntityClassifierService.class);
         return l;
     }
@@ -713,7 +654,6 @@
                 fmc.getServiceImpl(ITopologyService.class);
         this.restApi = fmc.getServiceImpl(IRestApiService.class);
         this.threadPool = fmc.getServiceImpl(IThreadPoolService.class);
-        this.flowReconcileMgr = fmc.getServiceImpl(IFlowReconcileService.class);
         this.entityClassifier = fmc.getServiceImpl(IEntityClassifierService.class);
     }
 
@@ -731,7 +671,6 @@
         floodlightProvider.addHAListener(this);
         if (topology != null)
             topology.addListener(this);
-        flowReconcileMgr.addFlowReconcileListener(this);
         entityClassifier.addListener(this);
 
         Runnable ecr = new Runnable() {
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FCQueryObj.java b/src/main/java/net/floodlightcontroller/flowcache/FCQueryObj.java
deleted file mode 100644
index cce3401..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/FCQueryObj.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import java.util.Arrays;
-
-import net.floodlightcontroller.devicemanager.IDevice;
-import net.floodlightcontroller.flowcache.IFlowCacheService.FCQueryEvType;
-
-
-/**
- * The Class FCQueryObj.
- */
-public class FCQueryObj {
-
-    /** The caller of the flow cache query. */
-    public IFlowQueryHandler fcQueryHandler;
-    /** The application instance name. */
-    public String applInstName;
-    /** The vlan Id. */
-    public Short[] vlans;
-    /** The destination device. */
-    public IDevice dstDevice;
-    /** The source device. */
-    public IDevice srcDevice;
-    /** The caller name */
-    public String callerName;
-    /** Event type that triggered this flow query submission */
-    public FCQueryEvType evType;
-    /** The caller opaque data. Returned unchanged in the query response
-     * via the callback. The type of this object could be different for
-     * different callers */
-    public Object callerOpaqueObj;
-
-    /**
-     * Instantiates a new flow cache query object
-     */
-    public FCQueryObj(IFlowQueryHandler fcQueryHandler,
-            String        applInstName,
-            Short         vlan,
-            IDevice       srcDevice,
-            IDevice       dstDevice,
-            String        callerName,
-            FCQueryEvType evType,
-            Object        callerOpaqueObj) {
-        this.fcQueryHandler    = fcQueryHandler;
-        this.applInstName     = applInstName;
-        this.srcDevice        = srcDevice;
-        this.dstDevice        = dstDevice;
-        this.callerName       = callerName;
-        this.evType           = evType;
-        this.callerOpaqueObj  = callerOpaqueObj;
-        
-        if (vlan != null) {
-        	this.vlans = new Short[] { vlan };
-        } else {
-	        if (srcDevice != null) {
-	        	this.vlans = srcDevice.getVlanId();
-	        } else if (dstDevice != null) {
-	            this.vlans = dstDevice.getVlanId();
-	        }
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "FCQueryObj [fcQueryCaller=" + fcQueryHandler
-                + ", applInstName="
-                + applInstName + ", vlans=" + Arrays.toString(vlans)
-                + ", dstDevice=" + dstDevice + ", srcDevice="
-                + srcDevice + ", callerName=" + callerName + ", evType="
-                + evType + ", callerOpaqueObj=" + callerOpaqueObj + "]";
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        FCQueryObj other = (FCQueryObj) obj;
-        if (applInstName == null) {
-            if (other.applInstName != null)
-                return false;
-        } else if (!applInstName.equals(other.applInstName))
-            return false;
-        if (callerName == null) {
-            if (other.callerName != null)
-                return false;
-        } else if (!callerName.equals(other.callerName))
-            return false;
-        if (callerOpaqueObj == null) {
-            if (other.callerOpaqueObj != null)
-                return false;
-        } else if (!callerOpaqueObj.equals(other.callerOpaqueObj))
-            return false;
-        if (dstDevice == null) {
-            if (other.dstDevice != null)
-                return false;
-        } else if (!dstDevice.equals(other.dstDevice))
-            return false;
-        if (evType != other.evType)
-            return false;
-        if (fcQueryHandler != other.fcQueryHandler)
-            return false;
-        if (srcDevice == null) {
-            if (other.srcDevice != null)
-                return false;
-        } else if (!srcDevice.equals(other.srcDevice))
-            return false;
-        if (!Arrays.equals(vlans, other.vlans))
-            return false;
-        return true;
-    }
-    
-    
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowCacheQueryResp.java b/src/main/java/net/floodlightcontroller/flowcache/FlowCacheQueryResp.java
deleted file mode 100644
index b01aedf..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowCacheQueryResp.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import java.util.ArrayList;
-
-/**
- * Object to return flows in response to a query message to BigFlowCache.
- * This object is passed in the flowQueryRespHandler() callback.
- */
-public class FlowCacheQueryResp {
-
-    /** query object provided by the caller, returned unchanged. */
-    public FCQueryObj  queryObj;
-    /** 
-     * Set to true if more flows could be returned for this query in
-     * additional callbacks. Set of false in the last callback for the
-     * query. 
-     */
-    public boolean     moreFlag;
-    
-    /**
-     * Set to true if the response has been sent to handler
-     */
-    public boolean     hasSent;
-    
-    /** 
-     * The flow list. If there are large number of flows to be returned
-     * then they may be returned in multiple callbacks.
-     */
-    public ArrayList<QRFlowCacheObj> qrFlowCacheObjList;
-
-    /**
-     * Instantiates a new big flow cache query response.
-     *
-     * @param query the flow cache query object as given by the caller of
-     * flow cache submit query API.
-     */
-    public FlowCacheQueryResp(FCQueryObj query) {
-        qrFlowCacheObjList = new ArrayList<QRFlowCacheObj>();
-        queryObj    = query;
-        moreFlag    = false;
-        hasSent     = false;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        String s = queryObj.toString() + "; moreFlasg=" + moreFlag +
-                   "; hasSent=" + hasSent;
-        s += "; FlowCount=" + Integer.toString(qrFlowCacheObjList.size());
-        return s;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowReconcileManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowReconcileManager.java
deleted file mode 100644
index b221b84..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowReconcileManager.java
+++ /dev/null
@@ -1,440 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.core.module.FloodlightModuleException;
-import net.floodlightcontroller.core.module.IFloodlightModule;
-import net.floodlightcontroller.core.module.IFloodlightService;
-import net.floodlightcontroller.core.util.ListenerDispatcher;
-import net.floodlightcontroller.core.util.SingletonTask;
-import net.floodlightcontroller.counter.CounterStore;
-import net.floodlightcontroller.counter.ICounter;
-import net.floodlightcontroller.counter.ICounterStoreService;
-import net.floodlightcontroller.counter.SimpleCounter;
-import net.floodlightcontroller.devicemanager.IDevice;
-import net.floodlightcontroller.flowcache.IFlowCacheService.FCQueryEvType;
-import net.floodlightcontroller.flowcache.IFlowReconcileListener;
-import net.floodlightcontroller.flowcache.OFMatchReconcile;
-import net.floodlightcontroller.threadpool.IThreadPoolService;
-
-import org.openflow.protocol.OFType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FlowReconcileManager 
-        implements IFloodlightModule, IFlowReconcileService {
-
-    /** The logger. */
-    private final static Logger logger =
-                        LoggerFactory.getLogger(FlowReconcileManager.class);
-    
-    /** Reference to dependent modules */
-    protected IThreadPoolService threadPool;
-    protected ICounterStoreService counterStore;
-
-    /**
-     * The list of flow reconcile listeners that have registered to get
-     * flow reconcile callbacks. Such callbacks are invoked, for example, when
-     * a switch with existing flow-mods joins this controller and those flows
-     * need to be reconciled with the current configuration of the controller.
-     */
-    protected ListenerDispatcher<OFType, IFlowReconcileListener>
-                                               flowReconcileListeners;
-
-    /** A FIFO queue to keep all outstanding flows for reconciliation */
-    Queue<OFMatchReconcile> flowQueue;
-    
-    /** Asynchronous task to feed the flowReconcile pipeline */
-    protected SingletonTask flowReconcileTask;
-    
-    String controllerPktInCounterName;
-    protected SimpleCounter lastPacketInCounter;
-    
-    protected static int MAX_SYSTEM_LOAD_PER_SECOND = 50000;
-    /** a minimum flow reconcile rate so that it won't stave */
-    protected static int MIN_FLOW_RECONCILE_PER_SECOND = 1000;
-    
-    /** once per second */
-    protected static int FLOW_RECONCILE_DELAY_MILLISEC = 10;
-    protected Date lastReconcileTime;
-    
-    /** Config to enable or disable flowReconcile */
-    protected static final String EnableConfigKey = "enable";
-    protected boolean flowReconcileEnabled;
-    
-    public int flowReconcileThreadRunCount;
-    
-    @Override
-    public synchronized void addFlowReconcileListener(
-                IFlowReconcileListener listener) {
-        flowReconcileListeners.addListener(OFType.FLOW_MOD, listener);
-
-        if (logger.isTraceEnabled()) {
-            StringBuffer sb = new StringBuffer();
-            sb.append("FlowMod listeners: ");
-            for (IFlowReconcileListener l :
-                flowReconcileListeners.getOrderedListeners()) {
-                sb.append(l.getName());
-                sb.append(",");
-            }
-            logger.trace(sb.toString());
-        }
-    }
-
-    @Override
-    public synchronized void removeFlowReconcileListener(
-                IFlowReconcileListener listener) {
-        flowReconcileListeners.removeListener(listener);
-    }
-    
-    @Override
-    public synchronized void clearFlowReconcileListeners() {
-        flowReconcileListeners.clearListeners();
-    }
-    
-    /**
-     * Add to-be-reconciled flow to the queue.
-     *
-     * @param ofmRcIn the ofm rc in
-     */
-    public void reconcileFlow(OFMatchReconcile ofmRcIn) {
-        if (ofmRcIn == null) return;
-        
-        // Make a copy before putting on the queue.
-        OFMatchReconcile myOfmRc = new OFMatchReconcile(ofmRcIn);
-    
-        flowQueue.add(myOfmRc);
-    
-        Date currTime = new Date();
-        long delay = 0;
-
-        /** schedule reconcile task immidiately if it has been more than 1 sec
-         *  since the last run. Otherwise, schedule the reconcile task in
-         *  DELAY_MILLISEC.
-         */
-        if (currTime.after(new Date(lastReconcileTime.getTime() + 1000))) {
-            delay = 0;
-        } else {
-            delay = FLOW_RECONCILE_DELAY_MILLISEC;
-        }
-        flowReconcileTask.reschedule(delay, TimeUnit.MILLISECONDS);
-    
-        if (logger.isTraceEnabled()) {
-            logger.trace("Reconciling flow: {}, total: {}",
-                myOfmRc.toString(), flowQueue.size());
-        }
-    }
-    
-    @Override
-    public void updateFlowForDestinationDevice(IDevice device,
-                                            IFlowQueryHandler handler,
-                                            FCQueryEvType fcEvType) {
-        // NO-OP
-    }
-
-    @Override
-    public void updateFlowForSourceDevice(IDevice device,
-                                          IFlowQueryHandler handler,
-                                          FCQueryEvType fcEvType) {
-        // NO-OP
-    }
-    
-    @Override
-    public void flowQueryGenericHandler(FlowCacheQueryResp flowResp) {
-        if (flowResp.queryObj.evType != FCQueryEvType.GET) {
-            OFMatchReconcile ofmRc = new OFMatchReconcile();;
-            /* Re-provision these flows */
-            for (QRFlowCacheObj entry : flowResp.qrFlowCacheObjList) {
-                /* reconcile the flows in entry */
-                entry.toOFMatchReconcile(ofmRc,
-                        flowResp.queryObj.applInstName,
-                        OFMatchReconcile.ReconcileAction.UPDATE_PATH);
-                reconcileFlow(ofmRc);
-            }
-        }
-        return;
-    }
-    
-    // IFloodlightModule
-
-    @Override
-    public Collection<Class<? extends IFloodlightService>> getModuleServices() {
-        Collection<Class<? extends IFloodlightService>> l = 
-            new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(IFlowReconcileService.class);
-        return l;
-    }
-
-    @Override
-    public Map<Class<? extends IFloodlightService>, IFloodlightService> 
-                                                            getServiceImpls() {
-        Map<Class<? extends IFloodlightService>,
-        IFloodlightService> m = 
-            new HashMap<Class<? extends IFloodlightService>,
-                IFloodlightService>();
-        m.put(IFlowReconcileService.class, this);
-        return m;
-    }
-
-    @Override
-    public Collection<Class<? extends IFloodlightService>> 
-                                                    getModuleDependencies() {
-        Collection<Class<? extends IFloodlightService>> l = 
-                new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(IThreadPoolService.class);
-        l.add(ICounterStoreService.class);
-        return null;
-    }
-
-    @Override
-    public void init(FloodlightModuleContext context)
-            throws FloodlightModuleException {
-        threadPool = context.getServiceImpl(IThreadPoolService.class);
-        counterStore = context.getServiceImpl(ICounterStoreService.class);
-    
-        flowQueue = new ConcurrentLinkedQueue<OFMatchReconcile>();
-        flowReconcileListeners = 
-                new ListenerDispatcher<OFType, IFlowReconcileListener>();
-        
-        Map<String, String> configParam = context.getConfigParams(this);
-        String enableValue = configParam.get(EnableConfigKey);
-        // Set flowReconcile default to true
-        flowReconcileEnabled = true;
-        if (enableValue != null &&
-            enableValue.equalsIgnoreCase("false")) {
-            flowReconcileEnabled = false;
-        }
-        
-        flowReconcileThreadRunCount = 0;
-        lastReconcileTime = new Date(0);
-        logger.debug("FlowReconcile is {}", flowReconcileEnabled);
-    }
-
-    @Override
-    public void startUp(FloodlightModuleContext context) {
-        // thread to do flow reconcile
-        ScheduledExecutorService ses = threadPool.getScheduledExecutor();
-        flowReconcileTask = new SingletonTask(ses, new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    if (doReconcile()) {
-                        flowReconcileTask.reschedule(
-                            FLOW_RECONCILE_DELAY_MILLISEC,
-                            TimeUnit.MILLISECONDS);
-                    }
-                } catch (Exception e) {
-                    logger.warn("Exception in doReconcile(): {}",
-                                e.getMessage());
-                    e.printStackTrace();
-                }
-            }
-        });
-        
-        String packetInName = OFType.PACKET_IN.toClass().getName();
-        packetInName = packetInName.substring(packetInName.lastIndexOf('.')+1); 
-        
-        // Construct controller counter for the packet_in
-        controllerPktInCounterName =
-            CounterStore.createCounterName(ICounterStoreService.CONTROLLER_NAME, 
-                                           -1,
-                                           packetInName);
-    }
-    
-    /**
-     * Feed the flows into the flow reconciliation pipeline.
-     * @return true if more flows to be reconciled
-     *         false if no more flows to be reconciled.
-     */
-    protected boolean doReconcile() {
-        if (!flowReconcileEnabled) {
-            return false;
-        }
-    
-        // Record the execution time.
-        lastReconcileTime = new Date();
-    
-        ArrayList<OFMatchReconcile> ofmRcList =
-                        new ArrayList<OFMatchReconcile>();
-        
-        // Get the maximum number of flows that can be reconciled.
-        int reconcileCapacity = getCurrentCapacity();
-        if (logger.isTraceEnabled()) {
-            logger.trace("Reconcile capacity {} flows", reconcileCapacity);
-        }
-        while (!flowQueue.isEmpty() && reconcileCapacity > 0) {
-            OFMatchReconcile ofmRc = flowQueue.poll();
-            reconcileCapacity--;
-            if (ofmRc != null) {
-                ofmRcList.add(ofmRc);
-                if (logger.isTraceEnabled()) {
-                    logger.trace("Add flow {} to be the reconcileList", ofmRc.cookie);
-                }
-            } else {
-                break;
-            }
-        }
-        
-        // Run the flow through all the flow reconcile listeners
-        IFlowReconcileListener.Command retCmd;
-        if (ofmRcList.size() > 0) {
-            List<IFlowReconcileListener> listeners =
-                flowReconcileListeners.getOrderedListeners();
-            if (listeners == null) {
-                if (logger.isTraceEnabled()) {
-                    logger.trace("No flowReconcile listener");
-                }
-                return false;
-            }
-        
-            for (IFlowReconcileListener flowReconciler :
-                flowReconcileListeners.getOrderedListeners()) {
-                if (logger.isTraceEnabled()) {
-                    logger.trace("Reconciling flow: call listener {}",
-                            flowReconciler.getName());
-                }
-                retCmd = flowReconciler.reconcileFlows(ofmRcList);
-                if (retCmd == IFlowReconcileListener.Command.STOP) {
-                    break;
-                }
-            }
-            flowReconcileThreadRunCount++;
-        } else {
-            if (logger.isTraceEnabled()) {
-                logger.trace("No flow to be reconciled.");
-            }
-        }
-        
-        // Return true if there are more flows to be reconciled
-        if (flowQueue.isEmpty()) {
-            return false;
-        } else {
-            if (logger.isTraceEnabled()) {
-                logger.trace("{} more flows to be reconciled.",
-                            flowQueue.size());
-            }
-            return true;
-        }
-    }
-    
-    /**
-     * Compute the maximum number of flows to be reconciled.
-     * 
-     * It computes the packetIn increment from the counter values in
-     * the counter store;
-     * Then computes the rate based on the elapsed time
-     * from the last query;
-     * Then compute the max flow reconcile rate by subtracting the packetIn
-     * rate from the hard-coded max system rate.
-     * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
-     * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
-     * to prevent starvation.
-     * Then convert the rate to an absolute number for the
-     * FLOW_RECONCILE_PERIOD.
-     * @return
-     */
-    protected int getCurrentCapacity() {
-        ICounter pktInCounter =
-            counterStore.getCounter(controllerPktInCounterName);
-        int minFlows = MIN_FLOW_RECONCILE_PER_SECOND *
-                        FLOW_RECONCILE_DELAY_MILLISEC / 1000;
-        
-        // If no packetInCounter, then there shouldn't be any flow.
-        if (pktInCounter == null ||
-            pktInCounter.getCounterDate() == null ||
-            pktInCounter.getCounterValue() == null) {
-            logger.debug("counter {} doesn't exist",
-                        controllerPktInCounterName);
-            return minFlows;
-        }
-        
-        // Haven't get any counter yet.
-        if (lastPacketInCounter == null) {
-            logger.debug("First time get the count for {}",
-                        controllerPktInCounterName);
-            lastPacketInCounter = (SimpleCounter)
-            SimpleCounter.createCounter(pktInCounter);
-            return minFlows;
-        }
-        
-        int pktInRate = getPktInRate(pktInCounter, new Date());
-        
-        // Update the last packetInCounter
-        lastPacketInCounter = (SimpleCounter)
-        SimpleCounter.createCounter(pktInCounter);
-        int capacity = minFlows;
-        if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
-                               MAX_SYSTEM_LOAD_PER_SECOND) {
-            capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
-                    * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
-        }
-        
-        if (logger.isTraceEnabled()) {
-            logger.trace("Capacity is {}", capacity);
-        }
-        return capacity;
-    }
-    
-    protected int getPktInRate(ICounter newCnt, Date currentTime) {
-        if (newCnt == null ||
-            newCnt.getCounterDate() == null ||
-            newCnt.getCounterValue() == null) {
-            return 0;
-        }
-    
-        // Somehow the system time is messed up. return max packetIn rate
-        // to reduce the system load.
-        if (newCnt.getCounterDate().before(
-                lastPacketInCounter.getCounterDate())) {
-            logger.debug("Time is going backward. new {}, old {}",
-                    newCnt.getCounterDate(),
-                    lastPacketInCounter.getCounterDate());
-            return MAX_SYSTEM_LOAD_PER_SECOND;
-        }
-    
-        long elapsedTimeInSecond = (currentTime.getTime() -
-                    lastPacketInCounter.getCounterDate().getTime()) / 1000;
-        if (elapsedTimeInSecond == 0) {
-            // This should never happen. Check to avoid division by zero.
-            return 0;
-        }
-    
-        long diff = 0;
-        switch (newCnt.getCounterValue().getType()) {
-            case LONG:
-                long newLong = newCnt.getCounterValue().getLong();
-                long oldLong = lastPacketInCounter.getCounterValue().getLong();
-                if (newLong < oldLong) {
-                    // Roll over event
-                    diff = Long.MAX_VALUE - oldLong + newLong;
-                } else {
-                    diff = newLong - oldLong;
-                }
-                break;
-    
-            case DOUBLE:
-                double newDouble = newCnt.getCounterValue().getDouble();
-                double oldDouble = lastPacketInCounter.getCounterValue().getDouble();
-                if (newDouble < oldDouble) {
-                    // Roll over event
-                    diff = (long)(Double.MAX_VALUE - oldDouble + newDouble);
-                } else {
-                    diff = (long)(newDouble - oldDouble);
-                }
-                break;
-        }
-    
-        return (int)(diff/elapsedTimeInSecond);
-    }
-}
-
diff --git a/src/main/java/net/floodlightcontroller/flowcache/IFlowCacheService.java b/src/main/java/net/floodlightcontroller/flowcache/IFlowCacheService.java
deleted file mode 100644
index 8e44ed3..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/IFlowCacheService.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import org.openflow.protocol.OFMatchWithSwDpid;
-
-import net.floodlightcontroller.core.FloodlightContext;
-import net.floodlightcontroller.core.FloodlightContextStore;
-import net.floodlightcontroller.core.IOFSwitch;
-import net.floodlightcontroller.devicemanager.SwitchPort;
-import net.floodlightcontroller.core.module.IFloodlightService;
-
-/**
- * The Interface IFlowCache.
- * <p>
- * public interface APIs to Big Switch Flow-Cache Service. Flow-Cache maintains
- * the network-level flows that are currently deployed in the underlying 
- * network. The flow cache can be queried using various filters by using the
- * corresponding APIs.
- * 
- * @author subrata
- *
- */
-public interface IFlowCacheService extends IFloodlightService {
-
-    public static final String FLOWCACHE_APP_NAME = 
-        "net.floodlightcontroller.flowcache.appName";
-    public static final String FLOWCACHE_APP_INSTANCE_NAME = 
-        "net.floodlightcontroller.flowcache.appInstanceName";
-
-    /**
-     * The flow cache query event type indicating the event that triggered the
-     * query. The callerOpaqueObj can be keyed based on this event type
-     */
-    public static enum FCQueryEvType {
-        /** The GET query. Flows need not be reconciled for this query type */
-        GET,
-        /** A new App was added. */
-        APP_ADDED,
-        /** An App was deleted. */
-        APP_DELETED,
-        /** Interface rule of an app was modified */
-        APP_INTERFACE_RULE_CHANGED,
-        /** Some App configuration was changed */
-        APP_CONFIG_CHANGED,
-        /** An ACL was added */
-        ACL_ADDED,
-        /** An ACL was deleted */
-        ACL_DELETED,
-        /** An ACL rule was added */
-        ACL_RULE_ADDED,
-        /** An ACL rule was deleted */
-        ACL_RULE_DELETED,
-        /** ACL configuration was changed */
-        ACL_CONFIG_CHANGED,
-        /** device had moved to a different port in the network */
-        DEVICE_MOVED,
-        /** device's property had changed, such as tag assignment */
-        DEVICE_PROPERTY_CHANGED,
-        /** Link down */
-        LINK_DOWN,
-        /** Periodic scan of switch flow table */
-        PERIODIC_SCAN,
-    }
-    
-    /**
-     * A FloodlightContextStore object that can be used to interact with the 
-     * FloodlightContext information about flowCache.
-     */
-    public static final FloodlightContextStore<String> fcStore = 
-        new FloodlightContextStore<String>();
-    
-    /**
-     * Submit a flow cache query with query parameters specified in FCQueryObj
-     * object. The query object can be created using one of the newFCQueryObj 
-     * helper functions in IFlowCache interface. 
-     * <p>
-     * The queried flows are returned via the flowQueryRespHandler() callback 
-     * that the caller must implement. The caller can match the query with
-     * the response using unique callerOpaqueData which remains unchanged
-     * in the request and response callback.
-     *
-     * @see  com.bigswitch.floodlight.flowcache#flowQueryRespHandler
-     * @param query the flow cache query object as input
-     * 
-     */
-    public void submitFlowCacheQuery(FCQueryObj query);
-
-    /**
-     * Deactivates all flows in the flow cache for which the source switch
-     * matches the given switchDpid. Note that the flows are NOT deleted
-     * from the cache.
-     *
-     * @param switchDpid Data-path identifier of the source switch
-     */
-    public void deactivateFlowCacheBySwitch(long switchDpid);
-
-    /**
-     * Deletes all flows in the flow cache for which the source switch
-     * matches the given switchDpid. 
-     * 
-     * @param switchDpid Data-path identifier of the source switch
-     */
-    public void deleteFlowCacheBySwitch(long switchDpid);
-
-    /**
-     * Add a flow to the flow-cache - called when a flow-mod is about to be
-     * written to a set of switches. If it returns false then it should not
-     * be written to the switches. If it returns true then the cookie returned
-     * should be used for the flow mod sent to the switches.
-     *
-     * @param appInstName Application instance name
-     * @param ofm openflow match object
-     * @param cookie openflow-mod cookie
-     * @param swPort SwitchPort object
-     * @param priority openflow match priority
-     * @param action action taken on the matched packets (PERMIT or DENY)
-     * @return true:  flow should be written to the switch(es)
-     *         false: flow should not be written to the switch(es). false is
-     *                returned, for example, when the flow was recently
-     *                written to the flow-cache and hence it is dampened to
-     *                avoid frequent writes of the same flow to the switches
-     *                This case can typically arise for the flows written at the
-     *                internal ports as they are heavily wild-carded.
-     */
-    public boolean addFlow(String appInstName, OFMatchWithSwDpid ofm, 
-                           Long cookie, long srcSwDpid, 
-                           short inPort, short priority, byte action);
-
-    /**
-     * Add a flow to the flow-cache - called when a flow-mod is about to be
-     * written to a set of switches. If it returns false then it should not
-     * be written to the switches. If it returns true then the cookie returned
-     * should be used for the flow mod sent to the switches.
-     *
-     * @param cntx the cntx
-     * @param ofm the ofm
-     * @param cookie the cookie
-     * @param swPort the sw port
-     * @param priority the priority
-     * @param action the action
-     * @return true:  flow should be written to the switch(es)
-     * false: flow should not be written to the switch(es). false is
-     * returned, for example, when the flow was recently
-     * written to the flow-cache and hence it is dampened to
-     * avoid frequent writes of the same flow to the switches
-     * This case can typically arise for the flows written at the
-     * internal ports as they are heavily wild-carded.
-     */
-    public boolean addFlow(FloodlightContext cntx, OFMatchWithSwDpid ofm, 
-                           Long cookie, SwitchPort swPort, 
-                           short priority, byte action);
-
-    /**
-     * Move the specified flow from its current application instance to a 
-     * different application instance. This API can be used when a flow moves
-     * to a different application instance when the application instance
-     * configuration changes or when a device moves to a different part in
-     * the network that belongs to a different application instance.
-     * <p>
-     * Note that, if the flow was not found in the current application 
-     * instance then the flow is not moved to the new application instance.
-     * 
-     * @param ofMRc the object containing the flow match and new application
-     * instance name.
-     * @return true is the flow was found in the flow cache in the current 
-     * application instance; false if the flow was not found in the flow-cache
-     * in the current application instance.
-     */
-    public boolean moveFlowToDifferentApplInstName(OFMatchReconcile ofMRc);
-
-    /**
-     * Delete all flow from the specified switch
-     * @param sw
-     */
-    public void deleteAllFlowsAtASourceSwitch(IOFSwitch sw);
-    
-    /**
-     * Post a request to update flowcache from a switch.
-     * This is an asynchronous operation.
-     * It queries the switch for stats and updates the flowcache asynchronously
-     * with the response.
-     * @param swDpid
-     * @param delay_ms
-     */
-    public void querySwitchFlowTable(long swDpid);
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/IFlowQueryHandler.java b/src/main/java/net/floodlightcontroller/flowcache/IFlowQueryHandler.java
deleted file mode 100644
index 5d1b1a9..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/IFlowQueryHandler.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-public interface IFlowQueryHandler {
-    /**
-     * This callback function is called in response to a flow query request
-     * submitted to the flow cache service. The module handling this callback
-     * can be different from the one that submitted the query. In the flow
-     * query object used for submitting the flow query, the identity of the
-     * callback handler is passed. When flow cache service has all or some
-     * of the flows that needs to be returned then this callback is called
-     * for the appropriate module. The respone contains a boolean more flag 
-     * that indicates if there are additional flows that may be returned
-     * via additional callback calls.
-     *
-     * @param resp the response object containing the original flow query 
-     * object, partial or complete list of flows that we queried and some 
-     * metadata such as the more flag described aboce.
-     *
-     */
-    public void flowQueryRespHandler(FlowCacheQueryResp resp);
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileListener.java b/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileListener.java
deleted file mode 100644
index f1100ed..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import java.util.ArrayList;
-
-import net.floodlightcontroller.core.IListener;
-import org.openflow.protocol.OFType;
-
-/**
- * The Interface IFlowReconciler.
- *
- * @author subrata
- */
-public interface IFlowReconcileListener extends IListener<OFType> {
-    /**
-     * Given an input OFMatch, this method applies the policy of the reconciler
-     * and returns a the same input OFMatch structure modified. Additional
-     * OFMatches, if needed, are returned in OFMatch-list. All the OFMatches
-     * are assumed to have "PERMIT" action.
-     *
-     * @param ofmRcList  input flow matches, to be updated to be consistent with
-     *                   the policies of this reconciler 
-     *                   Additional OFMatch-es can be added to the "list" as
-     *                   needed. 
-     *                   For example after a new ACL application, one flow-match
-     *                   may result in multiple flow-matches
-     *                   The method must also update the ReconcileAction
-     *                   member in ofmRcList entries to indicate if the
-     *                   flow needs to be modified, deleted or left unchanged
-     *                   OR of a new entry is to be added after flow 
-     *                   reconciliation
-     *
-     *
-     * @return   Command.CONTINUE if the OFMatch should be sent to the
-     *           next flow reconciler. 
-     *           Command.STOP if the OFMatch shouldn't be processed
-     *           further. In this case the no reconciled flow-mods would 
-     *           be programmed
-     */
-    public Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList);
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileService.java b/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileService.java
deleted file mode 100644
index f48c4e0..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/IFlowReconcileService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Provides Flow Reconcile service to other modules that need to reconcile
- * flows.
- */
-package net.floodlightcontroller.flowcache;
-
-import net.floodlightcontroller.core.module.IFloodlightService;
-import net.floodlightcontroller.devicemanager.IDevice;
-import net.floodlightcontroller.flowcache.IFlowCacheService.FCQueryEvType;
-
-public interface IFlowReconcileService extends IFloodlightService {
-    /**
-     * Add a flow reconcile listener
-     * @param listener The module that can reconcile flows
-     */
-    public void addFlowReconcileListener(IFlowReconcileListener listener);
-
-    /**
-     * Remove a flow reconcile listener
-     * @param listener The module that no longer reconcile flows
-     */
-    public void removeFlowReconcileListener(IFlowReconcileListener listener);
-    
-    /**
-     * Remove all flow reconcile listeners
-     */
-    public void clearFlowReconcileListeners();
-    
-    /**
-     * Reconcile flow. Returns false if no modified flow-mod need to be 
-     * programmed if cluster ID is providced then pnly flows in the given 
-     * cluster are reprogrammed
-     *
-     * @param ofmRcIn the ofm rc in
-     */
-    public void reconcileFlow(OFMatchReconcile ofmRcIn);
-    
-    /**
-     * Updates the flows to a device after the device moved to a new location
-     * <p>
-     * Queries the flow-cache to get all the flows destined to the given device.
-     * Reconciles each of these flows by potentially reprogramming them to its
-     * new attachment point
-     *
-     * @param device      device that has moved
-     * @param handler	  handler to process the flows
-     * @param fcEvType    Event type that triggered the update
-     *
-     */
-    public void updateFlowForDestinationDevice(IDevice device,
-            IFlowQueryHandler handler,
-    		FCQueryEvType fcEvType);
-    
-    /**
-     * Updates the flows from a device
-     * <p>
-     * Queries the flow-cache to get all the flows source from the given device.
-     * Reconciles each of these flows by potentially reprogramming them to its
-     * new attachment point
-     *
-     * @param device      device where the flow originates
-     * @param handler	  handler to process the flows
-     * @param fcEvType    Event type that triggered the update
-     *
-     */
-    public void updateFlowForSourceDevice(IDevice device,
-            IFlowQueryHandler handler,
-    		FCQueryEvType fcEvType);
-
-    /**
-     * Generic flow query handler to insert FlowMods into the reconcile pipeline.
-     * @param flowResp
-     */
-    public void flowQueryGenericHandler(FlowCacheQueryResp flowResp);
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/OFMatchReconcile.java b/src/main/java/net/floodlightcontroller/flowcache/OFMatchReconcile.java
deleted file mode 100644
index 68831f4..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/OFMatchReconcile.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import net.floodlightcontroller.core.FloodlightContext;
-import org.openflow.protocol.OFMatchWithSwDpid;
-
-/**
- * OFMatchReconcile class to indicate result of a flow-reconciliation.
- */
-public class OFMatchReconcile  {
- 
-    /**
-     * The enum ReconcileAction. Specifies the result of reconciliation of a 
-     * flow.
-     */
-    public enum ReconcileAction {
-
-        /** Delete the flow-mod from the switch */
-        DROP,
-        /** Leave the flow-mod as-is. */
-        NO_CHANGE,
-        /** Program this new flow mod. */
-        NEW_ENTRY,
-        /** 
-         * Reprogram the flow mod as the path of the flow might have changed,
-         * for example when a host is moved or when a link goes down. */
-        UPDATE_PATH,
-        /* Flow is now in a different BVS */
-        APP_INSTANCE_CHANGED,
-        /* Delete the flow-mod - used to delete, for example, drop flow-mods
-         * when the source and destination are in the same BVS after a 
-         * configuration change */
-        DELETE
-    }
-
-    /** The open flow match after reconciliation. */
-    public OFMatchWithSwDpid ofmWithSwDpid;
-    /** flow mod. priority */
-    public short priority;
-    /** Action of this flow-mod PERMIT or DENY */
-    public byte action;
-    /** flow mod. cookie */
-    public long cookie;
-    /** The application instance name. */
-    public String appInstName;
-    /**
-     * The new application instance name. This is null unless the flow
-     * has moved to a different BVS due to BVS config change or device
-     * move to a different switch port etc.*/
-    public String newAppInstName;
-    /** The reconcile action. */
-    public ReconcileAction rcAction;
-
-    // The context for the reconcile action
-    public FloodlightContext cntx;
-    
-    /**
-     * Instantiates a new oF match reconcile object.
-     */
-    public OFMatchReconcile() {
-        ofmWithSwDpid      = new OFMatchWithSwDpid();
-        rcAction = ReconcileAction.NO_CHANGE;
-        cntx = new FloodlightContext();
-    }
-    
-    public OFMatchReconcile(OFMatchReconcile copy) {
-        ofmWithSwDpid =
-            new OFMatchWithSwDpid(copy.ofmWithSwDpid.getOfMatch(),
-                    copy.ofmWithSwDpid.getSwitchDataPathId());
-        priority = copy.priority;
-        action = copy.action;
-        cookie = copy.cookie;
-        appInstName = copy.appInstName;
-        newAppInstName = copy.newAppInstName;
-        rcAction = copy.rcAction;
-        cntx = new FloodlightContext();
-    }
-    
-    @Override
-    public String toString() {
-        return "OFMatchReconcile [" + ofmWithSwDpid + " priority=" + priority + " action=" + action + 
-                " cookie=" + cookie + " appInstName=" + appInstName + " newAppInstName=" + newAppInstName + 
-                " ReconcileAction=" + rcAction + "]";
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/PendingSwRespKey.java b/src/main/java/net/floodlightcontroller/flowcache/PendingSwRespKey.java
deleted file mode 100644
index 767ce94..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/PendingSwRespKey.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-public class PendingSwRespKey {
-    long swDpid;
-    int  transId;
-
-    public PendingSwRespKey(long swDpid, int transId) {
-        this.swDpid  = swDpid;
-        this.transId = transId;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 97;
-        Long dpid   = swDpid;
-        Integer tid = transId;
-        return (tid.hashCode()*prime + dpid.hashCode());
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof PendingSwRespKey)) {
-            return false;
-        }
-        PendingSwRespKey other = (PendingSwRespKey) obj;
-        if ((swDpid != other.swDpid) || (transId != other.transId)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        return Long.toHexString(swDpid)+","+Integer.toString(transId);
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/PendingSwitchResp.java b/src/main/java/net/floodlightcontroller/flowcache/PendingSwitchResp.java
deleted file mode 100644
index d6f264f..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/PendingSwitchResp.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-import net.floodlightcontroller.flowcache.IFlowCacheService.FCQueryEvType;
-
-/**
- * The Class PendingSwitchResp. This object is used to track the pending
- * responses to switch flow table queries.
- */
-public class PendingSwitchResp {
-    protected FCQueryEvType evType;
-
-    public PendingSwitchResp(
-            FCQueryEvType evType) {
-        this.evType      = evType;
-    }
-    
-    public FCQueryEvType getEvType() {
-        return evType;
-    }
-
-    public void setEvType(FCQueryEvType evType) {
-        this.evType = evType;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/flowcache/QRFlowCacheObj.java b/src/main/java/net/floodlightcontroller/flowcache/QRFlowCacheObj.java
deleted file mode 100644
index 5121f8b..0000000
--- a/src/main/java/net/floodlightcontroller/flowcache/QRFlowCacheObj.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package net.floodlightcontroller.flowcache;
-
-
-import org.openflow.protocol.OFMatchWithSwDpid;
-
-/**
- * Used in BigFlowCacheQueryResp as query result.
- * Used to return one flow when queried by one of the big flow cache APIs.
- * One of these QRFlowCacheObj is returned for each combination of
- * priority and action.
- *
- * @author subrata
- */
-public class QRFlowCacheObj {
-
-    /** The open flow match object. */
-    public OFMatchWithSwDpid ofmWithSwDpid;
-    /** The flow-mod priority. */
-    public short   priority;
-    /** flow-mod cookie */
-    public long    cookie;
-    /** The action - PERMIT or DENY. */
-    public byte    action;
-    /** The reserved byte to align with 8 bytes. */
-    public byte    reserved;
-
-    /**
-     * Instantiates a new flow cache query object.
-     *
-     * @param priority the priority
-     * @param action the action
-     */
-    public QRFlowCacheObj(short priority, byte action, long cookie) {
-        ofmWithSwDpid = new OFMatchWithSwDpid();
-        this.action   = action;
-        this.priority = priority;
-        this.cookie   = cookie;
-    }
-
-    /**
-     * Populate a given OFMatchReconcile object from the values of this
-     * class.
-     *
-     * @param ofmRc the given OFMatchReconcile object
-     * @param appInstName the application instance name
-     * @param rcAction the reconcile action
-     */
-    public   void toOFMatchReconcile(OFMatchReconcile ofmRc,
-                            String appInstName, OFMatchReconcile.ReconcileAction rcAction) {
-        ofmRc.ofmWithSwDpid   = ofmWithSwDpid; // not copying
-        ofmRc.appInstName     = appInstName;
-        ofmRc.rcAction        = rcAction;
-        ofmRc.priority        = priority;
-        ofmRc.cookie          = cookie;
-        ofmRc.action          = action;
-    }
-    
-    @Override
-    public String toString() {
-        String str = "ofmWithSwDpid: " + this.ofmWithSwDpid.toString() + " ";
-        str += "priority: " + this.priority + " ";
-        str += "cookie: " + this.cookie + " ";
-        str += "action: " + this.action + " ";
-        str += "reserved: " + this.reserved + " ";
-        return str;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucket.java b/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucket.java
deleted file mode 100644
index e76253d..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucket.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import net.floodlightcontroller.core.IOFMessageListener;
-
-@JsonSerialize(using=CumulativeTimeBucketJSONSerializer.class)
-public class CumulativeTimeBucket {
-    private long startTime_ns; // First pkt time-stamp in this bucket
-    private Map<Integer, OneComponentTime> compStats;
-    private long totalPktCnt;
-    private long totalProcTimeNs; // total processing time for one pkt in
-    private long sumSquaredProcTimeNs2;
-    private long maxTotalProcTimeNs;
-    private long minTotalProcTimeNs;
-    private long avgTotalProcTimeNs;
-    private long sigmaTotalProcTimeNs; // std. deviation
-
-    public long getStartTimeNs() {
-        return startTime_ns;
-    }
-
-    public long getTotalPktCnt() {
-        return totalPktCnt;
-    }
-    
-    public long getAverageProcTimeNs() {
-        return avgTotalProcTimeNs;
-    }
-
-    public long getMinTotalProcTimeNs() {
-        return minTotalProcTimeNs;
-    }
-    
-    public long getMaxTotalProcTimeNs() {
-        return maxTotalProcTimeNs;
-    }
-    
-    public long getTotalSigmaProcTimeNs() {
-        return sigmaTotalProcTimeNs;
-    }
-    
-    public int getNumComps() {
-        return compStats.values().size();
-    }
-    
-    public Collection<OneComponentTime> getModules() {
-        return compStats.values();
-    }
-
-    public CumulativeTimeBucket(List<IOFMessageListener> listeners) {
-        compStats = new ConcurrentHashMap<Integer, OneComponentTime>(listeners.size());
-        for (IOFMessageListener l : listeners) {
-            OneComponentTime oct = new OneComponentTime(l);
-            compStats.put(oct.hashCode(), oct);
-        }
-        startTime_ns = System.nanoTime();
-    }
-
-    private void updateSquaredProcessingTime(long curTimeNs) {
-        sumSquaredProcTimeNs2 += (Math.pow(curTimeNs, 2));
-    }
-    
-    /**
-     * Resets all counters and counters for each component time
-     */
-    public void reset() {
-        startTime_ns = System.nanoTime();
-        totalPktCnt = 0;
-        totalProcTimeNs = 0;
-        avgTotalProcTimeNs = 0;
-        sumSquaredProcTimeNs2 = 0;
-        maxTotalProcTimeNs = Long.MIN_VALUE;
-        minTotalProcTimeNs = Long.MAX_VALUE;
-        sigmaTotalProcTimeNs = 0;
-        for (OneComponentTime oct : compStats.values()) {
-            oct.resetAllCounters();
-        }
-    }
-    
-    private void computeSigma() {
-        // Computes std. deviation from the sum of count numbers and from
-        // the sum of the squares of count numbers
-        double temp = totalProcTimeNs;
-        temp = Math.pow(temp, 2) / totalPktCnt;
-        temp = (sumSquaredProcTimeNs2 - temp) / totalPktCnt;
-        sigmaTotalProcTimeNs = (long) Math.sqrt(temp);
-    }
-    
-    public void computeAverages() {
-        // Must be called last to, needs latest info
-        computeSigma();
-        
-        for (OneComponentTime oct : compStats.values()) {
-            oct.computeSigma();
-        }
-    }
-    
-    public void updatePerPacketCounters(long procTimeNs) {
-        totalPktCnt++;
-        totalProcTimeNs += procTimeNs;
-        avgTotalProcTimeNs = totalProcTimeNs / totalPktCnt;
-        updateSquaredProcessingTime(procTimeNs);
-        
-        if (procTimeNs > maxTotalProcTimeNs) {
-            maxTotalProcTimeNs = procTimeNs;
-        }
-        
-        if (procTimeNs < minTotalProcTimeNs) {
-            minTotalProcTimeNs = procTimeNs;
-        }
-    }
-    
-    public void updateOneComponent(IOFMessageListener l, long procTimeNs) {
-        compStats.get(l.hashCode()).updatePerPacketCounters(procTimeNs);
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucketJSONSerializer.java b/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucketJSONSerializer.java
deleted file mode 100644
index e492777..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/CumulativeTimeBucketJSONSerializer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-
-
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.SerializerProvider;
-
-public class CumulativeTimeBucketJSONSerializer
-                                extends JsonSerializer<CumulativeTimeBucket> {
-    /**
-     * Performs the serialization of a OneComponentTime object
-     */
-   @Override
-   public void serialize(CumulativeTimeBucket ctb,
-                   JsonGenerator jGen,
-                   SerializerProvider serializer) 
-                   throws IOException, JsonProcessingException {
-       jGen.writeStartObject();
-       Timestamp ts = new Timestamp(ctb.getStartTimeNs()/1000000);
-       jGen.writeStringField("start-time", ts.toString());
-       jGen.writeStringField("current-time", 
-         new Timestamp(System.currentTimeMillis()).toString());
-       jGen.writeNumberField("total-packets", ctb.getTotalPktCnt());
-       jGen.writeNumberField("average", ctb.getAverageProcTimeNs());
-       jGen.writeNumberField("min", ctb.getMinTotalProcTimeNs());
-       jGen.writeNumberField("max", ctb.getMaxTotalProcTimeNs());
-       jGen.writeNumberField("std-dev", ctb.getTotalSigmaProcTimeNs());
-       jGen.writeArrayFieldStart("modules");
-       for (OneComponentTime oct : ctb.getModules()) {
-           serializer.defaultSerializeValue(oct, jGen);
-       }
-       jGen.writeEndArray();
-       jGen.writeEndObject();
-   }
-
-   /**
-    * Tells SimpleModule that we are the serializer for OFMatch
-    */
-   @Override
-   public Class<CumulativeTimeBucket> handledType() {
-       return CumulativeTimeBucket.class;
-   }
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/IPktInProcessingTimeService.java b/src/main/java/net/floodlightcontroller/perfmon/IPktInProcessingTimeService.java
deleted file mode 100644
index 80dfda0..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/IPktInProcessingTimeService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import java.util.List;
-
-import org.openflow.protocol.OFMessage;
-
-import net.floodlightcontroller.core.FloodlightContext;
-import net.floodlightcontroller.core.IOFMessageListener;
-import net.floodlightcontroller.core.IOFSwitch;
-import net.floodlightcontroller.core.module.IFloodlightService;
-
-public interface IPktInProcessingTimeService extends IFloodlightService {
-
-    /**
-     * Creates time buckets for a set of modules to measure their performance
-     * @param listeners The message listeners to create time buckets for
-     */
-    public void bootstrap(List<IOFMessageListener> listeners);
-    
-    /**
-     * Stores a timestamp in ns. Used right before a service handles an
-     * OF message. Only stores if the service is enabled.
-     */
-    public void recordStartTimeComp(IOFMessageListener listener);
-    
-    public void recordEndTimeComp(IOFMessageListener listener);
-    
-    public void recordStartTimePktIn();
-    
-    public void recordEndTimePktIn(IOFSwitch sw, OFMessage m, FloodlightContext cntx);
-    
-    public boolean isEnabled();
-    
-    public void setEnabled(boolean enabled);
-    
-    public CumulativeTimeBucket getCtb();
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/NullPktInProcessingTime.java b/src/main/java/net/floodlightcontroller/perfmon/NullPktInProcessingTime.java
deleted file mode 100644
index 3d9504b..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/NullPktInProcessingTime.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.openflow.protocol.OFMessage;
-
-import net.floodlightcontroller.core.FloodlightContext;
-import net.floodlightcontroller.core.IOFMessageListener;
-import net.floodlightcontroller.core.IOFSwitch;
-import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.core.module.FloodlightModuleException;
-import net.floodlightcontroller.core.module.IFloodlightModule;
-import net.floodlightcontroller.core.module.IFloodlightService;
-
-/**
- * An IPktInProcessingTimeService implementation that does nothing.
- * This is used mainly for performance testing or if you don't
- * want to use the IPktInProcessingTimeService features.
- * @author alexreimers
- *
- */
-public class NullPktInProcessingTime 
-    implements IFloodlightModule, IPktInProcessingTimeService {
-    
-    private CumulativeTimeBucket ctb;
-    private boolean inited = false;
-    
-    public Collection<Class<? extends IFloodlightService>> getModuleServices() {
-        Collection<Class<? extends IFloodlightService>> l = 
-                new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(IPktInProcessingTimeService.class);
-        return l;
-    }
-    
-    @Override
-    public Map<Class<? extends IFloodlightService>, IFloodlightService>
-            getServiceImpls() {
-        Map<Class<? extends IFloodlightService>,
-        IFloodlightService> m = 
-            new HashMap<Class<? extends IFloodlightService>,
-                        IFloodlightService>();
-        // We are the class that implements the service
-        m.put(IPktInProcessingTimeService.class, this);
-        return m;
-    }
-    
-    @Override
-    public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
-        // We don't have any dependencies
-        return null;
-    }
-    
-    @Override
-    public void init(FloodlightModuleContext context)
-                             throws FloodlightModuleException {
-
-    }
-
-    @Override
-    public void startUp(FloodlightModuleContext context) {
-        // no-op
-    }
-
-    @Override
-    public boolean isEnabled() {
-        return false;
-    }
-
-    @Override
-    public void bootstrap(List<IOFMessageListener> listeners) {
-        if (!inited)
-            ctb = new CumulativeTimeBucket(listeners);
-    }
-
-    @Override
-    public void recordStartTimeComp(IOFMessageListener listener) {
-
-    }
-
-    @Override
-    public void recordEndTimeComp(IOFMessageListener listener) {
-
-    }
-
-    @Override
-    public void recordStartTimePktIn() {
-
-    }
-
-    @Override
-    public void recordEndTimePktIn(IOFSwitch sw, OFMessage m,
-                                   FloodlightContext cntx) {
-        
-    }
-
-    @Override
-    public void setEnabled(boolean enabled) {
-    
-    }
-
-    @Override
-    public CumulativeTimeBucket getCtb() {
-        return ctb;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/OneComponentTime.java b/src/main/java/net/floodlightcontroller/perfmon/OneComponentTime.java
deleted file mode 100644
index 3e9734b..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/OneComponentTime.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import net.floodlightcontroller.core.IOFMessageListener;
-
-/**
- * Holds OF message processing time information for one IFloodlightModule.
- * @author Subrata
- */
-public class OneComponentTime {
-    private int compId; // hascode of IOFMessageListener
-    private String compName;
-    private int pktCnt;
-    // all times in nanoseconds
-    private long totalProcTimeNs;
-    private long sumSquaredProcTimeNs2; // squared
-    private long maxProcTimeNs;
-    private long minProcTimeNs;
-    private long avgProcTimeNs;
-    private long sigmaProcTimeNs;  // std. deviation
-
-    public OneComponentTime(IOFMessageListener module) {
-        compId = module.hashCode();
-        compName = module.getClass().getCanonicalName();
-        resetAllCounters();
-    }
-    
-    public void resetAllCounters() {
-        maxProcTimeNs = Long.MIN_VALUE;
-        minProcTimeNs = Long.MAX_VALUE;
-        pktCnt = 0;
-        totalProcTimeNs = 0;
-        sumSquaredProcTimeNs2 = 0;
-        avgProcTimeNs = 0;
-        sigmaProcTimeNs = 0;
-    }
-    
-    @JsonProperty("module-name")
-    public String getCompName() {
-        return compName;
-    }
-
-    @JsonProperty("num-packets")
-    public int getPktCnt() {
-        return pktCnt;
-    }
-
-    @JsonProperty("total")
-    public long getSumProcTimeNs() {
-        return totalProcTimeNs;
-    }
-
-    @JsonProperty("max")
-    public long getMaxProcTimeNs() {
-        return maxProcTimeNs;
-    }
-
-    @JsonProperty("min")
-    public long getMinProcTimeNs() {
-        return minProcTimeNs;
-    }
-
-    @JsonProperty("average")
-    public long getAvgProcTimeNs() {
-        return avgProcTimeNs;
-    }
-
-    @JsonProperty("std-dev")
-    public long getSigmaProcTimeNs() {
-        return sigmaProcTimeNs;
-    }
-    
-    @JsonProperty("average-squared")
-    public long getSumSquaredProcTimeNs() {
-        return sumSquaredProcTimeNs2;
-    }
-
-    // Methods used to update the counters
-    
-    private void increasePktCount() {
-        pktCnt++;
-    }
-    
-    private void updateTotalProcessingTime(long procTimeNs) {
-        totalProcTimeNs += procTimeNs;
-    }
-    
-    private void updateAvgProcessTime() {
-        avgProcTimeNs = totalProcTimeNs / pktCnt;
-    }
-    
-    private void updateSquaredProcessingTime(long procTimeNs) {
-        sumSquaredProcTimeNs2 += (Math.pow(procTimeNs, 2));
-    }
-    
-    private void calculateMinProcTime(long curTimeNs) {
-        if (curTimeNs < minProcTimeNs)
-            minProcTimeNs = curTimeNs;
-    }
-    
-    private void calculateMaxProcTime(long curTimeNs) {
-        if (curTimeNs > maxProcTimeNs)
-            maxProcTimeNs = curTimeNs;
-    }
-    
-    public void computeSigma() {
-        // Computes std. deviation from the sum of count numbers and from
-        // the sum of the squares of count numbers
-        double temp = totalProcTimeNs;
-        temp = Math.pow(temp, 2) / pktCnt;
-        temp = (sumSquaredProcTimeNs2 - temp) / pktCnt;
-        sigmaProcTimeNs = (long) Math.sqrt(temp);
-    }
-    
-    public void updatePerPacketCounters(long procTimeNs) {
-        increasePktCount();
-        updateTotalProcessingTime(procTimeNs);
-        calculateMinProcTime(procTimeNs);
-        calculateMaxProcTime(procTimeNs);
-        updateAvgProcessTime();
-        updateSquaredProcessingTime(procTimeNs);
-    }
-    
-    @Override
-    public int hashCode() {
-        return compId;
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/net/floodlightcontroller/perfmon/PerfMonDataResource.java b/src/main/java/net/floodlightcontroller/perfmon/PerfMonDataResource.java
deleted file mode 100644
index 297c44e..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/PerfMonDataResource.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import org.restlet.data.Status;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Return the performance monitoring data for the get rest api call
- * @author subrata
- */
-public class PerfMonDataResource extends ServerResource {
-    protected final static Logger logger = LoggerFactory.getLogger(PerfMonDataResource.class);  
-    
-    @Get("json")
-    public CumulativeTimeBucket handleApiQuery() {        
-        IPktInProcessingTimeService pktinProcTime = 
-            (IPktInProcessingTimeService)getContext().getAttributes().
-                get(IPktInProcessingTimeService.class.getCanonicalName());
-        
-        setStatus(Status.SUCCESS_OK, "OK");
-        // Allocate output object
-        if (pktinProcTime.isEnabled()) {
-            CumulativeTimeBucket ctb = pktinProcTime.getCtb();
-            ctb.computeAverages();
-            return ctb;
-        }
-        
-        return null;
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/net/floodlightcontroller/perfmon/PerfMonToggleResource.java b/src/main/java/net/floodlightcontroller/perfmon/PerfMonToggleResource.java
deleted file mode 100644
index 9ea1876..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/PerfMonToggleResource.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import org.restlet.data.Status;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-
-public class PerfMonToggleResource extends ServerResource {
-    
-    @Get("json")
-    public String retrieve() {
-        IPktInProcessingTimeService pktinProcTime = 
-                (IPktInProcessingTimeService)getContext().getAttributes().
-                    get(IPktInProcessingTimeService.class.getCanonicalName());
-        
-        String param = ((String)getRequestAttributes().get("perfmonstate")).toLowerCase();
-        if (param.equals("reset")) {
-            pktinProcTime.getCtb().reset();
-        } else {
-            if (param.equals("enable") || param.equals("true")) {
-                pktinProcTime.setEnabled(true);
-            } else if (param.equals("disable") || param.equals("false")) {
-                pktinProcTime.setEnabled(false);
-            }
-        }
-        setStatus(Status.SUCCESS_OK, "OK");
-        return "{ \"enabled\" : " + pktinProcTime.isEnabled() + " }";
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/PerfWebRoutable.java b/src/main/java/net/floodlightcontroller/perfmon/PerfWebRoutable.java
deleted file mode 100644
index ace0bc8..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/PerfWebRoutable.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package net.floodlightcontroller.perfmon;
-
-import org.restlet.Context;
-import org.restlet.Restlet;
-import org.restlet.routing.Router;
-
-import net.floodlightcontroller.restserver.RestletRoutable;
-
-public class PerfWebRoutable implements RestletRoutable {
-
-    @Override
-    public Restlet getRestlet(Context context) {
-        Router router = new Router(context);
-        router.attach("/data/json", PerfMonDataResource.class);
-        router.attach("/{perfmonstate}/json", PerfMonToggleResource.class); // enable, disable, or reset
-        return router;
-    }
-
-    @Override
-    public String basePath() {
-        return "/wm/performance";
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/perfmon/PktInProcessingTime.java b/src/main/java/net/floodlightcontroller/perfmon/PktInProcessingTime.java
deleted file mode 100644
index 639623b..0000000
--- a/src/main/java/net/floodlightcontroller/perfmon/PktInProcessingTime.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * Performance monitoring package
- */
-package net.floodlightcontroller.perfmon;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.floodlightcontroller.core.FloodlightContext;
-import net.floodlightcontroller.core.IOFMessageListener;
-import net.floodlightcontroller.core.IOFSwitch;
-import net.floodlightcontroller.core.annotations.LogMessageCategory;
-import net.floodlightcontroller.core.annotations.LogMessageDoc;
-import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.core.module.FloodlightModuleException;
-import net.floodlightcontroller.core.module.IFloodlightModule;
-import net.floodlightcontroller.core.module.IFloodlightService;
-import net.floodlightcontroller.restserver.IRestApiService;
-
-import org.openflow.protocol.OFMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class contains a set of buckets (called time buckets as the
- * primarily contain 'times' that are used in a circular way to 
- * store information on packet in processing time.
- * Each bucket is meant to store the various processing time 
- * related data for a fixed duration.
- * Buckets are reused to reduce garbage generation! Once the
- * last bucket is used up the LRU bucket is reused.
- * 
- * Naming convention for variable or constants
- * variable_s : value in seconds
- * variable_ms: value in milliseconds
- * variable_us: value in microseconds
- * variable_ns: value in nanoseconds
- * 
- * Key Constants:
- * ONE_BUCKET_DURATION_SECONDS_INT:  time duration of each bucket
- * BUCKET_SET_SIZE: Number of buckets
- * TOT_PROC_TIME_WARN_THRESHOLD_US: if processing time for a packet
- *    exceeds this threshold then a warning LOG message is generated
- * TOT_PROC_TIME_ALERT_THRESHOLD_US: same as above but an alert level
- *    syslog is generated instead
- * 
- */
-@LogMessageCategory("Performance Monitoring")
-public class PktInProcessingTime
-    implements IFloodlightModule, IPktInProcessingTimeService {
-
-    
-    // Our dependencies
-    private IRestApiService restApi;
-    
-    protected long ptWarningThresholdInNano;
-
-    // DB storage tables
-    protected static final String ControllerTableName = "controller_controller";
-    public static final String COLUMN_ID = "id";
-    public static final String COLUMN_PERF_MON = "performance_monitor_feature";
-    
-    protected static  Logger  logger = 
-        LoggerFactory.getLogger(PktInProcessingTime.class);
-    
-    protected boolean isEnabled = false;
-    protected boolean isInited = false;
-    // Maintains the time when the last packet was processed
-    protected long lastPktTime_ns;
-    private CumulativeTimeBucket ctb = null;
-
-    
-    /***
-     * BUCKET_SET_SIZE buckets each holding 10s of processing time data, a total
-     * of 30*10s = 5mins of processing time data is maintained
-     */
-    protected static final int ONE_BUCKET_DURATION_SECONDS = 10;// seconds
-    protected static final long ONE_BUCKET_DURATION_NANOSECONDS  =
-                                ONE_BUCKET_DURATION_SECONDS * 1000000000;
-    
-    @Override
-    public void bootstrap(List<IOFMessageListener> listeners) {
-        if (!isInited) {
-            ctb = new CumulativeTimeBucket(listeners);
-            isInited = true;
-        }
-    }
-    
-    @Override
-    public boolean isEnabled() {
-        return isEnabled && isInited;
-    }
-    
-    @Override
-    public void setEnabled(boolean enabled) {
-        this.isEnabled = enabled;
-        logger.debug("Setting module to " + isEnabled);
-    }
-    
-    @Override
-    public CumulativeTimeBucket getCtb() {
-        return ctb;
-    }
-    
-    private long startTimePktNs;
-    private long startTimeCompNs;
-    @Override
-    public void recordStartTimeComp(IOFMessageListener listener) {
-        if (isEnabled()) {
-            startTimeCompNs = System.nanoTime();
-        }
-    }
-    
-    @Override
-    public void recordEndTimeComp(IOFMessageListener listener) {
-        if (isEnabled()) {
-            long procTime = System.nanoTime() - startTimeCompNs;
-            ctb.updateOneComponent(listener, procTime);
-        }
-    }
-    
-    @Override
-    public void recordStartTimePktIn() {
-        if (isEnabled()) {
-            startTimePktNs = System.nanoTime();
-        }
-    }
-    
-    @Override
-    @LogMessageDoc(level="WARN",
-            message="Time to process packet-in exceeded threshold: {}",
-            explanation="Time to process packet-in exceeded the configured " +
-            		"performance threshold",
-            recommendation=LogMessageDoc.CHECK_CONTROLLER)
-    public void recordEndTimePktIn(IOFSwitch sw, OFMessage m, FloodlightContext cntx) {
-        if (isEnabled()) {
-            long procTimeNs = System.nanoTime() - startTimePktNs;
-            ctb.updatePerPacketCounters(procTimeNs);
-            
-            if (ptWarningThresholdInNano > 0 && 
-                    procTimeNs > ptWarningThresholdInNano) {
-                logger.warn("Time to process packet-in exceeded threshold: {}", 
-                            procTimeNs/1000);
-            }
-        }
-    }
-    
-    // IFloodlightModule methods
-    
-    @Override
-    public Collection<Class<? extends IFloodlightService>> getModuleServices() {
-        Collection<Class<? extends IFloodlightService>> l = 
-                new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(IPktInProcessingTimeService.class);
-        return l;
-    }
-    
-    @Override
-    public Map<Class<? extends IFloodlightService>, IFloodlightService>
-            getServiceImpls() {
-        Map<Class<? extends IFloodlightService>,
-        IFloodlightService> m = 
-            new HashMap<Class<? extends IFloodlightService>,
-                        IFloodlightService>();
-        // We are the class that implements the service
-        m.put(IPktInProcessingTimeService.class, this);
-        return m;
-    }
-    
-    @Override
-    public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
-        Collection<Class<? extends IFloodlightService>> l = 
-                new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(IRestApiService.class);
-        return l;
-    }
-    
-    @Override
-    public void init(FloodlightModuleContext context)
-                                             throws FloodlightModuleException {
-        restApi = context.getServiceImpl(IRestApiService.class);
-    }
-    
-    @Override
-    @LogMessageDoc(level="INFO",
-        message="Packet processing time threshold for warning" +
-            " set to {time} ms.",
-        explanation="Performance monitoring will log a warning if " +
-    		"packet processing time exceeds the configured threshold")
-    public void startUp(FloodlightModuleContext context) {
-        // Add our REST API
-        restApi.addRestletRoutable(new PerfWebRoutable());
-        
-        // TODO - Alex - change this to a config option
-        ptWarningThresholdInNano = Long.parseLong(System.getProperty(
-             "net.floodlightcontroller.core.PTWarningThresholdInMilli", "0")) * 1000000;
-        if (ptWarningThresholdInNano > 0) {
-            logger.info("Packet processing time threshold for warning" +
-            		" set to {} ms.", ptWarningThresholdInNano/1000000);
-        }
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/storage/memory/MemoryStorageSource.java b/src/main/java/net/floodlightcontroller/storage/memory/MemoryStorageSource.java
index 8a69eca..3c8d663 100644
--- a/src/main/java/net/floodlightcontroller/storage/memory/MemoryStorageSource.java
+++ b/src/main/java/net/floodlightcontroller/storage/memory/MemoryStorageSource.java
@@ -18,7 +18,6 @@
 package net.floodlightcontroller.storage.memory;
 
 import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.perfmon.IPktInProcessingTimeService;
 import net.floodlightcontroller.storage.nosql.NoSqlStorageSource;
 import net.floodlightcontroller.storage.SynchronousExecutorService;
 import net.floodlightcontroller.storage.IStorageSourceService;
@@ -36,7 +35,7 @@
 public class MemoryStorageSource extends NoSqlStorageSource {
     
     private Map<String, MemoryTable> tableMap = new HashMap<String,MemoryTable>();
-    IPktInProcessingTimeService pktinProcessingTime;
+
     
     synchronized private MemoryTable getTable(String tableName, boolean create) {
         MemoryTable table = tableMap.get(tableName);
@@ -172,11 +171,7 @@
         getTable(tableName, true);
     }
     
-    public void setPktinProcessingTime(
-            IPktInProcessingTimeService pktinProcessingTime) {
-        this.pktinProcessingTime = pktinProcessingTime;
-    }
-
+ 
     // IFloodlightModule methods
 
     @Override
diff --git a/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java b/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
index 775f952..6483121 100644
--- a/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
+++ b/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
@@ -27,7 +27,6 @@
 import net.onrc.onos.ofcontroller.util.FlowPath;
 import net.onrc.onos.ofcontroller.util.serializers.KryoFactory;
 
-import org.openflow.util.HexString;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,8 +98,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryAdded(EntryEvent event) {
-	    Long keyLong = (Long)event.getKey();
+	public void entryAdded(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -118,8 +116,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryRemoved(EntryEvent event) {
-	    Long keyLong = (Long)event.getKey();
+	public void entryRemoved(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -137,8 +134,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryUpdated(EntryEvent event) {
-	    Long keyLong = (Long)event.getKey();
+	public void entryUpdated(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -156,7 +152,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryEvicted(EntryEvent event) {
+	public void entryEvicted(EntryEvent<Long, byte[]> event) {
 	    // NOTE: We don't use eviction for this map
 	}
     }
@@ -174,14 +170,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryAdded(EntryEvent event) {
-	    //
-	    // NOTE: Ignore Flow Entries Events originated by this instance
-	    //
-	    if (event.getMember().localMember())
-		return;
-
-	    Long keyLong = (Long)event.getKey();
+	public void entryAdded(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -199,14 +188,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryRemoved(EntryEvent event) {
-	    //
-	    // NOTE: Ignore Flow Entries Events originated by this instance
-	    //
-	    if (event.getMember().localMember())
-		return;
-
-	    Long keyLong = (Long)event.getKey();
+	public void entryRemoved(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -224,14 +206,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryUpdated(EntryEvent event) {
-	    //
-	    // NOTE: Ignore Flow Entries Events originated by this instance
-	    //
-	    if (event.getMember().localMember())
-		return;
-
-	    Long keyLong = (Long)event.getKey();
+	public void entryUpdated(EntryEvent<Long, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -249,7 +224,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryEvicted(EntryEvent event) {
+	public void entryEvicted(EntryEvent<Long, byte[]> event) {
 	    // NOTE: We don't use eviction for this map
 	}
     }
@@ -267,8 +242,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryAdded(EntryEvent event) {
-	    String keyString = (String)event.getKey();
+	public void entryAdded(EntryEvent<String, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -287,8 +261,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryRemoved(EntryEvent event) {
-	    String keyString = (String)event.getKey();
+	public void entryRemoved(EntryEvent<String, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -307,8 +280,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryUpdated(EntryEvent event) {
-	    String keyString = (String)event.getKey();
+	public void entryUpdated(EntryEvent<String, byte[]> event) {
 	    byte[] valueBytes = (byte[])event.getValue();
 
 	    //
@@ -327,7 +299,7 @@
 	 *
 	 * @param event the notification event for the entry.
 	 */
-	public void entryEvicted(EntryEvent event) {
+	public void entryEvicted(EntryEvent<String, byte[]> event) {
 	    // NOTE: We don't use eviction for this map
 	}
     }
diff --git a/src/main/java/net/onrc/onos/graph/GraphDBOperation.java b/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
index bfd9046..03b4c96 100644
--- a/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
+++ b/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
@@ -176,9 +176,14 @@
 	 */
 	public IPortObject searchPort(String dpid, Short number) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+		if ( fg == null ) return null;
 		String id = dpid + number.toString();
-		return (fg != null && fg.getVertices("port_id",id).iterator().hasNext()) ? 
-				fg.getVertices("port_id",id,IPortObject.class).iterator().next() : null;
+		Iterator<IPortObject> ports =  fg.getVertices("port_id",id,IPortObject.class).iterator();
+		if ( ports.hasNext() ) {
+			return ports.next();
+		} else {
+			return null;
+		}
 	}
 
 	/**
@@ -206,10 +211,14 @@
 	 * @param macAddr MAC address to search and get
 	 */
 	public IDeviceObject searchDevice(String macAddr) {
-		// TODO Auto-generated method stub
-		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
-		return (fg != null && fg.getVertices("dl_addr",macAddr).iterator().hasNext()) ?
-			fg.getVertices("dl_addr",macAddr, IDeviceObject.class).iterator().next() : null;
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+		if ( fg == null ) return null;
+		Iterator<IDeviceObject> devices =  fg.getVertices("dl_addr",macAddr, IDeviceObject.class).iterator();
+		if ( devices.hasNext() ) {
+			return devices.next();
+		} else {
+			return null;
+		}
 	}
 
 	/**
@@ -288,10 +297,13 @@
 	 */
 	public IFlowPath searchFlowPath(FlowId flowId) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
-		
-		return fg.getVertices("flow_id", flowId.toString()).iterator().hasNext() ? 
-		    fg.getVertices("flow_id", flowId.toString(),
-				   IFlowPath.class).iterator().next() : null;
+		if ( fg == null ) return null;
+		Iterator<IFlowPath> flowpaths = fg.getVertices("flow_id", flowId.toString(), IFlowPath.class).iterator();
+		if ( flowpaths.hasNext() ) {
+			return flowpaths.next();
+		} else {
+			return null;
+		}
 	}
 
 	/**
@@ -299,10 +311,10 @@
 	 * @param flowEntry flow entry object
 	 */
 	public IFlowPath getFlowPathByFlowEntry(IFlowEntry flowEntry) {
-		GremlinPipeline<Vertex, IFlowPath> pipe = new GremlinPipeline<Vertex, IFlowPath>();
-		pipe.start(flowEntry.asVertex());
-		pipe.out("flow");
-		FramedVertexIterable<IFlowPath> r = new FramedVertexIterable(conn.getFramedGraph(), (Iterable) pipe, IFlowPath.class);
+		GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>();
+		pipe.start(flowEntry.asVertex()).out("flow");
+		FramedVertexIterable<IFlowPath> r = new FramedVertexIterable<IFlowPath>(conn.getFramedGraph(),
+				(Iterable<Vertex>) pipe, IFlowPath.class);
 		return r.iterator().hasNext() ? r.iterator().next() : null;
 	}
 
@@ -348,10 +360,13 @@
 	 */
 	public IFlowEntry searchFlowEntry(FlowEntryId flowEntryId) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
-		
-		return fg.getVertices("flow_entry_id", flowEntryId.toString()).iterator().hasNext() ? 
-		    fg.getVertices("flow_entry_id", flowEntryId.toString(),
-				   IFlowEntry.class).iterator().next() : null;
+		if ( fg == null ) return null;
+		Iterator<IFlowEntry> flowentries = fg.getVertices("flow_entry_id", flowEntryId.toString(), IFlowEntry.class).iterator();
+		if ( flowentries.hasNext() ) {
+			return flowentries.next();
+		} else {
+			return null;
+		}
 	}
 
 	/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Interface.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Interface.java
index 5db8f0a..cc454ec 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Interface.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Interface.java
@@ -14,7 +14,6 @@
 
 public class Interface {
 	private final String name;
-	private final SwitchPort switchPort;
 	private final long dpid;
 	private final short port;
 	private final InetAddress ipAddress;
@@ -31,7 +30,6 @@
 		this.port = port;
 		this.ipAddress = InetAddresses.forString(ipAddress);
 		this.prefixLength = prefixLength;
-		this.switchPort = new SwitchPort(new Dpid(this.dpid), new Port(this.port));
 	}
 	
 	public String getName() {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Ptree.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Ptree.java
index 041061c..c80d055 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Ptree.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Ptree.java
@@ -244,7 +244,6 @@
 		add.parent = node;
 	}
 	
-	@SuppressWarnings("unused")
     private PtreeNode node_common(PtreeNode node, byte [] key, int key_bits) {
 		int i;
 		int limit = Math.min(node.keyBits, key_bits) / 8;
@@ -275,8 +274,6 @@
 		}
 		
 		PtreeNode add = new PtreeNode(null, common_len, maxKeyOctets);
-		if (add == null)
-			return null;
 		
 		int j;
 		for (j = 0; j < i; j++)
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
index 49ffd4e..29c4377 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
@@ -1,7 +1,5 @@
 package net.onrc.onos.ofcontroller.core;
 
-import net.onrc.onos.ofcontroller.flowmanager.web.DatapathSummarySerializer;
-
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
@@ -13,6 +11,9 @@
 import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
 import com.tinkerpop.frames.VertexFrame;
 
+import net.onrc.onos.ofcontroller.flowmanager.web.DatapathSummarySerializer;
+import net.floodlightcontroller.core.web.serializers.IPv4Serializer;
+
 /*
  * This is the interfaces to make the objects for Cassandra DB.
  * They are interfaces, but it is also implementation,
@@ -205,6 +206,7 @@
 		
 		@JsonProperty("ipv4")
 		@Property("ipv4_address")
+		@JsonSerialize(using=IPv4Serializer.class)
 		public int getIpv4Address();
 		
 		@Property("ipv4_address")
@@ -251,6 +253,20 @@
 		@Property("flow_path_flags")
 		public void setFlowPathFlags(Long flowPathFlags);
 
+		@JsonProperty("idleTimeout")
+		@Property("idle_timeout")
+		public Integer getIdleTimeout();
+
+		@Property("idle_timeout")
+		public void setIdleTimeout(Integer idleTimeout);
+
+		@JsonProperty("hardTimeout")
+		@Property("hard_timeout")
+		public Integer getHardTimeout();
+
+		@Property("hard_timeout")
+		public void setHardTimeout(Integer hardTimeout);
+
 		@JsonProperty("srcDpid")
 		@Property("src_switch")
 		public String getSrcSwitch();
@@ -405,6 +421,20 @@
 		@Property("flow_entry_id")
 		public void setFlowEntryId(String flowEntryId);
 
+		@JsonProperty("idleTimeout")
+		@Property("idle_timeout")
+		public Integer getIdleTimeout();
+
+		@Property("idle_timeout")
+		public void setIdleTimeout(Integer idleTimeout);
+
+		@JsonProperty("hardTimeout")
+		@Property("hard_timeout")
+		public Integer getHardTimeout();
+
+		@Property("hard_timeout")
+		public void setHardTimeout(Integer hardTimeout);
+
 		@Property("switch_dpid")
 		public String getSwitchDpid();
 
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
index f5f8b00..4bbc054 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
@@ -80,6 +80,10 @@
 	                log.debug("Adding device {}: creating new device", device.getMACAddressString());
 	            }
 	 			
+	            if (obj == null) {
+	            	return null;
+	            }
+	            
 	            changeDeviceAttachments(device, obj);
 		        
 	            changeDeviceIpv4Addresses(device, obj);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
index 7a3d43e..635e24e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
@@ -14,10 +14,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.pipes.PipeFunction;
-import com.tinkerpop.pipes.transform.PathPipe;
-
 /**
  * This is the class for storing the information of links into GraphDB
  */
@@ -490,33 +486,4 @@
 	    
 	 	return success;
 	}
-
-	// TODO should be moved to TopoLinkServiceImpl (never used in this class)
-	static class ExtractLink implements PipeFunction<PathPipe<Vertex>, Link> {
-	
-		@SuppressWarnings("unchecked")
-		@Override
-		public Link compute(PathPipe<Vertex> pipe ) {
-			long s_dpid = 0;
-			long d_dpid = 0;
-			short s_port = 0;
-			short d_port = 0;
-			List<Vertex> V = new ArrayList<Vertex>();
-			V = (List<Vertex>)pipe.next();
-			Vertex src_sw = V.get(0);
-			Vertex dest_sw = V.get(3);
-			Vertex src_port = V.get(1);
-			Vertex dest_port = V.get(2);
-			s_dpid = HexString.toLong((String) src_sw.getProperty("dpid"));
-			d_dpid = HexString.toLong((String) dest_sw.getProperty("dpid"));
-			s_port = (Short) src_port.getProperty("number");
-			d_port = (Short) dest_port.getProperty("number");
-			
-			Link l = new Link(s_dpid,s_port,d_dpid,d_port);
-			
-			return l;
-		}
-	}
-
-
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
index dcfdc73..5f51b58 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
@@ -348,7 +348,6 @@
 	        	IPortObject p = sw.getPort(port);
 	            if (p != null) {
 	        		log.info("SwitchStorage:deletePort dpid:{} port:{} found and set INACTIVE", dpid, port);
-	        		//deletePortImpl(p);
 	        		p.setState("INACTIVE");
 	        		
 	        		// XXX for now delete devices when we change a port to prevent
@@ -492,12 +491,4 @@
 	    			new Object[] {port.getPortId(), state, desc});
 		}
 	}
-	
-	private void deletePortImpl(IPortObject port) {
-		if (port != null) {
-			op.removePort(port);
-	    	log.info("SwitchStorage:deletePortImpl port:{} done",
-	    			port.getPortId());
-		}
-	}
 }
\ No newline at end of file
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoLinkServiceImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoLinkServiceImpl.java
index b692e8e..f1f015a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoLinkServiceImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/TopoLinkServiceImpl.java
@@ -7,13 +7,15 @@
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoLinkService;
-import net.onrc.onos.ofcontroller.core.internal.LinkStorageImpl.ExtractLink;
 
+import org.openflow.util.HexString;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.tinkerpop.blueprints.Vertex;
 import com.tinkerpop.gremlin.java.GremlinPipeline;
+import com.tinkerpop.pipes.PipeFunction;
+import com.tinkerpop.pipes.transform.PathPipe;
 
 public class TopoLinkServiceImpl implements ITopoLinkService {
 	
@@ -31,7 +33,6 @@
  
 	@Override
 	public List<Link> getActiveLinks() {
-		// TODO Auto-generated method stub
 		op = new GraphDBOperation("");
 		op.commit(); //Commit to ensure we see latest data
 		Iterable<ISwitchObject> switches = op.getActiveSwitches();
@@ -56,7 +57,6 @@
 
 	@Override
 	public List<Link> getLinksOnSwitch(String dpid) {
-		// TODO Auto-generated method stub
 		List<Link> links = new ArrayList<Link>(); 
 		ISwitchObject sw = op.searchSwitch(dpid);
 		GremlinPipeline<Vertex, Link> pipe = new GremlinPipeline<Vertex, Link>();
@@ -73,5 +73,29 @@
 		return links;
 
 	}
-	
+
+	private class ExtractLink implements PipeFunction<PathPipe<Vertex>, Link> {
+		@Override
+		public Link compute(PathPipe<Vertex> pipe) {
+			long s_dpid = 0;
+			long d_dpid = 0;
+			short s_port = 0;
+			short d_port = 0;
+			
+			@SuppressWarnings("unchecked")
+			List<Vertex> V = pipe.next();
+			Vertex src_sw = V.get(0);
+			Vertex dest_sw = V.get(3);
+			Vertex src_port = V.get(1);
+			Vertex dest_port = V.get(2);
+			s_dpid = HexString.toLong((String) src_sw.getProperty("dpid"));
+			d_dpid = HexString.toLong((String) dest_sw.getProperty("dpid"));
+			s_port = (Short) src_port.getProperty("number");
+			d_port = (Short) dest_port.getProperty("number");
+			
+			Link l = new Link(s_dpid,s_port,d_dpid,d_port);
+			
+			return l;
+		}
+	}
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
index 50fe8f8..4b31667 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
@@ -39,7 +39,6 @@
 import net.onrc.onos.ofcontroller.core.ISwitchStorage;
 import net.onrc.onos.ofcontroller.core.INetMapStorage.DM_OPERATION;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
-import net.onrc.onos.ofcontroller.core.ISwitchStorage.SwitchState;
 import net.onrc.onos.ofcontroller.core.internal.DeviceStorageImpl;
 import net.onrc.onos.ofcontroller.core.internal.LinkStorageImpl;
 import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
index 1babafa..da407ab 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -3,10 +3,8 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.ArrayList;
-import java.util.Comparator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.concurrent.ConcurrentLinkedQueue;
 
 import net.floodlightcontroller.util.MACAddress;
 
@@ -90,6 +88,8 @@
 	// - flowPath.flowPathType()
 	// - flowPath.flowPathUserState()
 	// - flowPath.flowPathFlags()
+	// - flowPath.idleTimeout()
+	// - flowPath.hardTimeout()
 	// - flowPath.dataPath().srcPort()
 	// - flowPath.dataPath().dstPort()
 	// - flowPath.matchSrcMac()
@@ -109,6 +109,8 @@
 	flowObj.setFlowPathType(flowPath.flowPathType().toString());
 	flowObj.setFlowPathUserState(flowPath.flowPathUserState().toString());
 	flowObj.setFlowPathFlags(flowPath.flowPathFlags().flags());
+	flowObj.setIdleTimeout(flowPath.idleTimeout());
+	flowObj.setHardTimeout(flowPath.hardTimeout());
 	flowObj.setSrcSwitch(flowPath.dataPath().srcPort().dpid().toString());
 	flowObj.setSrcPort(flowPath.dataPath().srcPort().port().value());
 	flowObj.setDstSwitch(flowPath.dataPath().dstPort().dpid().toString());
@@ -225,6 +227,8 @@
 	// - InPort edge
 	// - OutPort edge
 	//
+	// - flowEntry.idleTimeout()
+	// - flowEntry.hardTimeout()
 	// - flowEntry.dpid()
 	// - flowEntry.flowEntryUserState()
 	// - flowEntry.flowEntrySwitchState()
@@ -245,6 +249,8 @@
 	// - flowEntry.actions()
 	//
 	ISwitchObject sw = dbHandler.searchSwitch(flowEntry.dpid().toString());
+	flowEntryObj.setIdleTimeout(flowEntry.idleTimeout());
+	flowEntryObj.setHardTimeout(flowEntry.hardTimeout());
 	flowEntryObj.setSwitchDpid(flowEntry.dpid().toString());
 	flowEntryObj.setSwitch(sw);
 	if (flowEntry.flowEntryMatch().matchInPort()) {
@@ -509,6 +515,8 @@
 	String flowPathType = flowObj.getFlowPathType();
 	String flowPathUserState = flowObj.getFlowPathUserState();
 	Long flowPathFlags = flowObj.getFlowPathFlags();
+	Integer idleTimeout = flowObj.getIdleTimeout();
+	Integer hardTimeout = flowObj.getHardTimeout();
 	String srcSwitchStr = flowObj.getSrcSwitch();
 	Short srcPortShort = flowObj.getSrcPort();
 	String dstSwitchStr = flowObj.getDstSwitch();
@@ -519,6 +527,8 @@
 	    (flowPathType == null) ||
 	    (flowPathUserState == null) ||
 	    (flowPathFlags == null) ||
+	    (idleTimeout == null) ||
+	    (hardTimeout == null) ||
 	    (srcSwitchStr == null) ||
 	    (srcPortShort == null) ||
 	    (dstSwitchStr == null) ||
@@ -533,6 +543,8 @@
 	flowPath.setFlowPathType(FlowPathType.valueOf(flowPathType));
 	flowPath.setFlowPathUserState(FlowPathUserState.valueOf(flowPathUserState));
 	flowPath.setFlowPathFlags(new FlowPathFlags(flowPathFlags));
+	flowPath.setIdleTimeout(idleTimeout);
+	flowPath.setHardTimeout(hardTimeout);
 	flowPath.dataPath().srcPort().setDpid(new Dpid(srcSwitchStr));
 	flowPath.dataPath().srcPort().setPort(new Port(srcPortShort));
 	flowPath.dataPath().dstPort().setDpid(new Dpid(dstSwitchStr));
@@ -611,11 +623,15 @@
      */
     public static FlowEntry extractFlowEntry(IFlowEntry flowEntryObj) {
 	String flowEntryIdStr = flowEntryObj.getFlowEntryId();
+	Integer idleTimeout = flowEntryObj.getIdleTimeout();
+	Integer hardTimeout = flowEntryObj.getHardTimeout();
 	String switchDpidStr = flowEntryObj.getSwitchDpid();
 	String userState = flowEntryObj.getUserState();
 	String switchState = flowEntryObj.getSwitchState();
 
 	if ((flowEntryIdStr == null) ||
+	    (idleTimeout == null) ||
+	    (hardTimeout == null) ||
 	    (switchDpidStr == null) ||
 	    (userState == null) ||
 	    (switchState == null)) {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
index 6c200fa..3538eb4 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
@@ -75,11 +75,14 @@
     // Transient state for processing the Flow Paths:
     //  - The Flow Paths that should be recomputed
     //  - The Flow Paths with modified Flow Entries
+    //  - The Flow Paths that we should check if installed in all switches
     //
     private Map<Long, FlowPath> shouldRecomputeFlowPaths =
 	new HashMap<Long, FlowPath>();
     private Map<Long, FlowPath> modifiedFlowPaths =
 	new HashMap<Long, FlowPath>();
+    private Map<Long, FlowPath> checkIfInstalledFlowPaths =
+	new HashMap<Long, FlowPath>();
 
     /**
      * Constructor for a given Flow Manager and Datagrid Service.
@@ -239,6 +242,12 @@
 	for (FlowPath flowPath : modifiedFlowPaths.values())
 	    flowPath.dataPath().removeDeletedFlowEntries();
 
+	//
+	// Check if Flow Paths have been installed into all switches,
+	// and generate the appropriate events.
+	//
+	checkInstalledFlowPaths(checkIfInstalledFlowPaths.values());
+
 	// Cleanup
 	topologyEvents.clear();
 	flowPathEvents.clear();
@@ -246,6 +255,44 @@
 	//
 	shouldRecomputeFlowPaths.clear();
 	modifiedFlowPaths.clear();
+	checkIfInstalledFlowPaths.clear();
+    }
+
+    /**
+     * Check if Flow Paths have been installed into all switches,
+     * and generate the appropriate events.
+     *
+     * @param flowPaths the flowPaths to process.
+     */
+    private void checkInstalledFlowPaths(Collection<FlowPath> flowPaths) {
+	List<FlowPath> installedFlowPaths = new LinkedList<FlowPath>();
+
+	Kryo kryo = kryoFactory.newKryo();
+
+	for (FlowPath flowPath : flowPaths) {
+	    boolean isInstalled = true;
+
+	    //
+	    // Check whether all Flow Entries have been installed
+	    //
+	    for (FlowEntry flowEntry : flowPath.flowEntries()) {
+		if (flowEntry.flowEntrySwitchState() !=
+		    FlowEntrySwitchState.FE_SWITCH_UPDATED) {
+		    isInstalled = false;
+		    break;
+		}
+	    }
+
+	    if (isInstalled) {
+		// Create a copy and add it to the list
+		FlowPath copyFlowPath = kryo.copy(flowPath);
+		installedFlowPaths.add(copyFlowPath);
+	    }
+	}
+	kryoFactory.deleteKryo(kryo);
+
+	// Generate an event for the installed Flow Path.
+	flowManager.notificationFlowPathsInstalled(installedFlowPaths);
     }
 
     /**
@@ -340,6 +387,9 @@
 		    }
 		    modifiedFlowPaths.put(flowPath.flowId().value(), flowPath);
 		    break;
+		case FP_TYPE_UNKNOWN:
+		    log.error("FlowPath event with unknown type");
+		    break;
 		}
 		allFlowPaths.put(flowPath.flowId().value(), flowPath);
 
@@ -526,10 +576,12 @@
 	    }
 
 	    //
-	    // Update the local Flow Entry.
+	    // Update the local Flow Entry, and keep state to check
+	    // if the Flow Path has been installed.
 	    //
 	    localFlowEntry.setFlowEntryUserState(flowEntry.flowEntryUserState());
 	    localFlowEntry.setFlowEntrySwitchState(flowEntry.flowEntrySwitchState());
+	    checkIfInstalledFlowPaths.put(flowPath.flowId().value(), flowPath);
 	    return localFlowEntry;
 	}
 
@@ -700,6 +752,12 @@
 	    newFlowEntry.setFlowId(new FlowId(flowPath.flowId().value()));
 
 	    //
+	    // Copy the Flow timeouts
+	    //
+	    newFlowEntry.setIdleTimeout(flowPath.idleTimeout());
+	    newFlowEntry.setHardTimeout(flowPath.hardTimeout());
+
+	    //
 	    // Allocate the FlowEntryMatch by copying the default one
 	    // from the FlowPath (if set).
 	    //
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 7ef49ef..41cf670 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -10,8 +10,6 @@
 import java.util.SortedMap;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
 
 import net.floodlightcontroller.core.IFloodlightProviderService;
 import net.floodlightcontroller.core.IOFSwitch;
@@ -23,15 +21,13 @@
 import net.onrc.onos.datagrid.IDatagridService;
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.core.INetMapStorage;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
 import net.onrc.onos.ofcontroller.floodlightlistener.INetworkGraphService;
 import net.onrc.onos.ofcontroller.flowmanager.web.FlowWebRoutable;
 import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService;
+import net.onrc.onos.ofcontroller.forwarding.IForwardingService;
 import net.onrc.onos.ofcontroller.topology.Topology;
 import net.onrc.onos.ofcontroller.util.*;
 
-import org.openflow.protocol.OFType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,6 +45,7 @@
     protected FlowEventHandler flowEventHandler;
 
     protected IFlowPusherService pusher;
+    protected IForwardingService forwardingService;
     
     // Flow Entry ID generation state
     private static Random randomGenerator = new Random();
@@ -134,7 +131,8 @@
 	l.add(INetworkGraphService.class);
 	l.add(IDatagridService.class);
 	l.add(IRestApiService.class);
-		l.add(IFlowPusherService.class);
+	l.add(IFlowPusherService.class);
+	l.add(IForwardingService.class);
         return l;
     }
 
@@ -151,6 +149,7 @@
 	datagridService = context.getServiceImpl(IDatagridService.class);
 	restApi = context.getServiceImpl(IRestApiService.class);
 	pusher = context.getServiceImpl(IFlowPusherService.class);
+	forwardingService = context.getServiceImpl(IForwardingService.class);
 
 	this.init("");
     }
@@ -352,8 +351,25 @@
      * @param sw the switch the Flow Entry expired on.
      * @param flowEntryId the Flow Entry ID of the expired Flow Entry.
      */
-    public void flowEntryOnSwitchExpired(IOFSwitch sw, FlowEntryId flowEntryId) {
-	// TODO: Not implemented yet
+    public void flowEntryOnSwitchExpired(IOFSwitch sw,
+					 FlowEntryId flowEntryId) {
+	// Find the Flow Entry
+	FlowEntry flowEntry = datagridService.getFlowEntry(flowEntryId);
+	if (flowEntryId == null)
+	    return;		// Flow Entry not found
+
+	// Find the Flow Path
+	FlowPath flowPath = datagridService.getFlow(flowEntry.flowId());
+	if (flowPath == null)
+	    return;		// Flow Path not found
+
+	//
+	// Remove the Flow if the Flow Entry expired on the first switch
+	//
+	Dpid srcDpid = flowPath.dataPath().srcPort().dpid();
+	if (srcDpid.value() != sw.getId())
+	    return;
+	deleteFlow(flowPath.flowId());
     }
 
     /**
@@ -370,7 +386,6 @@
 	// Process all entries
 	//
 	for (Pair<IOFSwitch, FlowEntry> entry : entries) {
-	    IOFSwitch sw = entry.first;
 	    FlowEntry flowEntry = entry.second;
 
 	    //
@@ -391,11 +406,24 @@
 	    case FE_USER_DELETE:
 		datagridService.notificationSendFlowEntryRemoved(flowEntry.flowEntryId());
 		break;
+	    case FE_USER_UNKNOWN:
+		assert(false);
+		break;
 	    }
 	}
     }
 
     /**
+     * Generate a notification that a collection of Flow Paths has been
+     * installed in the network.
+     *
+     * @param flowPaths the collection of installed Flow Paths.
+     */
+    void notificationFlowPathsInstalled(Collection<FlowPath> flowPaths) {
+	forwardingService.flowsInstalled(flowPaths);
+    }
+
+    /**
      * Push modified Flow-related state as appropriate.
      *
      * @param modifiedFlowPaths the collection of modified Flow Paths.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
index a25602d..549a0fc 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
@@ -6,8 +6,6 @@
 import net.floodlightcontroller.core.IOFSwitch;
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.onrc.onos.ofcontroller.topology.Topology;
-import net.onrc.onos.ofcontroller.util.CallerId;
-import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
 import net.onrc.onos.ofcontroller.util.FlowEntry;
 import net.onrc.onos.ofcontroller.util.FlowEntryId;
 import net.onrc.onos.ofcontroller.util.FlowId;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
index 461d231..a4f0a8c 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowProgrammer.java
@@ -42,9 +42,8 @@
 public class FlowProgrammer implements IFloodlightModule, 
 				       IOFMessageListener,
 				       IOFSwitchListener {
-    @SuppressWarnings("unused")
     // flag to enable FlowSynchronizer
-    private static final boolean enableFlowSync = false;
+    private static final boolean enableFlowSync = true;
     protected static Logger log = LoggerFactory.getLogger(FlowProgrammer.class);
     protected volatile IFloodlightProviderService floodlightProvider;
     protected volatile IControllerRegistryService registryService;
@@ -155,8 +154,10 @@
     public void addedSwitch(IOFSwitch sw) {
 	log.debug("Switch added: {}", sw.getId());
 
-	if (enableFlowSync && registryService.hasControl(sw.getId())) {
-	    synchronizer.synchronize(sw);
+	if (enableFlowSync) {
+		if (registryService.hasControl(sw.getId())) {
+		    synchronizer.synchronize(sw);
+		}
 	}
     }
 
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
index c3c7107..3f61248 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
@@ -34,7 +34,6 @@
 import net.onrc.onos.ofcontroller.util.FlowEntryAction.*;
 import net.onrc.onos.ofcontroller.util.FlowEntry;
 import net.onrc.onos.ofcontroller.util.FlowEntryActions;
-import net.onrc.onos.ofcontroller.util.FlowEntryId;
 import net.onrc.onos.ofcontroller.util.FlowEntryMatch;
 import net.onrc.onos.ofcontroller.util.FlowEntryUserState;
 import net.onrc.onos.ofcontroller.util.IPv4Net;
@@ -68,8 +67,6 @@
     protected static final int MAX_MESSAGE_SEND = 100;
 
     public static final short PRIORITY_DEFAULT = 100;
-    public static final short FLOWMOD_DEFAULT_IDLE_TIMEOUT = 0;	// infinity
-    public static final short FLOWMOD_DEFAULT_HARD_TIMEOUT = 0;	// infinite
 
 	public enum QueueState {
 		READY,
@@ -82,8 +79,9 @@
 	 * @author Naoki Shiota
 	 *
 	 */
-	@SuppressWarnings("serial")
 	private class SwitchQueue extends ArrayDeque<OFMessage> {
+		private static final long serialVersionUID = 1L;
+
 		QueueState state;
 		
 		// Max rate of sending message (bytes/ms). 0 implies no limitation.
@@ -722,8 +720,8 @@
 			}
 		}
 
-		fm.setIdleTimeout(FLOWMOD_DEFAULT_IDLE_TIMEOUT)
-				.setHardTimeout(FLOWMOD_DEFAULT_HARD_TIMEOUT)
+		fm.setIdleTimeout((short)flowEntry.idleTimeout())
+				.setHardTimeout((short)flowEntry.hardTimeout())
 				.setPriority(PRIORITY_DEFAULT)
 				.setBufferId(OFPacketOut.BUFFER_ID_NONE).setCookie(cookie)
 				.setCommand(flowModCommand).setMatch(match)
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
index 7d5527b..6ef44be 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
@@ -7,8 +7,10 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
 
 import org.openflow.protocol.OFFlowMod;
 import org.openflow.protocol.OFMatch;
@@ -44,26 +46,27 @@
 
     private GraphDBOperation dbHandler;
     protected IFlowPusherService pusher;
-    private Map<IOFSwitch, Thread> switchThreads; 
+    private Map<IOFSwitch, FutureTask<SyncResult>> switchThreads; 
 
     public FlowSynchronizer() {
 	dbHandler = new GraphDBOperation("");
-	switchThreads = new HashMap<IOFSwitch, Thread>();
+	switchThreads = new HashMap<IOFSwitch, FutureTask<SyncResult>>();
     }
 
     @Override
-    public void synchronize(IOFSwitch sw) {
+    public Future<SyncResult> synchronize(IOFSwitch sw) {
 	Synchronizer sync = new Synchronizer(sw);
-	Thread t = new Thread(sync);
-	switchThreads.put(sw, t);
-	t.start();
+	FutureTask<SyncResult> task = new FutureTask<SyncResult>(sync);
+	switchThreads.put(sw, task);
+	task.run();
+	return task;
     }
     
     @Override
     public void interrupt(IOFSwitch sw) {
-	Thread t = switchThreads.remove(sw);
+	FutureTask<SyncResult> t = switchThreads.remove(sw);
 	if(t != null) {
-	    t.interrupt();
+		t.cancel(true);
 	}	
     }
 
@@ -80,7 +83,7 @@
      * @author Brian
      *
      */
-	protected class Synchronizer implements Runnable {
+	protected class Synchronizer implements Callable<SyncResult> {
 	IOFSwitch sw;
 	ISwitchObject swObj;
 
@@ -90,14 +93,45 @@
 	    this.swObj = dbHandler.searchSwitch(dpid.toString());
 	}
 
+	double graphIDTime, switchTime, compareTime, graphEntryTime, extractTime, pushTime, totalTime;
 	@Override
-	public void run() {
+	public SyncResult call() {
 	    // TODO: stop adding other flow entries while synchronizing
 	    //pusher.suspend(sw);
+	    long start = System.nanoTime();
 	    Set<FlowEntryWrapper> graphEntries = getFlowEntriesFromGraph();
+	    long step1 = System.nanoTime();
 	    Set<FlowEntryWrapper> switchEntries = getFlowEntriesFromSwitch();
-	    compare(graphEntries, switchEntries);
+	    long step2 = System.nanoTime();
+	    SyncResult result = compare(graphEntries, switchEntries);
+	    long step3 = System.nanoTime();
+	    graphIDTime = (step1 - start); 
+	    switchTime = (step2 - step1);
+	    compareTime = (step3 - step2);
+	    totalTime = (step3 - start);
+	    outputTime();
 	    //pusher.resume(sw);
+	    
+	    return result;
+	}
+	
+	private void outputTime() {
+	    double div = Math.pow(10, 6); //convert nanoseconds to ms
+	    graphIDTime /= div;
+	    switchTime /= div;
+	    compareTime = (compareTime - graphEntryTime - extractTime - pushTime) / div;
+	    graphEntryTime /= div;
+	    extractTime /= div;
+	    pushTime /= div;
+	    totalTime /= div;
+	    log.debug("Sync time (ms):" +
+	    		  graphIDTime + "," +
+	     		  switchTime + "," + 
+	    		  compareTime + "," +
+	     		  graphEntryTime + "," +
+	    		  extractTime + "," + 
+	     		  pushTime + "," +
+	              totalTime);
 	}
 
 	/**
@@ -107,7 +141,7 @@
 	 * @param graphEntries Flow entries in GraphDB.
 	 * @param switchEntries Flow entries in switch.
 	 */
-	private void compare(Set<FlowEntryWrapper> graphEntries, Set<FlowEntryWrapper> switchEntries) {
+	private SyncResult compare(Set<FlowEntryWrapper> graphEntries, Set<FlowEntryWrapper> switchEntries) {
 	    int added = 0, removed = 0, skipped = 0;
 	    for(FlowEntryWrapper entry : switchEntries) {
 		if(graphEntries.contains(entry)) {
@@ -123,11 +157,16 @@
 	    for(FlowEntryWrapper entry : graphEntries) {
 		// add flow entry to switch
 		entry.addToSwitch(sw);
+		graphEntryTime += entry.dbTime;
+		extractTime += entry.extractTime;
+		pushTime += entry.pushTime;
 		added++;
 	    }	  
 	    log.debug("Flow entries added "+ added + ", " +
 		      "Flow entries removed "+ removed + ", " +
 		      "Flow entries skipped " + skipped);
+	    
+	    return new SyncResult(added, removed, skipped);
 	}
 
 	/**
@@ -216,6 +255,7 @@
 	 * Install this FlowEntry to a switch via FlowPusher.
 	 * @param sw Switch to which flow will be installed.
 	 */
+	double dbTime, extractTime, pushTime;
 	public void addToSwitch(IOFSwitch sw) {
 	    if (statisticsReply != null) {
 		log.error("Error adding existing flow entry {} to sw {}", 
@@ -223,6 +263,7 @@
 		return;
 	    }
 
+	    double startDB = System.nanoTime();
 	    // Get the Flow Entry state from the Network Graph
 	    IFlowEntry iFlowEntry = null;
 	    try {
@@ -237,7 +278,9 @@
 			  flowEntryId, sw.getId());
 		return;
 	    }
+	    dbTime = System.nanoTime() - startDB;
 
+	    double startExtract = System.nanoTime();
 	    FlowEntry flowEntry =
 		FlowDatabaseOperation.extractFlowEntry(iFlowEntry);
 	    if (flowEntry == null) {
@@ -245,8 +288,11 @@
 			  flowEntryId, sw.getId());
 		return;
 	    }
-
+	    extractTime = System.nanoTime() - startExtract;
+	    
+	    double startPush = System.nanoTime();
 	    pusher.pushFlowEntry(sw, flowEntry);
+	    pushTime = System.nanoTime() - startPush;
 	}
 	
 	/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/IFlowSyncService.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/IFlowSyncService.java
index 4e6efaf..4fe0857 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/IFlowSyncService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/IFlowSyncService.java
@@ -1,7 +1,8 @@
 package net.onrc.onos.ofcontroller.flowprogrammer;
 
+import java.util.concurrent.Future;
+
 import net.floodlightcontroller.core.IOFSwitch;
-import net.floodlightcontroller.core.IOFSwitchListener;
 import net.floodlightcontroller.core.module.IFloodlightService;
 
 /**
@@ -11,7 +12,19 @@
  *
  */
 public interface IFlowSyncService extends IFloodlightService {
-    public void synchronize(IOFSwitch sw);
+    public Future<SyncResult> synchronize(IOFSwitch sw);
     
     public void interrupt(IOFSwitch sw);
+    
+    public class SyncResult {
+    	public final int flowAdded;
+    	public final int flowRemoved;
+    	public final int flowSkipped;
+    	
+    	public SyncResult(int added, int removed, int skipped) {
+    		flowAdded = added;
+    		flowRemoved = removed;
+    		flowSkipped = skipped;
+    	}
+    }
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java b/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
index f33f986..3725d5e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
@@ -3,9 +3,11 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import net.floodlightcontroller.core.FloodlightContext;
 import net.floodlightcontroller.core.IFloodlightProviderService;
@@ -46,28 +48,80 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class Forwarding implements IOFMessageListener, IFloodlightModule {
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
+
+public class Forwarding implements IOFMessageListener, IFloodlightModule,
+									IForwardingService {
 	private final static Logger log = LoggerFactory.getLogger(Forwarding.class);
 
 	private IFloodlightProviderService floodlightProvider;
 	private IFlowService flowService;
+	@SuppressWarnings("unused")
 	private IDatagridService datagridService;
 	
 	private IDeviceStorage deviceStorage;
 	private TopologyManager topologyService;
 	
-	public Forwarding() {
+	private Map<Path, Long> pendingFlows;
+	private Multimap<Long, PacketToPush> waitingPackets;
+	
+	public class PacketToPush {
+		public final OFPacketOut packet;
+		public final long dpid;
 		
+		public PacketToPush(OFPacketOut packet, long dpid) {
+			this.packet = packet;
+			this.dpid = dpid;
+		}
+	}
+	
+	public final class Path {
+		public final SwitchPort srcPort;
+		public final SwitchPort dstPort;
+		
+		public Path(SwitchPort src, SwitchPort dst) {
+			srcPort = new SwitchPort(new Dpid(src.dpid().value()), 
+					new Port(src.port().value()));
+			dstPort = new SwitchPort(new Dpid(dst.dpid().value()), 
+					new Port(dst.port().value()));
+		}
+		
+		@Override
+		public boolean equals(Object other) {
+			if (!(other instanceof Path)) {
+				return false;
+			}
+			
+			Path otherPath = (Path) other;
+			return srcPort.equals(otherPath.srcPort) && 
+					dstPort.equals(otherPath.dstPort);
+		}
+		
+		@Override
+		public int hashCode() {
+			int hash = 17;
+			hash = 31 * hash + srcPort.hashCode();
+			hash = 31 * hash + dstPort.hashCode();
+			return hash;
+		}
 	}
 	
 	@Override
 	public Collection<Class<? extends IFloodlightService>> getModuleServices() {
-		return null;
+		List<Class<? extends IFloodlightService>> services = 
+				new ArrayList<Class<? extends IFloodlightService>>(1);
+		services.add(IForwardingService.class);
+		return services;
 	}
 
 	@Override
 	public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() {
-		return null;
+		Map<Class<? extends IFloodlightService>, IFloodlightService> impls = 
+				new HashMap<Class<? extends IFloodlightService>, IFloodlightService>(1);
+		impls.put(IForwardingService.class, this);
+		return impls;
 	}
 
 	@Override
@@ -89,6 +143,10 @@
 		
 		floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
 		
+		pendingFlows = new ConcurrentHashMap<Path, Long>();
+		waitingPackets = Multimaps.synchronizedSetMultimap(
+				HashMultimap.<Long, PacketToPush>create());
+		
 		deviceStorage = new DeviceStorageImpl();
 		deviceStorage.init("");
 		topologyService = new TopologyManager();
@@ -141,7 +199,8 @@
 	}
 	
 	private void handlePacketIn(IOFSwitch sw, OFPacketIn pi, Ethernet eth) {
-		String destinationMac = HexString.toHexString(eth.getDestinationMACAddress()); 
+		String destinationMac = 
+				HexString.toHexString(eth.getDestinationMACAddress()); 
 		
 		IDeviceObject deviceObject = deviceStorage.getDeviceByMac(
 				destinationMac);
@@ -151,7 +210,7 @@
 			return;
 		}
 		
-		Iterator<IPortObject> ports = deviceObject.getAttachedPorts().iterator();
+		Iterator<IPortObject> ports = deviceObject.getAttachedPorts().iterator();	
 		if (!ports.hasNext()) {
 			log.debug("No attachment point found for device {}", destinationMac);
 			return;
@@ -171,46 +230,32 @@
 		MACAddress srcMacAddress = MACAddress.valueOf(eth.getSourceMACAddress());
 		MACAddress dstMacAddress = MACAddress.valueOf(eth.getDestinationMACAddress());
 		
-		if (flowExists(srcSwitchPort, srcMacAddress, 
-				dstSwitchPort, dstMacAddress)) {
-			log.debug("Not adding flow because it already exists");
+		
+		DataPath datapath = new DataPath();
+		datapath.setSrcPort(srcSwitchPort);
+		datapath.setDstPort(dstSwitchPort);
+		
+		
+		
+		Path pathspec = new Path(srcSwitchPort, dstSwitchPort);
+		// TODO check concurrency
+		Long existingFlowId = pendingFlows.get(pathspec);
+		
+		if (existingFlowId != null) {
+			log.debug("Found existing flow {}", 
+					HexString.toHexString(existingFlowId));
 			
-			// TODO check reverse flow as well
-			
-			DataPath shortestPath = 
-					topologyService.getDatabaseShortestPath(srcSwitchPort, dstSwitchPort);
-			
-			if (shortestPath == null || shortestPath.flowEntries().isEmpty()) {
-				log.warn("No path found between {} and {} - not handling packet",
-						srcSwitchPort, dstSwitchPort);
-				return;
-			}
-			
-			Port outPort = shortestPath.flowEntries().get(0).outPort();
-			forwardPacket(pi, sw, outPort.value());
+			// TODO do stuff.
+			OFPacketOut po = constructPacketOut(datapath, pi, sw);
+			waitingPackets.put(existingFlowId, new PacketToPush(po, sw.getId()));
 			return;
 		}
 		
-		// Calculate a shortest path before pushing flow mods.
-		// This will be used later by the packet-out processing, but it uses
-		// the database so will be slow, and we should do it before flow mods.
-		DataPath shortestPath = 
-				topologyService.getDatabaseShortestPath(srcSwitchPort, dstSwitchPort);
-		
-		if (shortestPath == null || shortestPath.flowEntries().isEmpty()) {
-			log.warn("No path found between {} and {} - not handling packet",
-					srcSwitchPort, dstSwitchPort);
-			return;
-		}
 		
 		log.debug("Adding new flow between {} at {} and {} at {}",
 				new Object[]{srcMacAddress, srcSwitchPort, dstMacAddress, dstSwitchPort});
 		
 		
-		DataPath dataPath = new DataPath();
-		dataPath.setSrcPort(srcSwitchPort);
-		dataPath.setDstPort(dstSwitchPort);
-		
 		CallerId callerId = new CallerId("Forwarding");
 		
 		//FlowId flowId = new FlowId(flowService.getNextFlowEntryId());
@@ -226,18 +271,13 @@
 		// For now just forward IPv4 packets. This prevents accidentally
 		// forwarding other stuff like ARP.
 		flowPath.flowEntryMatch().enableEthernetFrameType(Ethernet.TYPE_IPv4);
-		flowPath.setDataPath(dataPath);
+		flowPath.setDataPath(datapath);
 			
-		FlowId flowId = flowService.addFlow(flowPath);
-		//flowService.addFlow(flowPath, flowId);
-		
-		
 		DataPath reverseDataPath = new DataPath();
 		// Reverse the ports for the reverse path
 		reverseDataPath.setSrcPort(dstSwitchPort);
 		reverseDataPath.setDstPort(srcSwitchPort);
 		
-		//FlowId reverseFlowId = new FlowId(flowService.getNextFlowEntryId());
 		// TODO implement copy constructor for FlowPath
 		FlowPath reverseFlowPath = new FlowPath();
 		//reverseFlowPath.setFlowId(reverseFlowId);
@@ -253,13 +293,25 @@
 		reverseFlowPath.dataPath().srcPort().dpid().toString();
 		
 		// TODO what happens if no path exists?
-		//flowService.addFlow(reverseFlowPath, reverseFlowId);
-		FlowId reverseFlowId = flowService.addFlow(reverseFlowPath);
+		FlowId flowId = new FlowId(flowService.getNextFlowEntryId());
+		FlowId reverseFlowId = new FlowId(flowService.getNextFlowEntryId());
 		
-		Port outPort = shortestPath.flowEntries().get(0).outPort();
-		forwardPacket(pi, sw, outPort.value());
+		flowPath.setFlowId(flowId);
+		reverseFlowPath.setFlowId(reverseFlowId);
+		
+		OFPacketOut po = constructPacketOut(datapath, pi, sw);
+		Path reversePathSpec = new Path(dstSwitchPort, srcSwitchPort);
+		
+		// Add to waiting lists
+		pendingFlows.put(pathspec, flowId.value());
+		pendingFlows.put(reversePathSpec, reverseFlowId.value());
+		waitingPackets.put(flowId.value(), new PacketToPush(po, sw.getId()));
+		
+		flowService.addFlow(reverseFlowPath);
+		flowService.addFlow(flowPath);
 	}
 	
+	/*
 	private boolean flowExists(SwitchPort srcPort, MACAddress srcMac, 
 			SwitchPort dstPort, MACAddress dstMac) {
 		for (FlowPath flow : datagridService.getAllFlows()) {
@@ -285,17 +337,18 @@
 		
 		return false;
 	}
+	*/
 
-	private void forwardPacket(OFPacketIn pi, IOFSwitch sw, short port) {
-		List<OFAction> actions = new ArrayList<OFAction>(1);
-		actions.add(new OFActionOutput(port));
+	private OFPacketOut constructPacketOut(DataPath datapath, OFPacketIn pi, 
+			IOFSwitch sw) {
+		//List<OFAction> actions = new ArrayList<OFAction>(1);
+		//actions.add(new OFActionOutput(port));
 		
 		OFPacketOut po = new OFPacketOut();
 		po.setInPort(OFPort.OFPP_NONE)
 		.setInPort(pi.getInPort())
-		.setActions(actions)
-		.setActionsLength((short)OFActionOutput.MINIMUM_LENGTH)
-		.setLengthU(OFPacketOut.MINIMUM_LENGTH + OFActionOutput.MINIMUM_LENGTH);
+		.setActions(new ArrayList<OFAction>())
+		.setLengthU(OFPacketOut.MINIMUM_LENGTH);
 		
 		if (sw.getBuffers() == 0) {
 			po.setBufferId(OFPacketOut.BUFFER_ID_NONE)
@@ -306,11 +359,45 @@
 			po.setBufferId(pi.getBufferId());
 		}
 		
-		try {
-			sw.write(po, null);
-			sw.flush();
-		} catch (IOException e) {
-			log.error("Error writing packet out to switch: {}", e);
+		return po;
+	}
+
+	@Override
+	public void flowsInstalled(Collection<FlowPath> installedFlowPaths) {
+		for (FlowPath flowPath : installedFlowPaths) {
+			flowInstalled(flowPath);
+		}
+	}
+
+	private void flowInstalled(FlowPath installedFlowPath) {
+		// TODO check concurrency
+		// will need to sync and access both collections at once.
+		long flowId = installedFlowPath.flowId().value();
+		Collection<PacketToPush> packets = waitingPackets.removeAll(flowId);
+		
+		//remove pending flows entry
+		Path pathToRemove = new Path(installedFlowPath.dataPath().srcPort(),
+				installedFlowPath.dataPath().dstPort());
+		pendingFlows.remove(pathToRemove);
+		
+		for (PacketToPush packet : packets) {
+			IOFSwitch sw = floodlightProvider.getSwitches().get(packet.dpid);
+			
+			OFPacketOut po = packet.packet;
+			short outPort = 
+					installedFlowPath.flowEntries().get(0).outPort().value();
+			po.getActions().add(new OFActionOutput(outPort));
+			po.setActionsLength((short)
+					(po.getActionsLength() + OFActionOutput.MINIMUM_LENGTH));
+			po.setLengthU(po.getLengthU() + OFActionOutput.MINIMUM_LENGTH);
+			
+			try {
+				sw.write(packet.packet, null);
+				sw.flush();
+			} catch (IOException e) {
+				log.error("Error writing packet out to switch {}:", 
+						sw.getId(), e);
+			}
 		}
 	}
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/forwarding/IForwardingService.java b/src/main/java/net/onrc/onos/ofcontroller/forwarding/IForwardingService.java
new file mode 100644
index 0000000..e5bd714
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/forwarding/IForwardingService.java
@@ -0,0 +1,25 @@
+package net.onrc.onos.ofcontroller.forwarding;
+
+import java.util.Collection;
+
+import net.floodlightcontroller.core.module.IFloodlightService;
+import net.onrc.onos.ofcontroller.util.FlowPath;
+
+/**
+ * Temporary interface that allows the Forwarding module to be
+ * notified when a flow has been installed by the FlowManager.
+ * 
+ * This should be refactored to a listener framework in the future.
+ * @author jono
+ *
+ */
+public interface IForwardingService extends IFloodlightService {
+	/**
+	 * Notify the Forwarding module that a collection of flows has been
+	 * installed in the network.
+	 *
+	 * @param installedFlowPaths the collection of FlowPaths that have
+	 * been installed in the network.
+	 */
+	public void flowsInstalled(Collection<FlowPath> installedFlowPaths);
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ArpMessage.java b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ArpMessage.java
index 6ce5ade..ee8f23d 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ArpMessage.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ArpMessage.java
@@ -2,11 +2,7 @@
 
 import java.io.Serializable;
 import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.List;
-
 import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.ofcontroller.util.SwitchPort;
 
 public class ArpMessage implements Serializable {
 
@@ -25,9 +21,8 @@
 	private final long outSwitch; 
 	private final short outPort;
 	
-	
-	private final List<SwitchPort> switchPorts = new ArrayList<SwitchPort>();
-	
+
+
 	public enum Type {
 		REQUEST,
 		REPLY
diff --git a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
index b2b3c48..c53e8e1 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
@@ -394,6 +394,7 @@
  
 	}
 	
+	@SuppressWarnings("unused")
 	private void handleArpReply(IOFSwitch sw, OFPacketIn pi, ARP arp){
 		if (log.isTraceEnabled()) {
 			log.trace("ARP reply recieved: {} => {}, on {}/{}", new Object[] { 
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java b/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java
index 9585366..4269eac 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java
@@ -1,7 +1,5 @@
 package net.onrc.onos.ofcontroller.topology;
 
-import java.util.Map;
-
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.SwitchPort;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
index dbf9ada..fc75591 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
@@ -265,6 +265,9 @@
 
 	    break;
 	}
+	case ELEMENT_UNKNOWN:
+	    // TODO: Adding "assert(false);" here can be dangerous
+	    break;
 	}
 
 	return isModified;
@@ -315,6 +318,9 @@
 	    }
 	    break;
 	}
+	case ELEMENT_UNKNOWN:
+	    // TODO: Adding "assert(false);" here can be dangerous
+	    break;
 	}
 
 	return isModified;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
index b01c7d3..0fefa3a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
@@ -1,8 +1,5 @@
 package net.onrc.onos.ofcontroller.topology;
 
-import java.util.Map;
-import java.util.TreeMap;
-
 /**
  * Class for storing information about a Topology Element: Switch, Port or
  * Link.
@@ -165,6 +162,8 @@
 	    return "Link=" +
 		Long.toHexString(fromSwitchDpid) + "/" + fromSwitchPort + "/" +
 		Long.toHexString(toSwitchDpid) + "/" + toSwitchPort;
+	case ELEMENT_UNKNOWN:
+	    return "Element=UNKNOWN";
 	}
 
 	assert(false);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
index c0e04f2..02e0ffb 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
@@ -225,8 +225,12 @@
 	    SwitchPort dest = flowPath.dataPath().dstPort();
 	    return ShortestPath.getTopologyShortestPath(topology, src, dest);
 	}
+
 	case FP_TYPE_EXPLICIT_PATH:
 	    return flowPath.dataPath();
+
+	case FP_TYPE_UNKNOWN:
+	    return null;
 	}
 
 	return null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
index 0d33b27..d8997dc 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
@@ -2,7 +2,6 @@
 
 import net.onrc.onos.ofcontroller.flowmanager.IFlowService;
 import net.onrc.onos.ofcontroller.topology.ITopologyNetService;
-import net.onrc.onos.ofcontroller.topology.TopologyManager;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.Dpid;
 import net.onrc.onos.ofcontroller.util.Port;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
index 98dbd88..c8b206f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
@@ -13,6 +13,8 @@
 public class FlowEntry {
     private FlowId flowId;			// FlowID of the Flow Entry
     private FlowEntryId flowEntryId;		// The Flow Entry ID
+    private int		idleTimeout;		// The Flow idle timeout
+    private int		hardTimeout;		// The Flow hard timeout
     private FlowEntryMatch flowEntryMatch;	// The Flow Entry Match
     private FlowEntryActions flowEntryActions;	// The Flow Entry Actions
     private Dpid dpid;				// The Switch DPID
@@ -174,6 +176,54 @@
     }
 
     /**
+     * Get the flow idle timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @return the flow idle timeout.
+     */
+    @JsonProperty("idleTimeout")
+    public int idleTimeout() { return idleTimeout; }
+
+    /**
+     * Set the flow idle timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @param idleTimeout the flow idle timeout to set.
+     */
+    @JsonProperty("idleTimeout")
+    public void setIdleTimeout(int idleTimeout) {
+	this.idleTimeout = 0xffff & idleTimeout;
+    }
+
+    /**
+     * Get the flow hard timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @return the flow hard timeout.
+     */
+    @JsonProperty("hardTimeout")
+    public int hardTimeout() { return hardTimeout; }
+
+    /**
+     * Set the flow hard timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @param hardTimeout the flow hard timeout to set.
+     */
+    @JsonProperty("hardTimeout")
+    public void setHardTimeout(int hardTimeout) {
+	this.hardTimeout = 0xffff & hardTimeout;
+    }
+
+    /**
      * Get the Flow Entry Match.
      *
      * @return the Flow Entry Match.
@@ -343,7 +393,8 @@
      * Convert the flow entry to a string.
      *
      * The string has the following form:
-     *  [flowEntryId=XXX flowEntryMatch=XXX flowEntryActions=XXX dpid=XXX
+     *  [flowEntryId=XXX idleTimeout=XXX hardTimeout=XXX
+     *   flowEntryMatch=XXX flowEntryActions=XXX dpid=XXX
      *   inPort=XXX outPort=XXX flowEntryUserState=XXX flowEntrySwitchState=XXX
      *   flowEntryErrorState=XXX]
      * @return the flow entry as a string.
@@ -359,10 +410,12 @@
 	if ( flowId != null ) {
 		ret.append(" flowId=" + this.flowId.toString());
 	}
+	ret.append(" idleTimeout=" + this.idleTimeout);
+	ret.append(" hardTimeout=" + this.hardTimeout);
 	if ( flowEntryMatch != null ) {
 		ret.append(" flowEntryMatch=" + this.flowEntryMatch.toString());
 	}
-	ret.append( " flowEntryActions=" + this.flowEntryActions.toString() );
+	ret.append(" flowEntryActions=" + this.flowEntryActions.toString() );
 	if ( dpid != null ) {
 		ret.append(" dpid=" + this.dpid.toString());
 	}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
index a1163c8..e431f8a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
@@ -43,6 +43,13 @@
 	private ActionValues(short value) {
 	    this.value = value;
 	}
+
+	/**
+	 * Get the value.
+	 *
+	 * @return the value.
+	 */
+	public short getValue() { return value; }
     }
 
     /**
@@ -1564,6 +1571,9 @@
 	case ACTION_ENQUEUE:
 	    ret += " action=" + actionEnqueue.toString();
 	    break;
+	case ACTION_VENDOR:
+	    ret += " action=VENDOR";
+	    break;
 	}
 	ret += "]";
 
@@ -1656,6 +1666,9 @@
 	    case ACTION_ENQUEUE:
 		actionEnqueue = new ActionEnqueue(decode);
 		break;
+	    case ACTION_VENDOR:
+		// TODO: Handle it as appropriate
+		break;
 	    }
 	} catch (IllegalArgumentException e) {
 	    throw new IllegalArgumentException("Invalid action string");
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index ab3edb1..7c87a10 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -18,7 +18,9 @@
     private FlowPathType flowPathType;	// The Flow Path type
     private FlowPathUserState flowPathUserState; // The Flow Path User state
     private FlowPathFlags flowPathFlags; // The Flow Path flags
-    private DataPath dataPath;		// The data path
+    private int		idleTimeout;	// The Flow idle timeout
+    private int		hardTimeout;	// The Flow hard timeout
+    private DataPath	dataPath;	// The data path
     private FlowEntryMatch flowEntryMatch; // Common Flow Entry Match for all
 					// Flow Entries
     private FlowEntryActions flowEntryActions; // The Flow Entry Actions for
@@ -45,6 +47,8 @@
 	this.setFlowPathType(FlowPathType.valueOf(flowObj.getFlowPathType()));
 	this.setFlowPathUserState(FlowPathUserState.valueOf(flowObj.getFlowPathUserState()));
 	this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
+	this.setIdleTimeout(flowObj.getIdleTimeout());
+	this.setHardTimeout(flowObj.getHardTimeout());
     	this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
     	this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
     	this.dataPath().dstPort().setDpid(new Dpid(flowObj.getDstSwitch()));
@@ -295,6 +299,54 @@
     }
 
     /**
+     * Get the flow idle timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @return the flow idle timeout.
+     */
+    @JsonProperty("idleTimeout")
+    public int idleTimeout() { return idleTimeout; }
+
+    /**
+     * Set the flow idle timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @param idleTimeout the flow idle timeout to set.
+     */
+    @JsonProperty("idleTimeout")
+    public void setIdleTimeout(int idleTimeout) {
+	this.idleTimeout = 0xffff & idleTimeout;
+    }
+
+    /**
+     * Get the flow hard timeout in seconds.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @return the flow hard timeout.
+     */
+    @JsonProperty("hardTimeout")
+    public int hardTimeout() { return hardTimeout; }
+
+    /**
+     * Set the flow hard timeout.
+     *
+     * It should be an unsigned integer in the interval [0, 65535].
+     * If zero, the timeout is not set.
+     *
+     * @param hardTimeout the flow hard timeout to set.
+     */
+    @JsonProperty("hardTimeout")
+    public void setHardTimeout(int hardTimeout) {
+	this.hardTimeout = 0xffff & hardTimeout;
+    }
+
+    /**
      * Get the flow path's data path.
      *
      * @return the flow path's data path.
@@ -366,8 +418,8 @@
      *
      * The string has the following form:
      *  [flowId=XXX installerId=XXX flowPathType = XXX flowPathUserState = XXX
-     *   flowPathFlags=XXX dataPath=XXX flowEntryMatch=XXX
-     *   flowEntryActions=XXX]
+     *   flowPathFlags=XXX idleTimeout=XXX hardTimeout=XXX dataPath=XXX
+     *   flowEntryMatch=XXX flowEntryActions=XXX]
      *
      * @return the flow path as a string.
      */
@@ -378,6 +430,8 @@
 	ret += " flowPathType=" + this.flowPathType;
 	ret += " flowPathUserState=" + this.flowPathUserState;
 	ret += " flowPathFlags=" + this.flowPathFlags.toString();
+	ret += " idleTimeout=" + this.idleTimeout;
+	ret += " hardTimeout=" + this.hardTimeout;
 	if (dataPath != null)
 	    ret += " dataPath=" + this.dataPath.toString();
 	if (flowEntryMatch != null)
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathFlags.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathFlags.java
index 4bbd399..595eb5f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathFlags.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathFlags.java
@@ -112,8 +112,6 @@
 
 	// Test all flags
 	if ((this.flags & DISCARD_FIRST_HOP_ENTRY) != 0) {
-	    if (flagsStr != null)
-		flagsStr += ",";
 	    flagsStr += "DISCARD_FIRST_HOP_ENTRY";
 	}
 	if ((this.flags & KEEP_ONLY_FIRST_HOP_ENTRY) != 0) {
@@ -121,6 +119,8 @@
 		flagsStr += ",";
 	    flagsStr += "KEEP_ONLY_FIRST_HOP_ENTRY";
 	}
+	if (flagsStr != null)
+	    ret += flagsStr;
 	ret += "]";
 
 	return ret;
