diff --git a/ndn-cxx/encoding/tlv-nfd.hpp b/ndn-cxx/encoding/tlv-nfd.hpp
index 3048b73..1c30ab4 100644
--- a/ndn-cxx/encoding/tlv-nfd.hpp
+++ b/ndn-cxx/encoding/tlv-nfd.hpp
@@ -94,7 +94,6 @@
   // FIB Management
   FibEntry      = 128,
   NextHopRecord = 129,
-  EndpointId    = 113,
 
   // Strategy Choice Management
   StrategyChoice = 128,
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.cpp b/ndn-cxx/mgmt/nfd/fib-entry.cpp
index 6fcb8e5..94154e3 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.cpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.cpp
@@ -53,22 +53,6 @@
 }
 
 NextHopRecord&
-NextHopRecord::setEndpointId(uint64_t endpointId)
-{
-  m_endpointId = endpointId;
-  m_wire.reset();
-  return *this;
-}
-
-NextHopRecord&
-NextHopRecord::unsetEndpointId()
-{
-  m_endpointId = nullopt;
-  m_wire.reset();
-  return *this;
-}
-
-NextHopRecord&
 NextHopRecord::setCost(uint64_t cost)
 {
   m_cost = cost;
@@ -82,9 +66,6 @@
 {
   size_t totalLength = 0;
 
-  if (m_endpointId) {
-    totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::EndpointId, *m_endpointId);
-  }
   totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::Cost, m_cost);
   totalLength += prependNonNegativeIntegerBlock(block, ndn::tlv::nfd::FaceId, m_faceId);
 
@@ -139,38 +120,22 @@
   }
   m_cost = readNonNegativeInteger(*val);
   ++val;
-
-  if (val != m_wire.elements_end() && val->type() == tlv::nfd::EndpointId) {
-    m_endpointId = readNonNegativeInteger(*val);
-    ++val;
-  }
-  else {
-    m_endpointId = nullopt;
-  }
 }
 
 bool
 operator==(const NextHopRecord& a, const NextHopRecord& b)
 {
   return a.getFaceId() == b.getFaceId() &&
-      a.hasEndpointId() == b.hasEndpointId() &&
-      (!a.hasEndpointId() || a.getEndpointId() == b.getEndpointId()) &&
       a.getCost() == b.getCost();
 }
 
 std::ostream&
 operator<<(std::ostream& os, const NextHopRecord& nh)
 {
-  os << "NextHopRecord("
-     << "FaceId: " << nh.getFaceId() << ", ";
-
-  if (nh.hasEndpointId()) {
-    os << "EndpointId: " << nh.getEndpointId() << ", ";
-  }
-
-  os << "Cost: " << nh.getCost();
-
-  return os << ")";
+  return os << "NextHopRecord("
+            << "FaceId: " << nh.getFaceId() << ", "
+            << "Cost: " << nh.getCost()
+            << ")";
 }
 
 ////////////////////
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.hpp b/ndn-cxx/mgmt/nfd/fib-entry.hpp
index 72a79dc..74dd611 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.hpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.hpp
@@ -54,25 +54,6 @@
   NextHopRecord&
   setFaceId(uint64_t faceId);
 
-  bool
-  hasEndpointId() const
-  {
-    return m_endpointId.has_value();
-  }
-
-  uint64_t
-  getEndpointId() const
-  {
-    BOOST_ASSERT(hasEndpointId());
-    return *m_endpointId;
-  }
-
-  NextHopRecord&
-  setEndpointId(uint64_t endpointId);
-
-  NextHopRecord&
-  unsetEndpointId();
-
   uint64_t
   getCost() const
   {
@@ -94,7 +75,6 @@
 
 private:
   uint64_t m_faceId;
-  optional<uint64_t> m_endpointId;
   uint64_t m_cost;
 
   mutable Block m_wire;
diff --git a/tests/unit/mgmt/nfd/fib-entry.t.cpp b/tests/unit/mgmt/nfd/fib-entry.t.cpp
index b199ba9..ff5d21b 100644
--- a/tests/unit/mgmt/nfd/fib-entry.t.cpp
+++ b/tests/unit/mgmt/nfd/fib-entry.t.cpp
@@ -39,10 +39,8 @@
   for (size_t i = 1; i < 4; i++) {
     nexthops.push_back(NextHopRecord()
                        .setFaceId(i * 10)
-                       .setEndpointId(i * 10 + 1)
                        .setCost(i * 100 + 100));
   }
-  nexthops.front().unsetEndpointId();
 
   return FibEntry()
       .setPrefix("/this/is/a/test")
@@ -53,15 +51,13 @@
 {
   NextHopRecord record1;
   record1.setFaceId(10)
-      .setEndpointId(7)
       .setCost(200);
   const Block& wire = record1.wireEncode();
 
   static const uint8_t expected[] = {
-    0x81, 0x09, // NextHopRecord
+    0x81, 0x06, // NextHopRecord
           0x69, 0x01, 0x0a, // FaceId
           0x6a, 0x01, 0xc8, // Cost
-          0x71, 0x01, 0x07 // EndpointId
   };
   BOOST_CHECK_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
                                 wire.begin(), wire.end());
@@ -79,20 +75,12 @@
   record2 = record1;
   BOOST_CHECK_EQUAL(record1, record2);
 
-  record1.setEndpointId(7);
-  record2.setEndpointId(7);
-  BOOST_CHECK_EQUAL(record1, record2);
-
   record2.setFaceId(42);
   BOOST_CHECK_NE(record1, record2);
 
   record2 = record1;
   record2.setCost(42);
   BOOST_CHECK_NE(record1, record2);
-
-  record2 = record1;
-  record2.setEndpointId(42);
-  BOOST_CHECK_NE(record1, record2);
 }
 
 BOOST_AUTO_TEST_CASE(FibEntryNoNextHopsEncode)
