diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 2ebdb4a..acd2435 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -21,18 +21,23 @@
 
 #include "nfd-controller.hpp"
 #include "nfd-control-response.hpp"
+#include "../util/segment-fetcher.hpp"
 
 namespace ndn {
 namespace nfd {
 
+using ndn::util::SegmentFetcher;
+
 const uint32_t Controller::ERROR_TIMEOUT = 10060; // WinSock ESAETIMEDOUT
 const uint32_t Controller::ERROR_NACK = 10800; // 10000 + TLV-TYPE of Nack header
 const uint32_t Controller::ERROR_SERVER = 500;
 const uint32_t Controller::ERROR_LBOUND = 400;
+ValidatorNull Controller::s_validatorNull;
 
 Controller::Controller(Face& face, KeyChain& keyChain)
   : m_face(face)
   , m_keyChain(keyChain)
+  , m_validator(s_validatorNull) /// \todo #3653 accept validator as constructor parameter
 {
 }
 
@@ -103,5 +108,41 @@
     onSuccess(parameters);
 }
 
+void
+Controller::fetchDataset(const Name& prefix,
+                         const std::function<void(const ConstBufferPtr&)>& processResponse,
+                         const CommandFailCallback& onFailure,
+                         const CommandOptions& options)
+{
+  Interest baseInterest(prefix);
+  baseInterest.setInterestLifetime(options.getTimeout());
+
+  SegmentFetcher::fetch(m_face, baseInterest, m_validator, processResponse,
+                        bind(&Controller::processDatasetFetchError, this, onFailure, _1, _2));
+}
+
+void
+Controller::processDatasetFetchError(const CommandFailCallback& onFailure,
+                                     uint32_t code, std::string msg)
+{
+  switch (static_cast<SegmentFetcher::ErrorCode>(code)) {
+    // It's intentional to cast as SegmentFetcher::ErrorCode, and to not have a 'default' clause.
+    // This forces the switch statement to handle every defined SegmentFetcher::ErrorCode,
+    // and breaks compilation if it does not.
+    case SegmentFetcher::ErrorCode::INTEREST_TIMEOUT:
+      onFailure(ERROR_TIMEOUT, msg);
+      break;
+    case SegmentFetcher::ErrorCode::DATA_HAS_NO_SEGMENT:
+      onFailure(ERROR_SERVER, msg);
+      break;
+    case SegmentFetcher::ErrorCode::SEGMENT_VALIDATION_FAIL:
+      BOOST_ASSERT(false); /// \todo #3653 introduce ERROR_VALIDATION
+      break;
+    case SegmentFetcher::ErrorCode::NACK_ERROR:
+      onFailure(ERROR_NACK, msg);
+      break;
+  }
+}
+
 } // namespace nfd
 } // namespace ndn
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 4fbfa3e..7ebc5eb 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,9 +23,11 @@
 #define NDN_MANAGEMENT_NFD_CONTROLLER_HPP
 
 #include "nfd-control-command.hpp"
+#include "nfd-status-dataset.hpp"
+#include "nfd-command-options.hpp"
 #include "../face.hpp"
 #include "../security/key-chain.hpp"
