diff --git a/src/encoding/tlv-nfd.hpp b/src/encoding/tlv-nfd.hpp
index 6888526..b72b731 100644
--- a/src/encoding/tlv-nfd.hpp
+++ b/src/encoding/tlv-nfd.hpp
@@ -16,6 +16,7 @@
 namespace tlv {
 namespace nfd {
 
+// NFD Management protocol
 enum {
   // ControlParameters
   ControlParameters   = 104,
@@ -25,30 +26,11 @@
   Cost                = 106,
   Strategy            = 107,
 
-  // (deprecated)
-  FibManagementOptions  = ControlParameters,
-  FaceManagementOptions = ControlParameters,
-  StrategyChoiceOptions = ControlParameters,
-
   // ControlResponse
   ControlResponse = 101,
   StatusCode      = 102,
   StatusText      = 103,
 
-  // FIB Enumeration Protocol
-  FibEntry        = 128,
-  NextHopRecord   = 129,
-
-  // Face Status Protocol
-  FaceStatus                   = 128,
-  TotalIncomingInterestCounter = 145,
-  TotalIncomingDataCounter     = 144,
-  TotalOutgoingInterestCounter = 146,
-  TotalOutgoingDataCounter     = 147,
-  FaceEventNotification        = 192,
-  FaceEventKind                = 193,
-  FaceFlags                    = 194,
-
   // ForwarderStatus
   NfdVersion           = 128,
   StartTimestamp       = 129,
@@ -61,7 +43,18 @@
   NInInterests         = 144,
   NInDatas             = 145,
   NOutInterests        = 146,
-  NOutDatas            = 147
+  NOutDatas            = 147,
+
+  // Face Management
+  FaceStatus            = 128,
+  LocalUri              = 129,
+  FaceFlags             = 194,
+  FaceEventNotification = 192,
+  FaceEventKind         = 193,
+
+  // FIB Management
+  FibEntry      = 128,
+  NextHopRecord = 129
 };
 
 enum {
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index 168daec..c1cb438 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -226,6 +226,27 @@
 
 class FaceLocalControlCommand : public ControlCommand
 {
+public:
+  virtual void
+  validateRequest(const ControlParameters& parameters) const
+  {
+    this->ControlCommand::validateRequest(parameters);
+
+    switch (parameters.getLocalControlFeature()) {
+      case LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID:
+      case LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID:
+        break;
+      default:
+        throw ArgumentError("LocalControlFeature is invalid");
+    }
+  }
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const
+  {
+    this->validateRequest(parameters);
+  }
+
 protected:
   explicit
   FaceLocalControlCommand(const std::string& verb)
diff --git a/src/management/nfd-face-event-notification.hpp b/src/management/nfd-face-event-notification.hpp
index 494475e..53640c8 100644
--- a/src/management/nfd-face-event-notification.hpp
+++ b/src/management/nfd-face-event-notification.hpp
@@ -1,48 +1,80 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /**
- * Copyright (C) 2014 Named Data Networking Project
+ * Copyright (C) 2013 Regents of the University of California.
  * See COPYING for copyright and distribution information.
  */
 
 #ifndef NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
 #define NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
 
-#include "../encoding/encoding-buffer.hpp"
+// This include must be kept as the first one, to ensure nfd-face-flags.hpp compiles on its own.
+#include "nfd-face-flags.hpp"
+
 #include "../encoding/tlv-nfd.hpp"
+#include "../encoding/encoding-buffer.hpp"
 
 namespace ndn {
 namespace nfd {
 
-enum FaceEventKind
-  {
-    FACE_EVENT_CREATED = 1,
-    FACE_EVENT_DESTROYED = 2
-  };
+enum FaceEventKind {
+  FACE_EVENT_CREATED = 1,
+  FACE_EVENT_DESTROYED = 2
+};
 
-enum FaceFlags
-  {
-    FACE_IS_LOCAL = 1,
-    FACE_IS_ON_DEMAND = 2
-    // FACE_? = 4
-    // FACE_? = 8
-  };
-
-class FaceEventNotification
+/** \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>
 {
 public:
   class Error : public Tlv::Error
   {
   public:
-    Error(const std::string& what) : Tlv::Error(what) { }
+    explicit
+    Error(const std::string& what)
+      : Tlv::Error(what)
+    {
+    }
   };
 
-  FaceEventNotification(FaceEventKind eventKind,
-                        uint64_t faceId,
-                        const std::string& uri,
-                        uint64_t flags);
+  FaceEventNotification();
 
   explicit
-  FaceEventNotification(const Block& block);
+  FaceEventNotification(const Block& block)
+  {
+    this->wireDecode(block);
+  }
+
+  /** \brief prepend FaceEventNotification to the encoder
+   */
+  template<bool T>
+  size_t
+  wireEncode(EncodingImpl<T>& encoder) const;
+
+  /** \brief encode FaceEventNotification
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode FaceEventNotification
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  FaceEventKind
+  getKind() const
+  {
+    return m_kind;
+  }
+
+  FaceEventNotification&
+  setKind(FaceEventKind kind)
+  {
+    m_wire.reset();
+    m_kind = kind;
+    return *this;
+  }
 
   uint64_t
   getFaceId() const
@@ -50,16 +82,40 @@
     return m_faceId;
   }
 
-  const std::string&
-  getUri() const
+  FaceEventNotification&
+  setFaceId(uint64_t faceId)
   {
-    return m_uri;
+    m_wire.reset();
+    m_faceId = faceId;
+    return *this;
   }
 
-  FaceEventKind
-  getEventKind() const
+  const std::string&
+  getRemoteUri() const
   {
-    return m_kind;
+    return m_remoteUri;
+  }
+
+  FaceEventNotification&
+  setRemoteUri(const std::string& remoteUri)
+  {
+    m_wire.reset();
+    m_remoteUri = remoteUri;
+    return *this;
+  }
+
+  const std::string&
+  getLocalUri() const
+  {
+    return m_localUri;
+  }
+
+  FaceEventNotification&
+  setLocalUri(const std::string& localUri)
+  {
+    m_wire.reset();
+    m_localUri = localUri;
+    return *this;
   }
 
   uint64_t
@@ -68,88 +124,94 @@
     return m_flags;
   }
 
-  bool
-  isLocal() const
+  FaceEventNotification&
+  setFlags(uint64_t flags)
   {
-    return m_flags & FACE_IS_LOCAL;
+    m_wire.reset();
+    m_flags = flags;
+    return *this;
   }
 
-  bool
-  isOnDemand() const
+public: // deprecated
+  /** \deprecated use default constructor and setters
+   */
+  FaceEventNotification(FaceEventKind kind,
+                        uint64_t faceId,
+                        const std::string& uri,
+                        uint64_t flags);
+
+  /** \deprecated
+   */
+  FaceEventKind
+  getEventKind() const
   {
-    return m_flags & FACE_IS_ON_DEMAND;
+    return this->getKind();
   }
 
-  template<bool T>
-  size_t
-  wireEncode(EncodingImpl<T>& buffer) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
+  /** \deprecated
+   */
+  const std::string&
+  getUri() const
+  {
+    return this->getRemoteUri();
+  }
 
 private:
   FaceEventKind m_kind;
   uint64_t m_faceId;
-  std::string m_uri;
+  std::string m_remoteUri;
+  std::string m_localUri;
   uint64_t m_flags;
 
   mutable Block m_wire;
 };
 
 inline
-FaceEventNotification::FaceEventNotification(FaceEventKind eventKind,
-                                             uint64_t faceId,
-                                             const std::string& uri,
-                                             uint64_t flags)
-  : m_kind(eventKind)
-  , m_faceId(faceId)
-  , m_uri(uri)
-  , m_flags(flags)
+FaceEventNotification::FaceEventNotification()
+  : m_kind(static_cast<FaceEventKind>(0))
+  , m_faceId(0)
+  , m_flags(0)
 {
 }
 
 inline
-FaceEventNotification::FaceEventNotification(const Block& block)
+FaceEventNotification::FaceEventNotification(FaceEventKind kind,
+                                             uint64_t faceId,
+                                             const std::string& uri,
+                                             uint64_t flags)
 {
-  wireDecode(block);
+  (*this).setKind(kind)
+         .setFaceId(faceId)
+         .setRemoteUri(uri)
+         .setFlags(flags);
 }
 
 template<bool T>
-size_t
-FaceEventNotification::wireEncode(EncodingImpl<T>& buffer) const
+inline size_t
+FaceEventNotification::wireEncode(EncodingImpl<T>& encoder) const
 {
   size_t totalLength = 0;
 
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::FaceFlags,
-                                                m_flags);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::FaceFlags, m_flags);
+  totalLength += prependByteArrayBlock(encoder, tlv::nfd::LocalUri,
+                 reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
+  totalLength += prependByteArrayBlock(encoder, tlv::nfd::Uri,
+                 reinterpret_cast<const uint8_t*>(m_remoteUri.c_str()), m_remoteUri.size());
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::FaceId, m_faceId);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::FaceEventKind, m_kind);
 
-  totalLength += prependByteArrayBlock(buffer,
-                                       tlv::nfd::Uri,
-                                       reinterpret_cast<const uint8_t*>(m_uri.c_str()),
-                                       m_uri.size());
-
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::FaceId,
-                                                m_faceId);
-
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::FaceEventKind,
-                                                static_cast<uint32_t>(m_kind));
-
-  totalLength += buffer.prependVarNumber(totalLength);
-  totalLength += buffer.prependVarNumber(tlv::nfd::FaceEventNotification);
-
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(tlv::nfd::FaceEventNotification);
   return totalLength;
 }
 
 inline const Block&
 FaceEventNotification::wireEncode() const
 {
-  if (m_wire.hasWire ())
+  if (m_wire.hasWire())
     return m_wire;
 
   EncodingEstimator estimator;
@@ -163,67 +225,76 @@
 }
 
 inline void
