diff --git a/helper/ndn-stack-helper.cc b/helper/ndn-stack-helper.cc
index d88eeb2..9fcc8f2 100644
--- a/helper/ndn-stack-helper.cc
+++ b/helper/ndn-stack-helper.cc
@@ -270,9 +270,6 @@
               NS_LOG_INFO ("Max packets per second: " << maxInterestPackets);
               NS_LOG_INFO ("Max burst: " << m_avgRtt.ToDouble (Time::S) * maxInterestPackets);
 
-              // Set bucket max to BDP
-              face->SetBucketMax (m_avgRtt.ToDouble (Time::S) * maxInterestPackets); // number of interests allowed
-              face->SetBucketLeak (maxInterestPackets);
             }
         }
         
diff --git a/model/fw/ndn-forwarding-strategy.cc b/model/fw/ndn-forwarding-strategy.cc
index f1c92bd..1cbcd09 100644
--- a/model/fw/ndn-forwarding-strategy.cc
+++ b/model/fw/ndn-forwarding-strategy.cc
@@ -440,11 +440,6 @@
       return false; // already forwarded before during this retransmission cycle
     }
 
-  
-  bool ok = outgoingFace->IsBelowLimit ();
-  if (!ok)
-    return false;
-
   pitEntry->AddOutgoing (outgoingFace);
   return true;
 }
diff --git a/model/ndn-face.cc b/model/ndn-face.cc
index 936021d..ece32f5 100644
--- a/model/ndn-face.cc
+++ b/model/ndn-face.cc
@@ -90,13 +90,9 @@
  */
 Face::Face (Ptr<Node> node) 
   : m_node (node)
-  , m_bucket (0.0)
-  , m_bucketMax (-1.0)
-  , m_bucketLeak (0.0)
   , m_protocolHandler (MakeNullCallback<void,const Ptr<Face>&,const Ptr<const Packet>&> ())
   , m_ifup (false)
   , m_id ((uint32_t)-1)
-  , m_lastLeakTime (0)
   , m_metric (0)
   // , m_enableMetricTagging (false)
 {
@@ -134,55 +130,6 @@
 }
 
 bool
-Face::IsBelowLimit ()
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  /// \todo Implement tracing, if requested
-  
-  if (!IsUp ()){
-    NS_LOG_INFO("Face is not up.");
-    return false;
-  }
-
-  LeakBucket ();
-  
-  if (m_bucketMax > 0)
-    {
-      NS_LOG_DEBUG ("Limits enabled: " << m_bucketMax << ", current: " << m_bucket);
-      if (m_bucket+1.0 > m_bucketMax)
-        {
-          //NS_LOG_DEBUG ("Returning false");
-          return false;
-        }
-
-      if (m_randomizeLimitChecking)
-        {
-          static NormalVariable acceptanceProbability (m_bucketMax, m_bucketMax/6.0, m_bucketMax/2.0);
-          // static UniformVariable acceptanceProbability (0, m_bucketMax);
-          double value = acceptanceProbability.GetValue ();
-          if (value > m_bucketMax)
-            value -= m_bucketMax;
-      
-          if (m_bucket < value)
-            {
-              m_bucket += 1.0;
-              return true;
-            }
-          else
-            return false;
-        }
-      else
-        {
-          m_bucket += 1.0;
-          return true;
-        }
-    }
-  
-  return true;
-}
-
-bool
 Face::Send (Ptr<Packet> packet)
 {
   NS_LOG_FUNCTION (boost::cref (*this) << packet << packet->GetSize ());
@@ -243,40 +190,6 @@
 }
 
 void
-Face::LeakBucket ()
-{
-  if (m_lastLeakTime.IsZero ())
-    {
-      m_lastLeakTime = Simulator::Now ();
-      return;
-    }
-
-  Time interval = Simulator::Now () - m_lastLeakTime;
-  const double leak = m_bucketLeak * interval.ToDouble (Time::S);
-  if (leak >= 1.0)
-    {
-      m_bucket = std::max (0.0, m_bucket - leak);
-      m_lastLeakTime = Simulator::Now ();
-    }
-
-  // NS_LOG_DEBUG ("max: " << m_bucketMax << ", Current bucket: " << m_bucket << ", leak size: " << leak << ", interval: " << interval << ", " << m_bucketLeak);
-}
-
-void
-Face::SetBucketMax (double bucket)
-{
-  NS_LOG_FUNCTION (this << bucket);
-  m_bucketMax = bucket;
-}
-
-void
-Face::SetBucketLeak (double leak)
-{
-  NS_LOG_FUNCTION (this << leak);
-  m_bucketLeak = leak;
-}
-
-void
 Face::SetMetric (uint16_t metric)
 {
   NS_LOG_FUNCTION (metric);
diff --git a/model/ndn-face.h b/model/ndn-face.h
index 0a46401..6ed40bc 100644
--- a/model/ndn-face.h
+++ b/model/ndn-face.h
@@ -89,14 +89,7 @@
   RegisterProtocolHandler (ProtocolHandler handler);
 
   /**
-   * @brief Check if Interest limit is reached
-   *
-   * Side effect: if limit is not yet reached, the number of outstanding packets will be increased
-   *
-   * @returns true if Interest limit is not yet reached
    */
-  bool
-  IsBelowLimit ();
   
   /**
    * \brief Send packet on a face
@@ -179,27 +172,6 @@
   GetId () const;
 
   /**
-   * @brief Set maximum value for Interest allowance
-   *
-   * @param bucket maximum value for Interest allowance. If < 0, then limit will be disabled
-   */
-  void
-  SetBucketMax (double bucket);
-
-  /**
-   * @brief Set a normalized value (one second) for Interest allowance bucket leak
-   */
-   void
-  SetBucketLeak (double leak);
-  
-  /**
-   * @brief Leak the Interest allowance bucket by (1/interval) * m_bucketMax amount,
-   * where interval is time between two consecutive calls of LeakBucket
-   */
-  void
-  LeakBucket ();
-
-  /**
    * \brief Compare two faces. Only two faces on the same node could be compared.
    *
    * Internal index is used for comparison.
@@ -237,20 +209,13 @@
   Face& operator= (const Face &); ///< \brief Disabled copy operator
   
 protected:
-  // uint16_t m_metric; ///< \brief Routing/forwarding metric
   Ptr<Node> m_node; ///< \brief Smart pointer to Node
-
-  double m_bucket; ///< \brief Value representing current size of the Interest allowance for this face
-  double m_bucketMax;  ///< \brief Maximum Interest allowance for this face
-  double m_bucketLeak; ///< \brief Normalized amount that should be leaked every second
   
 private:
   ProtocolHandler m_protocolHandler; ///< Callback via which packets are getting send to Ndn stack
   bool m_ifup; ///< \brief flag indicating that the interface is UP 
   uint32_t m_id; ///< \brief id of the interface in Ndn stack (per-node uniqueness)
-  Time m_lastLeakTime;
   uint32_t m_metric; ///< \brief metric of the face
-  bool m_randomizeLimitChecking;
 
   // bool m_enableMetricTagging;
 
