diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index 0eb9cce..320a92a 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -56,29 +56,6 @@
 }
 
 bool
-violatesScope(const pit::Entry& pitEntry, const Face& outFace)
-{
-  if (outFace.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
-    return false;
-  }
-  BOOST_ASSERT(outFace.getScope() == ndn::nfd::FACE_SCOPE_NON_LOCAL);
-
-  if (scope_prefix::LOCALHOST.isPrefixOf(pitEntry.getName())) {
-    // face is non-local, violates localhost scope
-    return true;
-  }
-
-  if (scope_prefix::LOCALHOP.isPrefixOf(pitEntry.getName())) {
-    // face is non-local, violates localhop scope unless PIT entry has local in-record
-    return std::none_of(pitEntry.in_begin(), pitEntry.in_end(),
-      [] (const pit::InRecord& inRecord) { return inRecord.getFace().getScope() == ndn::nfd::FACE_SCOPE_LOCAL; });
-  }
-
-  // Name is not subject to scope control
-  return false;
-}
-
-bool
 canForwardToLegacy(const pit::Entry& pitEntry, const Face& face)
 {
   time::steady_clock::TimePoint now = time::steady_clock::now();
diff --git a/daemon/fw/algorithm.hpp b/daemon/fw/algorithm.hpp
index 88ad0b4..7e830e5 100644
--- a/daemon/fw/algorithm.hpp
+++ b/daemon/fw/algorithm.hpp
@@ -73,14 +73,6 @@
 bool
 wouldViolateScope(const Face& inFace, const Interest& interest, const Face& outFace);
 
-/** \brief determine whether forwarding the Interest in \p pitEntry to \p outFace would violate scope
- *  \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
- *  \deprecated use violatesScope(inFace, interest, outFace) instead
- */
-DEPRECATED(
-bool
-violatesScope(const pit::Entry& pitEntry, const Face& outFace));
-
 /** \brief decide whether Interest can be forwarded to face
  *
  *  \return true if out-record of this face does not exist or has expired,
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 5de2e75..218ce44 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -25,7 +25,6 @@
 
 #include "strategy.hpp"
 #include "forwarder.hpp"
-#include "algorithm.hpp"
 #include "core/logger.hpp"
 #include "core/random.hpp"
 
@@ -68,42 +67,6 @@
 }
 
 void
-Strategy::sendInterest(const shared_ptr<pit::Entry>& pitEntry, Face& outFace,
-                       bool wantNewNonce)
-{
-  // scope control
-  if (fw::violatesScope(*pitEntry, outFace)) {
-    NFD_LOG_DEBUG("sendInterestLegacy face=" << outFace.getId() <<
-                  " interest=" << pitEntry->getName() << " violates scope");
-    return;
-  }
-
-  // pick Interest
-  // The outgoing Interest picked is the last incoming Interest that does not come from outFace.
-  // If all in-records come from outFace, it's fine to pick that.
-  // This happens when there's only one in-record that comes from outFace.
-  // The legit use is for vehicular network; otherwise, strategy shouldn't send to the sole inFace.
-  pit::InRecordCollection::iterator pickedInRecord = std::max_element(
-    pitEntry->in_begin(), pitEntry->in_end(),
-    [&outFace] (const pit::InRecord& a, const pit::InRecord& b) {
-      bool isOutFaceA = &a.getFace() == &outFace;
-      bool isOutFaceB = &b.getFace() == &outFace;
-      return (isOutFaceA > isOutFaceB) ||
-             (isOutFaceA == isOutFaceB && a.getLastRenewed() < b.getLastRenewed());
-    });
-  BOOST_ASSERT(pickedInRecord != pitEntry->in_end());
-  auto interest = const_pointer_cast<Interest>(pickedInRecord->getInterest().shared_from_this());
-
-  if (wantNewNonce) {
-    interest = make_shared<Interest>(*interest);
-    static std::uniform_int_distribution<uint32_t> dist;
-    interest->setNonce(dist(getGlobalRng()));
-  }
-
-  this->sendInterest(pitEntry, outFace, *interest);
-}
-
-void
 Strategy::sendNacks(const shared_ptr<pit::Entry>& pitEntry, const lp::NackHeader& header,
                     std::initializer_list<const Face*> exceptFaces)
 {
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 4346e78..f4ef3b1 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -140,18 +140,6 @@
     m_forwarder.onOutgoingInterest(pitEntry, outFace, interest);
   }
 
-  /** \brief send Interest to outFace
-   *  \param pitEntry PIT entry
-   *  \param outFace face through which to send out the Interest
-   *  \param wantNewNonce if true, a new Nonce will be generated,
-   *                      rather than reusing a Nonce from one of the PIT in-records
-   *  \deprecated use sendInterest(pitEntry, outFace, interest) instead
-   */
-  DEPRECATED(
-  void
-  sendInterest(const shared_ptr<pit::Entry>& pitEntry, Face& outFace,
-               bool wantNewNonce = false));
-
   /** \brief decide that a pending Interest cannot be forwarded
    *  \param pitEntry PIT entry
    *
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index caebecc..0986d24 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -89,61 +89,6 @@
 
 BOOST_AUTO_TEST_SUITE_END() // WouldViolateScope
 
-BOOST_FIXTURE_TEST_SUITE(ViolatesScope, ScopeControlFixture)
-
-BOOST_AUTO_TEST_CASE(Unrestricted)
-{
-  shared_ptr<Interest> interest = makeInterest("ndn:/ieWRzDsCu");
-  pit::Entry entry(*interest);
-
-  entry.insertOrUpdateInRecord(*nonLocalFace1, *interest);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *nonLocalFace2), false);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *localFace4), false);
-}
-
-BOOST_AUTO_TEST_CASE(Localhost)
-{
-  shared_ptr<Interest> interest = makeInterest("ndn:/localhost/5n1LzIt3");
-  pit::Entry entry(*interest);
-
-  entry.insertOrUpdateInRecord(*localFace3, *interest);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *nonLocalFace2), true);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *localFace4), false);
-}
-
-BOOST_AUTO_TEST_CASE(LocalhopFromLocal)
-{
-  shared_ptr<Interest> interest = makeInterest("ndn:/localhop/YcIKWCRYJ");
-  pit::Entry entry(*interest);
-
-  entry.insertOrUpdateInRecord(*localFace3, *interest);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *nonLocalFace2), false);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *localFace4), false);
-}
-
-BOOST_AUTO_TEST_CASE(LocalhopFromNonLocal)
-{
-  shared_ptr<Interest> interest = makeInterest("ndn:/localhop/x5uFr5IpqY");
-  pit::Entry entry(*interest);
-
-  entry.insertOrUpdateInRecord(*nonLocalFace1, *interest);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *nonLocalFace2), true);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *localFace4), false);
-}
-
-BOOST_AUTO_TEST_CASE(LocalhopFromLocalAndNonLocal)
-{
-  shared_ptr<Interest> interest = makeInterest("ndn:/localhop/gNn2MJAXt");
-  pit::Entry entry(*interest);
-
-  entry.insertOrUpdateInRecord(*nonLocalFace1, *interest);
-  entry.insertOrUpdateInRecord(*localFace3, *interest);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *nonLocalFace2), false);
-  BOOST_CHECK_EQUAL(violatesScope(entry, *localFace4), false);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // ViolatesScope
-
 BOOST_AUTO_TEST_CASE(CanForwardToLegacy)
 {
   shared_ptr<Interest> interest = makeInterest("ndn:/WDsuBLIMG");