-FaceEventNotification::wireDecode (const Block &wire)
+FaceEventNotification::wireDecode(const Block& block)
 {
-  m_wire = wire;
-
-  if (m_wire.type() != tlv::nfd::FaceEventNotification)
-    throw Error("Requested decoding of FaceEventNotification, but Block is of different type");
-
+  if (block.type() != tlv::nfd::FaceEventNotification) {
+    throw Error("expecting FaceEventNotification block");
+  }
+  m_wire = block;
   m_wire.parse();
-
-  // FaceKind
   Block::element_const_iterator val = m_wire.elements_begin();
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::FaceEventKind)
-    throw Error("Missing required Uri block");
-  m_kind = static_cast<FaceEventKind>(readNonNegativeInteger(*val));
 
-  // FaceID
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::FaceId)
-    throw Error("Missing required FaceId block");
-  m_faceId = readNonNegativeInteger(*val);
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceEventKind) {
+    m_kind = static_cast<FaceEventKind>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required FaceEventKind field");
+  }
 
-  // URI
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::Uri)
-    throw Error("Missing required Uri block");
-  m_uri = std::string(reinterpret_cast<const char*>(val->value()), val->value_size());
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
+    m_faceId = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required FaceId field");
+  }
 
-  // FaceFlags
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::FaceFlags)
-    throw Error("Missing required FaceFlags block");
-  m_flags = readNonNegativeInteger(*val);
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) {
+    m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+    ++val;
+  }
+  else {
+    throw Error("missing required Uri field");
+  }
+
+  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");
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceFlags) {
+    m_flags = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required FaceFlags field");
+  }
 }
 
 inline std::ostream&
