diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 9e85d4a..fae92d5 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,11 +16,11 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "adjacent.hpp"
 #include "logger.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 178ae78..a540a5c 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -1,7 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
  * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
  *
  * This file is part of NLSR (Named-data Link State Routing).
  * See AUTHORS.md for complete list of NLSR authors and contributors.
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 9dd2659..99bdeac 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "sync-logic-handler.hpp"
 #include "common.hpp"
@@ -28,9 +28,6 @@
 
 namespace nlsr {
 
-const std::string NLSR_COMPONENT = "nlsr";
-const std::string LSA_COMPONENT = "LSA";
-
 INIT_LOGGER(SyncLogicHandler);
 
 SyncLogicHandler::SyncLogicHandler(ndn::Face& face, const IsLsaNew& isLsaNew,
@@ -49,12 +46,11 @@
   m_coorLsaUserPrefix = ndn::Name(m_confParam.getSyncUserPrefix())
                          .append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE));
 
-  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF ||
-      m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
+  if (m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_ON) {
     m_syncLogic.addUserNode(m_adjLsaUserPrefix);
   }
-  else if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON ||
-           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
+
+  if (m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
     m_syncLogic.addUserNode(m_coorLsaUserPrefix);
   }
 }
@@ -64,8 +60,8 @@
 {
   NLSR_LOG_DEBUG("Update Name: " << updateName << " Seq no: " << highSeq);
 
-  int32_t nlsrPosition = util::getNameComponentPosition(updateName, nlsr::NLSR_COMPONENT);
-  int32_t lsaPosition = util::getNameComponentPosition(updateName, nlsr::LSA_COMPONENT);
+  int32_t nlsrPosition = util::getNameComponentPosition(updateName, NLSR_COMPONENT);
+  int32_t lsaPosition = util::getNameComponentPosition(updateName, LSA_COMPONENT);
 
   if (nlsrPosition < 0 || lsaPosition < 0) {
     NLSR_LOG_WARN("Received malformed sync update");
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 47f6c9a..7deb06a 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_SYNC_LOGIC_HANDLER_HPP
 #define NLSR_SYNC_LOGIC_HANDLER_HPP
@@ -114,8 +114,8 @@
   SyncProtocolAdapter m_syncLogic;
 
 private:
-  static const std::string NLSR_COMPONENT;
-  static const std::string LSA_COMPONENT;
+  const std::string NLSR_COMPONENT = "nlsr";
+  const std::string LSA_COMPONENT = "LSA";
 };
 
 } // namespace nlsr
diff --git a/src/conf-file-processor.hpp b/src/conf-file-processor.hpp
index e33b50b..f7270ba 100644
--- a/src/conf-file-processor.hpp
+++ b/src/conf-file-processor.hpp
@@ -1,7 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
  *
  * This file is part of NLSR (Named-data Link State Routing).
  * See AUTHORS.md for complete list of NLSR authors and contributors.
@@ -16,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_CONF_FILE_PROCESSOR_HPP
 #define NLSR_CONF_FILE_PROCESSOR_HPP
@@ -39,12 +40,7 @@
  * set all the parameters in NLSR to the received values. There are
  * defaults for any unconfigured settings.
  *
- * This is currently called by the wrapper class NlsrRunner to
- * populate the NLSR object with its configuration before NLSR is
- * started.
- *
  * \sa nlsr::ConfParameter
- * \sa NlsrRunner::run
  */
 class ConfFileProcessor
 {
diff --git a/src/lsa/adj-lsa.cpp b/src/lsa/adj-lsa.cpp
index e2d0a2b..e7dbf95 100644
--- a/src/lsa/adj-lsa.cpp
+++ b/src/lsa/adj-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "adj-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
@@ -141,4 +141,4 @@
   return os;
 }
 
-} // namespace nlsr
\ No newline at end of file
+} // namespace nlsr
diff --git a/src/lsa/coordinate-lsa.cpp b/src/lsa/coordinate-lsa.cpp
index a73ab76..b195e39 100644
--- a/src/lsa/coordinate-lsa.cpp
+++ b/src/lsa/coordinate-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "coordinate-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 #include <boost/lexical_cast.hpp>
 
@@ -156,4 +156,4 @@
   return os;
 }
 
-} // namespace nlsr
\ No newline at end of file
+} // namespace nlsr
diff --git a/src/lsa/lsa.cpp b/src/lsa/lsa.cpp
index c0d6435..73ddbe7 100644
--- a/src/lsa/lsa.cpp
+++ b/src/lsa/lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,13 +17,13 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "lsa.hpp"
 #include "nlsr.hpp"
 #include "name-prefix-list.hpp"
 #include "adjacent.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/lsa/name-lsa.cpp b/src/lsa/name-lsa.cpp
index 37b7408..f73014b 100644
--- a/src/lsa/name-lsa.cpp
+++ b/src/lsa/name-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "name-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index e3fe9d3..9913751 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "lsdb.hpp"
 
@@ -368,9 +368,9 @@
 void
 Lsdb::writeNameLsdbLog()
 {
-  NLSR_LOG_DEBUG("---------------Name LSDB-------------------");
+  NLSR_LOG_TRACE("---------------Name LSDB-------------------");
   for (const auto& nlsa : m_nameLsdb) {
-    NLSR_LOG_DEBUG(nlsa);
+    NLSR_LOG_TRACE(nlsa);
   }
 }
 
@@ -1247,9 +1247,9 @@
     return;
   }
 
-  NLSR_LOG_DEBUG("---------------Adj LSDB-------------------");
+  NLSR_LOG_TRACE("---------------Adj LSDB-------------------");
   for (const auto& adj : m_adjLsdb) {
-    NLSR_LOG_DEBUG(adj);
+    NLSR_LOG_TRACE(adj);
   }
 }
 
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 73a1ac5..b2c6118 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -42,16 +42,14 @@
 Nlsr::Nlsr(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
   , m_scheduler(face.getIoService())
-  , m_keyChain(keyChain)
   , m_confParam(confParam)
   , m_adjacencyList(confParam.getAdjacencyList())
   , m_namePrefixList(confParam.getNamePrefixList())
-  , m_validator(m_confParam.getValidator())
-  , m_fib(m_face, m_scheduler, m_adjacencyList, m_confParam, m_keyChain)
+  , m_fib(m_face, m_scheduler, m_adjacencyList, m_confParam, keyChain)
   , m_routingTable(m_scheduler, m_fib, m_lsdb, m_namePrefixTable, m_confParam)
   , m_namePrefixTable(m_fib, m_routingTable, m_routingTable.afterRoutingChange)
-  , m_lsdb(m_face, m_keyChain, m_confParam, m_namePrefixTable, m_routingTable)
-  , m_helloProtocol(m_face, m_keyChain, confParam, m_routingTable, m_lsdb)
+  , m_lsdb(m_face, keyChain, m_confParam, m_namePrefixTable, m_routingTable)
+  , m_helloProtocol(m_face, keyChain, confParam, m_routingTable, m_lsdb)
   , m_onNewLsaConnection(m_lsdb.getSync().onNewLsa->connect(
       [this] (const ndn::Name& updateName, uint64_t sequenceNumber,
               const ndn::Name& originRouter) {
@@ -69,10 +67,10 @@
                                ndn::time::milliseconds::max(), ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
         }
       }))
