Finalizing implementation of almost all events for forwarding strategy.
Implementing FwStats strategy that just calculates statistics for
pit entries and incoming/outgoing interests.

A serious testing is necessary to see if everything works.
diff --git a/model/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index 312404d..12087c1 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -117,7 +117,7 @@
   //     m_contentStore = GetObject<CcnxContentStore> ();
   //   }
 
-  Object::NotifyNewAggregate ();
+  Ccnx::NotifyNewAggregate ();
 }
 
 void 
@@ -135,7 +135,7 @@
   // Force delete on objects
   m_forwardingStrategy = 0; // there is a reference to PIT stored in here
 
-  Object::DoDispose ();
+  Ccnx::DoDispose ();
 }
 
 uint32_t 
diff --git a/model/forwarding-strategy/best-route.cc b/model/forwarding-strategy/best-route.cc
index 33d9cde..f109568 100644
--- a/model/forwarding-strategy/best-route.cc
+++ b/model/forwarding-strategy/best-route.cc
@@ -59,7 +59,7 @@
     
 bool
 BestRoute::DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                                Ptr<CcnxInterestHeader> &header,
+                                Ptr<CcnxInterestHeader> header,
                                 const Ptr<const Packet> &packet,
                                 Ptr<CcnxPitEntry> pitEntry)
 {
@@ -84,30 +84,17 @@
       if (pitEntry->GetIncoming ().find (metricFace.m_face) != pitEntry->GetIncoming ().end ()) 
         continue; // don't forward to face that we received interest from
 
-      CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
-        pitEntry->GetOutgoing ().find (metricFace.m_face);
-      
-      if (outgoing != pitEntry->GetOutgoing ().end () &&
-          outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
-        {
-          NS_LOG_ERROR (outgoing->m_retxCount << " >= " << pitEntry->GetMaxRetxCount ());
-          continue; // already forwarded before during this retransmission cycle
-        }
-
-      bool faceAvailable = metricFace.m_face->IsBelowLimit ();
-      if (!faceAvailable) // huh...
+      if (!WillSendOutInterest (metricFace.m_face, header, pitEntry))
         {
           continue;
         }
 
-      pitEntry->AddOutgoing (metricFace.m_face);
-
-      Ptr<Packet> packetToSend = packet->Copy ();
-
       //transmission
+      Ptr<Packet> packetToSend = packet->Copy ();
       metricFace.m_face->Send (packetToSend);
-      m_outInterests (header, metricFace.m_face);
-      
+
+      DidSendOutInterest (metricFace.m_face, header, pitEntry);
+
       propagatedCount++;
       break; // do only once
     }
diff --git a/model/forwarding-strategy/best-route.h b/model/forwarding-strategy/best-route.h
index aec1147..01c9493 100644
--- a/model/forwarding-strategy/best-route.h
+++ b/model/forwarding-strategy/best-route.h
@@ -47,7 +47,7 @@
   // inherited from  CcnxForwardingStrategy
   virtual bool
   DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                       Ptr<CcnxInterestHeader> &header,
+                       Ptr<CcnxInterestHeader> header,
                        const Ptr<const Packet> &packet,
                        Ptr<CcnxPitEntry> pitEntry);
 
diff --git a/model/forwarding-strategy/ccnx-forwarding-strategy.cc b/model/forwarding-strategy/ccnx-forwarding-strategy.cc
index 3d6f3de..e4b89f6 100644
--- a/model/forwarding-strategy/ccnx-forwarding-strategy.cc
+++ b/model/forwarding-strategy/ccnx-forwarding-strategy.cc
@@ -28,6 +28,7 @@
 #include "ns3/ccnx-pit.h"
 #include "ns3/ccnx-fib.h"
 #include "ns3/ccnx-content-store.h"
+#include "ns3/ccnx-face.h"
 
 #include "ns3/assert.h"
 #include "ns3/ptr.h"
@@ -166,6 +167,11 @@
       NS_ASSERT (contentObjectHeader != 0);      
 
       pitEntry->AddIncoming (incomingFace/*, Seconds (1.0)*/);
+
+      // Do data plane performance measurements
+      WillSatisfyPendingInterest (0, pitEntry);
+
+      // Actually satisfy pending interest
       SatisfyPendingInterest (0, contentObjectHeader, payload, contentObject, pitEntry);
       return;
     }
