diff --git a/daemon/mgmt/forwarder-status-manager.cpp b/daemon/mgmt/forwarder-status-manager.cpp
new file mode 100644
index 0000000..9f1e3a2
--- /dev/null
+++ b/daemon/mgmt/forwarder-status-manager.cpp
@@ -0,0 +1,66 @@
+/* -*- 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 "forwarder-status-manager.hpp"
+#include "fw/forwarder.hpp"
+#include "version.hpp"
+
+namespace nfd {
+
+const time::milliseconds STATUS_SERVER_DEFAULT_FRESHNESS = time::milliseconds(5000);
+
+ForwarderStatusManager::ForwarderStatusManager(Forwarder& forwarder, Dispatcher& dispatcher)
+  : m_forwarder(forwarder)
+  , m_dispatcher(dispatcher)
+  , m_startTimestamp(time::system_clock::now())
+{
+  m_dispatcher.addStatusDataset("status", ndn::mgmt::makeAcceptAllAuthorization(),
+                                bind(&ForwarderStatusManager::listStatus, this, _1, _2, _3));
+}
+
+void
+ForwarderStatusManager::listStatus(const Name& topPrefix, const Interest& interest,
+                                   ndn::mgmt::StatusDatasetContext& context)
+{
+  ndn::nfd::ForwarderStatus status;
+
+  status.setNfdVersion(NFD_VERSION_BUILD_STRING);
+  status.setStartTimestamp(m_startTimestamp);
+  status.setCurrentTimestamp(time::system_clock::now());
+
+  status.setNNameTreeEntries(m_forwarder.getNameTree().size());
+  status.setNFibEntries(m_forwarder.getFib().size());
+  status.setNPitEntries(m_forwarder.getPit().size());
+  status.setNMeasurementsEntries(m_forwarder.getMeasurements().size());
+  status.setNCsEntries(m_forwarder.getCs().size());
+
+  m_forwarder.getCounters().copyTo(status);
+
+  context.setExpiry(STATUS_SERVER_DEFAULT_FRESHNESS);
+  context.append(status.wireEncode());
+  context.end();
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/forwarder-status-manager.hpp b/daemon/mgmt/forwarder-status-manager.hpp
new file mode 100644
index 0000000..57d89c8
--- /dev/null
+++ b/daemon/mgmt/forwarder-status-manager.hpp
@@ -0,0 +1,58 @@
+/* -*- 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/>.
+ */
+
+#ifndef NFD_DAEMON_MGMT_FORWARDER_STATUS_MANAGER_HPP
+#define NFD_DAEMON_MGMT_FORWARDER_STATUS_MANAGER_HPP
+
+#include "manager-base.hpp"
+#include <ndn-cxx/management/nfd-forwarder-status.hpp>
+
+namespace nfd {
+
+class Forwarder;
+
+/**
+ * @brief implement the Forwarder Status of NFD Management Protocol.
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
+ */
+class ForwarderStatusManager : noncopyable
+{
+public:
+  ForwarderStatusManager(Forwarder& forwarder, Dispatcher& dispatcher);
+
+private:
+  void
+  listStatus(const Name& topPrefix, const Interest& interest,
+             ndn::mgmt::StatusDatasetContext& context);
+
+private:
+  Forwarder&  m_forwarder;
+  Dispatcher& m_dispatcher;
+  time::system_clock::TimePoint m_startTimestamp;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FORWARDER_STATUS_MANAGER_HPP
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index 023d3d8..d42be83 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -36,7 +36,7 @@
 #include "mgmt/fib-manager.hpp"
 #include "mgmt/face-manager.hpp"
 // #include "mgmt/strategy-choice-manager.hpp"
-// #include "mgmt/status-server.hpp"
+#include "mgmt/forwarder-status-manager.hpp"
 #include "mgmt/general-config-section.hpp"
 #include "mgmt/tables-config-section.hpp"
 #include "mgmt/command-validator.hpp"
@@ -150,7 +150,7 @@
   // m_strategyChoiceManager.reset(new StrategyChoiceManager(m_forwarder->getStrategyChoice(),
   //                                                         m_internalFace, m_keyChain));
 
-  // m_statusServer.reset(new StatusServer(m_internalFace, *m_forwarder, m_keyChain));
+  m_forwarderStatusManager.reset(new ForwarderStatusManager(*m_forwarder, *m_dispatcher));
 
   ConfigFile config(&ignoreRibAndLogSections);
   general::setConfigFile(config);
diff --git a/daemon/nfd.hpp b/daemon/nfd.hpp
index b18700a..667ff94 100644
--- a/daemon/nfd.hpp
+++ b/daemon/nfd.hpp
@@ -48,7 +48,7 @@
 class FibManager;
 class FaceManager;
 class StrategyChoiceManager;
-class StatusServer;
+class ForwarderStatusManager;
 class InternalClientFace;
 class CommandValidator;
 
@@ -107,19 +107,19 @@
 
   unique_ptr<Forwarder> m_forwarder;
 
-  ndn::KeyChain&                    m_keyChain;
-  shared_ptr<InternalFace>          m_internalFace;
-  shared_ptr<InternalClientFace>    m_internalClientFace;
-  unique_ptr<CommandValidator>      m_validator;
+  ndn::KeyChain&                     m_keyChain;
+  shared_ptr<InternalFace>           m_internalFace;
+  shared_ptr<InternalClientFace>     m_internalClientFace;
+  unique_ptr<CommandValidator>       m_validator;
 
-  unique_ptr<ndn::mgmt::Dispatcher> m_dispatcher;
-  unique_ptr<FibManager>            m_fibManager;
-  unique_ptr<FaceManager>           m_faceManager;
+  unique_ptr<ndn::mgmt::Dispatcher>  m_dispatcher;
+  unique_ptr<FibManager>             m_fibManager;
+  unique_ptr<FaceManager>            m_faceManager;
   // unique_ptr<StrategyChoiceManager> m_strategyChoiceManager;
-  // unique_ptr<StatusServer>          m_statusServer;
+  unique_ptr<ForwarderStatusManager> m_forwarderStatusManager;
 
-  ndn::util::NetworkMonitor         m_networkMonitor;
-  scheduler::ScopedEventId          m_reloadConfigEvent;
+  ndn::util::NetworkMonitor          m_networkMonitor;
+  scheduler::ScopedEventId           m_reloadConfigEvent;
 };
 
 } // namespace nfd
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
new file mode 100644
index 0000000..ba01396
--- /dev/null
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -0,0 +1,101 @@
+/* -*- 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 "mgmt/forwarder-status-manager.hpp"
+#include "fw/forwarder.hpp"
+#include "version.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include <ndn-cxx/util/dummy-client-face.hpp>
+#include <ndn-cxx/mgmt/dispatcher.hpp>
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(Mgmt, UnitTestTimeFixture)
+BOOST_AUTO_TEST_SUITE(TestForwarderStatusManager)
+
+BOOST_AUTO_TEST_CASE(Status)
+{
+  // initialize
+  time::system_clock::TimePoint t1 = time::system_clock::now();
+  Forwarder forwarder;
+  auto face = ndn::util::makeDummyClientFace(g_io, {true, true});
+  ndn::KeyChain keyChain;
+  ndn::mgmt::Dispatcher dispatcher(*face, ref(keyChain));
+  ForwarderStatusManager statusServer(ref(forwarder), ref(dispatcher));
+  dispatcher.addTopPrefix("/localhost/nfd");
+  advanceClocks(time::milliseconds(1));
+
+  // populate tables
+  time::system_clock::TimePoint t2 = time::system_clock::now();
+  forwarder.getFib().insert("ndn:/fib1");
+  forwarder.getPit().insert(*makeInterest("ndn:/pit1"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit2"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit3"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit4"));
+  forwarder.getMeasurements().get("ndn:/measurements1");
+  forwarder.getMeasurements().get("ndn:/measurements2");
+  forwarder.getMeasurements().get("ndn:/measurements3");
+  BOOST_CHECK_GE(forwarder.getFib().size(), 1);
+  BOOST_CHECK_GE(forwarder.getPit().size(), 4);
+  BOOST_CHECK_GE(forwarder.getMeasurements().size(), 3);
+
+  // request
+  time::system_clock::TimePoint t3 = time::system_clock::now();
+  auto request = makeInterest("ndn:/localhost/nfd/status");
+  request->setMustBeFresh(true);
+  request->setChildSelector(1);
+
+  face->receive<Interest>(*request);
+  advanceClocks(time::milliseconds(1));
+
+  // verify
+  time::system_clock::TimePoint t4 = time::system_clock::now();
+  BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
+  ndn::nfd::ForwarderStatus status;
+  BOOST_REQUIRE_NO_THROW(status.wireDecode(face->sentDatas[0].getContent().blockFromValue()));
+
+  BOOST_CHECK_EQUAL(status.getNfdVersion(), NFD_VERSION_BUILD_STRING);
+  BOOST_CHECK_GE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t1));
+  BOOST_CHECK_LE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t2));
+  BOOST_CHECK_GE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t3));
+  BOOST_CHECK_LE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t4));
+
+  // Interest/Data toward ForwarderStatusManager don't go through Forwarder,
+  // so request and response won't affect table size
+  BOOST_CHECK_EQUAL(status.getNNameTreeEntries(), forwarder.getNameTree().size());
+  BOOST_CHECK_EQUAL(status.getNFibEntries(), forwarder.getFib().size());
+  BOOST_CHECK_EQUAL(status.getNPitEntries(), forwarder.getPit().size());
+  BOOST_CHECK_EQUAL(status.getNMeasurementsEntries(), forwarder.getMeasurements().size());
+  BOOST_CHECK_EQUAL(status.getNCsEntries(), forwarder.getCs().size());
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestForwarderStatusManager
+BOOST_AUTO_TEST_SUITE_END() // Mgmt
+
+} // namespace tests
+} // namespace nfd