-  , m_dispatcher(m_face, m_keyChain)
+  , m_dispatcher(m_face, keyChain)
   , m_datasetHandler(m_dispatcher, m_lsdb, m_routingTable)
-  , m_controller(m_face, m_keyChain)
-  , m_faceDatasetController(m_face, m_keyChain)
+  , m_controller(m_face, keyChain)
+  , m_faceDatasetController(m_face, keyChain)
   , m_prefixUpdateProcessor(m_dispatcher,
       m_confParam.getPrefixUpdateValidator(),
       m_namePrefixList,
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 02e3625..9d7f032 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -61,8 +61,6 @@
 
 namespace nlsr {
 
-static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast");
-
 class Nlsr
 {
 public:
@@ -208,12 +206,9 @@
 private:
   ndn::Face& m_face;
   ndn::Scheduler m_scheduler;
-  ndn::security::KeyChain& m_keyChain;
   ConfParameter& m_confParam;
   AdjacencyList& m_adjacencyList;
   NamePrefixList& m_namePrefixList;
-  bool m_isDaemonProcess;
-  ndn::security::ValidatorConfig& m_validator;
   std::vector<ndn::Name> m_strategySetOnRouters;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
@@ -248,8 +243,6 @@
 
 private:
   ndn::nfd::FaceMonitor m_faceMonitor;
-
-  friend class NlsrRunner;
 };
 
 } // namespace nlsr
diff --git a/src/publisher/dataset-interest-handler.cpp b/src/publisher/dataset-interest-handler.cpp
index a574622..24c6e1a 100644
--- a/src/publisher/dataset-interest-handler.cpp
+++ b/src/publisher/dataset-interest-handler.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "dataset-interest-handler.hpp"
 #include "nlsr.hpp"
@@ -40,8 +40,7 @@
                                                const RoutingTable& rt)
   : m_dispatcher(dispatcher)
   , m_lsdb(lsdb)
-  , m_routingTableEntries(rt.getRoutingTableEntry())
-  , m_dryRoutingTableEntries(rt.getDryRoutingTableEntry())
+  , m_routingTable(rt)
 {
   setDispatcher(m_dispatcher);
 }
@@ -93,51 +92,12 @@
   context.end();
 }
 
-
-std::vector<tlv::RoutingTable>
-DatasetInterestHandler::getTlvRTEntries()
-{
-  std::vector<tlv::RoutingTable> rtable;
-  for (const auto& rte : m_routingTableEntries) {
-    tlv::RoutingTable tlvRoutingTable;
-    std::shared_ptr<tlv::Destination> tlvDes = tlv::makeDes(rte);
-    tlvRoutingTable.setDestination(*tlvDes);
-    for (const auto& nh : rte.getNexthopList().getNextHops()) {
-      tlv::NextHop tlvNexthop;
-      tlvNexthop.setUri(nh.getConnectingFaceUri());
-      tlvNexthop.setCost(nh.getRouteCost());
-      tlvRoutingTable.addNexthops(tlvNexthop);
-    }
-    rtable.push_back(tlvRoutingTable);
-  }
-  if (!m_dryRoutingTableEntries.empty()) {
-    for (const auto& dryRte : m_dryRoutingTableEntries) {
-      tlv::RoutingTable tlvRoutingTable;
-      std::shared_ptr<tlv::Destination> tlvDes = tlv::makeDes(dryRte);
-      tlvRoutingTable.setDestination(*tlvDes);
-      for (const auto& nh : dryRte.getNexthopList().getNextHops()) {
-        tlv::NextHop tlvNexthop;
-        tlvNexthop.setUri(nh.getConnectingFaceUri());
-        tlvNexthop.setCost(nh.getRouteCost());
-        tlvRoutingTable.addNexthops(tlvNexthop);
-      }
-      rtable.push_back(tlvRoutingTable);
-    }
-  }
-  return rtable;
-}
-
 void
 DatasetInterestHandler::publishRtStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                         ndn::mgmt::StatusDatasetContext& context)
 {
-  NLSR_LOG_DEBUG("Received interest:  " << interest);
-  tlv::RoutingTableStatus rtStatus;
-  for (const tlv::RoutingTable& rt : getTlvRTEntries()) {
-    rtStatus.addRoutingTable(rt);
-  }
-  const ndn::Block& wire = rtStatus.wireEncode();
-  context.append(wire);
+  NLSR_LOG_DEBUG("Received interest: " << interest);
+  context.append(m_routingTable.wireEncode());
   context.end();
 }
 
diff --git a/src/publisher/dataset-interest-handler.hpp b/src/publisher/dataset-interest-handler.hpp
index 28a6c4c..b39ac25 100644
--- a/src/publisher/dataset-interest-handler.hpp
+++ b/src/publisher/dataset-interest-handler.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
  /*! \file dataset-interest-handler.hpp
 
@@ -37,9 +37,6 @@
 #include "lsdb.hpp"
 #include "logger.hpp"
 
-#include "tlv/routing-table-status.hpp"
-#include "tlv/routing-table-entry.hpp"
-
 #include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <ndn-cxx/face.hpp>
 #include <boost/noncopyable.hpp>
@@ -79,11 +76,6 @@
   void
   setDispatcher(ndn::mgmt::Dispatcher& dispatcher);
 
-  /*! \brief generate a TLV-format of routing table entry
-   */
-  std::vector<tlv::RoutingTable>
-  getTlvRTEntries();
-
   /*! \brief provide routing-table dataset
   */
   void
@@ -111,9 +103,7 @@
 private:
   ndn::mgmt::Dispatcher& m_dispatcher;
   const Lsdb& m_lsdb;
-
-  const std::list<RoutingTableEntry>& m_routingTableEntries;
-  const std::list<RoutingTableEntry>& m_dryRoutingTableEntries;
+  const RoutingTable& m_routingTable;
 };
 
 } // namespace nlsr
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index 0091245..bc11634 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "fib-entry.hpp"
 #include "logger.hpp"
