diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp
index 4b702fc..896e7b3 100644
--- a/tests/publisher/publisher-fixture.hpp
+++ b/tests/publisher/publisher-fixture.hpp
@@ -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-2018,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -22,7 +22,7 @@
 #ifndef NLSR_PUBLISHER_FIXTURE_HPP
 #define NLSR_PUBLISHER_FIXTURE_HPP
 
-#include "publisher/lsdb-dataset-interest-handler.hpp"
+#include "publisher/dataset-interest-handler.hpp"
 #include "nlsr.hpp"
 
 #include "../boost-test.hpp"
@@ -48,6 +48,7 @@
     : face(m_ioService, m_keyChain, {true, true})
     , nlsr(m_ioService, m_scheduler, face, m_keyChain)
     , lsdb(nlsr.getLsdb())
+    , rt1(nlsr.getRoutingTable())
   {
     INIT_LOGGERS("/tmp/", "TRACE");
     nlsr.getConfParameter().setNetwork("/ndn");
@@ -100,6 +101,13 @@
     }
   }
 
+  NextHop
+  createNextHop(const std::string& faceUri, double cost)
+  {
+    NextHop nexthop(faceUri, cost);
+    return nexthop;
+  }
+
   CoordinateLsa
   createCoordinateLsa(const std::string& origin, double radius, std::vector<double> angle)
   {
@@ -159,6 +167,7 @@
   Lsdb& lsdb;
 
   ndn::security::pib::Identity routerId;
+  RoutingTable& rt1;
 };
 
 } // namespace test
diff --git a/tests/publisher/test-lsdb-dataset-interest-handler.cpp b/tests/publisher/test-dataset-interest-handler.cpp
similarity index 81%
rename from tests/publisher/test-lsdb-dataset-interest-handler.cpp
rename to tests/publisher/test-dataset-interest-handler.cpp
index cd9fcf3..ccd3b64 100644
--- a/tests/publisher/test-lsdb-dataset-interest-handler.cpp
+++ b/tests/publisher/test-dataset-interest-handler.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-2018,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -19,7 +19,7 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "publisher/lsdb-dataset-interest-handler.hpp"
+#include "publisher/dataset-interest-handler.hpp"
 #include "tests/test-common.hpp"
 #include "tlv/tlv-nlsr.hpp"
 
@@ -28,6 +28,8 @@
 
 #include <ndn-cxx/mgmt/nfd/control-response.hpp>
 
+#include <iostream>
+
 namespace nlsr {
 namespace test {
 
@@ -36,6 +38,7 @@
                        std::function<bool(const ndn::Block&)> isSameType)
 {
   face.processEvents(ndn::time::milliseconds(30));
+
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
 
   ndn::Block parser(face.sentData[0].getContent());
@@ -50,17 +53,6 @@
   face.sentData.clear();
 }
 
-void
-checkErrorResponse(ndn::util::DummyClientFace& face, uint64_t expectedCode)
-{
-  BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
-
-  ndn::nfd::ControlResponse response(face.sentData[0].getContent().blockFromValue());
-  BOOST_CHECK_EQUAL(response.getCode(), expectedCode);
-
-  face.sentData.clear();
-}
-
 BOOST_FIXTURE_TEST_SUITE(PublisherTestLsdbDatasetInterestHandler, PublisherFixture)
 
 BOOST_AUTO_TEST_CASE(Localhost)
@@ -83,6 +75,14 @@
   nameLsa.addName("/RouterA/name1");
   lsdb.installNameLsa(nameLsa);
 
+  // Install routing table
+  RoutingTableEntry rte1("desrouter1");
+  const ndn::Name& DEST_ROUTER = rte1.getDestination();
+
+  NextHop nh = createNextHop("udp://face-test1", 10);
+
+  rt1.addNextHop(DEST_ROUTER, nh);
+
   // Request adjacency LSAs
   face.receive(ndn::Interest(ndn::Name("/localhost/nlsr/lsdb").append("adjacencies")));
   processDatasetInterest(face,
@@ -98,10 +98,11 @@
   processDatasetInterest(face,
     [] (const ndn::Block& block) { return block.type() == ndn::tlv::nlsr::NameLsa; });
 
-  // Request LSDB Status
-  face.receive(ndn::Interest(ndn::Name("/localhost/nlsr/lsdb").append("list")));
+  // Request Routing Table
+  face.receive(ndn::Interest(ndn::Name("/localhost/nlsr/routing-table")));
   processDatasetInterest(face,
-    [] (const ndn::Block& block) { return block.type() == ndn::tlv::nlsr::LsdbStatus; });
+    [] (const ndn::Block& block) {
+      return block.type() == ndn::tlv::nlsr::RouteTableEntry; });
 }
 
 