-#include "nfd-command-options.hpp"
+#include "../security/validator-null.hpp"
 
 namespace ndn {
 namespace nfd {
@@ -48,7 +50,7 @@
 
   /** \brief a callback on command failure
    */
-  typedef function<void(uint32_t/*code*/,const std::string&/*reason*/)> CommandFailCallback;
+  typedef function<void(uint32_t code, const std::string& reason)> CommandFailCallback;
 
   /** \brief construct a Controller that uses face for transport,
    *         and uses the passed KeyChain to sign commands
@@ -68,6 +70,29 @@
     this->startCommand(command, parameters, onSuccess, onFailure, options);
   }
 
+  /** \brief start dataset fetching
+   */
+  template<typename Dataset>
+  typename std::enable_if<std::is_default_constructible<Dataset>::value>::type
+  fetch(const std::function<void(typename Dataset::ResultType)>& onSuccess,
+        const CommandFailCallback& onFailure,
+        const CommandOptions& options = CommandOptions())
+  {
+    this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
+  }
+
+  /** \brief start dataset fetching
+   */
+  template<typename Dataset, typename ParamType = typename Dataset::ParamType>
+  void
+  fetch(const ParamType& param,
+        const std::function<void(typename Dataset::ResultType)>& onSuccess,
+        const CommandFailCallback& onFailure,
+        const CommandOptions& options = CommandOptions())
+  {
+    this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
+  }
+
 private:
   void
   startCommand(const shared_ptr<ControlCommand>& command,
@@ -82,6 +107,30 @@
                          const CommandSucceedCallback& onSuccess,
                          const CommandFailCallback& onFailure);
 
+  template<typename Dataset>
+  void
+  fetchDataset(shared_ptr<Dataset> dataset,
+               const std::function<void(typename Dataset::ResultType)>& onSuccess,
+               const CommandFailCallback& onFailure,
+               const CommandOptions& options);
+
+  void
+  fetchDataset(const Name& prefix,
+               const std::function<void(const ConstBufferPtr&)>& processResponse,
+               const CommandFailCallback& onFailure,
+               const CommandOptions& options);
+
+  template<typename Dataset>
+  void
+  processDatasetResponse(shared_ptr<Dataset> dataset,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                         const CommandFailCallback& onFailure,
+                         ConstBufferPtr payload);
+
+  void
+  processDatasetFetchError(const CommandFailCallback& onFailure, uint32_t code, std::string msg);
+
+
 public:
   /** \brief error code for timeout
    */
@@ -102,8 +151,44 @@
 protected:
   Face& m_face;
   KeyChain& m_keyChain;
+  Validator& m_validator;
+
+private:
+  static ValidatorNull s_validatorNull;
 };
 
+template<typename Dataset>
+inline void
+Controller::fetchDataset(shared_ptr<Dataset> dataset,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                         const CommandFailCallback& onFailure,
+                         const CommandOptions& options)
+{
+  Name prefix = dataset->getDatasetPrefix(options.getPrefix());
+  this->fetchDataset(prefix,
+                     bind(&Controller::processDatasetResponse<Dataset>, this, dataset, onSuccess, onFailure, _1),
+                     onFailure,
+                     options);
+}
+
+template<typename Dataset>
+inline void
+Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
+                                   const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                                   const CommandFailCallback& onFailure,
+                                   ConstBufferPtr payload)
+{
+  typename Dataset::ResultType result;
+  try {
+    result = dataset->parseResult(payload);
+  }
+  catch (const tlv::Error& ex) {
+    onFailure(ERROR_SERVER, ex.what());
+    return;
+  }
+  onSuccess(result);
+}
+
 } // namespace nfd
 } // namespace ndn
 
