diff --git a/docs/source/_static/code-samples/custom-strategy.cc b/docs/source/_static/code-samples/custom-strategy.cc
new file mode 100644
index 0000000..3b1cea1
--- /dev/null
+++ b/docs/source/_static/code-samples/custom-strategy.cc
@@ -0,0 +1,117 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+// custom-strategy.cc
+
+#include "custom-strategy.h"
+#include "ns3/ndn-fib.h"
+#include "ns3/ndn-fib-entry.h"
+#include "ns3/ndn-pit-entry.h"
+#include "ns3/ndn-interest.h"
+
+namespace ns3 {
+namespace ndn {
+namespace fw {
+
+NS_OBJECT_ENSURE_REGISTERED(CustomStrategy);
+
+LogComponent CustomStrategy::g_log = LogComponent (CustomStrategy::GetLogName ().c_str ());
+    
+std::string
+CustomStrategy::GetLogName ()
+{
+  return "ndn.fw.CustomStrategy";
+}
+    
+TypeId
+CustomStrategy::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::ndn::fw::CustomStrategy")
+    .SetGroupName ("Ndn")
+    .SetParent <BaseStrategy> ()
+    .AddConstructor <CustomStrategy> ()
+        
+    // .AddAttribute ("Attribute", "Attribute spec",
+    //                         StringValue ("DefaultValue"),
+    //                         MakeStringAccessor (&BaseStrategy::m_variable),
+    //                         MakeStringChecker ())    
+    ;
+  return tid;
+}
+
+CustomStrategy::CustomStrategy ()
+  : m_counter (0)
+{
+}
+
+bool
+CustomStrategy::DoPropagateInterest (Ptr<Face> inFace,
+                                     Ptr<const InterestHeader> header,
+                                     Ptr<const Packet> origPacket,
+                                     Ptr<pit::Entry> pitEntry)
+{
+  typedef fib::FaceMetricContainer::type::index<fib::i_metric>::type FacesByMetric;
+  FacesByMetric &faces = pitEntry->GetFibEntry ()->m_faces.get<fib::i_metric> ();
+  FacesByMetric::iterator faceIterator = faces.begin ();
+
+  int propagatedCount = 0;
+
+  // forward to best-metric face
+  if (faceIterator != faces.end ())
+    {
+      if (TrySendOutInterest (inFace, faceIterator->m_face, header, origPacket, pitEntry))
+        propagatedCount ++;
+
+      faceIterator ++;
+    }
+
+  // forward to second-best-metric face
+  if (faceIterator != faces.end ())
+    {
+      if (TrySendOutInterest (inFace, faceIterator->m_face, header, origPacket, pitEntry))
+        propagatedCount ++;
+
+      faceIterator ++;
+    }
+  return propagatedCount > 0;
+}
+
+void
+CustomStrategy::DidSendOutInterest (Ptr<Face> outFace,
+                                    Ptr<const InterestHeader> header,
+                                    Ptr<const Packet> origPacket,
+                                    Ptr<pit::Entry> pitEntry)
+{
+  m_counter ++;
+}
+
+void
+CustomStrategy::WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry)
+{
+  for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin ();
+       face != pitEntry->GetOutgoing ().end ();
+       face ++)
+    {
+      m_counter --;
+    }
+        
+  BaseStrategy::WillEraseTimedOutPendingInterest (pitEntry);
+}
+        
+        
+void
+CustomStrategy::WillSatisfyPendingInterest (Ptr<Face> inFace,
+                                            Ptr<pit::Entry> pitEntry)
+{
+  for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin ();
+       face != pitEntry->GetOutgoing ().end ();
+       face ++)
+    {
+      m_counter --;
+    }
+          
+  BaseStrategy::WillSatisfyPendingInterest (inFace, pitEntry);
+}
+
+        
+} // namespace fw
+} // namespace ndn
+} // namespace ns3
diff --git a/docs/source/_static/code-samples/custom-strategy.h b/docs/source/_static/code-samples/custom-strategy.h
new file mode 100644
index 0000000..4a4476d
--- /dev/null
+++ b/docs/source/_static/code-samples/custom-strategy.h
@@ -0,0 +1,67 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+
+// custom-strategy.h
+        
+#ifndef CUSTOM_STRATEGY_H
+#define CUSTOM_STRATEGY_H
+
+#include "ns3/log.h"
+#include "ns3/ndn-forwarding-strategy.h"
+#include "ns3/ndn-l3-protocol.h"
+                
+namespace ns3 {
+namespace ndn {
+namespace fw {
+
+typedef ForwardingStrategy BaseStrategy;
+
+class CustomStrategy:
+    public BaseStrategy
+{
+public:
+  static TypeId
+  GetTypeId ();
+        
+  static std::string
+  GetLogName ();
+          
+  CustomStrategy ();
+        
+protected:
+  virtual bool
+  DoPropagateInterest (Ptr<Face> incomingFace,
+                       Ptr<const InterestHeader> header,
+                       Ptr<const Packet> origPacket,
+                       Ptr<pit::Entry> pitEntry);
+
+public:
+  virtual void
+  DidSendOutInterest (Ptr<Face> outFace,
+                      Ptr<const InterestHeader> header,
+                      Ptr<const Packet> origPacket,
+                      Ptr<pit::Entry> pitEntry);
+
+  virtual void
+  WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry);
+
+  virtual void
+  WillSatisfyPendingInterest (Ptr<Face> inFace,
+                              Ptr<pit::Entry> pitEntry);
+        
+protected:
+  static LogComponent g_log;
+        
+// private:
+//   std::string m_variable;
+
+private:
+  uint32_t m_counter;
+};
+        
+        
+        
+} // namespace fw
+} // namespace ndn
+} // namespace ns3
+                
+#endif // CUSTOM_STRATEGY_H