@@ -30,7 +30,7 @@
 {
   NLSR_LOG_DEBUG("Name Prefix: " << m_name);
   NLSR_LOG_DEBUG("Seq No: " << m_seqNo);
-  m_nexthopList.writeLog();
+  NLSR_LOG_DEBUG(m_nexthopList);
 }
 
 } // namespace nlsr
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 3e4ef68..27891eb 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -87,9 +87,6 @@
    * strictly necessary, because eventually those prefix registrations
    * will expire, but cleaning up after ourselves improves
    * performance.
-   *
-   * \sa NlsrRunner::run
-   *
    */
   void
   clean();
@@ -212,8 +209,6 @@
    * an entry is removed. Typically this happens when NLSR is
    * terminated or crashes, and we don't want the scheduler to crash
    * because it's referencing memory that has no valid function.
-   *
-   * \sa NlsrRunner::run
    */
   void
   cancelEntryRefresh(const FibEntry& entry);
diff --git a/src/route/map-entry.hpp b/src/route/map-entry.hpp
deleted file mode 100644
index e4c998c..0000000
--- a/src/route/map-entry.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- **/
-
-#ifndef NLSR_MAP_ENTRY_HPP
-#define NLSR_MAP_ENTRY_HPP
-
-#include <boost/cstdint.hpp>
-#include <ndn-cxx/name.hpp>
-
-namespace nlsr {
-
-class MapEntry
-{
-public:
-  MapEntry()
-    : m_router()
-    , m_mappingNumber(-1)
-  {
-  }
-
-  ~MapEntry()
-  {
-  }
-
-  MapEntry(const ndn::Name& rtr, int32_t mn)
-  {
-    m_router = rtr;
-    m_mappingNumber = mn;
-  }
-
-  const ndn::Name&
-  getRouter() const
-  {
-    return m_router;
-  }
-
-  int32_t
-  getMappingNumber() const
-  {
-    return m_mappingNumber;
-  }
-
-  void
-  reset();
-
-private:
-  ndn::Name m_router;
-  int32_t m_mappingNumber;
-};
-
-} // namespace nlsr
-
-#endif // NLSR_MAP_ENTRY_HPP
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 3f6513c..0aab84f 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "map.hpp"
 #include "nlsr.hpp"
@@ -32,7 +32,7 @@
 void
 Map::addEntry(const ndn::Name& rtrName)
 {
-  MapEntry me(rtrName, m_mappingIndex);
+  MapEntry me {rtrName, m_mappingIndex};
   if (addEntry(me)) {
     m_mappingIndex++;
   }
@@ -48,43 +48,25 @@
 Map::getRouterNameByMappingNo(int32_t mn) const
 {
   auto&& mappingNumberView = m_entries.get<detail::byMappingNumber>();
-  auto iterator = mappingNumberView.find(mn);
-  if (iterator == mappingNumberView.end()) {
-    return {};
-  }
-  else {
-    return {iterator->getRouter()};
-  }
+  auto it = mappingNumberView.find(mn);
+  return it == mappingNumberView.end() ? ndn::nullopt : ndn::optional<ndn::Name>(it->router);
 }
 
 ndn::optional<int32_t>
 Map::getMappingNoByRouterName(const ndn::Name& rName)
 {
   auto&& routerNameView = m_entries.get<detail::byRouterName>();
-  auto iterator = routerNameView.find(rName);
-  if (iterator == routerNameView.end()) {
-    return {};
-  }
-  else {
-    return {iterator->getMappingNumber()};
-  }
-}
-
-void
-Map::reset()
-{
-  m_entries = detail::entryContainer{};
-  m_mappingIndex = 0;
+  auto it = routerNameView.find(rName);
+  return it == routerNameView.end() ? ndn::nullopt : ndn::optional<int32_t>(it->mappingNumber);
 }
 
 void
 Map::writeLog()
 {
   NLSR_LOG_DEBUG("---------------Map----------------------");
-  auto&& routerNameView = m_entries.get<detail::byRouterName>();
-  for (auto entry = routerNameView.begin(); entry != routerNameView.end(); entry++) {
-    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry->getRouter() << " Mapping No: "
-               << entry->getMappingNumber() << " )");
+  for (const auto& entry : m_entries.get<detail::byRouterName>()) {
+    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry.router << " Mapping No: " <<
+                    entry.mappingNumber << " )");
   }
 }
 
diff --git a/src/route/map.hpp b/src/route/map.hpp
index c9511bf..ae92d25 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,24 +16,25 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_MAP_HPP
 #define NLSR_MAP_HPP
 
 #include "common.hpp"