@@ -379,7 +385,7 @@
 
 void
 CcnxForwardingStrategy::PropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                                           Ptr<CcnxInterestHeader> &header,
+                                           Ptr<CcnxInterestHeader> header,
                                            const Ptr<const Packet> &packet,
                                            Ptr<CcnxPitEntry> pitEntry)
 {
@@ -410,4 +416,42 @@
     }
 }
 
+bool
+CcnxForwardingStrategy::WillSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                                             Ptr<CcnxInterestHeader> header,
+                                             Ptr<CcnxPitEntry> pitEntry)
+{
+  CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
+    pitEntry->GetOutgoing ().find (outgoingFace);
+      
+  if (outgoing != pitEntry->GetOutgoing ().end () &&
+      outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
+    {
+      NS_LOG_ERROR (outgoing->m_retxCount << " >= " << pitEntry->GetMaxRetxCount ());
+      return false; // already forwarded before during this retransmission cycle
+    }
+
+  
+  bool ok = outgoingFace->IsBelowLimit ();
+  if (!ok)
+    return false;
+
+  pitEntry->AddOutgoing (outgoingFace);
+  return true;
+}
+
+void
+CcnxForwardingStrategy::DidSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                                            Ptr<CcnxInterestHeader> header,
+                                            Ptr<CcnxPitEntry> pitEntry)
+{
+  m_outInterests (header, outgoingFace);
+}
+
+void
+CcnxForwardingStrategy::WillErasePendingInterest (Ptr<CcnxPitEntry> pitEntry)
+{
+  // do nothing for now. may be need to do some logging
+}
+
 } //namespace ns3
diff --git a/model/forwarding-strategy/ccnx-forwarding-strategy.h b/model/forwarding-strategy/ccnx-forwarding-strategy.h
index 0683079..c46c70f 100644
--- a/model/forwarding-strategy/ccnx-forwarding-strategy.h
+++ b/model/forwarding-strategy/ccnx-forwarding-strategy.h
@@ -80,7 +80,10 @@
           Ptr<CcnxContentObjectHeader> &header,
           Ptr<Packet> &payload,
           const Ptr<const Packet> &packet);
-    
+
+  virtual void
+  WillErasePendingInterest (Ptr<CcnxPitEntry> pitEntry);
+  
 protected:
   // events
   virtual void
@@ -110,7 +113,8 @@
   DetectRetransmittedInterest (const Ptr<CcnxFace> &incomingFace,
                                Ptr<CcnxPitEntry> pitEntry);
 
-  // only for data received from network
+  // makes sense only for data received from network
+  // When Interest is satisfied from the cache, incoming face is 0
   virtual void
   WillSatisfyPendingInterest (const Ptr<CcnxFace> &incomingFace,
                               Ptr<CcnxPitEntry> pitEntry);
@@ -132,10 +136,28 @@
   ShouldSuppressIncomingInterest (const Ptr<CcnxFace> &incomingFace,
                                   Ptr<CcnxPitEntry> pitEntry);
 
+  /**
+   * @brief Event fired before actually sending out an interest
+   *
+   * If event returns false, then there is some kind of a problem (e.g., per-face limit reached)
+   */
+  virtual bool
+  WillSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                       Ptr<CcnxInterestHeader> header,
+                       Ptr<CcnxPitEntry> pitEntry);
+
+  /**
+   * @brief Event fired just after sending out an interest
+   */
+  virtual void
+  DidSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                       Ptr<CcnxInterestHeader> header,
+                       Ptr<CcnxPitEntry> pitEntry);
+  
 
   virtual void
   PropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                     Ptr<CcnxInterestHeader> &header,
+                     Ptr<CcnxInterestHeader> header,
                      const Ptr<const Packet> &packet,
                      Ptr<CcnxPitEntry> pitEntry);
   
@@ -152,7 +174,7 @@
    */
   virtual bool
   DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                       Ptr<CcnxInterestHeader> &header,
+                       Ptr<CcnxInterestHeader> header,
                        const Ptr<const Packet> &packet,
                        Ptr<CcnxPitEntry> pitEntry) = 0;
 
diff --git a/model/forwarding-strategy/flooding.cc b/model/forwarding-strategy/flooding.cc
index 79a29b9..545d1fb 100644
--- a/model/forwarding-strategy/flooding.cc
+++ b/model/forwarding-strategy/flooding.cc
@@ -61,7 +61,7 @@
 
 bool
 Flooding::DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                               Ptr<CcnxInterestHeader> &header,