@@ -119,34 +107,30 @@
   FibEntry entry1 = makeFibEntry();
   NextHopRecord oneMore;
   oneMore.setFaceId(40);
-  oneMore.setEndpointId(8);
   oneMore.setCost(500);
   entry1.addNextHopRecord(oneMore);
   const Block& wire = entry1.wireEncode();
 
-static const uint8_t expected[] = {
-     0x80, 0x41, // FibEntry
-           0x07, 0x13, // Name
-                 0x08, 0x04, 0x74, 0x68, 0x69, 0x73, // GenericNameComponent
-                 0x08, 0x02, 0x69, 0x73, // GenericNameComponent
-                 0x08, 0x01, 0x61, // GenericNameComponent
-                 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, // GenericNameComponent
-           0x81, 0x06, // NextHopRecord
-                 0x69, 0x01, 0x0a, // FaceId
-                 0x6a, 0x01, 0xc8, // Cost
-           0x81, 0x0a, // NextHopRecord
-                 0x69, 0x01, 0x14, // FaceId
-                 0x6a, 0x02, 0x01, 0x2c, // Cost
-                 0x71, 0x01, 0x15, // EndpointId
-           0x81, 0x0a, // NextHopRecord
-                 0x69, 0x01, 0x1e, // FaceId
-                 0x6a, 0x02, 0x01, 0x90, // Cost
-                 0x71, 0x01, 0x1f, // EndpointId
-           0x81, 0x0a, // NextHopRecord
-                 0x69, 0x01, 0x28, // FaceId
-                 0x6a, 0x02, 0x01, 0xf4, // Cost
-                 0x71, 0x01, 0x08 // EndpointId
-   };
+  static const uint8_t expected[] = {
+    0x80, 0x38, // FibEntry
+          0x07, 0x13, // Name
+                0x08, 0x04, 0x74, 0x68, 0x69, 0x73, // GenericNameComponent
+                0x08, 0x02, 0x69, 0x73, // GenericNameComponent
+                0x08, 0x01, 0x61, // GenericNameComponent
+                0x08, 0x04, 0x74, 0x65, 0x73, 0x74, // GenericNameComponent
+          0x81, 0x06, // NextHopRecord
+                0x69, 0x01, 0x0a, // FaceId
+                0x6a, 0x01, 0xc8, // Cost
+          0x81, 0x07, // NextHopRecord
+                0x69, 0x01, 0x14, // FaceId
+                0x6a, 0x02, 0x01, 0x2c, // Cost
+          0x81, 0x07, // NextHopRecord
+                0x69, 0x01, 0x1e, // FaceId
+                0x6a, 0x02, 0x01, 0x90, // Cost
+          0x81, 0x07, // NextHopRecord
+                0x69, 0x01, 0x28, // FaceId
+                0x6a, 0x02, 0x01, 0xf4, // Cost
+  };
   BOOST_CHECK_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
                                 wire.begin(), wire.end());
 
@@ -175,7 +159,6 @@
   entry2 = entry1;
   auto nh1 = NextHopRecord()
              .setFaceId(1)
-             .setEndpointId(7)
              .setCost(1000);
   entry1.addNextHopRecord(nh1);
   BOOST_CHECK_NE(entry1, entry2);
@@ -183,7 +166,6 @@
 
   auto nh42 = NextHopRecord()
               .setFaceId(42)
-              .setEndpointId(22)
               .setCost(42);
   entry1.addNextHopRecord(nh42);
   entry2.addNextHopRecord(nh42)
@@ -216,8 +198,8 @@
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(entry),
                     "FibEntry(Prefix: /this/is/a/test,\n"
                     "         NextHops: [NextHopRecord(FaceId: 10, Cost: 200),\n"
-                    "                    NextHopRecord(FaceId: 20, EndpointId: 21, Cost: 300),\n"
-                    "                    NextHopRecord(FaceId: 30, EndpointId: 31, Cost: 400)]\n"
+                    "                    NextHopRecord(FaceId: 20, Cost: 300),\n"
+                    "                    NextHopRecord(FaceId: 30, Cost: 400)]\n"
                     "         )");
 }
 
