diff --git a/core/counter.hpp b/core/counter.hpp
new file mode 100644
index 0000000..bb50c66
--- /dev/null
+++ b/core/counter.hpp
@@ -0,0 +1,141 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_CORE_COUNTER_HPP
+#define NFD_CORE_COUNTER_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+
+/** \brief represents a counter that encloses an integer value
+ *
+ *  SimpleCounter is noncopyable, because increment should be called on the counter,
+ *  not a copy of it; it's implicitly convertible to an integral type to be observed
+ */
+class SimpleCounter
+{
+public:
+  typedef uint64_t rep;
+
+  constexpr
+  SimpleCounter()
+    : m_value(0)
+  {
+  }
+
+  SimpleCounter(const SimpleCounter&) = delete;
+
+  SimpleCounter&
+  operator=(const SimpleCounter&) = delete;
+
+  /** \brief observe the counter
+   */
+  operator rep() const
+  {
+    return m_value;
+  }
+
+  /** \brief replace the counter value
+   */
+  void
+  set(rep value)
+  {
+    m_value = value;
+  }
+
+protected:
+  rep m_value;
+};
+
+/** \brief represents a counter of number of packets
+ *
+ *  \warning The counter value may wrap after exceeding the range of underlying integer type.
+ */
+class PacketCounter : public SimpleCounter
+{
+public:
+  /** \brief increment the counter by one
+   */
+  PacketCounter&
+  operator++()
+  {
+    ++m_value;
+    return *this;
+  }
+  // postfix ++ operator is not provided because it's not needed
+};
+
+/** \brief represents a counter of number of bytes
+ *
+ *  \warning The counter value may wrap after exceeding the range of underlying integer type.
+ */
+class ByteCounter : public SimpleCounter
+{
+public:
+  /** \brief increase the counter
+   */
+  ByteCounter&
+  operator+=(rep n)
+  {
+    m_value += n;
+    return *this;
+  }
+};
+
+/** \brief provides a counter that observes the size of a table
+ *  \tparam T a type that provides a size() const member function
+ */
+template<typename T>
+class SizeCounter
+{
+public:
+  typedef size_t rep;
+
+  constexpr
+  SizeCounter(const T& table)
+    : m_table(table)
+  {
+  }
+
+  SizeCounter(const SizeCounter&) = delete;
+
+  SizeCounter&
+  operator=(const SizeCounter&) = delete;
+
+  /** \brief observe the counter
+   */
+  operator rep() const
+  {
+    return m_table.size();
+  }
+
+private:
+  const T& m_table;
+};
+
+} // namespace nfd
+
+#endif // NFD_CORE_COUNTER_HPP