+                               Ptr<CcnxInterestHeader> header,
                                const Ptr<const Packet> &packet,
                                Ptr<CcnxPitEntry> pitEntry)
 {
@@ -81,30 +81,16 @@
           continue; // same face as incoming, don't forward
         }
 
-      CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
-        pitEntry->GetOutgoing ().find (metricFace.m_face);
-      
-      if (outgoing != pitEntry->GetOutgoing ().end () &&
-          outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
-        {
-          NS_LOG_DEBUG ("continue (same as previous outgoing)");
-          continue; // already forwarded before during this retransmission cycle
-        }
-      NS_LOG_DEBUG ("max retx count: " << pitEntry->GetMaxRetxCount ());
-
-      bool faceAvailable = metricFace.m_face->IsBelowLimit ();
-      if (!faceAvailable) // huh...
+      if (!WillSendOutInterest (metricFace.m_face, header, pitEntry))
         {
           continue;
         }
 
-      pitEntry->AddOutgoing (metricFace.m_face);
-
-      Ptr<Packet> packetToSend = packet->Copy ();
-
       //transmission
+      Ptr<Packet> packetToSend = packet->Copy ();
       metricFace.m_face->Send (packetToSend);
-      m_outInterests (header, metricFace.m_face);
+
+      DidSendOutInterest (metricFace.m_face, header, pitEntry);
       
       propagatedCount++;
     }
diff --git a/model/forwarding-strategy/flooding.h b/model/forwarding-strategy/flooding.h
index 99a6b9c..71665c7 100644
--- a/model/forwarding-strategy/flooding.h
+++ b/model/forwarding-strategy/flooding.h
@@ -48,7 +48,7 @@
   // inherited from  Nacks/CcnxForwardingStrategy
   virtual bool
   DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                       Ptr<CcnxInterestHeader> &header,
+                       Ptr<CcnxInterestHeader> header,
                        const Ptr<const Packet> &packet,
                        Ptr<CcnxPitEntry> pitEntry);
 
