diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 485a3e9..f29d0e7 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -25,6 +25,7 @@
 
 #include "asf-probing-module.hpp"
 #include "core/random.hpp"
+#include "algorithm.hpp"
 
 namespace nfd {
 namespace fw {
@@ -84,8 +85,9 @@
     Face& hopFace = hop.getFace();
 
     // Don't send probe Interest back to the incoming face or use the same face
-    // as the forwarded Interest
-    if (hopFace.getId() == inFace.getId() || hopFace.getId() == faceUsed.getId()) {
+    // as the forwarded Interest or use a face that violates scope
+    if (hopFace.getId() == inFace.getId() || hopFace.getId() == faceUsed.getId() ||
+        wouldViolateScope(inFace, interest, hopFace)) {
       continue;
     }
 
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 657656c..acab918 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "asf-strategy.hpp"
+#include "algorithm.hpp"
 
 #include "core/logger.hpp"
 
@@ -89,9 +90,6 @@
     Face* faceToProbe = m_probing.getFaceToProbe(inFace, interest, fibEntry, *faceToUse);
 
     if (faceToProbe != nullptr) {
-      NFD_LOG_TRACE("Sending probe for " << fibEntry.getPrefix()
-                                         << " to FaceId: " << faceToProbe->getId());
-
       bool wantNewNonce = true;
       forwardInterest(interest, fibEntry, pitEntry, *faceToProbe, wantNewNonce);
       m_probing.afterForwardingProbe(fibEntry, interest);
@@ -140,7 +138,17 @@
                              Face& outFace,
                              bool wantNewNonce)
 {
-  this->sendInterest(pitEntry, outFace, wantNewNonce);
+  if (wantNewNonce) {
+    //Send probe: interest with new Nonce
+    Interest probeInterest(interest);
+    probeInterest.refreshNonce();
+    NFD_LOG_TRACE("Sending probe for " << probeInterest << probeInterest.getNonce()
+                                       << " to FaceId: " << outFace.getId());
+    this->sendInterest(pitEntry, outFace, probeInterest);
+  }
+  else {
+    this->sendInterest(pitEntry, outFace, interest);
+  }
 
   FaceInfo& faceInfo = m_measurements.getOrCreateFaceInfo(fibEntry, interest, outFace);
 
@@ -219,7 +227,7 @@
   for (const fib::NextHop& hop : fibEntry.getNextHops()) {
     Face& hopFace = hop.getFace();
 
-    if (hopFace.getId() == inFace.getId()) {
+    if (hopFace.getId() == inFace.getId() || wouldViolateScope(inFace, interest, hopFace)) {
       continue;
     }
 
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index f3765c3..dddacf1 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -181,7 +181,7 @@
   BOOST_CHECK_GE(linkAD->getFace(nodeA).getCounters().nOutInterests, 2);
 }
 
-BOOST_AUTO_TEST_CASE(NoPitOutRecord)
+BOOST_AUTO_TEST_CASE(NoPitOutRecordAndProbeInterestNewNonce)
 {
   /*                 +---------+
   *                  |  nodeD  |
@@ -227,6 +227,8 @@
   topo.registerPrefix(nodeC, linkBC->getFace(nodeC), PRODUCER_PREFIX, 16);
   topo.registerPrefix(nodeB, linkBD->getFace(nodeB), PRODUCER_PREFIX, 80);
 
+  uint32_t nonce;
+
   // Send 6 interest since probes can be scheduled b/w 0-5 seconds
   for (int i = 1; i < 7; i++) {
     // Send ping number i
@@ -234,6 +236,7 @@
     name.appendTimestamp();
     shared_ptr<Interest> interest = makeInterest(name);
     ping->getClientFace().expressInterest(*interest, nullptr, nullptr, nullptr);
+    nonce = interest->getNonce();
 
     // Don't know when the probe will be triggered since it is random between 0-5 seconds
     // or whether it will be triggered for this interest
@@ -249,6 +252,16 @@
 
     // Check if probe is sent to B else send another ping
     if (linkAB->getFace(nodeA).getCounters().nOutInterests == 1) {
+      // Get pitEntry of node A
+      shared_ptr<pit::Entry> pitEntry = topo.getForwarder(nodeA).getPit().find(*interest);
+      //get outRecord associated with face towards B
+      pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA));
+
+      BOOST_CHECK(outRecord != pitEntry->out_end());
+
+      //Check that Nonce of interest is not equal to Nonce of Probe
+      BOOST_CHECK_NE(nonce, outRecord->getLastNonce());
+
       // B should not have received the probe interest yet
       BOOST_CHECK_EQUAL(linkAB->getFace(nodeB).getCounters().nInInterests, 0);
 
@@ -260,10 +273,10 @@
       BOOST_CHECK_EQUAL(linkAB->getFace(nodeB).getCounters().nInInterests, 1);
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nOutInterests, i);
 
-      shared_ptr<pit::Entry> pitEntry = topo.getForwarder(nodeB).getPit().find(*interest);
+      pitEntry = topo.getForwarder(nodeB).getPit().find(*interest);
 
       // Get outRecord associated with face towards D.
-      pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
+      outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
 
       BOOST_CHECK(outRecord != pitEntry->out_end());
 
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 8694322..2311ff7 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -29,6 +29,7 @@
 
 // Strategies implementing namespace-based scope control, sorted alphabetically.
 #include "fw/access-strategy.hpp"
+#include "fw/asf-strategy.hpp"
 #include "fw/best-route-strategy.hpp"
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
@@ -130,6 +131,7 @@
 
 using Tests = boost::mpl::vector<
   Test<AccessStrategy, false, false>,
+  Test<AsfStrategy, true, false>,
   Test<BestRouteStrategy, false, false>,
   Test<BestRouteStrategy2, true, true>,
   Test<MulticastStrategy, false, false>,