-operator << (std::ostream& os, const FaceEventNotification& event)
+operator<<(std::ostream& os, const FaceEventNotification& notification)
 {
   os << "FaceEventNotification(";
 
-  os << "Kind: ";
-  switch (event.getEventKind())
+  switch (notification.getKind())
     {
     case FACE_EVENT_CREATED:
-      os << "created";
+      os << "Kind: created, ";
       break;
     case FACE_EVENT_DESTROYED:
-      os << "destroyed";
+      os << "Kind: destroyed, ";
       break;
     }
-  os << ", ";
 
-  // FaceID
-  os << "FaceID: " << event.getFaceId() << ", ";
-
-  // URI
-  os << "Uri: " << event.getUri() << ", ";
-
-  // Flags
-  os << "Flags: " << event.getFlags();
-
-  os << ")";
+  os << "FaceID: " << notification.getFaceId() << ", "
+     << "RemoteUri: " << notification.getRemoteUri() << ", "
+     << "LocalUri: " << notification.getLocalUri() << ", "
+     << "Flags: " << notification.getFlags()
+     << ")";
   return os;
 }
 
diff --git a/src/management/nfd-face-flags.hpp b/src/management/nfd-face-flags.hpp
new file mode 100644
index 0000000..49baac7
--- /dev/null
+++ b/src/management/nfd-face-flags.hpp
@@ -0,0 +1,53 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_MANAGEMENT_NFD_FACE_FLAGS_HPP
+#define NDN_MANAGEMENT_NFD_FACE_FLAGS_HPP
+
+namespace ndn {
+namespace nfd {
+
+/** \class FaceFlags
+ *  \brief provides additional information about a face
+ */
+enum {
+  /** \brief face is local (for scope control purpose)
+   */
+  FACE_IS_LOCAL = 1,
+  /** \brief face is created on demand (accepted incoming connection,
+   *         not initiated outgoing connection)
+   */
+  FACE_IS_ON_DEMAND = 2
+  // FACE_? = 4
+  // FACE_? = 8
+};
+
+/** \brief implements getters to each face flag
+ *
+ *  \tparam T class containing a FaceFlags field and implements
+ *            `FaceFlags getFlags() const` method
+ */
+template<typename T>
+class FaceFlagsTraits
+{
+public:
+  bool
+  isLocal() const
+  {
+    return static_cast<const T*>(this)->getFlags() & FACE_IS_LOCAL;
+  }
+
+  bool
+  isOnDemand() const
+  {
+    return static_cast<const T*>(this)->getFlags() & FACE_IS_ON_DEMAND;
+  }
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_NFD_FACE_FLAGS_HPP
diff --git a/src/management/nfd-face-status.hpp b/src/management/nfd-face-status.hpp
index f3abdb5..1c2e636 100644
--- a/src/management/nfd-face-status.hpp
+++ b/src/management/nfd-face-status.hpp
@@ -1,151 +1,290 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /**
- * Copyright (C) 2014 Named Data Networking Project
+ * Copyright (C) 2013 Regents of the University of California.
  * See COPYING for copyright and distribution information.
  */
 
 #ifndef NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
 #define NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
 
-#include "../encoding/encoding-buffer.hpp"
+// This include must be kept as the first one, to ensure nfd-face-flags.hpp compiles on its own.
+#include "nfd-face-flags.hpp"
+
 #include "../encoding/tlv-nfd.hpp"
+#include "../encoding/encoding-buffer.hpp"
 
 namespace ndn {
 namespace nfd {
 
-class FaceStatus
+/** \brief represents Face status
+ *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+ */
+class FaceStatus : public FaceFlagsTraits<FaceStatus>
 {
 public:
   class Error : public Tlv::Error
   {
   public:
-    Error(const std::string& what) : Tlv::Error(what) { }
+    explicit
+    Error(const std::string& what)
+      : Tlv::Error(what)
+    {
+    }
   };
 
-  FaceStatus(const uint64_t faceId,
-             const std::string& uri,
-             uint64_t inInterest, uint64_t inData, uint64_t outInterest, uint64_t outData);
+  FaceStatus();
 
   explicit
-  FaceStatus(const Block& block);
+  FaceStatus(const Block& block)
+  {
+    this->wireDecode(block);
+  }
 
+  /** \brief prepend FaceStatus to the encoder
+   */
+  template<bool T>
+  size_t
+  wireEncode(EncodingImpl<T>& encoder) const;
+
+  /** \brief encode FaceStatus
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode FaceStatus
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
   uint64_t
   getFaceId() const
   {
     return m_faceId;
   }
 
+  FaceStatus&
+  setFaceId(uint64_t faceId)
+  {
+    m_wire.reset();
+    m_faceId = faceId;
+    return *this;
+  }
+
+  const std::string&
+  getRemoteUri() const
+  {
+    return m_remoteUri;
+  }
+
+  FaceStatus&
+  setRemoteUri(const std::string& remoteUri)
+  {
+    m_wire.reset();
+    m_remoteUri = remoteUri;
+    return *this;
+  }
+
+  const std::string&
+  getLocalUri() const
+  {
+    return m_localUri;
+  }
+
+  FaceStatus&
+  setLocalUri(const std::string& localUri)
+  {
+    m_wire.reset();
+    m_localUri = localUri;
+    return *this;
+  }
+
+  uint64_t
+  getFlags() const
+  {
+    return m_flags;
+  }
+
+  FaceStatus&
+  setFlags(uint64_t flags)
+  {
+    m_wire.reset();
+    m_flags = flags;
+    return *this;
+  }
+
+  uint64_t
+  getNInInterests() const
+  {
+    return m_nInInterests;
+  }
+
+  FaceStatus&
+  setNInInterests(uint64_t nInInterests)
+  {
+    m_wire.reset();
+    m_nInInterests = nInInterests;
+    return *this;
+  }
+
+  uint64_t
+  getNInDatas() const
+  {
+    return m_nInDatas;
+  }
+
+  FaceStatus&
+  setNInDatas(uint64_t nInDatas)
+  {
+    m_wire.reset();
+    m_nInDatas = nInDatas;
+    return *this;
+  }
+
+  uint64_t
+  getNOutInterests() const
+  {
+    return m_nOutInterests;
+  }
+
+  FaceStatus&
+  setNOutInterests(uint64_t nOutInterests)
+  {
+    m_wire.reset();
+    m_nOutInterests = nOutInterests;
+    return *this;
+  }
+
+  uint64_t
+  getNOutDatas() const
+  {
+    return m_nOutDatas;
+  }
+
+  FaceStatus&
+  setNOutDatas(uint64_t nOutDatas)
+  {
+    m_wire.reset();
+    m_nOutDatas = nOutDatas;
+    return *this;
+  }
+
+public: // deprecated
+  /** \deprecated
+   */
+  FaceStatus(const uint64_t faceId,
+             const std::string& uri,
+             uint64_t inInterest, uint64_t inData, uint64_t outInterest, uint64_t outData);
+
+  /** \deprecated
+   */
   const std::string&
   getUri() const
   {
-    return m_uri;
+    return this->getRemoteUri();
   }
 
+  /** \deprecated
+   */
   const uint64_t
   getInInterest() const
   {
-    return m_inInterest;
+    return this->getNInInterests();
   }
 
+  /** \deprecated
+   */
   const uint64_t
   getInData() const
   {
-    return m_inData;
+    return this->getNInDatas();
   }
 
+  /** \deprecated
+   */
   const uint64_t
   getOutInterest() const
   {
-    return m_outInterest;
+    return this->getNOutInterests();
   }
 
+  /** \deprecated
+   */
   const uint64_t
   getOutData() const
   {
-    return m_outData;
+    return this->getNOutDatas();
   }
 
-  template<bool T>
-  size_t
-  wireEncode(EncodingImpl<T>& buffer) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
 private:
   uint64_t m_faceId;
-  std::string m_uri;
-  uint64_t m_inInterest;
-  uint64_t m_inData;
-  uint64_t m_outInterest;
-  uint64_t m_outData;
+  std::string m_remoteUri;
+  std::string m_localUri;
+  uint64_t m_flags;
+  uint64_t m_nInInterests;
+  uint64_t m_nInDatas;
+  uint64_t m_nOutInterests;
+  uint64_t m_nOutDatas;
 
   mutable Block m_wire;
 };
 
 inline
-FaceStatus::FaceStatus(const uint64_t faceId,
-             const std::string& uri,
-             uint64_t inInterest, uint64_t inData, uint64_t outInterest, uint64_t outData)
-  : m_faceId(faceId)
-  , m_uri(uri)
-  , m_inInterest(inInterest)
-  , m_inData(inData)
-  , m_outInterest(outInterest)
-  , m_outData(outData)
+FaceStatus::FaceStatus()
+  : m_faceId(0)
+  , m_flags(0)
+  , m_nInInterests(0)
+  , m_nInDatas(0)
+  , m_nOutInterests(0)
+  , m_nOutDatas(0)
 {
 }
 
 inline
-FaceStatus::FaceStatus(const Block& block)
+FaceStatus::FaceStatus(const uint64_t faceId,
+             const std::string& uri,
+             uint64_t inInterest, uint64_t inData, uint64_t outInterest, uint64_t outData)
 {
-  wireDecode(block);
+  (*this).setFaceId(faceId)
+         .setRemoteUri(uri)
+         .setNInInterests(inInterest)
+         .setNInDatas(inData)
+         .setNOutInterests(outInterest)
+         .setNOutDatas(outData);
 }
 
 template<bool T>
-size_t
-FaceStatus::wireEncode(EncodingImpl<T>& buffer) const
+inline size_t
+FaceStatus::wireEncode(EncodingImpl<T>& encoder) const
 {
   size_t totalLength = 0;
 
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::TotalOutgoingDataCounter,
-                                                m_outData);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NOutDatas, m_nOutDatas);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NOutInterests, m_nOutInterests);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NInDatas, m_nInDatas);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NInInterests, m_nInInterests);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::FaceFlags, m_flags);
+  totalLength += prependByteArrayBlock(encoder, tlv::nfd::LocalUri,
+                 reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
+  totalLength += prependByteArrayBlock(encoder, tlv::nfd::Uri,
+                 reinterpret_cast<const uint8_t*>(m_remoteUri.c_str()), m_remoteUri.size());
+  totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::FaceId, m_faceId);
 
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::TotalOutgoingInterestCounter,
-                                                m_outInterest);
-
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::TotalIncomingDataCounter,
-                                                m_inData);
-
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::TotalIncomingInterestCounter,
-                                                m_inInterest);
-
-  totalLength += prependByteArrayBlock(buffer,
-                                       tlv::nfd::Uri,
-                                       reinterpret_cast<const uint8_t*>(m_uri.c_str()),
-                                       m_uri.size());
-
-  totalLength += prependNonNegativeIntegerBlock(buffer,
-                                                tlv::nfd::FaceId,
-                                                m_faceId);
-
-  totalLength += buffer.prependVarNumber(totalLength);
-  totalLength += buffer.prependVarNumber(tlv::nfd::FaceStatus);
-
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(tlv::nfd::FaceStatus);
   return totalLength;
 }
 
