diff --git a/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java b/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
index 4492643..74cccfb 100644
--- a/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
+++ b/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
@@ -45,13 +45,6 @@
         router.attach("/switch/{switchId}/{statType}/json", SwitchStatisticsResource.class);
         router.attach("/controller/switches/json", ControllerSwitchesResource.class);
         router.attach("/memory/json", ControllerMemoryResource.class);
-        // Get the last {count} events from the event histories
-        router.attach("/event-history/topology-switch/{count}/json",
-                EventHistoryTopologySwitchResource.class);
-        router.attach("/event-history/topology-link/{count}/json",
-                EventHistoryTopologyLinkResource.class);
-        router.attach("/event-history/topology-cluster/{count}/json",
-                EventHistoryTopologyClusterResource.class);
         router.attach("/health/json", HealthCheckResource.class);
         router.attach("/system/uptime/json", SystemUptimeResource.class);
         return router;
diff --git a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyClusterResource.java b/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyClusterResource.java
deleted file mode 100644
index 2bbb1bd..0000000
--- a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyClusterResource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.floodlightcontroller.core.web;
-
-import net.floodlightcontroller.util.EventHistory;
-import net.onrc.onos.core.linkdiscovery.ILinkDiscoveryService;
-import net.onrc.onos.core.linkdiscovery.internal.EventHistoryTopologyCluster;
-import net.onrc.onos.core.linkdiscovery.internal.LinkDiscoveryManager;
-
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author subrata
- */
-public class EventHistoryTopologyClusterResource extends ServerResource {
-    // TODO - Move this to the LinkDiscovery rest API
-    protected final static Logger log =
-            LoggerFactory.getLogger(EventHistoryTopologyClusterResource.class);
-
-    @Get("json")
-    public EventHistory<EventHistoryTopologyCluster> handleEvHistReq() {
-
-        // Get the event history count. Last <count> events would be returned
-        String evHistCount = (String) getRequestAttributes().get("count");
-        int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
-        try {
-            count = Integer.parseInt(evHistCount);
-        } catch (NumberFormatException nFE) {
-            // Invalid input for event count - use default value
-        }
-
-        LinkDiscoveryManager topoManager =
-                (LinkDiscoveryManager) getContext().getAttributes().
-                        get(ILinkDiscoveryService.class.getCanonicalName());
-        if (topoManager != null) {
-            return new EventHistory<EventHistoryTopologyCluster>(
-                    topoManager.evHistTopologyCluster, count);
-        }
-
-        return null;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyLinkResource.java b/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyLinkResource.java
deleted file mode 100644
index 90d9198..0000000
--- a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologyLinkResource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.floodlightcontroller.core.web;
-
-import net.floodlightcontroller.util.EventHistory;
-import net.onrc.onos.core.linkdiscovery.ILinkDiscoveryService;
-import net.onrc.onos.core.linkdiscovery.internal.EventHistoryTopologyLink;
-import net.onrc.onos.core.linkdiscovery.internal.LinkDiscoveryManager;
-
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author subrata
- */
-public class EventHistoryTopologyLinkResource extends ServerResource {
-    // TODO - Move this to the DeviceManager Rest API
-    protected final static Logger log =
-            LoggerFactory.getLogger(EventHistoryTopologyLinkResource.class);
-
-    @Get("json")
-    public EventHistory<EventHistoryTopologyLink> handleEvHistReq() {
-
-        // Get the event history count. Last <count> events would be returned
-        String evHistCount = (String) getRequestAttributes().get("count");
-        int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
-        try {
-            count = Integer.parseInt(evHistCount);
-        } catch (NumberFormatException nFE) {
-            // Invalid input for event count - use default value
-        }
-
-        LinkDiscoveryManager linkDiscoveryManager =
-                (LinkDiscoveryManager) getContext().getAttributes().
-                        get(ILinkDiscoveryService.class.getCanonicalName());
-        if (linkDiscoveryManager != null) {
-            return new EventHistory<EventHistoryTopologyLink>(
-                    linkDiscoveryManager.evHistTopologyLink, count);
-        }
-
-        return null;
-    }
-}
diff --git a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologySwitchResource.java b/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologySwitchResource.java
deleted file mode 100644
index e1fbb1b..0000000
--- a/src/main/java/net/floodlightcontroller/core/web/EventHistoryTopologySwitchResource.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package net.floodlightcontroller.core.web;
-
-import net.floodlightcontroller.util.EventHistory;
-import net.onrc.onos.core.linkdiscovery.ILinkDiscoveryService;
-import net.onrc.onos.core.linkdiscovery.internal.EventHistoryTopologySwitch;
-import net.onrc.onos.core.linkdiscovery.internal.LinkDiscoveryManager;
-
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-
-/**
- * @author subrata
- */
-public class EventHistoryTopologySwitchResource extends ServerResource {
-
-    @Get("json")
-    public EventHistory<EventHistoryTopologySwitch> handleEvHistReq() {
-
-        // Get the event history count. Last <count> events would be returned
-        String evHistCount = (String) getRequestAttributes().get("count");
-        int count = EventHistory.EV_HISTORY_DEFAULT_SIZE;
-        try {
-            count = Integer.parseInt(evHistCount);
-        } catch (NumberFormatException nFE) {
-            // Invalid input for event count - use default value
-        }
-
-        LinkDiscoveryManager topoManager =
-                (LinkDiscoveryManager) getContext().getAttributes().
-                        get(ILinkDiscoveryService.class.getCanonicalName());
-
-        return new EventHistory<EventHistoryTopologySwitch>(
-                topoManager.evHistTopologySwitch, count);
-    }
-}
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java
deleted file mode 100644
index 12ed97b..0000000
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyCluster.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package net.onrc.onos.core.linkdiscovery.internal;
-
-import net.floodlightcontroller.core.web.serializers.DPIDSerializer;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-/**
- * Topology Cluster merge/split event history related classes and members.
- *
- * @author subrata
- */
-public class EventHistoryTopologyCluster {
-    // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by
-    // the front end (e.g. in cli in Python)
-    public long dpid;
-    public long clusterIdOld; // Switch with dpid moved from cluster x to y
-    public long clusterIdNew;
-    public String reason;
-
-    @JsonProperty("Switch")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getDpid() {
-        return dpid;
-    }
-
-    @JsonProperty("OldClusterId")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getClusterIdOld() {
-        return clusterIdOld;
-    }
-
-    @JsonProperty("NewClusterId")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getClusterIdNew() {
-        return clusterIdNew;
-    }
-
-    @JsonProperty("Reason")
-    public String getReason() {
-        return reason;
-    }
-
-
-}
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java
deleted file mode 100644
index 50c6c7e..0000000
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologyLink.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package net.onrc.onos.core.linkdiscovery.internal;
-
-import net.floodlightcontroller.core.web.serializers.DPIDSerializer;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-/**
- * Topology link up/down event history related classes and members.
- *
- * @author subrata
- */
-public class EventHistoryTopologyLink {
-    // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by
-    // the front end (e.g. in cli in Python)
-    public long srcSwDpid;
-    public long dstSwDpid;
-    public int srcPortState;
-    public int dstPortState;
-    public int srcSwport;
-    public int dstSwport;
-    public String linkType;
-    public String reason;
-
-    @JsonProperty("Source-Switch")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getSrcSwDpid() {
-        return srcSwDpid;
-    }
-
-    @JsonProperty("Dest-Switch")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getDstSwDpid() {
-        return dstSwDpid;
-    }
-
-    @JsonProperty("SrcPortState")
-    public int getSrcPortState() {
-        return srcPortState;
-    }
-
-    @JsonProperty("DstPortState")
-    public int getDstPortState() {
-        return dstPortState;
-    }
-
-    @JsonProperty("SrcPort")
-    public int getSrcSwport() {
-        return srcSwport;
-    }
-
-    @JsonProperty("DstPort")
-    public int getDstSwport() {
-        return dstSwport;
-    }
-
-    @JsonProperty("LinkType")
-    public String getLinkType() {
-        return linkType;
-    }
-
-    @JsonProperty("Reason")
-    public String getReason() {
-        return reason;
-    }
-
-
-}
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java
deleted file mode 100644
index 456f176..0000000
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/EventHistoryTopologySwitch.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package net.onrc.onos.core.linkdiscovery.internal;
-
-import net.floodlightcontroller.core.web.serializers.DPIDSerializer;
-import net.floodlightcontroller.core.web.serializers.IPv4Serializer;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-/**
- * Topology Switch event history related classes and members.
- *
- * @author subrata
- */
-public class EventHistoryTopologySwitch {
-    // The following fields are not stored as String to save memory
-    // They should be converted to appropriate human-readable strings by
-    // the front end (e.g. in cli in Python)
-    public long dpid;
-    public int ipv4Addr;
-    public int l4Port;
-    public String reason;
-
-    @JsonProperty("Switch")
-    @JsonSerialize(using = DPIDSerializer.class)
-    public long getDpid() {
-        return dpid;
-    }
-
-    @JsonProperty("IpAddr")
-    @JsonSerialize(using = IPv4Serializer.class)
-    public int getIpv4Addr() {
-        return ipv4Addr;
-    }
-
-    @JsonProperty("Port")
-    public int getL4Port() {
-        return l4Port;
-    }
-
-    @JsonProperty("Reason")
-    public String getReason() {
-        return reason;
-    }
-
-
-}
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
index 279e4c3..ed57586 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/internal/LinkDiscoveryManager.java
@@ -19,9 +19,7 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
-import java.net.InetSocketAddress;
 import java.net.NetworkInterface;
-import java.net.SocketAddress;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -54,8 +52,6 @@
 import net.floodlightcontroller.core.util.SingletonTask;
 import net.floodlightcontroller.restserver.IRestApiService;
 import net.floodlightcontroller.threadpool.IThreadPoolService;
-import net.floodlightcontroller.util.EventHistory;
-import net.floodlightcontroller.util.EventHistory.EvAction;
 import net.onrc.onos.core.linkdiscovery.ILinkDiscovery;
 import net.onrc.onos.core.linkdiscovery.ILinkDiscovery.LDUpdate;
 import net.onrc.onos.core.linkdiscovery.ILinkDiscovery.UpdateOperation;
@@ -1131,14 +1127,6 @@
                 updateOperation = UpdateOperation.LINK_ADDED;
                 linkChanged = true;
 
-                // Add to event history
-                evHistTopoLink(lt.getSrc(),
-                        lt.getDst(),
-                        lt.getSrcPort(),
-                        lt.getDstPort(),
-                        newInfo.getSrcPortState(), newInfo.getDstPortState(),
-                        getLinkType(lt, newInfo),
-                        EvAction.LINK_ADDED, "LLDP Recvd");
             } else {
                 // Since the link info is already there, we need to
                 // update the right fields.
@@ -1186,15 +1174,6 @@
                     if (log.isTraceEnabled()) {
                         log.trace("Updated link {}", lt);
                     }
-                    // Add to event history
-                    evHistTopoLink(lt.getSrc(),
-                            lt.getDst(),
-                            lt.getSrcPort(),
-                            lt.getDstPort(),
-                            newInfo.getSrcPortState(), newInfo.getDstPortState(),
-                            getLinkType(lt, newInfo),
-                            EvAction.LINK_PORT_STATE_UPDATED,
-                            "LLDP Recvd");
                 }
             }
 