-#include "map-entry.hpp"
-
-#include <list>
-#include <boost/cstdint.hpp>
 
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/hashed_index.hpp>
-#include <boost/multi_index/mem_fun.hpp>
+#include <boost/multi_index/member.hpp>
 #include <boost/multi_index/tag.hpp>
 
 namespace nlsr {
 
+struct MapEntry {
+  ndn::Name router;
+  int32_t mappingNumber = -1;
+};
+
 namespace detail {
 
   using namespace boost::multi_index;
@@ -44,10 +45,10 @@
     MapEntry,
     indexed_by<
       hashed_unique<tag<byRouterName>,
-                    const_mem_fun<MapEntry, const ndn::Name&, &MapEntry::getRouter>,
+                    member<MapEntry, ndn::Name, &MapEntry::router>,
                     std::hash<ndn::Name>>,
       hashed_unique<tag<byMappingNumber>,
-                    const_mem_fun<MapEntry, int32_t, &MapEntry::getMappingNumber>>
+                    member<MapEntry, int32_t, &MapEntry::mappingNumber>>
       >
     >;
 
@@ -107,9 +108,6 @@
   ndn::optional<int32_t>
   getMappingNoByRouterName(const ndn::Name& rName);
 
-  void
-  reset();
-
   size_t
   getMapSize() const
   {
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 9890101..368cc08 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "name-prefix-table-entry.hpp"
 
@@ -32,7 +32,7 @@
 void
 NamePrefixTableEntry::generateNhlfromRteList()
 {
-  m_nexthopList.reset();
+  m_nexthopList.clear();
   for (auto iterator = m_rteList.begin(); iterator != m_rteList.end(); ++iterator) {
     for (auto nhItr = (*iterator)->getNexthopList().getNextHops().begin();
          nhItr != (*iterator)->getNexthopList().getNextHops().end();
@@ -76,18 +76,6 @@
   // be updated there.
 }
 
-void
-NamePrefixTableEntry::writeLog()
-{
-  NLSR_LOG_DEBUG("Name: " << m_namePrefix);
-  for (auto it = m_rteList.begin(); it != m_rteList.end(); ++it) {
-    NLSR_LOG_DEBUG("Destination: " << (*it)->getDestination());
-    NLSR_LOG_DEBUG("Nexthops: ");
-    (*it)->getNexthopList().writeLog();
-  }
-  m_nexthopList.writeLog();
-}
-
 bool
 operator==(const NamePrefixTableEntry& lhs, const NamePrefixTableEntry& rhs)
 {
@@ -104,8 +92,10 @@
 operator<<(std::ostream& os, const NamePrefixTableEntry& entry)
 {
   os << "Name: " << entry.getNamePrefix() << "\n";
+
   for (const auto& entryPtr : entry.getRteList()) {
-    os << "Destination: " << entryPtr->getDestination() << "\n";
+    os << "  Destination: " << entryPtr->getDestination() << "\n";
+    os << entryPtr->getNexthopList();
   }
   return os;
 }
diff --git a/src/route/name-prefix-table-entry.hpp b/src/route/name-prefix-table-entry.hpp
index 828d64a..c298e97 100644
--- a/src/route/name-prefix-table-entry.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -17,13 +17,12 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
 #define NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
 
 #include "routing-table-pool-entry.hpp"
-
 #include "test-access-control.hpp"
 
 #include <list>
@@ -64,7 +63,7 @@
   {
     if (m_rteList.size() > 0) {
       for (auto it = m_rteList.begin(); it != m_rteList.end(); ++it) {
-        (*it)->getNexthopList().reset();
+        (*it)->getNexthopList().clear();
       }
     }
   }
@@ -112,7 +111,6 @@
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   std::list<std::shared_ptr<RoutingTablePoolEntry>> m_rteList;
   NexthopList m_nexthopList;
-
 };
 
 bool
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index b38bbea..55f0c54 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "name-prefix-table.hpp"
 
@@ -228,7 +228,7 @@
     }
     else if (sourceEntry == entries.end()) {
       NLSR_LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " now has no next-hops.");
-      poolEntry->getNexthopList().reset();
+      poolEntry->getNexthopList().clear();
       for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
         auto nameEntryFullPtr = nameEntry.second.lock();
         addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination());
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 8b9366e..7ab1352 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -17,17 +17,16 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "nexthop-list.hpp"
 #include "common.hpp"
 #include "nexthop.hpp"
-#include "logger.hpp"
+
+#include <ndn-cxx/util/ostream-joiner.hpp>
 
 namespace nlsr {
 
-INIT_LOGGER(route.NexthopList);
-
 static bool
 nexthopAddCompare(const NextHop& nh1, const NextHop& nh2)
 {
@@ -71,21 +70,16 @@
 std::ostream&
 operator<<(std::ostream& os, const NexthopList& nhl)
 {
-  NexthopList& ucnhl = const_cast<NexthopList&>(nhl);
-  os << "NexthopList(\nNext hops: ";
-  for (auto&& nh : ucnhl.getNextHops()) {
-    os << nh;
-  }
-  os << ")";
+  os << "    ";
+  std::copy(nhl.cbegin(), nhl.cend(), ndn::make_ostream_joiner(os, "\n    "));
   return os;
 }
 
 void
 NexthopList::addNextHop(const NextHop& nh)
 {
-  std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
-                                                 m_nexthopList.end(),
-                                                 std::bind(&nexthopAddCompare, _1, nh));
+  auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
+                         std::bind(&nexthopAddCompare, _1, nh));
   if (it == m_nexthopList.end()) {
     m_nexthopList.insert(nh);
   }
@@ -98,23 +92,11 @@
 void
 NexthopList::removeNextHop(const NextHop& nh)
 {
-  std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
-                                                 m_nexthopList.end(),
-                                                 std::bind(&nexthopRemoveCompare, _1, nh));
+  auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
+                         std::bind(&nexthopRemoveCompare, _1, nh));
   if (it != m_nexthopList.end()) {
     m_nexthopList.erase(it);
   }
 }
 
-void
-NexthopList::writeLog() const
-{
-  int i = 1;
-
-  for (const auto& nexthop : m_nexthopList) {
-    NLSR_LOG_DEBUG("Nexthop " << i++ << ": " << nexthop.getConnectingFaceUri() <<
-                   " Route Cost: " << nexthop.getRouteCost());
-  }
-}
-
 } // namespace nlsr
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index e405889..537448e 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_NEXTHOP_LIST_HPP
 #define NLSR_NEXTHOP_LIST_HPP
@@ -47,13 +47,7 @@
 class NexthopList
 {
 public:
-  NexthopList()
-  {
-  }
-
-  ~NexthopList()
-  {
-  }
+  NexthopList() = default;
 
   /*! \brief Adds a next hop to the list.
     \param nh The next hop.
@@ -80,7 +74,7 @@
   }
 
   void
-  reset()
+  clear()
   {
     m_nexthopList.clear();
   }
@@ -93,6 +87,7 @@
 
   typedef std::set<NextHop, NextHopComparator>::iterator iterator;
   typedef std::set<NextHop, NextHopComparator>::const_iterator const_iterator;
+  typedef std::set<NextHop, NextHopComparator>::reverse_iterator reverse_iterator;
 
   iterator
   begin()
@@ -118,8 +113,17 @@
     return m_nexthopList.end();
   }
 
-  void
-  writeLog() const;
+  reverse_iterator
+  rbegin() const
+  {
+    return m_nexthopList.rbegin();
+  }
+
+  reverse_iterator
+  rend() const
+  {
+    return m_nexthopList.rend();
+  }
 
 private:
   std::set<NextHop, NextHopComparator> m_nexthopList;
diff --git a/src/route/nexthop.cpp b/src/route/nexthop.cpp
index 14bfb43..11399aa 100644
--- a/src/route/nexthop.cpp
+++ b/src/route/nexthop.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,29 +16,91 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- **/
+ */
 
 #include "nexthop.hpp"
+#include "tlv-nlsr.hpp"
+
+#include <ndn-cxx/encoding/block-helpers.hpp>
 
 namespace nlsr {
 
+template<ndn::encoding::Tag TAG>
+size_t
+NextHop::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::CostDouble, m_routeCost);
+  totalLength += ndn::encoding::prependStringBlock(block, ndn::tlv::nlsr::Uri, m_connectingFaceUri);
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NextHop);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
+
+const ndn::Block&
+NextHop::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+NextHop::wireDecode(const ndn::Block& wire)
+{
+  m_connectingFaceUri = "";
+  m_routeCost = 0;
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::NextHop) {
+    std::stringstream error;
+    error << "Expected NextHop Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  ndn::Block::element_const_iterator val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
+    m_connectingFaceUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("Missing required Uri field"));
+  }
+
+  m_routeCost = ndn::encoding::readDouble(*val);
+}
+
 bool
 operator==(const NextHop& lhs, const NextHop& rhs)
 {
-  return ((lhs.getRouteCostAsAdjustedInteger() == rhs.getRouteCostAsAdjustedInteger())
-          &&
-          (lhs.getConnectingFaceUri() == rhs.getConnectingFaceUri()));
+  return (lhs.getRouteCostAsAdjustedInteger() == rhs.getRouteCostAsAdjustedInteger()) &&
+         (lhs.getConnectingFaceUri() == rhs.getConnectingFaceUri());
 }
 
 std::ostream&
 operator<<(std::ostream& os, const NextHop& hop)
 {
-  os << "Nexthop("
-     << "face-uri: " << hop.getConnectingFaceUri()
-     << ", cost: " << hop.getRouteCost() << ")";
-
+  os << "NextHop(Uri: " << hop.getConnectingFaceUri() << ", Cost: " << hop.getRouteCost() << ")";
   return os;
 }
 