-const Block&
+inline const Block&
 FaceStatus::wireEncode() const
 {
-  if (m_wire.hasWire ())
+  if (m_wire.hasWire())
     return m_wire;
 
   EncodingEstimator estimator;
@@ -159,71 +298,95 @@
 }
 
 inline void
-FaceStatus::wireDecode(const Block &wire)
+FaceStatus::wireDecode(const Block& block)
 {
-  m_wire = wire;
-
-  if (m_wire.type() != tlv::nfd::FaceStatus)
-    throw Error("Requested decoding of FaceStatus, but Block is of different type");
-
+  if (block.type() != tlv::nfd::FaceStatus) {
+    throw Error("expecting FaceStatus block");
+  }
+  m_wire = block;
   m_wire.parse();
-
-  // FaceKind
   Block::element_const_iterator val = m_wire.elements_begin();
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::FaceId)
-    throw Error("Missing required FaceId block");
-  m_faceId = readNonNegativeInteger(*val);
 
-  // URI
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::Uri)
-    throw Error("Missing required Uri block");
-  m_uri = std::string(reinterpret_cast<const char*>(val->value()), val->value_size());
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
+    m_faceId = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required FaceId field");
+  }
 
-  // TotalIncomingInterestCounter
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::TotalIncomingInterestCounter)
-    throw Error("Missing required FaceId block");
-  m_inInterest = readNonNegativeInteger(*val);
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) {
+    m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+    ++val;
+  }
+  else {
+    throw Error("missing required Uri field");
+  }
 
