diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
new file mode 100644
index 0000000..fba7f4c
--- /dev/null
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -0,0 +1,99 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  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 "strategy-choice-manager.hpp"
+#include "table/strategy-choice.hpp"
+#include <ndn-cxx/management/nfd-strategy-choice.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("StrategyChoiceManager");
+
+StrategyChoiceManager::StrategyChoiceManager(StrategyChoice& strategyChoice,
+                                             Dispatcher& dispatcher,
+                                             CommandValidator& validator)
+  : ManagerBase(dispatcher, validator, "strategy-choice")
+  , m_strategyChoice(strategyChoice)
+{
+  registerCommandHandler<ndn::nfd::StrategyChoiceSetCommand>("set",
+    bind(&StrategyChoiceManager::setStrategy, this, _2, _3, _4, _5));
+  registerCommandHandler<ndn::nfd::StrategyChoiceUnsetCommand>("unset",
+    bind(&StrategyChoiceManager::unsetStrategy, this, _2, _3, _4, _5));
+
+  registerStatusDatasetHandler("list",
+    bind(&StrategyChoiceManager::listChoices, this, _1, _2, _3));
+}
+
+void
+StrategyChoiceManager::setStrategy(const Name& topPrefix, const Interest& interest,
+                                   ControlParameters parameters,
+                                   const ndn::mgmt::CommandContinuation& done)
+{
+  const Name& prefix = parameters.getName();
+  const Name& selectedStrategy = parameters.getStrategy();
+
+  if (!m_strategyChoice.hasStrategy(selectedStrategy)) {
+    NFD_LOG_DEBUG("strategy-choice result: FAIL reason: unknown-strategy: "
+                  << parameters.getStrategy());
+    return done(ControlResponse(504, "Unsupported strategy"));
+  }
+
+  if (m_strategyChoice.insert(prefix, selectedStrategy)) {
+    NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
+    auto currentStrategyChoice = m_strategyChoice.get(prefix);
+    BOOST_ASSERT(currentStrategyChoice.first);
+    parameters.setStrategy(currentStrategyChoice.second);
+    return done(ControlResponse(200, "OK").setBody(parameters.wireEncode()));
+  }
+  else {
+    NFD_LOG_DEBUG("strategy-choice result: FAIL reason: not-installed");
+    return done(ControlResponse(405, "Strategy not installed"));
+  }
+}
+
+void
+StrategyChoiceManager::unsetStrategy(const Name& topPrefix, const Interest& interest,
+                                     ControlParameters parameters,
+                                     const ndn::mgmt::CommandContinuation& done)
+{
+  m_strategyChoice.erase(parameters.getName());
+
+  NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
+  done(ControlResponse(200, "OK").setBody(parameters.wireEncode()));
+}
+
+void
+StrategyChoiceManager::listChoices(const Name& topPrefix, const Interest& interest,
+                                   ndn::mgmt::StatusDatasetContext& context)
+{
+  for (auto&& i : m_strategyChoice) {
+    ndn::nfd::StrategyChoice entry;
+    entry.setName(i.getPrefix()).setStrategy(i.getStrategyName());
+    context.append(entry.wireEncode());
+  }
+  context.end();
+}
+
+} // namespace