diff --git a/src/route/nexthop.hpp b/src/route/nexthop.hpp
index e24df7b..7f91cfe 100644
--- a/src/route/nexthop.hpp
+++ b/src/route/nexthop.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,22 +16,36 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_ROUTE_NEXTHOP_HPP
 #define NLSR_ROUTE_NEXTHOP_HPP
 
 #include "test-access-control.hpp"
 
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/encoding/encoding-buffer.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
+
 #include <iostream>
 #include <cmath>
 #include <boost/cstdint.hpp>
 
 namespace nlsr {
 
+/*! \brief Data abstraction for Nexthop
+ *
+ *   NextHop := NEXTHOP-TYPE TLV-LENGTH
+ *                Uri
+ *                Cost
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
+ */
 class NextHop
 {
 public:
+  using Error = ndn::tlv::Error;
+
   NextHop()
     : m_connectingFaceUri()
     , m_routeCost(0)
@@ -40,10 +54,15 @@
   }
 
   NextHop(const std::string& cfu, double rc)
-    : m_isHyperbolic(false)
+    : m_connectingFaceUri(cfu)
+    , m_routeCost(rc)
+    , m_isHyperbolic(false)
   {
-    m_connectingFaceUri = cfu;
-    m_routeCost = rc;
+  }
+
+  NextHop(const ndn::Block& block)
+  {
+    wireDecode(block);
   }
 
   const std::string&
@@ -96,11 +115,23 @@
     return m_isHyperbolic;
   }
 
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+  const ndn::Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const ndn::Block& wire);
+
 private:
   std::string m_connectingFaceUri;
   double m_routeCost;
   bool m_isHyperbolic;
 
+  mutable ndn::Block m_wire;
+
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /*! \brief Used to adjust floating point route costs to integers
       Since NFD uses integer route costs in the FIB, hyperbolic paths with similar route costs
@@ -115,6 +146,8 @@
   static const uint64_t HYPERBOLIC_COST_ADJUSTMENT_FACTOR = 1000;
 };
 
+NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
+
 bool
 operator==(const NextHop& lhs, const NextHop& rhs);
 
diff --git a/src/route/routing-table-entry.cpp b/src/route/routing-table-entry.cpp
index 750dc79..7320d91 100644
--- a/src/route/routing-table-entry.cpp
+++ b/src/route/routing-table-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,19 +16,96 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "routing-table-entry.hpp"
 #include "nexthop-list.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
+template<ndn::encoding::Tag TAG>
+size_t
+RoutingTableEntry::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  for (auto it = m_nexthopList.rbegin(); it != m_nexthopList.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  totalLength += m_destination.wireEncode(block);
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTableEntry);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableEntry);
+
+const ndn::Block&
+RoutingTableEntry::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+RoutingTableEntry::wireDecode(const ndn::Block& wire)
+{
+  m_nexthopList.clear();
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::RoutingTableEntry) {
+    std::stringstream error;
+    error << "Expected RoutingTable Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  auto val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == ndn::tlv::Name) {
+    m_destination.wireDecode(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("Missing required destination field"));
+  }
+
+  for (; val != m_wire.elements_end(); ++val) {
+    if (val->type() == ndn::tlv::nlsr::NextHop) {
+      m_nexthopList.addNextHop(NextHop(*val));
+    }
+    else {
+      std::stringstream error;
+      error << "Expected NextHop Block, but Block is of a different type: #"
+            << m_wire.type();
+      BOOST_THROW_EXCEPTION(Error(error.str()));
+    }
+  }
+}
+
 std::ostream&
 operator<<(std::ostream& os, const RoutingTableEntry& rte)
 {
-  os << "RoutingTableEntry("
-     << "Destination: " << rte.getDestination()
-     << "Next hop list: " << rte.getNexthopList() << ")";
+  os << "  Destination: " << rte.getDestination() << "\n"
+     << rte.getNexthopList() << "\n";
 
   return os;
 }
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index 83731b9..ffbbfac 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,27 +16,38 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- **/
+ */
 
 #ifndef NLSR_ROUTING_TABLE_ENTRY_HPP
 #define NLSR_ROUTING_TABLE_ENTRY_HPP
 
 #include "nexthop-list.hpp"
 
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/encoding/encoding-buffer.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/name.hpp>
 
 namespace nlsr {
 
+/*! \brief Data abstraction for RouteTableInfo
+ *
+ *   RoutingTableEntry := ROUTINGTABLEENTRY-TYPE TLV-LENGTH
+ *                          Name
+ *                          NexthopList*
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
+ */
 class RoutingTableEntry
 {
 public:
-  RoutingTableEntry()
-  {
-  }
+  using Error = ndn::tlv::Error;
 
-  ~RoutingTableEntry()
+  RoutingTableEntry() = default;
+
+  RoutingTableEntry(const ndn::Block& block)
   {
+    wireDecode(block);
   }
 
   RoutingTableEntry(const ndn::Name& dest)
@@ -65,15 +76,29 @@
   inline bool
   operator==(RoutingTableEntry& rhs)
   {
-    return ((*this).getDestination() == rhs.getDestination() &&
-            (*this).getNexthopList() == rhs.getNexthopList());
+    return m_destination == rhs.getDestination() &&
+           m_nexthopList == rhs.getNexthopList();
   }
 
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+  const ndn::Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const ndn::Block& wire);
+
 protected:
   ndn::Name m_destination;
   NexthopList m_nexthopList;
+
+  mutable ndn::Block m_wire;
 };
 
+NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableEntry);
+
 std::ostream&
 operator<<(std::ostream& os, const RoutingTableEntry& rte);
 
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 3fcd654..a2ec12b 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "routing-table.hpp"
 #include "nlsr.hpp"
@@ -26,6 +26,7 @@
 #include "routing-table-entry.hpp"
 #include "name-prefix-table.hpp"
 #include "logger.hpp"
