diff --git a/src/interest-table.cpp b/src/interest-table.cpp
new file mode 100644
index 0000000..ef7193a
--- /dev/null
+++ b/src/interest-table.cpp
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2014 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
+ * @author Chaoyi Bian <bcy@pku.edu.cn>
+ * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * @author Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#include "interest-table.hpp"
+
+namespace chronosync {
+
+InterestTable::InterestTable(boost::asio::io_service& io)
+  : m_scheduler(io)
+{
+}
+
+InterestTable::~InterestTable()
+{
+  clear();
+}
+
+bool
+InterestTable::insert(shared_ptr<const Interest> interest,
+                      ndn::ConstBufferPtr digest,
+                      bool isKnown/*=false*/)
+{
+  bool doesExist = erase(digest);
+
+  UnsatisfiedInterestPtr request =
+    boost::make_shared<UnsatisfiedInterest>(interest, digest, isKnown);
+
+  time::milliseconds entryLifetime = interest->getInterestLifetime();
+  if (entryLifetime < time::milliseconds::zero())
+    entryLifetime = ndn::DEFAULT_INTEREST_LIFETIME;
+
+  request->expirationEvent =
+    m_scheduler.scheduleEvent(entryLifetime, ndn::bind(&InterestTable::erase, this, digest));
+
+  m_table.insert(request);
+
+  return doesExist;
+}
+
+bool
+InterestTable::erase(ndn::ConstBufferPtr digest)
+{
+  InterestContainer::index<hashed>::type::iterator it = m_table.get<hashed>().find(digest);
+  if (it != m_table.get<hashed>().end()) {
+    m_scheduler.cancelEvent((*it)->expirationEvent);
+    m_table.erase(it);
+    return true;
+  }
+  return false;
+}
+
+size_t
+InterestTable::size() const
+{
+  return m_table.size();
+}
+
+void
+InterestTable::clear()
+{
+  for (InterestContainer::iterator it = m_table.begin();
+       it != m_table.end(); it++) {
+    m_scheduler.cancelEvent((*it)->expirationEvent);
+  }
+
+  m_table.clear();
+}
+
+}