diff --git a/model/forwarding-strategy/fw-stats.cc b/model/forwarding-strategy/fw-stats.cc
new file mode 100644
index 0000000..1c1c873
--- /dev/null
+++ b/model/forwarding-strategy/fw-stats.cc
@@ -0,0 +1,100 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Ilya Moiseenko <iliamo@cs.ucla.edu>
+ */
+
+#include "fw-stats.h"
+
+#include "ns3/ccnx-interest-header.h"
+#include "ns3/ccnx-content-object-header.h"
+#include "ns3/ccnx-pit.h"
+#include "ns3/ccnx-pit-entry.h"
+
+#include "ns3/assert.h"
+#include "ns3/log.h"
+
+#include <boost/foreach.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/lambda/bind.hpp>
+namespace ll = boost::lambda;
+
+NS_LOG_COMPONENT_DEFINE ("NdnSimFwStats");
+
+namespace ns3 {
+namespace ndnSIM {
+
+NS_OBJECT_ENSURE_REGISTERED (FwStats);
+  
+TypeId
+FwStats::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::ndnSIM::FwStats")
+    .SetGroupName ("Ccnx")
+    .SetParent <BestRoute> ()
+    .AddConstructor <FwStats> ()
+    ;
+  return tid;
+}
+    
+FwStats::FwStats ()
+{
+}
+
+void
+FwStats::DidCreatePitEntry (const Ptr<CcnxFace> &incomingFace,
+                            Ptr<CcnxInterestHeader> header,
+                            const Ptr<const Packet> &packet,
+                            Ptr<CcnxPitEntry> pitEntry)
+{
+  super::DidCreatePitEntry (incomingFace, header, packet, pitEntry);
+  
+  m_stats.NewPitEntry (header->GetName ());
+  m_stats.Incoming (header->GetName (), incomingFace);
+}
+
+void
+FwStats::WillSatisfyPendingInterest (const Ptr<CcnxFace> &incomingFace,
+                                     Ptr<CcnxPitEntry> pitEntry)
+{
+  super::WillSatisfyPendingInterest (incomingFace, pitEntry);
+  
+  m_stats.Satisfy (pitEntry->GetPrefix ());  
+}
+
+void
+FwStats::DidSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                             Ptr<CcnxInterestHeader> header,
+                             Ptr<CcnxPitEntry> pitEntry)
+{
+  super::DidSendOutInterest (outgoingFace, header, pitEntry);
+
+  m_stats.Outgoing (header->GetName (), outgoingFace);
+}
+
+void
+FwStats::WillErasePendingInterest (Ptr<CcnxPitEntry> pitEntry)
+{
+  super::WillErasePendingInterest (pitEntry);
+
+  m_stats.Timeout (pitEntry->GetPrefix ());
+}
+
+
+} // namespace ndnSIM
+} // namespace ns3
diff --git a/model/forwarding-strategy/fw-stats.h b/model/forwarding-strategy/fw-stats.h
new file mode 100644
index 0000000..e2432b0
--- /dev/null
+++ b/model/forwarding-strategy/fw-stats.h
@@ -0,0 +1,75 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+
+#ifndef NDNSIM_FW_STATS_H
+#define NDNSIM_FW_STATS_H
+
+#include "best-route.h"
+#include "../../utils/stats-tree.h"
+
+namespace ns3 {
+namespace ndnSIM {
+
+/**
+ * \ingroup ccnx
+ * \brief Best route strategy
+ */
+class FwStats :
+    public BestRoute
+{
+public:
+  static TypeId
+  GetTypeId (void);
+
+  /**
+   * @brief Default constructor
+   */
+  FwStats ();
+
+protected:
+  virtual void
+  DidCreatePitEntry (const Ptr<CcnxFace> &incomingFace,
+                     Ptr<CcnxInterestHeader> header,
+                     const Ptr<const Packet> &packet,
+                     Ptr<CcnxPitEntry> pitEntry);
+
+  virtual void
+  WillSatisfyPendingInterest (const Ptr<CcnxFace> &incomingFace,
+                              Ptr<CcnxPitEntry> pitEntry);
+
+  virtual void
+  DidSendOutInterest (const Ptr<CcnxFace> &outgoingFace,
+                      Ptr<CcnxInterestHeader> header,
+                      Ptr<CcnxPitEntry> pitEntry);
+
+  virtual void
+  WillErasePendingInterest (Ptr<CcnxPitEntry> pitEntry);
+    
+private:
+  ::ndnSIM::StatsTree m_stats;
+  
+  typedef BestRoute super;
+};
+
+} // namespace ndnSIM
+} // namespace ns3
+
+#endif // NDNSIM_FW_STATS_H
diff --git a/model/forwarding-strategy/green-yellow-red.cc b/model/forwarding-strategy/green-yellow-red.cc
index e3d4322..70ae829 100644
--- a/model/forwarding-strategy/green-yellow-red.cc
+++ b/model/forwarding-strategy/green-yellow-red.cc
@@ -66,7 +66,7 @@
 
 bool
 GreenYellowRed::DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                                     Ptr<CcnxInterestHeader> &header,
+                                     Ptr<CcnxInterestHeader> header,
                                      const Ptr<const Packet> &packet,
                                      Ptr<CcnxPitEntry> pitEntry)
 {
@@ -84,30 +84,16 @@
       if (pitEntry->GetIncoming ().find (metricFace.m_face) != pitEntry->GetIncoming ().end ()) 
         continue; // don't forward to face that we received interest from
 
-      CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
-        pitEntry->GetOutgoing ().find (metricFace.m_face);
-      
-      if (outgoing != pitEntry->GetOutgoing ().end () &&
-          outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
+      if (!WillSendOutInterest (metricFace.m_face, header, pitEntry))
         {
-          NS_LOG_DEBUG ("retxCount: " << outgoing->m_retxCount << ", maxRetxCount: " << pitEntry->GetMaxRetxCount ());
           continue;
         }
-      
-      bool faceAvailable = metricFace.m_face->IsBelowLimit ();
-      if (!faceAvailable) // huh...
-        {
-          // let's try different green face
-          continue;
-        }
-
-      pitEntry->AddOutgoing (metricFace.m_face);
-
-      Ptr<Packet> packetToSend = packet->Copy ();
 
       //transmission
+      Ptr<Packet> packetToSend = packet->Copy ();
       metricFace.m_face->Send (packetToSend);
-      m_outInterests (header, metricFace.m_face);
+
+      DidSendOutInterest (metricFace.m_face, header, pitEntry);
       
       propagatedCount++;
       break; // propagate only one interest
diff --git a/model/forwarding-strategy/green-yellow-red.h b/model/forwarding-strategy/green-yellow-red.h
index 383f3f4..71002b9 100644
--- a/model/forwarding-strategy/green-yellow-red.h
+++ b/model/forwarding-strategy/green-yellow-red.h
@@ -42,7 +42,7 @@
 
   virtual bool
   DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                       Ptr<CcnxInterestHeader> &header,
+                       Ptr<CcnxInterestHeader> header,
                        const Ptr<const Packet> &packet,
                        Ptr<CcnxPitEntry> pitEntry);
   virtual void
diff --git a/model/forwarding-strategy/smart-flooding.cc b/model/forwarding-strategy/smart-flooding.cc
index 20bc7ba..6cc05e3 100644
--- a/model/forwarding-strategy/smart-flooding.cc
+++ b/model/forwarding-strategy/smart-flooding.cc
@@ -62,7 +62,7 @@
 
 bool
 SmartFlooding::DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                                    Ptr<CcnxInterestHeader> &header,
+                                    Ptr<CcnxInterestHeader> header,
                                     const Ptr<const Packet> &packet,
                                     Ptr<CcnxPitEntry> pitEntry)
 {
@@ -87,30 +87,16 @@
           continue; // same face as incoming, don't forward
         }
 
