diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index cbf409c..d053482 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -25,14 +25,18 @@
 
 #include "multicast-strategy.hpp"
 #include "algorithm.hpp"
+#include "core/logger.hpp"
 
 namespace nfd {
 namespace fw {
 
 NFD_REGISTER_STRATEGY(MulticastStrategy);
 
+NFD_LOG_INIT("MulticastStrategy");
+
 MulticastStrategy::MulticastStrategy(Forwarder& forwarder, const Name& name)
   : Strategy(forwarder)
+  , ProcessNackTraits(this)
 {
   ParsedInstanceName parsed = parseInstanceName(name);
   if (!parsed.parameters.empty()) {
@@ -56,21 +60,44 @@
 MulticastStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
                                         const shared_ptr<pit::Entry>& pitEntry)
 {
+  if (hasPendingOutRecords(*pitEntry)) {
+    // not a new Interest, don't forward
+    return;
+  }
+
   const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
 
-  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
-    Face& outFace = it->getFace();
-    if (!wouldViolateScope(inFace, interest, outFace) &&
-        canForwardToLegacy(*pitEntry, outFace)) {
+  int nEligibleNextHops = 0;
+
+  for (const auto& nexthop : nexthops) {
+    Face& outFace = nexthop.getFace();
+
+    if (&outFace != &inFace && !wouldViolateScope(inFace, interest, outFace)) {
       this->sendInterest(pitEntry, outFace, interest);
+      NFD_LOG_DEBUG(interest << " from=" << inFace.getId()
+                             << " pitEntry-to=" << outFace.getId());
+      ++nEligibleNextHops;
     }
   }
 
-  if (!hasPendingOutRecords(*pitEntry)) {
-    this->rejectPendingInterest(pitEntry);
+  if (nEligibleNextHops == 0) {
+      NFD_LOG_DEBUG(interest << " from=" << inFace.getId() << " noNextHop");
+
+      lp::NackHeader nackHeader;
+      nackHeader.setReason(lp::NackReason::NO_ROUTE);
+      this->sendNack(pitEntry, inFace, nackHeader);
+
+      this->rejectPendingInterest(pitEntry);
   }
 }
 
+void
+MulticastStrategy::afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+                                    const shared_ptr<pit::Entry>& pitEntry)
+{
+  this->processNack(inFace, nack, pitEntry);
+}
+
 } // namespace fw
 } // namespace nfd
diff --git a/daemon/fw/multicast-strategy.hpp b/daemon/fw/multicast-strategy.hpp
index e656e45..7e77d72 100644
--- a/daemon/fw/multicast-strategy.hpp
+++ b/daemon/fw/multicast-strategy.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,7 @@
 #define NFD_DAEMON_FW_MULTICAST_STRATEGY_HPP
 
 #include "strategy.hpp"
+#include "process-nack-traits.hpp"
 
 namespace nfd {
 namespace fw {
@@ -34,16 +35,25 @@
 /** \brief a forwarding strategy that forwards Interest to all FIB nexthops
  */
 class MulticastStrategy : public Strategy
+                        , public ProcessNackTraits<MulticastStrategy>
 {
 public:
+  explicit
   MulticastStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
 
   static const Name&
   getStrategyName();
 
-  virtual void
+  void
   afterReceiveInterest(const Face& inFace, const Interest& interest,
                        const shared_ptr<pit::Entry>& pitEntry) override;
+
+  void
+  afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+                   const shared_ptr<pit::Entry>& pitEntry) override;
+
+private:
+  friend ProcessNackTraits<MulticastStrategy>;
 };
 
 } // namespace fw
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 69328ff..3ebe7f1 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -28,7 +28,6 @@
 #include "tests/test-common.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
 #include "strategy-tester.hpp"
-#include "topology-tester.hpp"
 
 namespace nfd {
 namespace fw {
@@ -145,81 +144,6 @@
   // face1 cannot be used because it's gone from FIB entry
 }
 
-BOOST_AUTO_TEST_SUITE(NoRouteNack) // send Nack-NoRoute if there's no usable FIB nexthop
-
-class EmptyNextHopList
-{
-public:
-  Name
-  getInterestName()
-  {
-    return "/P";
-  }
-
-  void
-  insertFibEntry(BestRouteStrategy2Fixture* fixture)
-  {
-    fixture->fib.insert(Name());
-  }
-};
-
-class NextHopIsDownstream
-{
-public:
-  Name
-  getInterestName()
-  {
-    return "/P";
-  }
-
-  void
-  insertFibEntry(BestRouteStrategy2Fixture* fixture)
-  {
-    fixture->fib.insert(Name()).first->addNextHop(*fixture->face1, 10);
-  }
-};
-
-class NextHopViolatesScope
-{
-public:
-  Name
-  getInterestName()
-  {
-    return "/localhop/P";
-  }
-
-  void
-  insertFibEntry(BestRouteStrategy2Fixture* fixture)
-  {
-    fixture->fib.insert("/localhop").first->addNextHop(*fixture->face2, 10);
-    // face1 and face2 are both non-local; Interest from face1 cannot be forwarded to face2
-  }
-};
-
-typedef boost::mpl::vector<EmptyNextHopList, NextHopIsDownstream, NextHopViolatesScope> NoRouteScenarios;
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(IncomingInterest, Scenario, NoRouteScenarios)
-{
-  Scenario scenario;
-  scenario.insertFibEntry(this);
-
-  shared_ptr<Interest> interest = makeInterest(scenario.getInterestName());
-  shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
-  pitEntry->insertOrUpdateInRecord(*face1, *interest);
-
-  strategy.afterReceiveInterest(*face1, *interest, pitEntry);
-
-  BOOST_REQUIRE_EQUAL(strategy.rejectPendingInterestHistory.size(), 1);
-  BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory[0].pitInterest, pitEntry->getInterest());
-
-  BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
-  BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitInterest, pitEntry->getInterest());
-  BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].outFaceId, face1->getId());
-  BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].header.getReason(), lp::NackReason::NO_ROUTE);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // NoRouteNack
-
 BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy2
 BOOST_AUTO_TEST_SUITE_END() // Fw
 
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index de00ff6..be87930 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -90,6 +90,10 @@
   std::set<FaceId> expectedInterestFaceIds{face1->getId(), face2->getId()};
   BOOST_CHECK_EQUAL_COLLECTIONS(sentInterestFaceIds.begin(), sentInterestFaceIds.end(),
                                 expectedInterestFaceIds.begin(), expectedInterestFaceIds.end());