diff --git a/src/management/nfd-status-dataset.cpp b/src/management/nfd-status-dataset.cpp
new file mode 100644
index 0000000..2409254
--- /dev/null
+++ b/src/management/nfd-status-dataset.cpp
@@ -0,0 +1,151 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "nfd-status-dataset.hpp"
+#include "../util/concepts.hpp"
+
+namespace ndn {
+namespace nfd {
+
+StatusDataset::StatusDataset(const PartialName& datasetName)
+  : m_datasetName(datasetName)
+{
+}
+
+Name
+StatusDataset::getDatasetPrefix(const Name& prefix) const
+{
+  Name name;
+  name.append(prefix).append(m_datasetName);
+  this->addParameters(name);
+  return name;
+}
+
+void
+StatusDataset::addParameters(Name& name) const
+{
+}
+
+/**
+ * \brief parses elements into a vector of T
+ * \tparam T element type
+ * \param payload pointer to a buffer of zero or more blocks of decodable by T
+ * \return a vector of T
+ * \throw tlv::Error cannot parse payload
+ */
+template<typename T>
+static std::vector<T>
+parseDatasetVector(ConstBufferPtr payload)
+{
+  BOOST_CONCEPT_ASSERT((WireDecodable<T>));
+
+  std::vector<T> result;
+
+  size_t offset = 0;
+  while (offset < payload->size()) {
+    bool isOk = false;
+    Block block;
+    std::tie(isOk, block) = Block::fromBuffer(payload, offset);
+    if (!isOk) {
+      BOOST_THROW_EXCEPTION(StatusDataset::ParseResultError("cannot decode Block"));
+    }
+
+    offset += block.size();
+    result.emplace_back(block);
+  }
+
+  return result;
+}
+
+ForwarderGeneralStatusDataset::ForwarderGeneralStatusDataset()
+  : StatusDataset("status/general")
+{
+}
+
+ForwarderGeneralStatusDataset::ResultType
+ForwarderGeneralStatusDataset::parseResult(ConstBufferPtr payload) const
+{
+  return ForwarderStatus(Block(tlv::Content, payload));
+}
+
+FaceDatasetBase::FaceDatasetBase(const PartialName& datasetName)
+  : StatusDataset(datasetName)
+{
+}
+
+FaceDatasetBase::ResultType
+FaceDatasetBase::parseResult(ConstBufferPtr payload) const
+{
+  return parseDatasetVector<FaceStatus>(payload);
+}
+
+FaceDataset::FaceDataset()
+  : FaceDatasetBase("faces/list")
+{
+}
+
+FaceQueryDataset::FaceQueryDataset(const FaceQueryFilter& filter)
+  : FaceDatasetBase("faces/query")
+  , m_filter(filter)
+{
+}
+
+void
+FaceQueryDataset::addParameters(Name& name) const
+{
+  name.append(m_filter.wireEncode());
+}
+
+FibDataset::FibDataset()
+  : StatusDataset("fib/list")
+{
+}
+
+FibDataset::ResultType
+FibDataset::parseResult(ConstBufferPtr payload) const
+{
+  return parseDatasetVector<FibEntry>(payload);
+}
+
+StrategyChoiceDataset::StrategyChoiceDataset()
+  : StatusDataset("strategy-choice/list")
+{
+}
+
+StrategyChoiceDataset::ResultType
+StrategyChoiceDataset::parseResult(ConstBufferPtr payload) const
+{
+  return parseDatasetVector<StrategyChoice>(payload);
+}
+
+RibDataset::RibDataset()
+  : StatusDataset("rib/list")
+{
+}
+
+RibDataset::ResultType
+RibDataset::parseResult(ConstBufferPtr payload) const
+{
+  return parseDatasetVector<RibEntry>(payload);
+}
+
+} // namespace nfd
+} // namespace ndn
diff --git a/src/management/nfd-status-dataset.hpp b/src/management/nfd-status-dataset.hpp
new file mode 100644
index 0000000..39537bc
--- /dev/null
+++ b/src/management/nfd-status-dataset.hpp
@@ -0,0 +1,234 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
+#define NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
+
+#include "../name.hpp"
+#include "nfd-forwarder-status.hpp"
+#include "nfd-face-status.hpp"
+#include "nfd-face-query-filter.hpp"
+#include "nfd-fib-entry.hpp"
+#include "nfd-strategy-choice.hpp"
+#include "nfd-rib-entry.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief base class of NFD StatusDataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+ */
+class StatusDataset : noncopyable
+{
+public:
+#ifdef DOXYGEN
+  /**
+   * \brief if defined, specifies constructor argument type;
+   *        otherwise, constructor has no argument
+   */
+  typedef int ParamType;
+#endif
+
+  /**
+   * \brief constructs a name prefix for the dataset
+   * \param prefix top-level prefix, such as ndn:/localhost/nfd
+   * \return name prefix without version and segment components
+   */
+  Name
+  getDatasetPrefix(const Name& prefix) const;
+
+#ifdef DOXYGEN
+  /**
+   * \brief provides the result type, usually a vector
+   */
+  typedef std::vector<int> ResultType;
+#endif
+
+  /**
+   * \brief indicates reassembled payload cannot be parsed as ResultType
+   */
+  class ParseResultError : public tlv::Error
+  {
+  public:
+    explicit
+    ParseResultError(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+#ifdef DOXYGEN
+  /**
+   * \brief parses a result from reassembled payload
+   * \param payload reassembled payload
+   * \throw tlv::Error cannot parse payload
+   */
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+#endif
+
+protected:
+  /**
+   * \brief constructs a StatusDataset instance with given sub-prefix
+   * \param datasetName dataset name after top-level prefix, such as faces/list
+   */
+  explicit
+  StatusDataset(const PartialName& datasetName);
+
+private:
+  /**
+   * \brief appends parameters to the dataset name prefix
+   * \param[in,out] the dataset name prefix onto which parameter components can be appended
+   */
+  virtual void
+  addParameters(Name& name) const;
+
+private:
+  PartialName m_datasetName;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a status/general dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus#General-Status-Dataset
+ */
+class ForwarderGeneralStatusDataset : public StatusDataset
+{
+public:
+  ForwarderGeneralStatusDataset();
+
+  typedef ForwarderStatus ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief provides common functionality among FaceDataset and FaceQueryDataset
+ */
+class FaceDatasetBase : public StatusDataset
+{
+public:
+  typedef std::vector<FaceStatus> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+
+protected:
+  explicit
+  FaceDatasetBase(const PartialName& datasetName);
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+ */
+class FaceDataset : public FaceDatasetBase
+{
+public:
+  FaceDataset();
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/query dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Query-Operation
+ */
+class FaceQueryDataset : public FaceDatasetBase
+{
+public:
+  typedef FaceQueryFilter ParamType;
+
+  explicit
+  FaceQueryDataset(const FaceQueryFilter& filter);
+
+private:
+  virtual void
+  addParameters(Name& name) const override;
+
+private:
+  FaceQueryFilter m_filter;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a fib/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#FIB-Dataset
+ */
+class FibDataset : public StatusDataset
+{
+public:
+  FibDataset();
+
+  typedef std::vector<FibEntry> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
+ */
+class StrategyChoiceDataset : public StatusDataset
+{
+public:
+  StrategyChoiceDataset();
+
+  typedef std::vector<StrategyChoice> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a rib/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#RIB-Dataset
+ */
+class RibDataset : public StatusDataset
+{
+public:
+  RibDataset();
+
+  typedef std::vector<RibEntry> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
diff --git a/tests/unit-tests/management/nfd-controller-fixture.hpp b/tests/unit-tests/management/nfd-controller-fixture.hpp
new file mode 100644
index 0000000..e9ffde2
--- /dev/null
+++ b/tests/unit-tests/management/nfd-controller-fixture.hpp
@@ -0,0 +1,70 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_TESTS_MANAGEMENT_NFD_CONTROLLER_FIXTURE_HPP
+#define NDN_TESTS_MANAGEMENT_NFD_CONTROLLER_FIXTURE_HPP
+
+#include "boost-test.hpp"
+#include "util/dummy-client-face.hpp"
+#include "../identity-management-time-fixture.hpp"
+
+namespace ndn {
+namespace nfd {
+namespace tests {
+
+using namespace ndn::tests;
+
+class ControllerFixture : public security::IdentityManagementTimeFixture
+{
+protected:
+  ControllerFixture()
+    : face(io)
+    , controller(face, m_keyChain)
+    , failCallback(bind(&ControllerFixture::fail, this, _1, _2))
+  {
+    Name identityName("/localhost/ControllerFixture");
+    if (this->addIdentity(identityName)) {
+      m_keyChain.setDefaultIdentity(identityName);
+    }
+    else {
+      BOOST_FAIL("cannot create identity");
+    }
+  }
+
+private:
+  void
+  fail(uint32_t code, const std::string& reason)
+  {
+    failCodes.push_back(code);
+  }
+
+protected:
+  ndn::util::DummyClientFace face;
+  Controller controller;
+  Controller::CommandFailCallback failCallback;
+  std::vector<uint32_t> failCodes;
+};
+
+} // namespace tests
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_TESTS_MANAGEMENT_NFD_CONTROLLER_FIXTURE_HPP
diff --git a/tests/unit-tests/management/nfd-controller.t.cpp b/tests/unit-tests/management/nfd-controller.t.cpp
index 2379d5c..c2e2b6c 100644
--- a/tests/unit-tests/management/nfd-controller.t.cpp
+++ b/tests/unit-tests/management/nfd-controller.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,55 +24,36 @@
 
 #include <boost/tuple/tuple.hpp>
 
-#include "boost-test.hpp"
-#include "util/dummy-client-face.hpp"
+#include "nfd-controller-fixture.hpp"
 #include "../make-interest-data.hpp"
-#include "../unit-test-time-fixture.hpp"
 
 namespace ndn {
 namespace nfd {
 namespace tests {
 
-using ndn::util::DummyClientFace;
+using ndn::util::makeData;
+using ndn::util::makeNack;
 
 BOOST_AUTO_TEST_SUITE(Management)
 
-class CommandFixture : public ndn::tests::UnitTestTimeFixture
+class CommandFixture : public ControllerFixture
 {
 protected:
   CommandFixture()
-    : face(io)
-    , controller(face, keyChain)
-    , commandSucceedCallback(bind(&CommandFixture::onCommandSucceed, this, _1))
-    , commandFailCallback(bind(&CommandFixture::onCommandFail, this, _1, _2))
+    : succeedCallback(bind(&CommandFixture::succeed, this, _1))
   {
   }
 
 private:
   void
-  onCommandSucceed(const ControlParameters& parameters)
+  succeed(const ControlParameters& parameters)
   {
-    commandSucceedHistory.push_back(boost::make_tuple(parameters));
-  }
-
-  void
-  onCommandFail(uint32_t code, const std::string& reason)
-  {
-    commandFailHistory.push_back(boost::make_tuple(code, reason));
+    succeeds.push_back(parameters);
   }
 
 protected:
-  DummyClientFace face;
-  KeyChain keyChain;
-  Controller controller;
-
-  Controller::CommandSucceedCallback commandSucceedCallback;
-  typedef boost::tuple<ControlParameters> CommandSucceedArgs;
-  std::vector<CommandSucceedArgs> commandSucceedHistory;
-
-  Controller::CommandFailCallback commandFailCallback;
-  typedef boost::tuple<uint32_t,std::string> CommandFailArgs;
-  std::vector<CommandFailArgs> commandFailHistory;
+  Controller::CommandSucceedCallback succeedCallback;
+  std::vector<ControlParameters> succeeds;
 };
 
 BOOST_FIXTURE_TEST_SUITE(TestNfdController, CommandFixture)
@@ -83,10 +64,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   BOOST_CHECK_NO_THROW(controller.start<FaceCreateCommand>(
-                       parameters,
-                       commandSucceedCallback,
-                       commandFailCallback));
-
+                         parameters, succeedCallback, failCallback));
   advanceClocks(time::milliseconds(1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -110,17 +88,16 @@
   ControlResponse responsePayload(201, "created");
   responsePayload.setBody(responseBody.wireEncode());
 
-  auto responseData = util::makeData(requestInterest.getName());
+  auto responseData = makeData(requestInterest.getName());
   responseData->setContent(responsePayload.wireEncode());
   face.receive(*responseData);
 
   advanceClocks(time::milliseconds(1));
 
-  BOOST_CHECK_EQUAL(commandFailHistory.size(), 0);
-  BOOST_REQUIRE_EQUAL(commandSucceedHistory.size(), 1);
-  const ControlParameters& response = commandSucceedHistory[0].get<0>();
-  BOOST_CHECK_EQUAL(response.getUri(), responseBody.getUri());
-  BOOST_CHECK_EQUAL(response.getFaceId(), responseBody.getFaceId());
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+  BOOST_REQUIRE_EQUAL(succeeds.size(), 1);
+  BOOST_CHECK_EQUAL(succeeds.back().getUri(), responseBody.getUri());
+  BOOST_CHECK_EQUAL(succeeds.back().getFaceId(), responseBody.getFaceId());
 }
 
 BOOST_AUTO_TEST_CASE(CommandInvalidRequest)
@@ -130,9 +107,7 @@
   // Uri is missing
 
   BOOST_CHECK_THROW(controller.start<FaceCreateCommand>(
-                      parameters,
-                      commandSucceedCallback,
-                      commandFailCallback),
+                      parameters, succeedCallback, failCallback),
                     ControlCommand::ArgumentError);
 }
 
@@ -142,9 +117,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   BOOST_CHECK_NO_THROW(controller.start<FaceCreateCommand>(
-                         parameters,
-                         commandSucceedCallback,
-                         commandFailCallback));
+                         parameters, succeedCallback, failCallback));
   advanceClocks(time::milliseconds(1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -152,14 +125,14 @@
 
   ControlResponse responsePayload(401, "Not Authenticated");
 
-  auto responseData = util::makeData(requestInterest.getName());
+  auto responseData = makeData(requestInterest.getName());
   responseData->setContent(responsePayload.wireEncode());
   face.receive(*responseData);
   advanceClocks(time::milliseconds(1));
 
-  BOOST_CHECK_EQUAL(commandSucceedHistory.size(), 0);
-  BOOST_REQUIRE_EQUAL(commandFailHistory.size(), 1);
-  BOOST_CHECK_EQUAL(commandFailHistory[0].get<0>(), 401);
+  BOOST_CHECK_EQUAL(succeeds.size(), 0);
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), 401);
 }
 
 BOOST_AUTO_TEST_CASE(CommandInvalidResponse)
@@ -168,9 +141,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   BOOST_CHECK_NO_THROW(controller.start<FaceCreateCommand>(
-                         parameters,
-                         commandSucceedCallback,
-                         commandFailCallback));
+                         parameters, succeedCallback, failCallback));
   advanceClocks(time::milliseconds(1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -183,13 +154,13 @@
   ControlResponse responsePayload(201, "created");
   responsePayload.setBody(responseBody.wireEncode());
 
-  auto responseData = util::makeData(requestInterest.getName());
+  auto responseData = makeData(requestInterest.getName());
   responseData->setContent(responsePayload.wireEncode());
   face.receive(*responseData);
   advanceClocks(time::milliseconds(1));
 
-  BOOST_CHECK_EQUAL(commandSucceedHistory.size(), 0);
-  BOOST_REQUIRE_EQUAL(commandFailHistory.size(), 1);
+  BOOST_CHECK_EQUAL(succeeds.size(), 0);
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
 }
 
 BOOST_AUTO_TEST_CASE(CommandNack)
@@ -198,20 +169,18 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   BOOST_CHECK_NO_THROW(controller.start<FaceCreateCommand>(
-                       parameters,
-                       commandSucceedCallback,
-                       commandFailCallback));
+                         parameters, succeedCallback, failCallback));
   advanceClocks(time::milliseconds(1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
   const Interest& requestInterest = face.sentInterests[0];
 
-  auto responseNack = util::makeNack(requestInterest, lp::NackReason::NO_ROUTE);
+  auto responseNack = makeNack(requestInterest, lp::NackReason::NO_ROUTE);
   face.receive(responseNack);
   advanceClocks(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(commandFailHistory.size(), 1);
-  BOOST_CHECK_EQUAL(commandFailHistory[0].get<0>(), Controller::ERROR_NACK);
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_NACK);
 }
 
 BOOST_AUTO_TEST_CASE(OptionsPrefix)
@@ -224,10 +193,7 @@
   options.setPrefix("/localhop/net/example/router1/nfd");
 
   BOOST_CHECK_NO_THROW(controller.start<RibRegisterCommand>(
-                       parameters,
-                       commandSucceedCallback,
-                       commandFailCallback,
-                       options));
+                         parameters, succeedCallback, failCallback, options));
   advanceClocks(time::milliseconds(1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -247,19 +213,18 @@
   options.setTimeout(time::milliseconds(50));
 
   BOOST_CHECK_NO_THROW(controller.start<FaceCreateCommand>(
-                       parameters,
-                       commandSucceedCallback,
-                       commandFailCallback,
-                       options));
+                         parameters, succeedCallback, failCallback, options));
   advanceClocks(time::milliseconds(1), 101); // Face's PIT granularity is 100ms
 
-  BOOST_REQUIRE_EQUAL(commandFailHistory.size(), 1);
-  BOOST_CHECK_EQUAL(commandFailHistory[0].get<0>(), Controller::ERROR_TIMEOUT);
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_TIMEOUT);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestController
 BOOST_AUTO_TEST_SUITE_END() // Management
 
+// Controller::fetch<Dataset> has a separate test suite in nfd-status-dataset.t.cpp
+
 } // namespace tests
 } // namespace nfd
 } // namespace ndn
diff --git a/tests/unit-tests/management/nfd-status-dataset.t.cpp b/tests/unit-tests/management/nfd-status-dataset.t.cpp
new file mode 100644
index 0000000..63b98aa
--- /dev/null
+++ b/tests/unit-tests/management/nfd-status-dataset.t.cpp
@@ -0,0 +1,387 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "management/nfd-status-dataset.hpp"
+#include "management/nfd-controller.hpp"
+
+#include "nfd-controller-fixture.hpp"
+#include "../make-interest-data.hpp"
+
+namespace ndn {
+namespace nfd {
+namespace tests {
+
+using ndn::util::makeData;
+using ndn::util::signData;
+
+BOOST_AUTO_TEST_SUITE(Management)
+
+class ControllerStatusDatasetFixture : public ControllerFixture
+{
+protected:
+  /** \brief send one WireEncodable as Data reply
+   *  \param prefix dataset prefix without version and segment
+   *  \param payload payload block
+   *  \note payload must fit in one Data
+   */
+  template<typename T>
+  void
+  sendDataset(const Name& prefix, const T& payload)
+  {
+    BOOST_CONCEPT_ASSERT((WireEncodable<T>));
+
+    auto data = this->prepareDatasetReply(prefix);
+    data->setContent(payload.wireEncode());
+    face.receive(*signData(data));
+  }
+
+  /** \brief send two WireEncodables as Data reply
+   *  \param prefix dataset prefix without version and segment
+   *  \param payload1 first vector item
+   *  \param payload2 second vector item
+   *  \note all payloads must fit in one Data
+   */
+  template<typename T1, typename T2>
+  void
+  sendDataset(const Name& prefix, const T1& payload1, const T2& payload2)
+  {
+    // The test suite allows up to two items, and put them in the same Data packet,
+    // because this test suite focuses on Controller::fetch<StatusDataset>,
+    // and is not intended to cover SegmentFetcher behavior.
+
+    BOOST_CONCEPT_ASSERT((WireEncodable<T1>));
+    BOOST_CONCEPT_ASSERT((WireEncodable<T2>));
+
+    ndn::encoding::EncodingBuffer buffer;
+    payload2.wireEncode(buffer);
+    payload1.wireEncode(buffer);
+
+    auto data = this->prepareDatasetReply(prefix);
+    data->setContent(buffer.buf(), buffer.size());
+    face.receive(*signData(data));
+  }
+
+private:
+  shared_ptr<Data>
+  prepareDatasetReply(const Name& prefix)
+  {
+    Name name = prefix;
+    name.appendVersion().appendSegment(0);
+
+    // These warnings assist in debugging a `hasResult` check failure.
+    // They usually indicate a misspelled prefix or incorrect timing in the test case.
+    if (face.sentInterests.size() < 1) {
+      BOOST_WARN_MESSAGE(false, "no Interest expressed");
+    }
+    else {
+      BOOST_WARN_MESSAGE(face.sentInterests.back().getName().isPrefixOf(name),
+                         "last Interest " << face.sentInterests.back().getName() <<
+                         " cannot be satisfied by this Data " << name);
+    }
+
+    auto data = make_shared<Data>(name);
+    data->setFinalBlockId(data->getName()[-1]);
+    return data;
+  }
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestNfdStatusDataset, ControllerStatusDatasetFixture)
+
+BOOST_AUTO_TEST_SUITE(Failures)
+
+BOOST_AUTO_TEST_CASE(Timeout)
+{
+  CommandOptions options;
+  options.setTimeout(time::milliseconds(3000));
+  controller.fetch<FaceDataset>(
+    [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
+    failCallback,
+    options);
+  this->advanceClocks(time::milliseconds(500), 7);
+
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_TIMEOUT);
+}
+
+BOOST_AUTO_TEST_CASE(DataHasNoSegment)
+{
+  controller.fetch<FaceDataset>(
+    [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  face.receive(*makeData("/localhost/nfd/faces/list/%FD%00"));
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
+}
+
+BOOST_AUTO_TEST_CASE(Nack)
+{
+  controller.fetch<FaceDataset>(
+    [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
+  face.receive(lp::Nack(face.sentInterests.back()));
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_NACK);
+}
+
+BOOST_AUTO_TEST_CASE(ParseError1)
+{
+  controller.fetch<FaceDataset>(
+    [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  Name payload; // Name is not valid FaceStatus
+  this->sendDataset("/localhost/nfd/faces/list", payload);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
+}
+
+BOOST_AUTO_TEST_CASE(ParseError2)
+{
+  controller.fetch<FaceDataset>(
+    [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  FaceStatus payload1;
+  payload1.setFaceId(10930);
+  Name payload2; // Name is not valid FaceStatus
+  this->sendDataset("/localhost/nfd/faces/list", payload1, payload2);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
+  BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // Failures
+
+BOOST_AUTO_TEST_SUITE(Datasets)
+
+BOOST_AUTO_TEST_CASE(StatusGeneral)
+{
+  bool hasResult = false;
+  controller.fetch<ForwarderGeneralStatusDataset>(
+    [&hasResult] (const ForwarderStatus& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.getNfdVersion(), "0.4.2");
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  ForwarderStatus payload;
+  payload.setNfdVersion("0.4.2");
+  this->sendDataset("/localhost/nfd/status/general", payload);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(FaceList)
+{
+  bool hasResult = false;
+  controller.fetch<FaceDataset>(
+    [&hasResult] (const std::vector<FaceStatus>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 2);
+      BOOST_CHECK_EQUAL(result.front().getFaceId(), 24485);
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  FaceStatus payload1;
+  payload1.setFaceId(24485);
+  FaceStatus payload2;
+  payload2.setFaceId(12987);
+  this->sendDataset("/localhost/nfd/faces/list", payload1, payload2);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(FaceQuery)
+{
+  FaceQueryFilter filter;
+  filter.setUriScheme("udp4");
+  bool hasResult = false;
+  controller.fetch<FaceQueryDataset>(
+    filter,
+    [&hasResult] (const std::vector<FaceStatus>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 1);
+      BOOST_CHECK_EQUAL(result.front().getFaceId(), 8795);
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  Name prefix("/localhost/nfd/faces/query");
+  prefix.append(filter.wireEncode());
+  FaceStatus payload;
+  payload.setFaceId(8795);
+  this->sendDataset(prefix, payload);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(FaceQueryWithOptions)
+{
+  FaceQueryFilter filter;
+  filter.setUriScheme("udp4");
+  CommandOptions options;
+  options.setTimeout(time::milliseconds(3000));
+  bool hasResult = false;
+  controller.fetch<FaceQueryDataset>(
+    filter,
+    [&hasResult] (const std::vector<FaceStatus>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 1);
+      BOOST_CHECK_EQUAL(result.front().getFaceId(), 14022);
+    },
+    failCallback,
+    options);
+  this->advanceClocks(time::milliseconds(500));
+
+  Name prefix("/localhost/nfd/faces/query");
+  prefix.append(filter.wireEncode());
+  FaceStatus payload;
+  payload.setFaceId(14022);
+  this->sendDataset(prefix, payload);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(FibList)
+{
+  bool hasResult = false;
+  controller.fetch<FibDataset>(
+    [&hasResult] (const std::vector<FibEntry>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 2);
+      BOOST_CHECK_EQUAL(result.front().getPrefix(), "/wYs7fzYcfG");
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  FibEntry payload1;
+  payload1.setPrefix("/wYs7fzYcfG");
+  FibEntry payload2;
+  payload2.setPrefix("/LKvmnzY5S");
+  this->sendDataset("/localhost/nfd/fib/list", payload1, payload2);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(StrategyChoiceList)
+{
+  bool hasResult = false;
+  controller.fetch<StrategyChoiceDataset>(
+    [&hasResult] (const std::vector<StrategyChoice>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 2);
+      BOOST_CHECK_EQUAL(result.front().getName(), "/8MLz6N3B");
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  StrategyChoice payload1;
+  payload1.setName("/8MLz6N3B");
+  StrategyChoice payload2;
+  payload2.setName("/svqcBu0YwU");
+  this->sendDataset("/localhost/nfd/strategy-choice/list", payload1, payload2);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(RibList)
+{
+  bool hasResult = false;
+  controller.fetch<RibDataset>(
+    [&hasResult] (const std::vector<RibEntry>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 2);
+      BOOST_CHECK_EQUAL(result.front().getName(), "/zXxBth97ee");
+    },
+    failCallback);
+  this->advanceClocks(time::milliseconds(500));
+
+  RibEntry payload1;
+  payload1.setName("/zXxBth97ee");
+  RibEntry payload2;
+  payload2.setName("/rJ8CvUpr4G");
+  this->sendDataset("/localhost/nfd/rib/list", payload1, payload2);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(RibListWithOptions)
+{
+  CommandOptions options;
+  options.setPrefix("/localhop/nfd");
+  bool hasResult = false;
+  controller.fetch<RibDataset>(
+    [&hasResult] (const std::vector<RibEntry>& result) {
+      hasResult = true;
+      BOOST_CHECK_EQUAL(result.size(), 1);
+      BOOST_CHECK_EQUAL(result.front().getName(), "/e6L5K4ascd");
+    },
+    failCallback,
+    options);
+  this->advanceClocks(time::milliseconds(500));
+
+  RibEntry payload;
+  payload.setName("/e6L5K4ascd");
+  this->sendDataset("/localhop/nfd/rib/list", payload);
+  this->advanceClocks(time::milliseconds(500));
+
+  BOOST_CHECK(hasResult);
+  BOOST_CHECK_EQUAL(failCodes.size(), 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // Datasets
+
+BOOST_AUTO_TEST_SUITE_END() // TestNfdStatusDataset
+BOOST_AUTO_TEST_SUITE_END() // Management
+
+} // namespace tests
+} // namespace nfd
+} // namespace ndn