@@ -119,6 +120,14 @@
   CoordinateLsa coordinateLsa = createCoordinateLsa("/RouterA", 10.0, angles);
   lsdb.installCoordinateLsa(coordinateLsa);
 
+  //Install routing table
+  RoutingTableEntry rte1("desrouter1");
+  const ndn::Name& DEST_ROUTER = rte1.getDestination();
+
+  NextHop nh = createNextHop("udp://face-test1", 10);
+
+  rt1.addNextHop(DEST_ROUTER, nh);
+
   // Request adjacency LSAs
   face.receive(ndn::Interest(ndn::Name("/ndn/This/Router/lsdb").append("adjacencies")));
   processDatasetInterest(face,
@@ -134,10 +143,11 @@
   processDatasetInterest(face,
     [] (const ndn::Block& block) { return block.type() == ndn::tlv::nlsr::NameLsa; });
 
-  // Request LSDB Status
-  face.receive(ndn::Interest(ndn::Name("/ndn/This/Router/lsdb").append("list")));
+  // Request Routing Table
+  face.receive(ndn::Interest(ndn::Name("/ndn/This/Router/routing-table")));
   processDatasetInterest(face,
-    [] (const ndn::Block& block) { return block.type() == ndn::tlv::nlsr::LsdbStatus; });
+    [] (const ndn::Block& block) {
+      return block.type() == ndn::tlv::nlsr::RouteTableEntry; });
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index 180c295..5c91312 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.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-2018,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -362,7 +362,7 @@
 {
   nlsr.initialize();
 
-  BOOST_CHECK_EQUAL(nlsr.getLsdbDatasetHandler().getRouterNameCommandPrefix(),
+  BOOST_CHECK_EQUAL(nlsr.getDatasetHandler().getRouterNameCommandPrefix(),
                     ndn::Name("/ndn/site/%C1.Router/this-router/lsdb"));
 }
 
diff --git a/tests/tlv/test-destination.cpp b/tests/tlv/test-destination.cpp
new file mode 100644
index 0000000..b74120d
--- /dev/null
+++ b/tests/tlv/test-destination.cpp
@@ -0,0 +1,86 @@
+/* -*- 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 "tlv/destination.hpp"
+
+#include "../boost-test.hpp"
+
+namespace nlsr {
+namespace tlv {
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TlvTestDes)
+
+const uint8_t DesData[] =
+{
+  // Header
+  0x8e, 0x13,
+  // Routername 746573742f646573742f746c76
+  0x07, 0x11, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x08, 0x04, 0x64, 0x65, 0x73, 0x74,
+  0x08, 0x03, 0x74, 0x6c, 0x76
+};
+
+BOOST_AUTO_TEST_CASE(DesEncode)
+{
+  Destination des1;
+  des1.setName("/test/dest/tlv");
+
+  const ndn::Block& wire = des1.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(DesData,
+                                  DesData + sizeof(DesData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(DesDecode)
+{
+  Destination des1;
+
+  des1.wireDecode(ndn::Block(DesData, sizeof(DesData)));
+
+  ndn::Name DEST_NAME = ndn::Name("/test/dest/tlv");
+  BOOST_REQUIRE_EQUAL(des1.getName(), DEST_NAME);
+}
+
+BOOST_AUTO_TEST_CASE(DesOutputStream)
+{
+  Destination des1;
+  des1.setName("/test/dest/tlv");
+
+  std::ostringstream os;
+  os << des1;
+
+  BOOST_CHECK_EQUAL(os.str(), "Destination: /test/dest/tlv");
+}
+
+BOOST_AUTO_TEST_CASE(DesMake)
+{
+  RoutingTableEntry rte("/test/dest/tlv");
+
+  std::shared_ptr<Destination> des = makeDes(rte);
+  BOOST_CHECK_EQUAL(des->getName(), rte.getDestination());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace tlv
+} // namespace nlsr
diff --git a/tests/tlv/test-nexthops.cpp b/tests/tlv/test-nexthops.cpp
new file mode 100644
index 0000000..a0472e8
--- /dev/null
+++ b/tests/tlv/test-nexthops.cpp
@@ -0,0 +1,80 @@
+/* -*- 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 "tlv/nexthop.hpp"
+
+#include "../boost-test.hpp"
+
+namespace nlsr {
+namespace tlv {
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TlvTestNexthops)
+
+const uint8_t NexthopData[] =
+{
+  // Header
+  0x8f, 0x1d,
+  // Uri
+  0x8d, 0x11, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x2f, 0x74, 0x6c, 0x76,
+  // Cost
+  0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f
+};
+
+BOOST_AUTO_TEST_CASE(NexthopEncode)
+{
+  NextHop nexthops1;
+  nexthops1.setUri("/test/nexthop/tlv");
+  nexthops1.setCost(1.65);
+
+  const ndn::Block& wire = nexthops1.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(NexthopData,
+                                  NexthopData + sizeof(NexthopData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(NexthopDecode)
+{
+  NextHop nexthops1;
+
+  nexthops1.wireDecode(ndn::Block(NexthopData, sizeof(NexthopData)));
+
+  BOOST_REQUIRE_EQUAL(nexthops1.getUri(), "/test/nexthop/tlv");
+  BOOST_REQUIRE_EQUAL(nexthops1.getCost(), 1.65);
+}
+
+BOOST_AUTO_TEST_CASE(AdjacencyOutputStream)
+{
+  NextHop nexthops1;
+  nexthops1.setUri("/test/nexthop/tlv");
+  nexthops1.setCost(99);
+
+  std::ostringstream os;
+  os << nexthops1;
+  BOOST_CHECK_EQUAL(os.str(), "NextHop(Uri: /test/nexthop/tlv, Cost: 99)\n");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace tlv
+} // namespace nlsr
diff --git a/tests/tlv/test-routing-table-entry.cpp b/tests/tlv/test-routing-table-entry.cpp
new file mode 100644
index 0000000..5b882a2
--- /dev/null
+++ b/tests/tlv/test-routing-table-entry.cpp
@@ -0,0 +1,192 @@
+/* -*- 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 "tlv/routing-table-entry.hpp"
+
+#include "../boost-test.hpp"
+
+namespace nlsr {
+namespace tlv {
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TlvTestRoutingTableEntry)
+
+const uint8_t RoutingTableEntryWithNexthopsData[] =
+{
+  // Header
+  0x91, 0x37,
+  // Destination
+  0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31,
+  // Nexthop
+  0x8f, 0x14, 0x8d, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70,
+  0x31, 0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f,
+  // Nexthop
+  0x8f, 0x14, 0x8d, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70,
+  0x32, 0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f
+};
+
+const uint8_t RoutingTableEntryWithoutNexthopsData[] =
+{
+  // Header
+  0x91, 0x0b,
+  // Destination
+  0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31
+};
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithNexthops)
+{
+  RoutingTable rt;
+
+  Destination des1;
+  des1.setName("dest1");
+  rt.setDestination(des1);
+
+  NextHop nexthops1;
+  nexthops1.setUri("nexthop1");
+  nexthops1.setCost(1.65);
+  rt.addNexthops(nexthops1);
+
+  NextHop nexthops2;
+  nexthops2.setUri("nexthop2");
+  nexthops2.setCost(1.65);
+  rt.addNexthops(nexthops2);
+
+  const ndn::Block& wire = rt.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithNexthopsData,
+                                  RoutingTableEntryWithNexthopsData +
+                                    sizeof(RoutingTableEntryWithNexthopsData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithNexthops)
+{
+  RoutingTable rt;
+
+  rt.wireDecode(ndn::Block(RoutingTableEntryWithNexthopsData,
+                                      sizeof(RoutingTableEntryWithNexthopsData)));
+
+  Destination des = rt.getDestination();
+  BOOST_CHECK_EQUAL(des.getName(), "dest1");
+
+  BOOST_CHECK_EQUAL(rt.hasNexthops(), true);
+  std::list<NextHop> nexthops = rt.getNextHops();
+  std::list<NextHop>::const_iterator it = nexthops.begin();
+  BOOST_CHECK_EQUAL(it->getUri(), "nexthop1");
+  BOOST_CHECK_EQUAL(it->getCost(), 1.65);
+
+  it++;
+  BOOST_CHECK_EQUAL(it->getUri(), "nexthop2");
+  BOOST_CHECK_EQUAL(it->getCost(), 1.65);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithoutNexthops)
+{
+  RoutingTable rt;
+
+  Destination des1;
+  des1.setName("dest1");
+  rt.setDestination(des1);
+
+  const ndn::Block& wire = rt.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithoutNexthopsData,
+                                  RoutingTableEntryWithoutNexthopsData +
+                                    sizeof(RoutingTableEntryWithoutNexthopsData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithoutNexthops)
+{
+  RoutingTable rt;
+
+  rt.wireDecode(ndn::Block(RoutingTableEntryWithoutNexthopsData,
+                           sizeof(RoutingTableEntryWithoutNexthopsData)));
+
+  Destination des = rt.getDestination();
+  BOOST_CHECK_EQUAL(des.getName(), "dest1");
+
+  BOOST_CHECK_EQUAL(rt.hasNexthops(), false);
+}
+
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryClear)
+{
+  RoutingTable rt;
+  Destination des1;
+  des1.setName("dest1");
+  rt.setDestination(des1);
+
+  NextHop nexthops1;
+  nexthops1.setUri("nexthop1");
+  nexthops1.setCost(99);
+  rt.addNexthops(nexthops1);
+
+  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 1);
+
+  std::list<NextHop> nexthops = rt.getNextHops();
+  std::list<NextHop>::const_iterator it = nexthops.begin();
+  BOOST_CHECK_EQUAL(it->getUri(), "nexthop1");
+  BOOST_CHECK_EQUAL(it->getCost(), 99);
+
+  rt.clearNexthops();
+  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 0);
+
+  NextHop nexthops2;
+  nexthops2.setUri("nexthop2");
+  nexthops2.setCost(99);
+  rt.addNexthops(nexthops2);
+
+  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 1);
+
+  nexthops = rt.getNextHops();
+  it = nexthops.begin();
+  BOOST_CHECK_EQUAL(it->getUri(), "nexthop2");
+  BOOST_CHECK_EQUAL(it->getCost(), 99);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryOutputStream)
+{
+  RoutingTable rt;
+  Destination des1;
+  des1.setName("dest1");
+  rt.setDestination(des1);
+
+  NextHop nexthops1;
+  nexthops1.setUri("nexthop1");
+  nexthops1.setCost(99);
+  rt.addNexthops(nexthops1);
+
+  std::ostringstream os;
+  os << rt;
+
+  BOOST_CHECK_EQUAL(os.str(), "Routing Table: \n"
+                                  "Destination: /dest1\n"
+                                  "Nexthops: NexthopList(\n"
+                                  "NextHop(Uri: nexthop1, Cost: 99)\n"
+                                  "\n)");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace tlv
+} // namespace nlsr
diff --git a/tests/tlv/test-routing-table.cpp b/tests/tlv/test-routing-table.cpp
new file mode 100644
index 0000000..c4b798f
--- /dev/null
+++ b/tests/tlv/test-routing-table.cpp
@@ -0,0 +1,169 @@
+/* -*- 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 "tlv/routing-table-status.hpp"
+
+#include "../boost-test.hpp"
+
+namespace nlsr {
+namespace tlv {
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TlvTestRoutingTable)
+
+const uint8_t RoutingTableData1[] =
+{
+  // Header
+  0x90, 0x22,
+  // Routing table entry
+  0x91, 0x20,
+    // Destination
+    0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31,
+    // Nexthop
+    0x8f, 0x13, 0x8d, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x86, 0x08, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xfa, 0x3f
+};
+
+const uint8_t RoutingTableData2[] =
+{
+  // Header
+  0x90, 0x00
+};
+
+BOOST_AUTO_TEST_CASE(RoutingTableEncode1)
+{
+  RoutingTableStatus rtStatus;
+
+  Destination des;
+  des.setName("dest1");
+
+  // RoutingtableEntry
+  RoutingTable rt;
+  rt.setDestination(des);
+
+  NextHop nexthops;
+  nexthops.setUri("nexthop");
+  nexthops.setCost(1.65);
+  rt.addNexthops(nexthops);
+
+  rtStatus.addRoutingTable(rt);
+
+  const ndn::Block& wire = rtStatus.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData1,
+                                  RoutingTableData1 + sizeof(RoutingTableData1),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEncode2)
+{
+  RoutingTableStatus rtStatus;
+
+  const ndn::Block& wire = rtStatus.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData2,
+                                  RoutingTableData2 + sizeof(RoutingTableData2),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableDecode1)
+{
+  RoutingTableStatus rtStatus;
+
+  rtStatus.wireDecode(ndn::Block(RoutingTableData1, sizeof(RoutingTableData1)));
+
+  std::list<RoutingTable> rte = rtStatus.getRoutingtable();
+  std::list<RoutingTable>::const_iterator it1 = rte.begin();
+
+  Destination des1 = it1->getDestination();
+  BOOST_CHECK_EQUAL(des1.getName(), "dest1");
+
+  std::list<NextHop> nexthops = it1->getNextHops();
+  std::list<NextHop>::const_iterator it2 = nexthops.begin();
+  BOOST_CHECK_EQUAL(it2->getUri(), "nexthop");
+  BOOST_CHECK_EQUAL(it2->getCost(), 1.65);
+
+  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), true);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableDecode2)
+{
+  RoutingTableStatus rtStatus;
+
+  rtStatus.wireDecode(ndn::Block(RoutingTableData2, sizeof(RoutingTableData2)));
+
+  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), false);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableClear)
+{
+  RoutingTableStatus rtStatus;
+  Destination des;
+  des.setName("dest1");
+
+  // RoutingtableEntry
+  RoutingTable rt;
+  rt.setDestination(des);
+
+  NextHop nexthops;
+  nexthops.setUri("nexthop");
+  nexthops.setCost(1.65);
+  rt.addNexthops(nexthops);
+
+  rtStatus.addRoutingTable(rt);
+
+  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), true);
+  rtStatus.clearRoutingTable();
+  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), false);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableOutputStream)
+{
+  RoutingTableStatus rtStatus;
+  Destination des;
+  des.setName("dest1");
+
+  // RoutingtableEntry
+  RoutingTable rt;
+  rt.setDestination(des);
+
+  NextHop nexthops;
+  nexthops.setUri("nexthop");
+  nexthops.setCost(99);
+  rt.addNexthops(nexthops);
+
+  rtStatus.addRoutingTable(rt);
+
+  std::ostringstream os;
+  os << rtStatus;
+
+  BOOST_CHECK_EQUAL(os.str(), "Routing Table Status: \n"
+                                "Routing Table: \n"
+                                  "Destination: /dest1\n"
+                                  "Nexthops: NexthopList(\n"
+                                  "NextHop(Uri: nexthop, Cost: 99)\n"
+                                  "\n)");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace test
+} // namespace tlv
+} // namespace nlsr