@@ -1263,15 +1242,6 @@
                         UpdateOperation.LINK_REMOVED));
                 controller.publishUpdate(update);
 
-                // Update Event History
-                evHistTopoLink(lt.getSrc(),
-                        lt.getDst(),
-                        lt.getSrcPort(),
-                        lt.getDstPort(),
-                        0, 0, // Port states
-                        ILinkDiscovery.LinkType.INVALID_LINK,
-                        EvAction.LINK_DELETED, reason);
-
                 // TODO  Whenever link is removed, it has to checked if
                 // the switchports must be added to quarantine.
 
@@ -1443,14 +1413,12 @@
      */
     @Override
     public void addedSwitch(IOFSwitch sw) {
-
         if (sw.getEnabledPorts() != null) {
             for (Short p : sw.getEnabledPortNumbers()) {
                 processNewPort(sw.getId(), p);
             }
         }
-        // Update event history
-        evHistTopoSwitch(sw, EvAction.SWITCH_CONNECTED, "None");
+
         LinkUpdate update = new LinkUpdate(new LDUpdate(sw.getId(), null,
                 UpdateOperation.SWITCH_UPDATED));
         controller.publishUpdate(update);
@@ -1463,7 +1431,7 @@
     public void removedSwitch(IOFSwitch iofSwitch) {
         // Update event history
         long sw = iofSwitch.getId();
-        evHistTopoSwitch(iofSwitch, EvAction.SWITCH_DISCONNECTED, "None");
+
         List<Link> eraseList = new ArrayList<Link>();
         lock.writeLock().lock();
         try {
@@ -1748,13 +1716,6 @@
         this.maintenanceQueue = new LinkedBlockingQueue<NodePortTuple>();
         // Added by ONOS
         this.remoteSwitches = new HashMap<Long, IOnosRemoteSwitch>();
-
-        this.evHistTopologySwitch =
-                new EventHistory<EventHistoryTopologySwitch>("Topology: Switch");
-        this.evHistTopologyLink =
-                new EventHistory<EventHistoryTopologyLink>("Topology: Link");
-        this.evHistTopologyCluster =
-                new EventHistory<EventHistoryTopologyCluster>("Topology: Cluster");
     }
 
     @Override
@@ -1826,88 +1787,6 @@
         setControllerTLV();
     }
 
-    // ****************************************************
-    // Topology Manager's Event History members and methods
-    // ****************************************************
-
-    // Topology Manager event history
-    public EventHistory<EventHistoryTopologySwitch> evHistTopologySwitch;
-    public EventHistory<EventHistoryTopologyLink> evHistTopologyLink;
-    public EventHistory<EventHistoryTopologyCluster> evHistTopologyCluster;
-    public EventHistoryTopologySwitch evTopoSwitch;
-    public EventHistoryTopologyLink evTopoLink;
-    public EventHistoryTopologyCluster evTopoCluster;
-
-    // Switch Added/Deleted
-    private void evHistTopoSwitch(IOFSwitch sw, EvAction actn, String reason) {
-        if (evTopoSwitch == null) {
-            evTopoSwitch = new EventHistoryTopologySwitch();
-        }
-        evTopoSwitch.dpid = sw.getId();
-        if ((sw.getChannel() != null) &&
-                (SocketAddress.class.isInstance(
-                        sw.getChannel().getRemoteAddress()))) {
-            evTopoSwitch.ipv4Addr =
-                    IPv4.toIPv4Address(((InetSocketAddress) (sw.getChannel().
-                            getRemoteAddress())).getAddress().getAddress());
-            evTopoSwitch.l4Port =
-                    ((InetSocketAddress) (sw.getChannel().
-                            getRemoteAddress())).getPort();
-        } else {
-            evTopoSwitch.ipv4Addr = 0;
-            evTopoSwitch.l4Port = 0;
-        }
-        evTopoSwitch.reason = reason;
-        evTopoSwitch = evHistTopologySwitch.put(evTopoSwitch, actn);
-    }
-
-    // CHECKSTYLE:OFF suppress warning about too many parameters
-    private void evHistTopoLink(long srcDpid, long dstDpid, short srcPort,
-                                short dstPort, int srcPortState, int dstPortState,
-                                ILinkDiscovery.LinkType linkType,
-                                EvAction actn, String reason) {
-    // CHECKSTYLE:ON
-
-        if (evTopoLink == null) {
-            evTopoLink = new EventHistoryTopologyLink();
-        }
-        evTopoLink.srcSwDpid = srcDpid;
-        evTopoLink.dstSwDpid = dstDpid;
-        evTopoLink.srcSwport = srcPort & 0xffff;
-        evTopoLink.dstSwport = dstPort & 0xffff;
-        evTopoLink.srcPortState = srcPortState;
-        evTopoLink.dstPortState = dstPortState;
-        evTopoLink.reason = reason;
-        switch (linkType) {
-            case DIRECT_LINK:
-                evTopoLink.linkType = "DIRECT_LINK";
-                break;
-            case MULTIHOP_LINK:
-                evTopoLink.linkType = "MULTIHOP_LINK";
-                break;
-            case TUNNEL:
-                evTopoLink.linkType = "TUNNEL";
-                break;
-            case INVALID_LINK:
-            default:
-                evTopoLink.linkType = "Unknown";
-                break;
-        }
-        evTopoLink = evHistTopologyLink.put(evTopoLink, actn);
-    }
-
-    public void evHistTopoCluster(long dpid, long clusterIdOld,
-                                  long clusterIdNew, EvAction action, String reason) {
-        if (evTopoCluster == null) {
-            evTopoCluster = new EventHistoryTopologyCluster();
-        }
-        evTopoCluster.dpid = dpid;
-        evTopoCluster.clusterIdOld = clusterIdOld;
-        evTopoCluster.clusterIdNew = clusterIdNew;
-        evTopoCluster.reason = reason;
-        evTopoCluster = evHistTopologyCluster.put(evTopoCluster, action);
-    }
-
     @Override
     public boolean isAutoPortFastFeature() {
         return autoPortFastFeature;