-  // TotalIncomingDataCounter
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::TotalIncomingDataCounter)
-    throw Error("Missing required FaceId block");
-  m_inData = readNonNegativeInteger(*val);
+  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");
+  }
 
-  // TotalOutgoingInterestCounter
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::TotalOutgoingInterestCounter)
-    throw Error("Missing required FaceId block");
-  m_outInterest = readNonNegativeInteger(*val);
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceFlags) {
+    m_flags = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required FaceFlags field");
+  }
 
-  // TotalOutgoingDataCounter
-  ++val;
-  if (val == m_wire.elements_end() || val->type() != tlv::nfd::TotalOutgoingDataCounter)
-    throw Error("Missing required FaceId block");
-  m_outData = readNonNegativeInteger(*val);
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInInterests) {
+    m_nInInterests = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required NInInterests field");
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInDatas) {
+    m_nInDatas = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required NInDatas field");
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) {
+    m_nOutInterests = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required NOutInterests field");
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutDatas) {
+    m_nOutDatas = static_cast<uint64_t>(readNonNegativeInteger(*val));
+    ++val;
+  }
+  else {
+    throw Error("missing required NOutDatas field");
+  }
 }
 
 inline std::ostream&
-operator << (std::ostream& os, const FaceStatus& status)
+operator<<(std::ostream& os, const FaceStatus& status)
 {
-  os << "FaceStatus(";
-
-  // FaceID
-  os << "FaceID: " << status.getFaceId() << ", ";
-
-  // URI
-  os << "Uri: " << status.getUri() << ", ";
-
-  os << "Counters: " << status.getInInterest() << "|" << status.getInData()
-     << "|" << status.getOutInterest() << "|" << status.getOutData();
-
-  os << ")";
+  os << "FaceStatus("
+     << "FaceID: " << status.getFaceId() << ", "
+     << "RemoteUri: " << status.getRemoteUri() << ", "
+     << "LocalUri: " << status.getLocalUri() << ", "
+     << "Flags: " << status.getFlags() << ", "
+     << "Counters: " << status.getNInInterests() << "|" << status.getNInDatas()
+     << "|" << status.getNOutInterests() << "|" << status.getNOutDatas()
+     << ")";
   return os;
 }
 
 } // namespace nfd
 } // namespace ndn
 
-#endif // NDN_MANAGEMENT_NFD_FACE_EVENT_STATUS_HPP
+#endif // NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
diff --git a/src/management/nfd-forwarder-status.hpp b/src/management/nfd-forwarder-status.hpp
index de8a93b..af1e05a 100644
--- a/src/management/nfd-forwarder-status.hpp
+++ b/src/management/nfd-forwarder-status.hpp
@@ -8,7 +8,6 @@
 #define NDN_MANAGEMENT_NFD_FORWARDER_STATUS_HPP
 
 #include "../encoding/tlv-nfd.hpp"
-#include "../encoding/tlv.hpp"
 #include "../encoding/encoding-buffer.hpp"
 
 namespace ndn {
@@ -260,8 +259,8 @@
   , m_nInDatas(0)
   , m_nOutInterests(0)
   , m_nOutDatas(0)
-  {
-  }
+{
+}
 
 template<bool T>
 inline size_t
@@ -318,21 +317,8 @@
 inline void
 ForwarderStatus::wireDecode(const Block& block)
 {
-  m_nfdVersion = 0;
-  m_startTimestamp = time::system_clock::TimePoint::min();
-  m_currentTimestamp = time::system_clock::TimePoint::min();
-  m_nNameTreeEntries = 0;
-  m_nFibEntries = 0;
-  m_nPitEntries = 0;
-  m_nMeasurementsEntries = 0;
-  m_nCsEntries = 0;
-  m_nInInterests = 0;
-  m_nInDatas = 0;
-  m_nOutInterests = 0;
-  m_nOutDatas = 0;
-
   if (block.type() != Tlv::Content) {
-    throw Error("Requested decoding of Status Payload, but block is not Content");
+    throw Error("expecting Content block for Status payload");
   }
   m_wire = block;
   m_wire.parse();
diff --git a/tests/management/nfd-control-command.cpp b/tests/management/nfd-control-command.cpp
index eeb18ed..5cf1910 100644
--- a/tests/management/nfd-control-command.cpp
+++ b/tests/management/nfd-control-command.cpp
@@ -73,6 +73,11 @@
     .setFaceId(9);
   BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
   BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
+
+  ControlParameters p3;
+  p3.setLocalControlFeature(static_cast<LocalControlFeature>(666));
+  BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
+  BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
 }
 
 BOOST_AUTO_TEST_CASE(FaceDisableLocalControl)
@@ -90,6 +95,11 @@
     .setFaceId(9);
   BOOST_CHECK_THROW(command.validateRequest(p2), ControlCommand::ArgumentError);
   BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError);
