diff --git a/src/management/fib-management-options.hpp b/src/management/fib-management-options.hpp
new file mode 100644
index 0000000..db3f765
--- /dev/null
+++ b/src/management/fib-management-options.hpp
@@ -0,0 +1,140 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ *
+ * @author: Wentao Shang <wentao@cs.ucla.edu>
+ *
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_FIB_MANAGEMENT_HPP
+#define NDN_FIB_MANAGEMENT_HPP
+
+#include "encoding/block.hpp"
+#include "encoding/tlv-nfd-control.hpp"
+#include "name.hpp"
+
+namespace ndn {
+
+class FibManagementOptions {
+public:
+  FibManagementOptions ()
+    : faceId_ (-1)
+    , cost_ (-1)
+  {
+  }
+  
+  const Name& 
+  getName () const { return name_; }
+  
+  void
+  setName (const Name &name) { name_ = name; wire_.reset (); }
+  
+  int 
+  getFaceId () const { return faceId_; }
+
+  void 
+  setFaceId (int faceId) { faceId_ = faceId; wire_.reset (); }
+
+  int 
+  getCost () const { return cost_; }
+
+  void 
+  setCost (int cost) { cost_ = cost; wire_.reset (); }
+
+  inline const Block&
+  wireEncode () const;
+  
+  inline void 
+  wireDecode (const Block &wire);
+  
+private:
+  Name name_;
+  int faceId_;
+  int cost_;
+  //Name strategy_;
+  //TODO: implement strategy after its use is properly defined
+
+  mutable Block wire_;
+};
+
+inline const Block&
+FibManagementOptions::wireEncode () const
+{
+  if (wire_.hasWire ())
+    return wire_;
+  
+  wire_ = Block (tlv::nfd_control::FibManagementOptions);
+
+  // Name
+  wire_.push_back (name_.wireEncode ());
+  
+  // FaceId
+  if (faceId_ != -1)
+    wire_.push_back (nonNegativeIntegerBlock (tlv::nfd_control::FaceId, faceId_));
+
+  // Cost
+  if (cost_ != -1)
+    wire_.push_back (nonNegativeIntegerBlock (tlv::nfd_control::Cost, cost_));
+
+  //TODO: Strategy
+  
+  wire_.encode ();
+  return wire_;
+}
+  
+inline void 
+FibManagementOptions::wireDecode (const Block &wire)
+{
+  name_.clear ();
+  faceId_ = -1;
+  cost_ = -1;
+
+  wire_ = wire;
+  wire_.parse ();
+
+  // Name
+  Block::element_iterator val = wire_.find(Tlv::Name);
+  if (val != wire_.getAll().end())
+    {
+      name_.wireDecode(*val);
+    }
+
+  // FaceID
+  val = wire_.find(tlv::nfd_control::FaceId);
+  if (val != wire_.getAll().end())
+    {
+      faceId_ = readNonNegativeInteger(*val);
+    }
+
+  // Cost
+  val = wire_.find(tlv::nfd_control::Cost);
+  if (val != wire_.getAll().end())
+    {
+      cost_ = readNonNegativeInteger(*val);
+    }
+
+  //TODO: Strategy
+}
+
+inline std::ostream&
+operator << (std::ostream &os, const FibManagementOptions &option)
+{
+  os << "ForwardingEntry(";
+  
+  // Name
+  os << "Prefix: " << option.getName () << ", ";
+
+  // FaceID
+  os << "FaceID: " << option.getFaceId () << ", ";
+
+  // Cost
+  os << "Cost: " << option.getCost ();
+
+  os << ")";
+  return os;
+}
+
+}
+
+#endif
diff --git a/tests/test-nfd-control.cpp b/tests/test-nfd-control.cpp
index 8e282a0..ae898f7 100644
--- a/tests/test-nfd-control.cpp
+++ b/tests/test-nfd-control.cpp
@@ -4,10 +4,10 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include <boost/test/unit_test.hpp>
-
 #include "management/control-response.hpp"
+#include "management/fib-management-options.hpp"
 
+#include <boost/test/unit_test.hpp>
 #include <boost/test/output_test_stream.hpp>
 
 using namespace std;
@@ -18,6 +18,14 @@
 
 const uint8_t TestControlResponse[] = {0x65, 0x17, 0x66, 0x02, 0x01, 0x94, 0x67, 0x11, 0x4e, 0x6f, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64};
 
+const uint8_t TestFibManagementOptions[] = {
+  0x68, 0x1e, 0x03, 0x16, 0x04, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68,
+  0x6f, 0x73, 0x74, 0x04, 0x03, 0x72, 0x65, 0x67, 0x04, 0x04, 0x74, 0x65,
+  0x73, 0x74, 0x69, 0x01, 0x00, 0x6a, 0x01, 0x00
+};
+
+// ControlResponse
+
 BOOST_AUTO_TEST_CASE (ControlResponseEncode)
 {
   ndn::ControlResponse controlResponse(404, "Nothing not found");
@@ -37,6 +45,38 @@
   BOOST_REQUIRE_EQUAL(controlResponse.getText(), "Nothing not found");
 }
 
+// FibManagementOptions
+
+BOOST_AUTO_TEST_CASE (FibManagementOptionsEncoding)
+{
+  Name n ("/localhost/reg/test");
+  FibManagementOptions opt;
+
+  opt.setName (n);
+  opt.setFaceId (0);
+  opt.setCost (0);
+
+  const ndn::Block& blk = opt.wireEncode ();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS (TestFibManagementOptions,
+                                   TestFibManagementOptions + sizeof (TestFibManagementOptions),
+                                   blk.begin (), blk.end ());
+}
+
+BOOST_AUTO_TEST_CASE (FibManagementOptionsDecoding)
+{
+  Block blk (TestFibManagementOptions, sizeof (TestFibManagementOptions));
+  Name n ("/localhost/reg/test");
+  FibManagementOptions opt;
+
+  BOOST_REQUIRE_NO_THROW (opt.wireDecode (blk));
+  
+  BOOST_CHECK_EQUAL (opt.getName (), n);
+  BOOST_CHECK_EQUAL (opt.getFaceId (), 0);
+  BOOST_CHECK_EQUAL (opt.getCost (), 0);
+}
+
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace ndn