+
+  // Check retransmission suppression, sendInterestHistory should remain 2
+  strategy.afterReceiveInterest(*face3, *interest, pitEntry);
+  BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 2);
 }
 
 BOOST_AUTO_TEST_CASE(RejectScope)
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 89902d3..b9c2421 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -29,6 +29,7 @@
 
 // Strategies implementing recommended Nack processing procedure, sorted alphabetically.
 #include "fw/best-route-strategy2.hpp"
+#include "fw/multicast-strategy.hpp"
 
 #include "tests/test-common.hpp"
 #include "tests/limited-io.hpp"
@@ -86,7 +87,8 @@
 BOOST_AUTO_TEST_SUITE(TestStrategyNackReturn)
 
 using Strategies = boost::mpl::vector<
-  BestRouteStrategy2
+  BestRouteStrategy2,
+  MulticastStrategy
 >;
 
 // one upstream, send Nack when Nack arrives
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
new file mode 100644
index 0000000..18f45a8
--- /dev/null
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -0,0 +1,184 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2017,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** \file
+ *  This test suite checks that a strategy returns Nack-NoRoute
+ *  when there is no usable FIB nexthop.
+ */
+
+// Strategies returning Nack-NoRoute when there is no usable FIB nexthop,
+// sorted alphabetically.
+#include "fw/asf-strategy.hpp"
+#include "fw/best-route-strategy2.hpp"
+#include "fw/multicast-strategy.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/limited-io.hpp"
+#include "choose-strategy.hpp"
+#include "strategy-tester.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include <boost/mpl/copy_if.hpp>
+#include <boost/mpl/vector.hpp>
+
+namespace nfd {
+namespace fw {
+namespace tests {
+
+using namespace nfd::tests;
+
+template<typename S>
+class StrategyNoRouteFixture : public UnitTestTimeFixture
+{
+public:
+  StrategyNoRouteFixture()
+    : limitedIo(this)
+    , strategy(choose<StrategyTester<S>>(forwarder))
+    , fib(forwarder.getFib())
+    , pit(forwarder.getPit())
+    , face1(make_shared<DummyFace>())
+    , face2(make_shared<DummyFace>())
+  {
+    forwarder.addFace(face1);
+    forwarder.addFace(face2);
+  }
+
+public:
+  LimitedIo limitedIo;
+
+  Forwarder forwarder;
+  StrategyTester<S>& strategy;
+  Fib& fib;
+  Pit& pit;
+
+  shared_ptr<Face> face1;
+  shared_ptr<Face> face2;
+};
+
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestStrategyNoRoute, BaseFixture)
+
+template<typename S, typename C>
+class Test
+{
+public:
+  using Strategy = S;
+  using Case = C;
+};
+
+template<typename S>
+class EmptyNextHopList
+{
+public:
+  Name
+  getInterestName()
+  {
+    return "/P";
+  }
+
+  void
+  insertFibEntry(StrategyNoRouteFixture<S>* fixture)
+  {
+    fixture->fib.insert(Name());
+  }
+};
+
+template<typename S>
+class NextHopIsDownstream
+{
+public:
+  Name
+  getInterestName()
+  {
+    return "/P";
+  }
+
+  void
+  insertFibEntry(StrategyNoRouteFixture<S>* fixture)
+  {
+    fixture->fib.insert(Name()).first->addNextHop(*fixture->face1, 10);
+  }
+};
+
+template<typename S>
+class NextHopViolatesScope
+{
+public:
+  Name
+  getInterestName()
+  {
+    return "/localhop/P";
+  }
+
+  void
+  insertFibEntry(StrategyNoRouteFixture<S>* fixture)
+  {
+    fixture->fib.insert("/localhop").first->addNextHop(*fixture->face2, 10);
+    // face1 and face2 are both non-local; Interest from face1 cannot be forwarded to face2
+  }
+};
+
+using Tests = boost::mpl::vector<
+  Test<AsfStrategy, EmptyNextHopList<AsfStrategy>>,
+  Test<AsfStrategy, NextHopIsDownstream<AsfStrategy>>,
+  Test<AsfStrategy, NextHopViolatesScope<AsfStrategy>>,
+
+  Test<BestRouteStrategy2, EmptyNextHopList<BestRouteStrategy2>>,
+  Test<BestRouteStrategy2, NextHopIsDownstream<BestRouteStrategy2>>,
+  Test<BestRouteStrategy2, NextHopViolatesScope<BestRouteStrategy2>>,
+
+  Test<MulticastStrategy, EmptyNextHopList<MulticastStrategy>>,
+  Test<MulticastStrategy, NextHopIsDownstream<MulticastStrategy>>,
+  Test<MulticastStrategy, NextHopViolatesScope<MulticastStrategy>>
+>;
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(IncomingInterest, T, Tests,
+                                 StrategyNoRouteFixture<typename T::Strategy>)
+{
+  typename T::Case scenario;
+  scenario.insertFibEntry(this);
+
+  shared_ptr<Interest> interest = makeInterest(scenario.getInterestName());
+  shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
+  pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
+
+  BOOST_REQUIRE(this->strategy.waitForAction(
+    [&] { this->strategy.afterReceiveInterest(*this->face1, *interest, pitEntry); },
+    this->limitedIo, 2));
+
+  BOOST_REQUIRE_EQUAL(this->strategy.rejectPendingInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(this->strategy.rejectPendingInterestHistory[0].pitInterest, pitEntry->getInterest());
+
+  BOOST_REQUIRE_EQUAL(this->strategy.sendNackHistory.size(), 1);
+  BOOST_CHECK_EQUAL(this->strategy.sendNackHistory[0].pitInterest, pitEntry->getInterest());
+  BOOST_CHECK_EQUAL(this->strategy.sendNackHistory[0].outFaceId, this->face1->getId());
+  BOOST_CHECK_EQUAL(this->strategy.sendNackHistory[0].header.getReason(), lp::NackReason::NO_ROUTE);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestStrategyNoRoute
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace fw
+} // namespace nfd
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 8a9b93d..4c6494a 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -110,7 +110,7 @@
   Test<AsfStrategy, true, false>,
   Test<BestRouteStrategy, false, false>,
   Test<BestRouteStrategy2, true, true>,
-  Test<MulticastStrategy, false, false>,
+  Test<MulticastStrategy, true, true>,
   Test<NccStrategy, false, false>
 >;
 