+
+  ControlParameters p3;
+  p3.setLocalControlFeature(static_cast<LocalControlFeature>(666));
+  BOOST_CHECK_THROW(command.validateRequest(p3), ControlCommand::ArgumentError);
+  BOOST_CHECK_THROW(command.validateResponse(p3), ControlCommand::ArgumentError);
 }
 
 BOOST_AUTO_TEST_CASE(FibAddNextHop)
diff --git a/tests/management/nfd-face-event-notification.cpp b/tests/management/nfd-face-event-notification.cpp
new file mode 100644
index 0000000..76be7c4
--- /dev/null
+++ b/tests/management/nfd-face-event-notification.cpp
@@ -0,0 +1,128 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "management/nfd-face-event-notification.hpp"
+
+#include <boost/test/unit_test.hpp>
+
+namespace ndn {
+namespace nfd {
+
+BOOST_AUTO_TEST_SUITE(NfdFaceEventNotification)
+
+BOOST_AUTO_TEST_CASE(Flags)
+{
+  FaceEventNotification notification;
+
+  notification.setFlags(0);
+  BOOST_CHECK_EQUAL(notification.isLocal(), false);
+  BOOST_CHECK_EQUAL(notification.isOnDemand(), false);
+
+  notification.setFlags(FACE_IS_LOCAL);
+  BOOST_CHECK_EQUAL(notification.isLocal(), true);
+  BOOST_CHECK_EQUAL(notification.isOnDemand(), false);
+
+  notification.setFlags(FACE_IS_ON_DEMAND);
+  BOOST_CHECK_EQUAL(notification.isLocal(), false);
+  BOOST_CHECK_EQUAL(notification.isOnDemand(), true);
+
+  notification.setFlags(FACE_IS_LOCAL | FACE_IS_ON_DEMAND);
+  BOOST_CHECK_EQUAL(notification.isLocal(), true);
+  BOOST_CHECK_EQUAL(notification.isOnDemand(), true);
+}
+
+BOOST_AUTO_TEST_CASE(EncodeCreated)
+{
+  FaceEventNotification notification1;
+  notification1.setKind(FACE_EVENT_CREATED)
+               .setFaceId(20)
+               .setRemoteUri("tcp4://192.0.2.1:55555")
+               .setLocalUri("tcp4://192.0.2.2:6363")
+               .setFlags(FACE_IS_ON_DEMAND);
+  Block wire;
+  BOOST_REQUIRE_NO_THROW(wire = notification1.wireEncode());
+
+  // These octets are obtained by the snippet below.
+  // This check is intended to detect unexpected encoding change in the future.
+  //for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
+  //  printf("0x%02x, ", *it);
+  //}
+  static const uint8_t expected[] = {
+    0xc0, 0x38, 0xc1, 0x01, 0x01, 0x69, 0x01, 0x14, 0x72, 0x16, 0x74, 0x63,
+    0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32,
+    0x2e, 0x31, 0x3a, 0x35, 0x35, 0x35, 0x35, 0x35, 0x81, 0x15, 0x74, 0x63,
+    0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32,
+    0x2e, 0x32, 0x3a, 0x36, 0x33, 0x36, 0x33, 0xc2, 0x01, 0x02,
+  };
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
+                                  wire.begin(), wire.end());
+
+  BOOST_REQUIRE_NO_THROW(FaceEventNotification(wire));
+  FaceEventNotification notification2(wire);
+  BOOST_CHECK_EQUAL(notification1.getKind(), notification2.getKind());
+  BOOST_CHECK_EQUAL(notification1.getFaceId(), notification2.getFaceId());
+  BOOST_CHECK_EQUAL(notification1.getRemoteUri(), notification2.getRemoteUri());
+  BOOST_CHECK_EQUAL(notification1.getLocalUri(), notification2.getLocalUri());
+  BOOST_CHECK_EQUAL(notification1.getFlags(), notification2.getFlags());
+
+  std::ostringstream os;
+  os << notification2;
+  BOOST_CHECK_EQUAL(os.str(), "FaceEventNotification("
+                              "Kind: created, "
+                              "FaceID: 20, "
+                              "RemoteUri: tcp4://192.0.2.1:55555, "
+                              "LocalUri: tcp4://192.0.2.2:6363, "
+                              "Flags: 2)");
+}
+
+BOOST_AUTO_TEST_CASE(EncodeDestroyed)
+{
+  FaceEventNotification notification1;
+  notification1.setKind(FACE_EVENT_DESTROYED)
+               .setFaceId(20)
+               .setRemoteUri("tcp4://192.0.2.1:55555")
+               .setLocalUri("tcp4://192.0.2.2:6363")
+               .setFlags(FACE_IS_ON_DEMAND);
+  Block wire;
+  BOOST_REQUIRE_NO_THROW(wire = notification1.wireEncode());
+
+  // These octets are obtained by the snippet below.
+  // This check is intended to detect unexpected encoding change in the future.
+  //for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
+  //  printf("0x%02x, ", *it);
+  //}
+  static const uint8_t expected[] = {
+    0xc0, 0x38, 0xc1, 0x01, 0x02, 0x69, 0x01, 0x14, 0x72, 0x16, 0x74, 0x63,
+    0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32,
+    0x2e, 0x31, 0x3a, 0x35, 0x35, 0x35, 0x35, 0x35, 0x81, 0x15, 0x74, 0x63,
+    0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32,
+    0x2e, 0x32, 0x3a, 0x36, 0x33, 0x36, 0x33, 0xc2, 0x01, 0x02,
+  };
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
+                                  wire.begin(), wire.end());
+
+  BOOST_REQUIRE_NO_THROW(FaceEventNotification(wire));
+  FaceEventNotification notification2(wire);
+  BOOST_CHECK_EQUAL(notification1.getKind(), notification2.getKind());
+  BOOST_CHECK_EQUAL(notification1.getFaceId(), notification2.getFaceId());
+  BOOST_CHECK_EQUAL(notification1.getRemoteUri(), notification2.getRemoteUri());
+  BOOST_CHECK_EQUAL(notification1.getLocalUri(), notification2.getLocalUri());
+  BOOST_CHECK_EQUAL(notification1.getFlags(), notification2.getFlags());
+
+  std::ostringstream os;
+  os << notification2;
+  BOOST_CHECK_EQUAL(os.str(), "FaceEventNotification("
+                              "Kind: destroyed, "
+                              "FaceID: 20, "
+                              "RemoteUri: tcp4://192.0.2.1:55555, "
+                              "LocalUri: tcp4://192.0.2.2:6363, "
+                              "Flags: 2)");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace nfd
+} // namespace ndn
diff --git a/tests/management/nfd-face-status.cpp b/tests/management/nfd-face-status.cpp
new file mode 100644
index 0000000..08b5fb0
--- /dev/null
+++ b/tests/management/nfd-face-status.cpp
@@ -0,0 +1,70 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "management/nfd-face-status.hpp"
+
+#include <boost/test/unit_test.hpp>
+
+namespace ndn {
+namespace nfd {
+
+BOOST_AUTO_TEST_SUITE(NfdFaceStatus)
+
+BOOST_AUTO_TEST_CASE(Encode)
+{
+  FaceStatus status1;
+  status1.setFaceId(100)
+         .setRemoteUri("tcp4://192.0.2.1:6363")
+         .setLocalUri("tcp4://192.0.2.2:55555")
+         .setFlags(FACE_IS_ON_DEMAND)
+         .setNInInterests(10)
+         .setNInDatas(200)
+         .setNOutInterests(3000)
+         .setNOutDatas(4);
+
+  Block wire;
+  BOOST_REQUIRE_NO_THROW(wire = status1.wireEncode());
+
+  // These octets are obtained by the snippet below.
+  // This check is intended to detect unexpected encoding change in the future.
+  //for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
+  //  printf("0x%02x, ", *it);
+  //}
+  static const uint8_t expected[] = {
+    0x80, 0x42, 0x69, 0x01, 0x64, 0x72, 0x15, 0x74, 0x63, 0x70, 0x34, 0x3a,
+    0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32, 0x2e, 0x31, 0x3a,
+    0x36, 0x33, 0x36, 0x33, 0x81, 0x16, 0x74, 0x63, 0x70, 0x34, 0x3a, 0x2f,
+    0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e, 0x32, 0x2e, 0x32, 0x3a, 0x35,
+    0x35, 0x35, 0x35, 0x35, 0xc2, 0x01, 0x02, 0x90, 0x01, 0x0a, 0x91, 0x01,
+    0xc8, 0x92, 0x02, 0x0b, 0xb8, 0x93, 0x01, 0x04
+  };
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
+                                  wire.begin(), wire.end());
+
+  BOOST_REQUIRE_NO_THROW(FaceStatus(wire));
+  FaceStatus status2(wire);
+  BOOST_CHECK_EQUAL(status1.getFaceId(), status2.getFaceId());
+  BOOST_CHECK_EQUAL(status1.getRemoteUri(), status2.getRemoteUri());
+  BOOST_CHECK_EQUAL(status1.getLocalUri(), status2.getLocalUri());
+  BOOST_CHECK_EQUAL(status1.getFlags(), status2.getFlags());
+  BOOST_CHECK_EQUAL(status1.getNInInterests(), status2.getNInInterests());
+  BOOST_CHECK_EQUAL(status1.getNInDatas(), status2.getNInDatas());
+  BOOST_CHECK_EQUAL(status1.getNOutInterests(), status2.getNOutInterests());
+  BOOST_CHECK_EQUAL(status1.getNOutDatas(), status2.getNOutDatas());
+
+  std::ostringstream os;
+  os << status2;
+  BOOST_CHECK_EQUAL(os.str(), "FaceStatus(FaceID: 100, "
+                              "RemoteUri: tcp4://192.0.2.1:6363, "
+                              "LocalUri: tcp4://192.0.2.2:55555, "
+                              "Flags: 2, "
+                              "Counters: 10|200|3000|4)");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace nfd
+} // namespace ndn
diff --git a/tests/management/nfd-forwarder-status.cpp b/tests/management/nfd-forwarder-status.cpp
index 123459e..d881ad1 100644
--- a/tests/management/nfd-forwarder-status.cpp
+++ b/tests/management/nfd-forwarder-status.cpp
@@ -5,7 +5,6 @@
  */
 
 #include "management/nfd-forwarder-status.hpp"
-// Having a separate compilation unit is necessary to ensure .hpp can compile on its own.
 #include "data.hpp"
 
 #include <boost/test/unit_test.hpp>
@@ -31,13 +30,12 @@
   status1.setNOutInterests(952144445);
   status1.setNOutDatas(138198826);
 
-  EncodingBuffer buffer;
-  status1.wireEncode(buffer);
-  Block wire = buffer.block();
+  Block wire;
+  BOOST_REQUIRE_NO_THROW(wire = status1.wireEncode());
 
   // These octets are obtained by the snippet below.
   // This check is intended to detect unexpected encoding change in the future.
-  //for (Buffer::iterator it = buffer.begin(); it != buffer.end(); ++it) {
+  //for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
   //  printf("0x%02x, ", *it);
   //}
   static const uint8_t expected[] = {
@@ -55,6 +53,7 @@
   Data data;
   data.setContent(wire);
 
+  BOOST_REQUIRE_NO_THROW(ForwarderStatus(data.getContent()));
   ForwarderStatus status2(data.getContent());
   BOOST_CHECK_EQUAL(status1.getNfdVersion(), status2.getNfdVersion());
   BOOST_CHECK_EQUAL(status1.getStartTimestamp(), status2.getStartTimestamp());
diff --git a/tests/management/test-nfd-control.cpp b/tests/management/test-nfd-control.cpp
index 6e3de4d..68eece2 100644
--- a/tests/management/test-nfd-control.cpp
+++ b/tests/management/test-nfd-control.cpp
@@ -7,8 +7,6 @@
 #include "management/nfd-control-response.hpp"
 #include "management/nfd-fib-management-options.hpp"
 #include "management/nfd-face-management-options.hpp"
-#include "management/nfd-face-event-notification.hpp"
-#include "management/nfd-face-status.hpp"
 
 #include <boost/test/unit_test.hpp>
 #include <boost/test/output_test_stream.hpp>
@@ -41,19 +39,6 @@
   0x6c, 0x6f, 0x2f, 0x77, 0x6f, 0x72, 0x6c, 0x64
 };
 
-const uint8_t TestFaceEventNotification[] = {
-  0xc0, 0x20, 0xc1, 0x01, 0x01, 0x69, 0x01, 0x64, 0x72, 0x15, 0x74, 0x63,
-  0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30,
-  0x2e, 0x31, 0x3a, 0x36, 0x33, 0x36, 0x33, 0xc2, 0x01, 0x03
-};
-
-const uint8_t TestFaceStatus[] = {
-  0x80, 0x27, 0x69, 0x01, 0x64, 0x72, 0x15, 0x74, 0x63, 0x70, 0x34, 0x3a,
-  0x2f, 0x2f, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a,
-  0x36, 0x33, 0x36, 0x33, 0x91, 0x01, 0x0a, 0x90, 0x01, 0x14, 0x92, 0x01,
-  0x1e, 0x93, 0x02, 0x01, 0x90
-};
-
 // ControlResponse
 
 BOOST_AUTO_TEST_CASE(ControlResponseEncode)
@@ -161,71 +146,6 @@
 }
 
 