+#include "tlv-nlsr.hpp"
 
 #include <list>
 #include <string>
@@ -94,24 +95,22 @@
         // Inform the NPT that updates have been made
         NLSR_LOG_DEBUG("Calling Update NPT With new Route");
         (*afterRoutingChange)(m_rTable);
-        writeLog();
+        NLSR_LOG_DEBUG(*this);
         m_namePrefixTable.writeLog();
         m_fib.writeLog();
       }
       else {
-        NLSR_LOG_DEBUG("Adjacency building is scheduled, so"
-                   " routing table can not be calculated :(");
+        NLSR_LOG_DEBUG("Adjacency building is scheduled, so routing table can not be calculated :(");
       }
     }
     else {
-      NLSR_LOG_DEBUG("No Adj LSA of router itself,"
-                 " so Routing table can not be calculated :(");
+      NLSR_LOG_DEBUG("No Adj LSA of router itself, so Routing table can not be calculated :(");
       clearRoutingTable();
       clearDryRoutingTable(); // for dry run options
       // need to update NPT here
       NLSR_LOG_DEBUG("Calling Update NPT With new Route");
       (*afterRoutingChange)(m_rTable);
-      writeLog();
+      NLSR_LOG_DEBUG(*this);
       m_namePrefixTable.writeLog();
       m_fib.writeLog();
       // debugging purpose end
@@ -199,26 +198,6 @@
 }
 
 void
-RoutingTable::writeLog()
-{
-  NLSR_LOG_DEBUG("---------------Routing Table------------------");
-  for (const auto& rte : m_rTable) {
-    NLSR_LOG_DEBUG("Destination: " << rte.getDestination());
-    NLSR_LOG_DEBUG("Nexthops: ");
-    rte.getNexthopList().writeLog();
-  }
-
-  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
-    NLSR_LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
-    for (const auto& rte : m_dryTable) {
-      NLSR_LOG_DEBUG("Destination: " << rte.getDestination());
-      NLSR_LOG_DEBUG("Nexthops: ");
-      rte.getNexthopList().writeLog();
-    }
-  }
-}
-
-void
 RoutingTable::addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh)
 {
   NLSR_LOG_DEBUG("Adding " << nh << " to dry table for destination: " << destRouter);
@@ -251,4 +230,100 @@
   }
 }
 
