diff --git a/daemon/common/counter.hpp b/daemon/common/counter.hpp
new file mode 100644
index 0000000..4619b35
--- /dev/null
+++ b/daemon/common/counter.hpp
@@ -0,0 +1,134 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  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_DAEMON_COMMON_COUNTER_HPP
+#define NFD_DAEMON_COMMON_COUNTER_HPP
+
+#include "core/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 : noncopyable
+{
+public:
+  typedef uint64_t rep;
+
+  /** \brief observe the counter
+   */
+  operator rep() const noexcept
+  {
+    return m_value;
+  }
+
+  /** \brief replace the counter value
+   */
+  void
+  set(rep value) noexcept
+  {
+    m_value = value;
+  }
+
+protected:
+  rep m_value = 0;
+};
+
+/** \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++() noexcept
+  {
+    ++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) noexcept
+  {
+    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
+ *
+ *  if table not specified in constructor, it can be added later by invoking observe()
+ */
+template<typename T>
+class SizeCounter : noncopyable
+{
+public:
+  typedef size_t Rep;
+
+  explicit constexpr
+  SizeCounter(const T* table = nullptr) noexcept
+    : m_table(table)
+  {
+  }
+
+  void
+  observe(const T* table) noexcept
+  {
+    m_table = table;
+  }
+
+  /** \brief observe the counter
+   */
+  operator Rep() const
+  {
+    BOOST_ASSERT(m_table != nullptr);
+    return m_table->size();
+  }
+
+private:
+  const T* m_table;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_COMMON_COUNTER_HPP