-BOOST_AUTO_TEST_CASE(FaceEventNotificationEncodingDecoding)
-{
-  FaceEventKind expectedKind = FACE_EVENT_CREATED;
-  std::string expectedUri("tcp4://127.0.0.1:6363");
-  uint64_t expectedFaceId = 100;
-  uint64_t expectedFlags = 3;
-
-  {
-    FaceEventNotification faceEvent(expectedKind, expectedFaceId, expectedUri, expectedFlags);
-    BOOST_REQUIRE_NO_THROW(faceEvent.wireEncode());
-
-    BOOST_REQUIRE_EQUAL_COLLECTIONS(TestFaceEventNotification,
-                                    TestFaceEventNotification + sizeof(TestFaceEventNotification),
-                                    faceEvent.wireEncode().begin(), faceEvent.wireEncode().end());
-
-    std::ostringstream os;
-    os << faceEvent;
-    BOOST_CHECK_EQUAL(os.str(), "FaceEventNotification(Kind: created, FaceID: 100, Uri: tcp4://127.0.0.1:6363, Flags: 3)");
-  }
-
-  {
-    Block blk(TestFaceEventNotification, sizeof(TestFaceEventNotification));
-    FaceEventNotification faceEvent(blk);
-
-    BOOST_CHECK_EQUAL(faceEvent.getEventKind(), expectedKind);
-    BOOST_CHECK_EQUAL(faceEvent.getFaceId(), expectedFaceId);
-    BOOST_CHECK_EQUAL(faceEvent.getUri(), expectedUri);
-    BOOST_CHECK_EQUAL(faceEvent.getFlags(), expectedFlags);
-    BOOST_CHECK(faceEvent.isLocal());
-    BOOST_CHECK(faceEvent.isOnDemand());
-  }
-}
-
-BOOST_AUTO_TEST_CASE(FaceStatusEncodingDecoding)
-{
-  {
-    FaceStatus faceStatus(100, "tcp4://127.0.0.1:6363", 10, 20, 30, 400);
-    BOOST_REQUIRE_NO_THROW(faceStatus.wireEncode());
-
-    BOOST_CHECK_EQUAL_COLLECTIONS(TestFaceStatus,
-                                  TestFaceStatus + sizeof(TestFaceStatus),
-                                  faceStatus.wireEncode().begin(), faceStatus.wireEncode().end());
-
-    std::ostringstream os;
-    os << faceStatus;
-    BOOST_CHECK_EQUAL(os.str(), "FaceStatus(FaceID: 100, Uri: tcp4://127.0.0.1:6363, "
-                      "Counters: 10|20|30|400)");
-  }
-
-  {
-    Block block(TestFaceStatus, sizeof(TestFaceStatus));
-    BOOST_REQUIRE_NO_THROW((FaceStatus(block)));
-
-    FaceStatus faceStatus(block);
-
-    BOOST_CHECK_EQUAL(faceStatus.getFaceId(), 100);
-    BOOST_CHECK_EQUAL(faceStatus.getUri(), "tcp4://127.0.0.1:6363");
-
-    BOOST_CHECK_EQUAL(faceStatus.getInInterest(),  10);
-    BOOST_CHECK_EQUAL(faceStatus.getInData(),      20);
-    BOOST_CHECK_EQUAL(faceStatus.getOutInterest(), 30);
-    BOOST_CHECK_EQUAL(faceStatus.getOutData(),     400);
-  }
-}
-
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace nfd