-      CcnxPitEntryOutgoingFaceContainer::type::iterator outgoing =
-        pitEntry->GetOutgoing ().find (metricFace.m_face);
-      
-      if (outgoing != pitEntry->GetOutgoing ().end () &&
-          outgoing->m_retxCount >= pitEntry->GetMaxRetxCount ())
-        {
-          NS_LOG_DEBUG ("continue (same as previous outgoing)");
-          continue; // already forwarded before during this retransmission cycle
-        }
-      NS_LOG_DEBUG ("max retx count: " << pitEntry->GetMaxRetxCount ());
-
-      bool faceAvailable = metricFace.m_face->IsBelowLimit ();
-      if (!faceAvailable) // huh...
+      if (!WillSendOutInterest (metricFace.m_face, header, pitEntry))
         {
           continue;
         }
 
-      pitEntry->AddOutgoing (metricFace.m_face);
-
-      Ptr<Packet> packetToSend = packet->Copy ();
-
       //transmission
+      Ptr<Packet> packetToSend = packet->Copy ();
       metricFace.m_face->Send (packetToSend);
-      m_outInterests (header, metricFace.m_face);
+
+      DidSendOutInterest (metricFace.m_face, header, pitEntry);
       
       propagatedCount++;
     }
diff --git a/model/forwarding-strategy/smart-flooding.h b/model/forwarding-strategy/smart-flooding.h
index 3e1cca6..840ce6a 100644
--- a/model/forwarding-strategy/smart-flooding.h
+++ b/model/forwarding-strategy/smart-flooding.h
@@ -43,7 +43,7 @@
   // inherited
   virtual bool
   DoPropagateInterest (const Ptr<CcnxFace> &incomingFace,
-                       Ptr<CcnxInterestHeader> &header,
+                       Ptr<CcnxInterestHeader> header,
                        const Ptr<const Packet> &packet,
                        Ptr<CcnxPitEntry> pitEntry);
 
diff --git a/model/pit/ccnx-pit-impl.cc b/model/pit/ccnx-pit-impl.cc
index c1867f0..2dfd39d 100644
--- a/model/pit/ccnx-pit-impl.cc
+++ b/model/pit/ccnx-pit-impl.cc
@@ -22,6 +22,7 @@
 
 #include "ns3/ccnx-interest-header.h"
 #include "ns3/ccnx-content-object-header.h"
+#include "ns3/ccnx-forwarding-strategy.h"
 
 #include "ns3/log.h"
 #include "ns3/string.h"
@@ -100,12 +101,23 @@
     {
       m_fib = GetObject<CcnxFib> ();
     }
+  if (m_forwardingStrategy == 0)
+    {
+      m_forwardingStrategy = GetObject<CcnxForwardingStrategy> ();
+    }
+
+  CcnxPit::NotifyNewAggregate ();
 }
 
 void 
 CcnxPitImpl::DoDispose ()
 {
   super::clear ();
+
+  m_forwardingStrategy = 0;
+  m_fib = 0;
+
+  CcnxPit::DoDispose ();
 }
 
 void CcnxPitImpl::RescheduleCleaning ()
