diff --git a/daemon/fw/random-strategy.cpp b/daemon/fw/random-strategy.cpp
new file mode 100644
index 0000000..a95d2cd
--- /dev/null
+++ b/daemon/fw/random-strategy.cpp
@@ -0,0 +1,92 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  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/>.
+ */
+
+#include "random-strategy.hpp"
+#include "algorithm.hpp"
+
+#include <ndn-cxx/util/random.hpp>
+
+namespace nfd {
+namespace fw {
+
+NFD_REGISTER_STRATEGY(RandomStrategy);
+NFD_LOG_INIT(RandomStrategy);
+
+RandomStrategy::RandomStrategy(Forwarder& forwarder, const Name& name)
+  : Strategy(forwarder)
+  , ProcessNackTraits(this)
+{
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    NDN_THROW(std::invalid_argument("RandomStrategy does not accept parameters"));
+  }
+  if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
+    NDN_THROW(std::invalid_argument(
+      "RandomStrategy does not support version " + to_string(*parsed.version)));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
+}
+
+const Name&
+RandomStrategy::getStrategyName()
+{
+  static Name strategyName("/localhost/nfd/strategy/random/%FD%01");
+  return strategyName;
+}
+
+void
+RandomStrategy::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+                                     const shared_ptr<pit::Entry>& pitEntry)
+{
+  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
+  const Face& inFace = ingress.face;
+  fib::NextHopList nhs;
+
+  std::copy_if(fibEntry.getNextHops().begin(), fibEntry.getNextHops().end(), std::back_inserter(nhs),
+               [&] (const auto& nh) { return isNextHopEligible(inFace, interest, nh, pitEntry); });
+
+  if (nhs.empty()) {
+    NFD_LOG_DEBUG(interest << " from=" << ingress << " no nexthop");
+
+    lp::NackHeader nackHeader;
+    nackHeader.setReason(lp::NackReason::NO_ROUTE);
+    this->sendNack(pitEntry, ingress, nackHeader);
+    this->rejectPendingInterest(pitEntry);
+    return;
+  }
+
+  std::shuffle(nhs.begin(), nhs.end(), ndn::random::getRandomNumberEngine());
+  this->sendInterest(pitEntry, FaceEndpoint(nhs.front().getFace(), 0), interest);
+}
+
+void
+RandomStrategy::afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+                                 const shared_ptr<pit::Entry>& pitEntry)
+{
+  this->processNack(ingress.face, nack, pitEntry);
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/random-strategy.hpp b/daemon/fw/random-strategy.hpp
new file mode 100644
index 0000000..6837e29
--- /dev/null
+++ b/daemon/fw/random-strategy.hpp
@@ -0,0 +1,66 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  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/>.
+ */
+
+#ifndef NFD_DAEMON_FW_RANDOM_STRATEGY_HPP
+#define NFD_DAEMON_FW_RANDOM_STRATEGY_HPP
+
+#include "strategy.hpp"
+#include "process-nack-traits.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \brief Randomly chooses a nexthop
+ *
+ * Sends an incoming interest to a random outgoing face,
+ * excluding the incoming face.
+ *
+ */
+class RandomStrategy : public Strategy
+                     , public ProcessNackTraits<RandomStrategy>
+{
+public:
+  explicit
+  RandomStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
+
+  static const Name&
+  getStrategyName();
+
+  void
+  afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
+                       const shared_ptr<pit::Entry>& pitEntry) override;
+
+  void
+  afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
+                   const shared_ptr<pit::Entry>& pitEntry) override;
+
+private:
+  friend ProcessNackTraits<RandomStrategy>;
+};
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_RANDOM_STRATEGY_HPP
diff --git a/tests/daemon/fw/ad-hoc-forwarding.t.cpp b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
index 7ec07c7..da696a0 100644
--- a/tests/daemon/fw/ad-hoc-forwarding.t.cpp
+++ b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
@@ -32,6 +32,7 @@
 #include "fw/asf-strategy.hpp"
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "tests/daemon/global-io-fixture.hpp"
 #include "topology-tester.hpp"
@@ -88,7 +89,8 @@
 using Strategies = boost::mpl::vector<
   AsfStrategy,
   BestRouteStrategy2,
