diff --git a/src/encoding/tlv-nfd.hpp b/src/encoding/tlv-nfd.hpp
index ad86636..ec315d6 100644
--- a/src/encoding/tlv-nfd.hpp
+++ b/src/encoding/tlv-nfd.hpp
@@ -54,13 +54,18 @@
   // Face Management
   FaceStatus            = 128,
   LocalUri              = 129,
+  ChannelStatus         = 130,
   FaceFlags             = 194,
   FaceEventNotification = 192,
   FaceEventKind         = 193,
 
   // FIB Management
   FibEntry      = 128,
-  NextHopRecord = 129
+  NextHopRecord = 129,
+
+  // Strategy Choice Management
+  StrategyChoice = 128
+
 };
 
 enum {
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
