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
