diff --git a/src/management/nfd-channel-status.hpp b/src/management/nfd-channel-status.hpp
new file mode 100644
index 0000000..6ac5aae
--- /dev/null
+++ b/src/management/nfd-channel-status.hpp
@@ -0,0 +1,137 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (c) 2013-2014,  Regents of the University of California.
+ * All rights reserved.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ *
+ * This file licensed under New BSD License.  See COPYING for detailed information about
+ * ndn-cxx library copyright, permissions, and redistribution restrictions.
+ */
+
+#ifndef NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
+#define NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
+
+#include "../encoding/tlv-nfd.hpp"
+#include "../encoding/encoding-buffer.hpp"
+#include "../encoding/block-helpers.hpp"
+
+#include "../util/time.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * @ingroup management
+ * @brief represents NFD Channel Status dataset
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
+ */
+class ChannelStatus
+{
+public:
+  class Error : public Tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : Tlv::Error(what)
+    {
+    }
+  };
+
+  ChannelStatus()
+  {
+  }
+
+  explicit
+  ChannelStatus(const Block& payload)
+  {
+    this->wireDecode(payload);
+  }
+
+  template<bool T>
+  size_t
+  wireEncode(EncodingImpl<T>& encoder) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  const std::string&
+  getLocalUri() const
+  {
+    return m_localUri;
+  }
+
+  ChannelStatus&
+  setLocalUri(const std::string localUri)
+  {
+    m_wire.reset();
+    m_localUri = localUri;
+    return *this;
+  }
+
+private:
+  std::string m_localUri;
+
+  mutable Block m_wire;
+};
+
+
+template<bool T>
+inline size_t
+ChannelStatus::wireEncode(EncodingImpl<T>& encoder) const
+{
+  size_t totalLength = 0;
+
+  totalLength += prependByteArrayBlock(encoder, tlv::nfd::LocalUri,
+                 reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
+
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(tlv::nfd::ChannelStatus);
+  return totalLength;
+}
+
+inline const Block&
+ChannelStatus::wireEncode() const
+{
+  if (m_wire.hasWire())
+    return m_wire;
+
+  EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+  return m_wire;
+}
+
+inline void
+ChannelStatus::wireDecode(const Block& block)
+{
+  if (block.type() != tlv::nfd::ChannelStatus) {
+    throw Error("expecting ChannelStatus block");
+  }
+  m_wire = block;
+  m_wire.parse();
+  Block::element_const_iterator val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) {
+    m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+    ++val;
+  }
+  else {
+    throw Error("missing required LocalUri field");
+  }
+}
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index bde5725..1bf0c0c 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -19,8 +19,10 @@
 namespace ndn {
 namespace nfd {
 
-/** \brief base class of NFD ControlCommand
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
+/**
+ * \ingroup management
+ * \brief base class of NFD ControlCommand
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
  */
 class ControlCommand : noncopyable
 {
@@ -174,8 +176,10 @@
 };
 
 
-/** \brief represents a faces/create command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face
+/**
+ * \ingroup management
+ * \brief represents a faces/create command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face
  */
 class FaceCreateCommand : public ControlCommand
 {
@@ -202,8 +206,10 @@
 };
 
 
-/** \brief represents a faces/destroy command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face
+/**
+ * \ingroup management
+ * \brief represents a faces/destroy command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face
  */
 class FaceDestroyCommand : public ControlCommand
 {
@@ -233,7 +239,10 @@
   }
 };
 
-
+/**
+ * \ingroup management
+ * \brief Base class for faces/[*]-local-control commands
+ */
 class FaceLocalControlCommand : public ControlCommand
 {
 public:
@@ -269,8 +278,10 @@
 };
 
 
-/** \brief represents a faces/enable-local-control command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
+/**
+ * \ingroup management
+ * \brief represents a faces/enable-local-control command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
  */
 class FaceEnableLocalControlCommand : public FaceLocalControlCommand
 {
@@ -282,8 +293,10 @@
 };
 
 
-/** \brief represents a faces/disable-local-control command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
+/**
+ * \ingroup management
+ * \brief represents a faces/disable-local-control command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
  */
 class FaceDisableLocalControlCommand : public FaceLocalControlCommand
 {
@@ -295,8 +308,10 @@
 };
 
 
-/** \brief represents a fib/add-nexthop command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop
+/**
+ * \ingroup management
+ * \brief represents a fib/add-nexthop command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop
  */
 class FibAddNextHopCommand : public ControlCommand
 {
@@ -334,8 +349,10 @@
 };
 
 
-/** \brief represents a fib/remove-nexthop command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop
+/**
+ * \ingroup management
+ * \brief represents a fib/remove-nexthop command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop
  */
 class FibRemoveNextHopCommand : public ControlCommand
 {
@@ -363,8 +380,10 @@
 };
 
 
-/** \brief represents a strategy-choice/set command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/set command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace
  */
 class StrategyChoiceSetCommand : public ControlCommand
 {
@@ -380,8 +399,10 @@
 };
 
 
-/** \brief represents a strategy-choice/set command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/set command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace
  */
 class StrategyChoiceUnsetCommand : public ControlCommand
 {
@@ -412,6 +433,9 @@
 };
 
 
+/**
+ * \ingroup management
+ */
 enum {
   // route origin
   ROUTE_ORIGIN_APP    = 0,
@@ -424,8 +448,10 @@
 };
 
 
-/** \brief represents a rib/register command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route
+/**
+ * \ingroup management
+ * \brief represents a rib/register command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route
  */
 class RibRegisterCommand : public ControlCommand
 {
@@ -486,8 +512,10 @@
 };
 
 
-/** \brief represents a rib/unregister command
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route
+/**
+ * \ingroup management
+ * \brief represents a rib/unregister command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route
  */
 class RibUnregisterCommand : public ControlCommand
 {
diff --git a/src/management/nfd-control-parameters.hpp b/src/management/nfd-control-parameters.hpp
index ea13b82..de9bf98 100644
--- a/src/management/nfd-control-parameters.hpp
+++ b/src/management/nfd-control-parameters.hpp
@@ -19,6 +19,9 @@
 namespace ndn {
 namespace nfd {
 
+/**
+ * \ingroup management
+ */
 enum ControlParameterField {
   CONTROL_PARAMETER_NAME,
   CONTROL_PARAMETER_FACE_ID,
@@ -44,13 +47,18 @@
   "ExpirationPeriod",
 };
 
+/**
+ * \ingroup management
+ */
 enum LocalControlFeature {
   LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID = 1,
   LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID = 2
 };
 
-/** \brief represents parameters in a ControlCommand request or response
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
+/**
+ * \ingroup management
+ * \brief represents parameters in a ControlCommand request or response
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
  */
 class ControlParameters
 {
diff --git a/src/management/nfd-control-response.hpp b/src/management/nfd-control-response.hpp
index c239804..307200f 100644
--- a/src/management/nfd-control-response.hpp
+++ b/src/management/nfd-control-response.hpp
@@ -21,6 +21,7 @@
 namespace nfd {
 
 /**
+ * @ingroup management
  * @brief Class defining abstraction of ControlResponse for NFD Control Protocol
  *
  * @see http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 52b37a6..34b6e54 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -19,7 +19,13 @@
 namespace ndn {
 namespace nfd {
 
-/** \brief NFD Management protocol - ControlCommand client
+/**
+ * \defgroup management
+ * \brief Classes and data structures to manage NDN forwarder
+ */
+/**
+ * \ingroup management
+ * \brief NFD Management protocol - ControlCommand client
  */
 class Controller : noncopyable
 {
diff --git a/src/management/nfd-face-event-notification.hpp b/src/management/nfd-face-event-notification.hpp
index 6432d30..7f5b5fa 100644
--- a/src/management/nfd-face-event-notification.hpp
+++ b/src/management/nfd-face-event-notification.hpp
@@ -23,13 +23,18 @@
 namespace ndn {
 namespace nfd {
 
+/**
+ * \ingroup management
+ */
 enum FaceEventKind {
   FACE_EVENT_CREATED = 1,
   FACE_EVENT_DESTROYED = 2
 };
 
-/** \brief represents a Face status change notification
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
+/**
+ * \ingroup management
+ * \brief represents a Face status change notification
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
  */
 class FaceEventNotification : public FaceFlagsTraits<FaceEventNotification>
 {
diff --git a/src/management/nfd-face-flags.hpp b/src/management/nfd-face-flags.hpp
index 9671ee4..15595ed 100644
--- a/src/management/nfd-face-flags.hpp
+++ b/src/management/nfd-face-flags.hpp
@@ -16,8 +16,10 @@
 namespace ndn {
 namespace nfd {
 
-/** \class FaceFlags
- *  \brief provides additional information about a face
+/**
+ * \ingroup management
+ * \enum FaceFlags
+ * \brief provides additional information about a face
  */
 enum {
   /** \brief face is local (for scope control purpose)
@@ -31,10 +33,12 @@
   // FACE_? = 8
 };
 
-/** \brief implements getters to each face flag
+/**
+ * \ingroup management
+ * \brief implements getters to each face flag
  *
- *  \tparam T class containing a FaceFlags field and implements
- *            `FaceFlags getFlags() const` method
+ * \tparam T class containing a FaceFlags field and implements
+ *           `FaceFlags getFlags() const` method
  */
 template<typename T>
 class FaceFlagsTraits
diff --git a/src/management/nfd-face-status.hpp b/src/management/nfd-face-status.hpp
index 02e9b9a..b4ae417 100644
--- a/src/management/nfd-face-status.hpp
+++ b/src/management/nfd-face-status.hpp
@@ -23,8 +23,10 @@
 namespace ndn {
 namespace nfd {
 
-/** \brief represents Face status
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+/**
+ * \ingroup management
+ * \brief represents Face status
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
  */
 class FaceStatus : public FaceFlagsTraits<FaceStatus>
 {
diff --git a/src/management/nfd-fib-entry.hpp b/src/management/nfd-fib-entry.hpp
index eaa372c..74a2b5e 100644
--- a/src/management/nfd-fib-entry.hpp
+++ b/src/management/nfd-fib-entry.hpp
@@ -27,6 +27,9 @@
 //                    FaceId
 //                    Cost
 
+/**
+ * @ingroup management
+ */
 class NextHopRecord
 {
 public:
@@ -171,6 +174,9 @@
 //                    Name
 //                    NextHopRecord*
 
+/**
+ * @ingroup management
+ */
 class FibEntry
 {
 public:
diff --git a/src/management/nfd-forwarder-status.hpp b/src/management/nfd-forwarder-status.hpp
index 43e6150..db0bdbe 100644
--- a/src/management/nfd-forwarder-status.hpp
+++ b/src/management/nfd-forwarder-status.hpp
@@ -22,8 +22,10 @@
 namespace ndn {
 namespace nfd {
 
-/** \brief represents NFD Forwarder Status
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
+/**
+ * \ingroup management
+ * \brief represents NFD Forwarder Status
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
  */
 class ForwarderStatus
 {
diff --git a/src/management/nfd-local-control-header.hpp b/src/management/nfd-local-control-header.hpp
index e6fae95..fc73b50 100644
--- a/src/management/nfd-local-control-header.hpp
+++ b/src/management/nfd-local-control-header.hpp
@@ -19,6 +19,11 @@
 namespace ndn {
 namespace nfd {
 
+/**
+ * @ingroup management
+ * @brief Class to handle work with LocalControlHeader
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/LocalControlHeader
+ */
 class LocalControlHeader
 {
 public:
diff --git a/src/management/nfd-strategy-choice.hpp b/src/management/nfd-strategy-choice.hpp
new file mode 100644
index 0000000..3f9fa8c
--- /dev/null
+++ b/src/management/nfd-strategy-choice.hpp
@@ -0,0 +1,165 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (c) 2013-2014,  Regents of the University of California.
+ * All rights reserved.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ *
+ * This file licensed under New BSD License.  See COPYING for detailed information about
+ * ndn-cxx library copyright, permissions, and redistribution restrictions.
+ */
+
+#ifndef NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
+#define NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
+
+#include "../encoding/tlv-nfd.hpp"
+#include "../encoding/encoding-buffer.hpp"
+#include "../encoding/block-helpers.hpp"
+#include "../name.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * @ingroup management
+ * @brief represents NFD StrategyChoice dataset
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
+ */
+class StrategyChoice
+{
+public:
+  class Error : public Tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : Tlv::Error(what)
+    {
+    }
+  };
+
+  StrategyChoice()
+  {
+  }
+
+  explicit
+  StrategyChoice(const Block& payload)
+  {
+    this->wireDecode(payload);
+  }
+
+  template<bool T>
+  size_t
+  wireEncode(EncodingImpl<T>& encoder) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  const Name&
+  getName() const
+  {
+    return m_name;
+  }
+
+  StrategyChoice&
+  setName(const Name& name)
+  {
+    m_wire.reset();
+    m_name = name;
+    return *this;
+  }
+
+  const Name&
+  getStrategy() const
+  {
+    return m_strategy;
+  }
+
+  StrategyChoice&
+  setStrategy(const Name& strategy)
+  {
+    m_wire.reset();
+    m_strategy = strategy;
+    return *this;
+  }
+
+private:
+  Name m_name; // namespace
+  Name m_strategy; // strategy for the namespace
+
+  mutable Block m_wire;
+};
+
+
+template<bool T>
+inline size_t
+StrategyChoice::wireEncode(EncodingImpl<T>& encoder) const
+{
+  size_t totalLength = 0;
+
+  totalLength += prependNestedBlock(encoder, tlv::nfd::Strategy, m_strategy);
+  totalLength += m_name.wireEncode(encoder);
+
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(tlv::nfd::StrategyChoice);
+  return totalLength;
+}
+
+inline const Block&
+StrategyChoice::wireEncode() const
+{
+  if (m_wire.hasWire())
+    return m_wire;
+
+  EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+  return m_wire;
+}
+
+inline void
+StrategyChoice::wireDecode(const Block& block)
+{
+  if (block.type() != tlv::nfd::StrategyChoice) {
+    throw Error("expecting StrategyChoice block");
+  }
+  m_wire = block;
+  m_wire.parse();
+  Block::element_const_iterator val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == Tlv::Name) {
+    m_name.wireDecode(*val);
+    ++val;
+  }
+  else {
+    throw Error("missing required Name field");
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::Strategy) {
+    val->parse();
+    if (val->elements().empty()) {
+      throw Error("expecting Strategy/Name");
+    }
+    else {
+      m_strategy.wireDecode(*val->elements_begin());
+    }
+    ++val;
+  }
+  else {
+    throw Error("missing required Strategy field");
+  }
+}
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