+template<ndn::encoding::Tag TAG>
+size_t
+RoutingTableStatus::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  for (auto it = m_dryTable.rbegin(); it != m_dryTable.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  for (auto it = m_rTable.rbegin(); it != m_rTable.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTable);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
+
+const ndn::Block&
+RoutingTableStatus::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+RoutingTableStatus::wireDecode(const ndn::Block& wire)
+{
+  m_rTable.clear();
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::RoutingTable) {
+    std::stringstream error;
+    error << "Expected RoutingTableStatus Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  auto val = m_wire.elements_begin();
+
+  std::set<ndn::Name> destinations;
+  for (; val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::RoutingTableEntry; ++val) {
+    auto entry = RoutingTableEntry(*val);
+
+    if (destinations.emplace(entry.getDestination()).second) {
+      m_rTable.push_back(entry);
+    }
+    else {
+      // If destination already exists then this is the start of dry HR table
+      m_dryTable.push_back(entry);
+    }
+  }
+
+  if (val != m_wire.elements_end()) {
+    std::stringstream error;
+    error << "Expected the end of elements, but Block is of a different type: #"
+          << val->type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+}
+
+std::ostream&
+operator<<(std::ostream& os, const RoutingTableStatus& rts)
+{
+  os << "Routing Table:\n";
+  for (const auto& rte : rts.getRoutingTableEntry()) {
+    os << rte;
+  }
+
+  if (!rts.getDryRoutingTableEntry().empty()) {
+    os << "Dry-Run Hyperbolic Routing Table:\n";
+    for (const auto& rte : rts.getDryRoutingTableEntry()) {
+      os << rte;
+    }
+  }
+  return os;
+}
+
 } // namespace nlsr
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index af2ba93..8f9309b 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,8 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- **/
+ */
 
 #ifndef NLSR_ROUTING_TABLE_HPP
 #define NLSR_ROUTING_TABLE_HPP
@@ -35,7 +34,58 @@
 
 class NextHop;
 
-class RoutingTable : boost::noncopyable
+/*! \brief Data abstraction for routing table status
+ *
+ * RtStatus := RT-STATUS-TYPE TLV-LENGTH
+ *              RouteTableEntry*
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
+ */
+class RoutingTableStatus
+{
+public:
+  using Error = ndn::tlv::Error;
+
+  RoutingTableStatus() = default;
+
+  RoutingTableStatus(const ndn::Block& block)
+  {
+    wireDecode(block);
+  }
+
+  const std::list<RoutingTableEntry>&
+  getRoutingTableEntry() const
+  {
+    return m_rTable;
+  }
+
+  const std::list<RoutingTableEntry>&
+  getDryRoutingTableEntry() const
+  {
+    return m_dryTable;
+  }
+
+  const ndn::Block&
+  wireEncode() const;
+
+private:
+  void
+  wireDecode(const ndn::Block& wire);
+
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+  std::list<RoutingTableEntry> m_dryTable;
+  std::list<RoutingTableEntry> m_rTable;
+  mutable ndn::Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const RoutingTableStatus& rts);
+
+class RoutingTable : public RoutingTableStatus
 {
 public:
   explicit
@@ -84,18 +134,6 @@
     return m_routingCalcInterval;
   }
 
-  const std::list<RoutingTableEntry>&
-  getRoutingTableEntry() const
-  {
-    return m_rTable;
-  }
-
-  const std::list<RoutingTableEntry>&
-  getDryRoutingTableEntry() const
-  {
-    return m_dryTable;
-  }
-
   uint64_t
   getRtSize()
   {
@@ -117,23 +155,15 @@
   void
   clearDryRoutingTable();
 
-  void
-  writeLog();
-
 public:
   std::unique_ptr<AfterRoutingChange> afterRoutingChange;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  std::list<RoutingTableEntry> m_rTable;
-
 private:
   ndn::Scheduler& m_scheduler;
   Fib& m_fib;
   Lsdb& m_lsdb;
   NamePrefixTable& m_namePrefixTable;
 
-  std::list<RoutingTableEntry> m_dryTable;
-
   ndn::time::seconds m_routingCalcInterval;
 
   bool m_isRoutingTableCalculating;
diff --git a/src/tlv/tlv-nlsr.hpp b/src/tlv-nlsr.hpp
similarity index 97%
rename from src/tlv/tlv-nlsr.hpp
rename to src/tlv-nlsr.hpp
index e7d2253..93cfd2d 100644
--- a/src/tlv/tlv-nlsr.hpp
+++ b/src/tlv-nlsr.hpp
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_TLV_NLSR_HPP
 #define NLSR_TLV_NLSR_HPP
@@ -47,7 +47,6 @@
   ExpirationTime              = 139,
   Cost                        = 140,
   Uri                         = 141,
-  Destination                 = 142,
   NextHop                     = 143,
   RoutingTable                = 144,
   RoutingTableEntry           = 145
diff --git a/src/tlv/destination.cpp b/src/tlv/destination.cpp
deleted file mode 100644
index a1ea06f..0000000
--- a/src/tlv/destination.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "destination.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<Destination>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<Destination>));
-static_assert(std::is_base_of<ndn::tlv::Error, Destination::Error>::value,
-              "Destination::Error must inherit from tlv::Error");
-
-Destination::Destination() = default;
-
-Destination::Destination(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-Destination::wireEncode(ndn::EncodingImpl<TAG>& encoder) const
-{
-  size_t totalLength = 0;
-
-  totalLength += m_name.wireEncode(encoder);
-
-  totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(ndn::tlv::nlsr::Destination);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(Destination);
-
-const ndn::Block&
-Destination::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-Destination::wireDecode(const ndn::Block& wire)
-{
-  m_name.clear();
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::Destination) {
-    std::stringstream error;
-    error << "Expected Destination Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::Name) {
-    m_name.wireDecode(*val);
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required Name field"));
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Destination& Destination)
-{
-  os << "Destination: " << Destination.getName();
-  return os;
-}
-
-std::shared_ptr<Destination>
-makeDes(const RoutingTableEntry& rte)
-{
-  std::shared_ptr<Destination> desInfo = std::make_shared<Destination>();
-
-  desInfo->setName(rte.getDestination());
-
-  return desInfo;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/destination.hpp b/src/tlv/destination.hpp
deleted file mode 100644
index 859c8a8..0000000
--- a/src/tlv/destination.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_TLV_DESTINATION_HPP
-#define NLSR_TLV_DESTINATION_HPP
-
-#include "route/routing-table-entry.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-#include <boost/throw_exception.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for Destination
- *
- *    Destination := DESTINATION-TYPE TLV-LENGTH
- *                     Name
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
- */
-class Destination
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  Destination();
-
-  explicit
-  Destination(const ndn::Block& block);
-
-  const ndn::Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  Destination&
-  setName(const ndn::Name& name)
-  {
-    m_name = name;
-    m_wire.reset();
-    return *this;
-  }
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  ndn::Name m_name;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Destination);
-
-std::ostream&
-operator<<(std::ostream& os, const Destination& destination);
-
-std::shared_ptr<Destination>
-makeDes(const RoutingTableEntry& rte);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_DESTINATION_HPP
diff --git a/src/tlv/nexthop.cpp b/src/tlv/nexthop.cpp
deleted file mode 100644
index 508bf1a..0000000
--- a/src/tlv/nexthop.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "nexthop.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<NextHop>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<NextHop>));
-static_assert(std::is_base_of<ndn::tlv::Error, NextHop::Error>::value,
-              "NextHop::Error must inherit from tlv::Error");
-
-NextHop::NextHop()
-  : m_cost(0)
-{
-}
-
-NextHop::NextHop(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-NextHop::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::CostDouble, m_cost);
-
-  totalLength += block.prependByteArrayBlock(
-    ndn::tlv::nlsr::Uri, reinterpret_cast<const uint8_t*>(m_uri.c_str()), m_uri.size());
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NextHop);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
-
-const ndn::Block&
-NextHop::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-NextHop::wireDecode(const ndn::Block& wire)
-{
-  m_uri = "";
-  m_cost = 0;
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::NextHop) {
-    std::stringstream error;
-    error << "Expected NextHop Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
-    m_uri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required Uri field"));
-  }
-
-  m_cost = ndn::encoding::readDouble(*val);
-}
-
-std::ostream&
-operator<<(std::ostream& os, const NextHop& nexthop)
-{
-  os << "NextHop("
-     << "Uri: " << nexthop.getUri() << ", "<< "Cost: " << nexthop.getCost() << ")" << std::endl;
-
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/nexthop.hpp b/src/tlv/nexthop.hpp
deleted file mode 100644
index 9b0f72c..0000000
--- a/src/tlv/nexthop.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_TLV_NEXTHOP_HPP
-#define NLSR_TLV_NEXTHOP_HPP
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-#include <boost/throw_exception.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for Nexthop
- *
- *   NextHop := NEXTHOP-TYPE TLV-LENGTH
- *                Uri
- *                Cost
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
- */
-class NextHop
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  NextHop();
-
-  explicit
-  NextHop(const ndn::Block& block);
-
-  const std::string&
-  getUri() const
-  {
-    return m_uri;
-  }
-
-  NextHop&
-  setUri(const std::string& uri)
-  {
-    m_uri = uri;
-    m_wire.reset();
-    return *this;
-  }
-
-  double
-  getCost() const
-  {
-    return m_cost;
-  }
-
-  NextHop&
-  setCost(double cost)
-  {
-    m_cost = cost;
-    m_wire.reset();
-    return *this;
-  }
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  std::string m_uri;
-  double m_cost;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
-
-std::ostream&
-operator<<(std::ostream& os, const NextHop& nexthop);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_NEXTHOP_HPP
diff --git a/src/tlv/routing-table-entry.cpp b/src/tlv/routing-table-entry.cpp
deleted file mode 100644
index 255d418..0000000
--- a/src/tlv/routing-table-entry.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "routing-table-entry.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<RoutingTable>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<RoutingTable>));
-static_assert(std::is_base_of<ndn::tlv::Error, RoutingTable::Error>::value,
-              "RoutingTable::Error must inherit from tlv::Error");
-
-RoutingTable::RoutingTable()
-  : m_hasNexthops(false)
-{
-}
-
-RoutingTable::RoutingTable(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-bool
-RoutingTable::hasNexthops() const
-{
-  return m_hasNexthops;
-}
-
-RoutingTable&
-RoutingTable::addNexthops(const NextHop& nexthop)
-{
-  m_nexthops.push_back(nexthop);
-  m_wire.reset();
-  m_hasNexthops = true;
-  return *this;
-}
-
-RoutingTable&
-RoutingTable::clearNexthops()
-{
-  m_nexthops.clear();
-  m_hasNexthops = false;
-  return *this;
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-RoutingTable::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  for (std::list<NextHop>::const_reverse_iterator it = m_nexthops.rbegin();
-       it != m_nexthops.rend(); ++it) {
-    totalLength += it->wireEncode(block);
-  }
-
-  totalLength += m_des.wireEncode(block);
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTableEntry);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTable);
-
-const ndn::Block&
-RoutingTable::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-RoutingTable::wireDecode(const ndn::Block& wire)
-{
-  m_hasNexthops = false;
-  m_nexthops.clear();
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTableEntry) {
-    std::stringstream error;
-    error << "Expected RoutingTable Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Destination) {
-    m_des.wireDecode(*val);
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required destination field"));
-  }
-
-  for (; val != m_wire.elements_end(); ++val) {
-    if (val->type() == ndn::tlv::nlsr::NextHop) {
-      m_nexthops.push_back(NextHop(*val));
-      m_hasNexthops = true;
-    }
-    else {
-      std::stringstream error;
-      error << "Expected NextHop Block, but Block is of a different type: #"
-            << m_wire.type();
-      BOOST_THROW_EXCEPTION(Error(error.str()));
-    }
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTable& routingtable)
-{
-  os << routingtable.getDestination() << std::endl;
-  os << "NexthopList(" << std::endl;
-
-  for (const auto& rtentry : routingtable) {
-    os << rtentry;
-  }
-
-  os << ")";
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/routing-table-entry.hpp b/src/tlv/routing-table-entry.hpp
deleted file mode 100644
index 167f63a..0000000
--- a/src/tlv/routing-table-entry.hpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
-#define NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
-
-#include "destination.hpp"
-#include "nexthop.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for RouteTableInfo
- *
- *   RouteTableInfo := ROUTINGTABLE-TYPE TLV-LENGTH
- *                       Destination
- *                       NexthopList*
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
- */
-class RoutingTable
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  typedef std::list<NextHop> HopList;
-  typedef HopList::const_iterator const_iterator;
-
-  RoutingTable();
-
-  explicit
-  RoutingTable(const ndn::Block& block);
-
-  const Destination&
-  getDestination() const
-  {
-    return m_des;
-  }
-
-  RoutingTable&
-  setDestination(const Destination& des)
-  {
-    m_des = des;
-    m_wire.reset();
-    return *this;
-  }
-
-  uint64_t
-  getRtSize() const
-  {
-    return m_size;
-  }
-
-  RoutingTable&
-  setRtSize(uint64_t size)
-  {
-    m_size = size;
-    m_wire.reset();
-    return *this;
-  }
-
-  bool
-  hasNexthops() const;
-
-  const std::list<NextHop>&
-  getNextHops() const
-  {
-    return m_nexthops;
-  }
-
-  RoutingTable&
-  addNexthops(const NextHop& nexthop);
-
-  RoutingTable&
-  clearNexthops();
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-  const_iterator
-  begin() const;
-
-  const_iterator
-  end() const;
-
-private:
-  Destination m_des;
-  uint64_t m_size;
-  bool m_hasNexthops;
-  HopList m_nexthops;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTable);
-
-inline RoutingTable::const_iterator
-RoutingTable::begin() const
-{
-  return m_nexthops.begin();
-}
-
-inline RoutingTable::const_iterator
-RoutingTable::end() const
-{
-  return m_nexthops.end();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTable& routetable);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/tlv/routing-table-status.cpp b/src/tlv/routing-table-status.cpp
deleted file mode 100644
index 00d2c78..0000000
--- a/src/tlv/routing-table-status.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "routing-table-status.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<RoutingTableStatus>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<RoutingTableStatus>));
-static_assert(std::is_base_of<ndn::tlv::Error, RoutingTableStatus::Error>::value,
-              "RoutingTableStatus::Error must inherit from tlv::Error");
-
-RoutingTableStatus::RoutingTableStatus()
-  : m_hasRoutingtable(false)
-{
-}
-
-RoutingTableStatus::RoutingTableStatus(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-RoutingTableStatus&
-RoutingTableStatus::addRoutingTable(const RoutingTable& routetable)
-{
-  m_routingtables.push_back(routetable);
-  m_wire.reset();
-  m_hasRoutingtable = true;
-  return *this;
-}
-
-RoutingTableStatus&
-RoutingTableStatus::clearRoutingTable()
-{
-  m_routingtables.clear();
-  m_hasRoutingtable = false;
-  return *this;
-}
-
-bool
-RoutingTableStatus::hasRoutingTable()
-{
-  return m_hasRoutingtable;
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-RoutingTableStatus::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  for (std::list<RoutingTable>::const_reverse_iterator it = m_routingtables.rbegin();
-       it != m_routingtables.rend(); ++it) {
-    totalLength += it->wireEncode(block);
-  }
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTable);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
-
-const ndn::Block&
-RoutingTableStatus::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-RoutingTableStatus::wireDecode(const ndn::Block& wire)
-{
-  m_routingtables.clear();
-
-  m_hasRoutingtable = false;
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTable) {
-    std::stringstream error;
-    error << "Expected RoutingTableStatus Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  for (; val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::RoutingTableEntry; ++val) {
-    m_routingtables.push_back(RoutingTable(*val));
-    m_hasRoutingtable = true;
-  }
-
-  if (val != m_wire.elements_end()) {
-    std::stringstream error;
-    error << "Expected the end of elements, but Block is of a different type: #"
-          << val->type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTableStatus& rtStatus)
-{
-  os << "Routing Table Status: " << std::endl;
-
-  bool isFirst = true;
-
-  for (const auto& routingtable : rtStatus.getRoutingtable()) {
-    if (isFirst) {
-      isFirst = false;
-    }
-    else {
-      os << ", ";
-    }
-
-    os << routingtable;
-  }
-
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/routing-table-status.hpp b/src/tlv/routing-table-status.hpp
deleted file mode 100644
index 97d083f..0000000
--- a/src/tlv/routing-table-status.hpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_TLV_ROUTING_TABLE_STATUS_HPP
-#define NLSR_TLV_ROUTING_TABLE_STATUS_HPP
-
-#include "routing-table-entry.hpp"
-#include "destination.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for routing table status
- *
- * RtStatus := RT-STATUS-TYPE TLV-LENGTH
- *              RouteTableInfo*
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
- */
-class RoutingTableStatus
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  typedef std::list<RoutingTable> RTList;
-
-  RoutingTableStatus();
-
-  explicit
-  RoutingTableStatus(const ndn::Block& block);
-
-  const std::list<RoutingTable>&
-  getRoutingtable() const
-  {
-    return m_routingtables;
-  }
-
-  RoutingTableStatus&
-  addRoutingTable(const RoutingTable& routeTable);
-
-  RoutingTableStatus&
-  clearRoutingTable();
-
-  bool
-  hasRoutingTable();
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  RTList m_routingtables;
-  bool m_hasRoutingtable;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTableStatus& rtStatus);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_ROUTING_TABLE_STATUS_HPP
