diff --git a/rib/rib-entry.cpp b/rib/rib-entry.cpp
index 7d4cff8..a33e113 100644
--- a/rib/rib-entry.cpp
+++ b/rib/rib-entry.cpp
@@ -46,7 +46,7 @@
   return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, route));
 }
 
-bool
+std::pair<RibEntry::iterator, bool>
 RibEntry::insertRoute(const Route& route)
 {
   iterator it = findRoute(route);
@@ -58,10 +58,10 @@
 
     m_routes.push_back(route);
 
-    return true;
+    return std::make_pair(std::prev(m_routes.end()), true);
   }
   else {
-    return false;
+    return std::make_pair(it, false);
   }
 }
 
diff --git a/rib/rib-entry.hpp b/rib/rib-entry.hpp
index c3c5b4c..d55d3f1 100644
--- a/rib/rib-entry.hpp
+++ b/rib/rib-entry.hpp
@@ -72,9 +72,12 @@
   /** \brief inserts a new route into the entry's route list
    *  If another route already exists with the same faceId and origin,
    *  the new route is not inserted.
-   *  \return{ true if the route is inserted, false otherwise }
+   *  \return a pair, whose first element is the iterator to the newly
+   *  inserted element if the insert succeeds and to the
+   *  previously-existing element otherwise, and whose second element
+   *  is true if the insert succeeds and false otherwise.
    */
-  bool
+  std::pair<RibEntry::iterator, bool>
   insertRoute(const Route& route);
 
   /** \brief erases a Route with the same faceId and origin
diff --git a/rib/rib.cpp b/rib/rib.cpp
index eb577bb..97492b2 100644
--- a/rib/rib.cpp
+++ b/rib/rib.cpp
@@ -89,42 +89,45 @@
   if (ribIt != m_rib.end()) {
     shared_ptr<RibEntry> entry(ribIt->second);
 
-    RibEntry::iterator routeIt = entry->findRoute(route);
+    RibEntry::iterator entryIt;
+    bool didInsert = false;
+    std::tie(entryIt, didInsert) = entry->insertRoute(route);
 
-    if (routeIt == entry->end()) {
-      // New route
-      entry->insertRoute(route);
+    if (didInsert) {
+      // The route was new and we successfully inserted it.
       m_nItems++;
 
+      afterAddRoute(RibRouteRef{entry, entryIt});
+
       // Register with face lookup table
       m_faceMap[route.faceId].push_back(entry);
     }
     else {
       // Route exists, update fields
       // First cancel old scheduled event, if any, then set the EventId to new one
-      if (static_cast<bool>(routeIt->getExpirationEvent())) {
+      if (static_cast<bool>(entryIt->getExpirationEvent())) {
         NFD_LOG_TRACE("Cancelling expiration event for " << entry->getName() << " "
-                                                         << *routeIt);
-        scheduler::cancel(routeIt->getExpirationEvent());
+                                                         << (*entryIt));
+        scheduler::cancel(entryIt->getExpirationEvent());
       }
 
       // No checks are required here as the iterator needs to be updated in all cases.
-      routeIt->setExpirationEvent(route.getExpirationEvent());
+      entryIt->setExpirationEvent(route.getExpirationEvent());
 
-      routeIt->flags = route.flags;
-      routeIt->cost = route.cost;
-      routeIt->expires = route.expires;
+      entryIt->flags = route.flags;
+      entryIt->cost = route.cost;
+      entryIt->expires = route.expires;
     }
   }
   else {
     // New name prefix
-    shared_ptr<RibEntry> entry(make_shared<RibEntry>(RibEntry()));
+    shared_ptr<RibEntry> entry = make_shared<RibEntry>();
 
     m_rib[prefix] = entry;
     m_nItems++;
 
     entry->setName(prefix);
-    entry->insertRoute(route);
+    RibEntry::iterator routeIt = entry->insertRoute(route).first;
 
     // Find prefix's parent
     shared_ptr<RibEntry> parent = findParent(prefix);
@@ -152,6 +155,7 @@
 
     // do something after inserting an entry
     afterInsertEntry(prefix);
+    afterAddRoute(RibRouteRef{entry, routeIt});
   }
 }
 
@@ -166,6 +170,8 @@
     RibEntry::iterator routeIt = entry->findRoute(route);
 
     if (routeIt != entry->end()) {
+      beforeRemoveRoute(RibRouteRef{entry, routeIt});
+
       auto faceId = route.faceId;
       entry->eraseRoute(routeIt);
       m_nItems--;
diff --git a/rib/rib.hpp b/rib/rib.hpp
index 4c9e608..70554e6 100644
--- a/rib/rib.hpp
+++ b/rib/rib.hpp
@@ -38,7 +38,20 @@
 
 class FibUpdater;
 
-/** \brief represents the RIB
+  /** \brief references a route
+   */
+struct RibRouteRef
+{
+  shared_ptr<RibEntry> entry;
+  RibEntry::const_iterator route;
+};
+
+/** \brief represents the Routing Information Base
+
+    The Routing Information Base contains a collection of Routes, each
+    represents a piece of static or dynamic routing information
+    registered by applications, operators, or NFD itself. Routes
+    associated with the same namespace are collected into a RIB entry.
  */
 class Rib : noncopyable
 {
@@ -201,9 +214,29 @@
   findRoutesWithFaceId(uint64_t faceId);
 
 public:
+  /** \brief signals after a RIB entry is inserted
+   *
+   *  A RIB entry is inserted when the first route associated with a
+   *  certain namespace is added.
+   */
   ndn::util::signal::Signal<Rib, Name> afterInsertEntry;
+
+  /** \brief signals after a RIB entry is erased
+   *
+   *  A RIB entry is erased when the last route associated with a
+   *  certain namespace is removed.
+   */
+
   ndn::util::signal::Signal<Rib, Name> afterEraseEntry;
 
+  /** \brief signals after a Route is added
+   */
+  ndn::util::signal::Signal<Rib, RibRouteRef> afterAddRoute;
+
+  /** \brief signals before a route is removed
+   */
+  ndn::util::signal::Signal<Rib, RibRouteRef> beforeRemoveRoute;
+
 private:
   RibTable m_rib;
   FaceLookupTable m_faceMap;
