diff --git a/src/util/event-emitter.hpp b/src/util/event-emitter.hpp
index 261dabc..bcb703b 100644
--- a/src/util/event-emitter.hpp
+++ b/src/util/event-emitter.hpp
@@ -39,6 +39,8 @@
  *    onEventName(args);
  *  To clear event subscriptions:
  *    onEventName.clear();
+ *
+ *  \deprecated use Signal instead
  */
 
 template<typename ...TArgs>
diff --git a/src/util/signal-connection.cpp b/src/util/signal-connection.cpp
new file mode 100644
index 0000000..8660e4d
--- /dev/null
+++ b/src/util/signal-connection.cpp
@@ -0,0 +1,64 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "signal-connection.hpp"
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Connection>));
+
+Connection::Connection()
+{
+}
+
+Connection::Connection(weak_ptr<function<void()>> disconnect)
+  : m_disconnect(disconnect)
+{
+}
+
+void
+Connection::disconnect()
+{
+  shared_ptr<function<void()>> f = m_disconnect.lock();
+  if (f != nullptr) {
+    (*f)();
+  }
+}
+
+bool
+Connection::operator==(const Connection& other) const
+{
+  shared_ptr<function<void()>> f1 = m_disconnect.lock();
+  shared_ptr<function<void()>> f2 = other.m_disconnect.lock();
+  return f1 == f2;
+}
+
+bool
+Connection::operator!=(const Connection& other) const
+{
+  return !(this->operator==(other));
+}
+
+} // namespace signal
+} // namespace util
+} // namespace ndn
diff --git a/src/util/signal-connection.hpp b/src/util/signal-connection.hpp
new file mode 100644
index 0000000..1276182
--- /dev/null
+++ b/src/util/signal-connection.hpp
@@ -0,0 +1,83 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_SIGNAL_CONNECTION_HPP
+#define NDN_UTIL_SIGNAL_CONNECTION_HPP
+
+#include "../common.hpp"
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+/** \brief represents a connection to a signal
+ *  \note This type is copyable. Any copy can be used to disconnect.
+ */
+class Connection
+{
+public:
+  Connection();
+
+  /** \brief disconnects from the signal
+   *  \note If the connection is already disconnected, or if the Signal has been destructed,
+   *        this operation has no effect.
+   *  \warning During signal emission, attempting to disconnect a connection other than
+   *           the executing handler's own connection results in undefined behavior.
+   */
+  void
+  disconnect();
+
+  /** \brief compare for equality
+   *
+   *  Two connections are equal if they both refer to the same connection that isn't disconnected,
+   *  or they are both disconnected.
+   */
+  bool
+  operator==(const Connection& other) const;
+
+  bool
+  operator!=(const Connection& other) const;
+
+private:
+  /** \param disconnect weak_ptr to a function that disconnects the handler
+   */
+  explicit
+  Connection(weak_ptr<function<void()>> disconnect);
+
+  template<typename Owner, typename ...TArgs>
+  friend class Signal;
+
+private:
+  /** \note The only shared_ptr to the disconnect function is stored in Signal<..>::Slot,
+   *        and will be destructed if the handler is disconnected (through another Connection
+   *        instance) or the Signal is destructed.
+   *        Connection needs a weak_ptr instead of a shared_ptr to the disconnect function,
+   *        because the disconnect function is bound with an iterator to the Slot,
+   *        which is invalidated when the Slot is erased.
+   */
+  weak_ptr<function<void()>> m_disconnect;
+};
+
+} // namespace signal
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_SIGNAL_CONNECTION_HPP
diff --git a/src/util/signal-emit.hpp b/src/util/signal-emit.hpp
new file mode 100644
index 0000000..729d92a
--- /dev/null
+++ b/src/util/signal-emit.hpp
@@ -0,0 +1,81 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+/** \file
+ *
+ *  This header provides macros that allows a signal to be emitted
+ *  from a derived class of its owner.
+ *
+ *  In 'protected' section of owner class declaration,
+ *    DECLARE_SIGNAL_EMIT(signalName)
+ *  From a derived class of owner,
+ *    this->emitSignal(signalName, arg1, arg2);
+ */
+
+#ifndef NDN_UTIL_SIGNAL_EMIT_HPP
+#define NDN_UTIL_SIGNAL_EMIT_HPP
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+/** \brief (implementation detail) a filler for extra argument
+ */
+class DummyExtraArg
+{
+};
+
+} // namespace signal
+} // namespace util
+} // namespace ndn
+
+/** \brief (implementation detail) declares a 'emit_signalName' method
+ *  \note This macro should be used in 'protected' section so that it's accessible
+ *        by derived classes.
+ *  \note emit_signalName method is implementation detail.
+ *        Derived classes should use 'emit' macro.
+ *  \note The name 'emit_signalName' is an intentional violation of code-style rule 2.5.
+ *  \note The DummyExtraArg is necessary so that 'emit' macro can be used for
+ *        both signals with zero arguments and signals with non-zero arguments.
+ *  \note The method is declared as a template, so that the macro doesn't need argument types.
+ *        But only argument types that are compatible with Signal declaration will work.
+ */
+#define DECLARE_SIGNAL_EMIT(signalName) \
+  template<typename ...TArgs> \
+  void emit_##signalName(const TArgs&... args, const ::ndn::util::signal::DummyExtraArg&) \
+  { \
+    signalName(args...); \
+  }
+
+/** \brief (implementation detail) invokes emit_signalName method
+ *  \note C99 requires at least one argument to be passed in __VA_ARGS__,
+ *        thus a DummyExtraArg is expected at the end of __VA_ARGS__,
+ *        which will be accepted but ignored by emit_signalName method.
+ */
+#define NDN_CXX_SIGNAL_EMIT(signalName, ...) \
+  emit_##signalName(__VA_ARGS__)
+
+/** \brief (implementation detail)
+ */
+#define emitSignal(...) \
+  NDN_CXX_SIGNAL_EMIT(__VA_ARGS__, ::ndn::util::signal::DummyExtraArg())
+
+#endif // NDN_UTIL_SIGNAL_EMIT_HPP
diff --git a/src/util/signal-scoped-connection.cpp b/src/util/signal-scoped-connection.cpp
new file mode 100644
index 0000000..ae90c5f
--- /dev/null
+++ b/src/util/signal-scoped-connection.cpp
@@ -0,0 +1,72 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "signal-scoped-connection.hpp"
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+ScopedConnection::ScopedConnection()
+{
+}
+
+ScopedConnection::ScopedConnection(const Connection& connection)
+  : m_connection(connection)
+{
+}
+
+ScopedConnection::ScopedConnection(ScopedConnection&& other)
+  : m_connection(other.m_connection)
+{
+  other.release();
+}
+
+ScopedConnection&
+ScopedConnection::operator=(const Connection& connection)
+{
+  if (m_connection != connection) {
+    m_connection.disconnect();
+    m_connection = connection;
+  }
+  return *this;
+}
+
+ScopedConnection::~ScopedConnection()
+{
+  m_connection.disconnect();
+}
+
+void
+ScopedConnection::disconnect()
+{
+  m_connection.disconnect();
+}
+
+void
+ScopedConnection::release()
+{
+  m_connection = {};
+}
+
+} // namespace signal
+} // namespace util
+} // namespace ndn
diff --git a/src/util/signal-scoped-connection.hpp b/src/util/signal-scoped-connection.hpp
new file mode 100644
index 0000000..9104791
--- /dev/null
+++ b/src/util/signal-scoped-connection.hpp
@@ -0,0 +1,78 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_SIGNAL_SCOPED_CONNECTION_HPP
+#define NDN_UTIL_SIGNAL_SCOPED_CONNECTION_HPP
+
+#include "signal-connection.hpp"
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+/** \brief disconnects a Connection automatically upon destruction
+ */
+class ScopedConnection : noncopyable
+{
+public:
+  ScopedConnection();
+
+  /** \brief implicit constructor from Connection
+   *  \param connection the Connection to be disconnected upon destruction
+   */
+  ScopedConnection(const Connection& connection);
+
+  /** \brief move constructor
+   */
+  ScopedConnection(ScopedConnection&& other);
+
+  /** \brief assigns a connection
+   *
+   *  If a different connection has been assigned to this instance previously,
+   *  that connection will be disconnected immediately.
+   */
+  ScopedConnection&
+  operator=(const Connection& connection);
+
+  /** \brief disconnects the connection
+   */
+  ~ScopedConnection();
+
+  /** \brief disconnects the connection manually
+   */
+  void
+  disconnect();
+
+  /** \brief releases the connection so that it won't be disconnected
+   *         when this ScopedConnection is destructed
+   */
+  void
+  release();
+
+private:
+  Connection m_connection;
+};
+
+} // namespace signal
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_SIGNAL_SCOPED_CONNECTION_HPP
diff --git a/src/util/signal-signal.hpp b/src/util/signal-signal.hpp
new file mode 100644
index 0000000..6fd6c70
--- /dev/null
+++ b/src/util/signal-signal.hpp
@@ -0,0 +1,218 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_SIGNAL_SIGNAL_HPP
+#define NDN_UTIL_SIGNAL_SIGNAL_HPP
+
+#include "signal-connection.hpp"
+#include <list>
+
+namespace ndn {
+namespace util {
+namespace signal {
+
+/** \brief provides a lightweight signal / event system
+ *
+ *  To declare a signal:
+ *    public:
+ *      Signal<Owner, T1, T2> signalName;
+ *  To connect to a signal:
+ *    owner->signalName.connect(f);
+ *    Multiple functions can connect to the same signal.
+ *  To emit a signal from owner:
+ *    this->signalName(arg1, arg2);
+ *
+ *  \tparam Owner the signal owner class; only this class can emit the signal
+ *  \tparam TArgs types of signal arguments
+ *  \sa signal-emit.hpp allows owner's derived classes to emit signals
+ */
+template<typename Owner, typename ...TArgs>
+class Signal : noncopyable
+{
+public: // API for anyone
+  /** \brief represents a function that can connect to the signal
+   */
+  typedef function<void(const TArgs&...)> Handler;
+
+  Signal();
+
+  /** \brief connects a handler to the signal
+   *  \note If invoked from a handler, the new handler won't receive the current emitted signal.
+   */
+  Connection
+  connect(const Handler& handler);
+
+private: // API for owner
+  /** \retval true if there is no connection
+   */
+  bool
+  isEmpty() const;
+
+  /** \brief emits a signal
+   *  \param args arguments passed to all handlers
+   *  \warning Emitting the signal from a handler is undefined behavior.
+   *  \note If a handler throws, the exception will be propagated to the caller
+   *        who emits this signal, and some handlers may not be executed.
+   */
+  void
+  operator()(const TArgs&...args);
+
+  // make Owner a friend of Signal<Owner, ...> so that API for owner can be called
+#if NDN_CXX_HAVE_CXX_FRIEND_TYPENAME
+  friend Owner;
+#elif NDN_CXX_HAVE_CXX_FRIEND_TYPENAME_WRAPPER
+  template<typename T>
+  struct TypeWrapper
+  {
+    typedef T Type;
+  }; // http://stackoverflow.com/a/5608542/3729203
+  friend class TypeWrapper<Owner>::Type;
+#else
+#  error "cannot declare Owner as friend"
+#endif
+
+private: // internal implementation
+  typedef Signal<Owner, TArgs...> Self;
+  struct Slot;
+
+  /** \brief stores slots
+   *  \note std::list is used because iterators must not be invalidated
+   *        when other slots are added or removed
+   */
+  typedef std::list<Slot> SlotList;
+
+  /** \brief stores a handler function, and a function to disconnect this handler
+   */
+  struct Slot
+  {
+    /** \brief the handler function who will receive emitted signals
+     */
+    Handler handler;
+
+    /** \brief the disconnect function which will disconnect this handler
+     *
+     *  This is .disconnect method bound with the iterator to this slot.
+     *
+     *  This is the only shared_ptr to this function object.
+     *  Connection class has a weak_ptr which references the same function object.
+     *  When the slot is removed or the signal is destructed, this function object would be
+     *  destructed, and the related Connections cannot disconnect this slot again.
+     */
+    shared_ptr<function<void()>> disconnect;
+  };
+
+  /** \brief stores slots
+   */
+  SlotList m_slots;
+
+  /** \brief is a signal handler executing?
+   */
+  bool m_isExecuting;
+
+  /** \brief iterator to current executing slot
+   *  \note This field is meaningful when isExecuting==true
+   */
+  typename SlotList::iterator m_currentSlot;
+
+  /** \brief disconnects the handler in a slot
+   */
+  void
+  disconnect(typename SlotList::iterator it);
+};
+
+template<typename Owner, typename ...TArgs>
+Signal<Owner, TArgs...>::Signal()
+  : m_isExecuting(false)
+{
+}
+
+template<typename Owner, typename ...TArgs>
+inline Connection
+Signal<Owner, TArgs...>::connect(const Handler& handler)
+{
+  typename SlotList::iterator it = m_slots.insert(m_slots.end(), {handler, nullptr});
+  it->disconnect = make_shared<function<void()>>(bind(&Self::disconnect, this, it));
+
+  return signal::Connection(weak_ptr<function<void()>>(it->disconnect));
+}
+
+template<typename Owner, typename ...TArgs>
+inline void
+Signal<Owner, TArgs...>::disconnect(typename SlotList::iterator it)
+{
+  // it could be const_iterator, but gcc 4.6 doesn't support std::list::erase(const_iterator)
+
+  if (m_isExecuting) {
+    // during signal emission, only the currently executing handler can be disconnected
+    BOOST_ASSERT_MSG(it == m_currentSlot,
+                     "cannot disconnect another handler from a handler");
+    m_currentSlot = m_slots.end(); // prevent disconnect twice
+  }
+  m_slots.erase(it);
+}
+
+template<typename Owner, typename ...TArgs>
+inline bool
+Signal<Owner, TArgs...>::isEmpty() const
+{
+  return !m_isExecuting && m_slots.empty();
+}
+
+template<typename Owner, typename ...TArgs>
+inline void
+Signal<Owner, TArgs...>::operator()(const TArgs&... args)
+{
+  BOOST_ASSERT_MSG(!m_isExecuting, "cannot emit signal from a handler");
+  if (m_slots.empty()) {
+    return;
+  }
+  m_isExecuting = true;
+
+  typename SlotList::iterator it = m_slots.begin();
+  typename SlotList::iterator last = m_slots.end();
+  --last;
+
+  try {
+    bool isLast = false;
+    while (!isLast) {
+      m_currentSlot = it;
+      isLast = it == last;
+      ++it;
+
+      m_currentSlot->handler(args...);
+    }
+  }
+  catch (...) {
+    m_isExecuting = false;
+    throw;
+  }
+  m_isExecuting = false;
+}
+
+} // namespace signal
+
+// expose as ndn::util::Signal
+using signal::Signal;
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_SIGNAL_SIGNAL_HPP
diff --git a/src/util/signal.hpp b/src/util/signal.hpp
new file mode 100644
index 0000000..cd36b5d
--- /dev/null
+++ b/src/util/signal.hpp
@@ -0,0 +1,30 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_SIGNAL_HPP
+#define NDN_UTIL_SIGNAL_HPP
+
+#include "signal-signal.hpp"
+#include "signal-emit.hpp"
+#include "signal-connection.hpp"
+#include "signal-scoped-connection.hpp"
+
+#endif // NDN_UTIL_SIGNAL_HPP