@@ -139,6 +151,7 @@
       time_index::iterator entry = i_time.begin ();
       if (entry->GetExpireTime () <= now) // is the record stale?
         {
+          m_forwardingStrategy->WillErasePendingInterest (entry->to_iterator ()->payload ());
           super::erase (entry->to_iterator ());
       //     // count ++;
         }
@@ -166,6 +179,7 @@
 {
   NS_LOG_FUNCTION (header.GetName ());
   NS_ASSERT_MSG (m_fib != 0, "FIB should be set");
+  NS_ASSERT_MSG (m_forwardingStrategy != 0, "Forwarding strategy  should be set");
 
   super::iterator foundItem, lastItem;
   bool reachLast;
diff --git a/model/pit/ccnx-pit-impl.h b/model/pit/ccnx-pit-impl.h
index 692f78b..2f52604 100644
--- a/model/pit/ccnx-pit-impl.h
+++ b/model/pit/ccnx-pit-impl.h
@@ -113,6 +113,7 @@
 private:
   EventId m_cleanEvent;
   Ptr<CcnxFib> m_fib; ///< \brief Link to FIB table
+  Ptr<CcnxForwardingStrategy> m_forwardingStrategy;
 
   // indexes
   typedef
diff --git a/model/pit/ccnx-pit.cc b/model/pit/ccnx-pit.cc
index 00e58c7..e07ccfd 100644
--- a/model/pit/ccnx-pit.cc
+++ b/model/pit/ccnx-pit.cc
@@ -45,11 +45,6 @@
   static TypeId tid = TypeId ("ns3::private::CcnxPit")
     .SetGroupName ("Ccnx")
     .SetParent<Object> ()
-    // .AddAttribute ("CleanupTimeout",
-    //                "Timeout defining how frequent RIT should be cleaned up",
-    //                StringValue ("1s"),
-    //                MakeTimeAccessor (&CcnxPit::GetCleanupTimeout, &CcnxPit::SetCleanupTimeout),
-    //                MakeTimeChecker ())
     
     .AddAttribute ("PitEntryPruningTimout",
                    "Timeout for PIT entry to live after being satisfied. To make sure recently satisfied interest will not be satisfied again",
@@ -69,32 +64,4 @@
 {
 }
 
-// void CcnxPit::CleanExpired ()
-// {
-//   DoCleanExpired ();
-  
-//   // schedule next event  
-//   m_cleanupEvent = Simulator::Schedule (m_cleanupTimeout,
-//                                         &CcnxPit::CleanExpired, this); 
-// }
-
-// void
-// CcnxPit::SetCleanupTimeout (const Time &timeout)
-// {
-//   m_cleanupTimeout = timeout;
-//   if (m_cleanupEvent.IsRunning ())
-//     m_cleanupEvent.Cancel (); // cancel any scheduled cleanup events
-
-//   // schedule even with new timeout
-//   m_cleanupEvent = Simulator::Schedule (m_cleanupTimeout,
-//                                         &CcnxPit::CleanExpired, this); 
-// }
-
-// Time
-// CcnxPit::GetCleanupTimeout () const
-// {
-//   return m_cleanupTimeout;
-// }
-
-
 } // namespace ns3
diff --git a/model/pit/ccnx-pit.h b/model/pit/ccnx-pit.h
index 941b079..26cc626 100644
--- a/model/pit/ccnx-pit.h
+++ b/model/pit/ccnx-pit.h
@@ -147,35 +147,6 @@
   static inline Ptr<CcnxPit>
   GetCcnxPit (Ptr<Object> node);
 
-  ////////////////////////////////////////////////////////////////////////////
-  ////////////////////////////////////////////////////////////////////////////
-  ////////////////////////////////////////////////////////////////////////////
-
-private:
-  // /**
-  //  * @brief Remove expired records from PIT
-  //  */
-  // void
-  // CleanExpired ();
-  
-  // /**
-  //  * \brief Set cleanup timeout
-  //  *
-  //  * Side effect: current clean up even (if any) will be cancelled and a new event started
-  //  *
-  //  * \param timeout cleanup timeout
-  //  */
-  // void
-  // SetCleanupTimeout (const Time &timeout);
-
-  // /**
-  //  * \brief Get cleanup timeout
-  //  *
-  //  * \returns cleanup timeout
-  //  */
-  // Time
-  // GetCleanupTimeout () const;
-  
 protected:
   // configuration variables. Check implementation of GetTypeId for more details
   Time    m_PitEntryPruningTimout;