-  MulticastStrategy
+  MulticastStrategy,
+  RandomStrategy
 >;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(SingleNexthop, S, Strategies,
diff --git a/tests/daemon/fw/broadcast-medium.t.cpp b/tests/daemon/fw/broadcast-medium.t.cpp
index 15999e2..da02718 100644
--- a/tests/daemon/fw/broadcast-medium.t.cpp
+++ b/tests/daemon/fw/broadcast-medium.t.cpp
@@ -28,6 +28,7 @@
 #include "fw/asf-strategy.hpp"
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "tests/daemon/global-io-fixture.hpp"
 #include "topology-tester.hpp"
@@ -86,7 +87,8 @@
 using Strategies = boost::mpl::vector<
   AsfStrategy,
   BestRouteStrategy2,
-  MulticastStrategy
+  MulticastStrategy,
+  RandomStrategy
 >;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(SameFaceDifferentEndpoint, S, Strategies, BroadcastMediumFixture<S>)
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
new file mode 100644
index 0000000..de62113
--- /dev/null
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -0,0 +1,107 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  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/>.
+ */
+
+#include "fw/random-strategy.hpp"
+#include "common/global.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include "strategy-tester.hpp"
+
+namespace nfd {
+namespace fw {
+namespace tests {
+
+using RandomStrategyTester = StrategyTester<RandomStrategy>;
+NFD_REGISTER_STRATEGY(RandomStrategyTester);
+
+BOOST_AUTO_TEST_SUITE(Fw)
+
+class RandomStrategyFixture : public GlobalIoTimeFixture
+{
+protected:
+  RandomStrategyFixture()
+    : strategy(forwarder)
+    , fib(forwarder.getFib())
+    , pit(forwarder.getPit())
+    , face1(make_shared<DummyFace>())
+    , face2(make_shared<DummyFace>())
+    , face3(make_shared<DummyFace>())
+    , face4(make_shared<DummyFace>())
+  {
+    forwarder.addFace(face1);
+    forwarder.addFace(face2);
+    forwarder.addFace(face3);
+    forwarder.addFace(face4);
+  }
+
+public:
+  Forwarder forwarder;
+  RandomStrategyTester strategy;
+  Fib& fib;
+  Pit& pit;
+
+  shared_ptr<DummyFace> face1;
+  shared_ptr<DummyFace> face2;
+  shared_ptr<DummyFace> face3;
+  shared_ptr<DummyFace> face4;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestRandomStrategy, RandomStrategyFixture)
+
+BOOST_AUTO_TEST_CASE(Forward)
+{
+  fib::Entry& fibEntry = *fib.insert(Name()).first;
+  fib.addOrUpdateNextHop(fibEntry, *face2, 10);
+  fib.addOrUpdateNextHop(fibEntry, *face3, 20);
+  fib.addOrUpdateNextHop(fibEntry, *face4, 30);
+
+  // Send 1000 Interests
+  for (int i = 0; i < 1000; ++i) {
+    shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA" + std::to_string(i));
+    shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+
+    pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+    strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  }
+
+  // Map outFaceId -> SentInterests.
+  std::unordered_map<int, int> faceInterestMap;
+  for (const auto& i : strategy.sendInterestHistory) {
+    faceInterestMap[i.outFaceId]++;
+  }
+
+  // Check that all faces received at least 10 Interest
+  for (const auto& x : faceInterestMap) {
+    BOOST_CHECK_GE(x.second, 10);
+  }
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestRandomStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace fw
+} // namespace nfd
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index f6ff4e2..705b3aa 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -35,6 +35,7 @@
 #include "fw/multicast-strategy.hpp"
 #include "fw/ncc-strategy.hpp"
 #include "fw/self-learning-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "tests/test-common.hpp"
 #include <boost/mpl/vector.hpp>
@@ -80,7 +81,8 @@
   Test<BestRouteStrategy2, false, 5>,
   Test<MulticastStrategy, false, 3>,
   Test<NccStrategy, false, 1>,
-  Test<SelfLearningStrategy, false, 1>
+  Test<SelfLearningStrategy, false, 1>,
+  Test<RandomStrategy, false, 1>
 >;
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(Registration, T, Tests)
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index ea2d417..ee0d15d 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -30,6 +30,7 @@
 // Strategies implementing recommended Nack processing procedure, sorted alphabetically.
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "choose-strategy.hpp"
 #include "strategy-tester.hpp"
@@ -85,7 +86,8 @@
 
 using Strategies = boost::mpl::vector<
   BestRouteStrategy2,
-  MulticastStrategy
+  MulticastStrategy,
+  RandomStrategy
 >;
 
 // 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
index a8fed80..4cc687d 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -33,6 +33,7 @@
 #include "fw/asf-strategy.hpp"
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "tests/test-common.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
@@ -150,7 +151,11 @@
 
   Test<MulticastStrategy, EmptyNextHopList<MulticastStrategy>>,
   Test<MulticastStrategy, NextHopIsDownstream<MulticastStrategy>>,
-  Test<MulticastStrategy, NextHopViolatesScope<MulticastStrategy>>
+  Test<MulticastStrategy, NextHopViolatesScope<MulticastStrategy>>,
+
+  Test<RandomStrategy, EmptyNextHopList<RandomStrategy>>,
+  Test<RandomStrategy, NextHopIsDownstream<RandomStrategy>>,
+  Test<RandomStrategy, NextHopViolatesScope<RandomStrategy>>
 >;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(IncomingInterest, T, Tests,
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index a2fa21d..50f3fde 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -34,6 +34,7 @@
 #include "fw/best-route-strategy2.hpp"
 #include "fw/multicast-strategy.hpp"
 #include "fw/ncc-strategy.hpp"
+#include "fw/random-strategy.hpp"
 
 #include "tests/test-common.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
@@ -109,7 +110,8 @@
   Test<BestRouteStrategy, false, false>,
   Test<BestRouteStrategy2, true, true>,
   Test<MulticastStrategy, true, true>,
-  Test<NccStrategy, false, false>
+  Test<NccStrategy, false, false>,
+  Test<RandomStrategy, true, true>
 >;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(LocalhostInterestToLocal,
