diff --git a/daemon/mgmt/tables-config-section.cpp b/daemon/mgmt/tables-config-section.cpp
index f0b9eaf..773e906 100644
--- a/daemon/mgmt/tables-config-section.cpp
+++ b/daemon/mgmt/tables-config-section.cpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -39,12 +39,14 @@
                                          Pit& pit,
                                          Fib& fib,
                                          StrategyChoice& strategyChoice,
-                                         Measurements& measurements)
+                                         Measurements& measurements,
+                                         NetworkRegionTable& networkRegionTable)
   : m_cs(cs)
   // , m_pit(pit)
   // , m_fib(fib)
   , m_strategyChoice(strategyChoice)
   // , m_measurements(measurements)
+  , m_networkRegionTable(networkRegionTable)
   , m_areTablesConfigured(false)
 {
 
@@ -54,17 +56,16 @@
 TablesConfigSection::setConfigFile(ConfigFile& configFile)
 {
   configFile.addSectionHandler("tables",
-                               bind(&TablesConfigSection::onConfig, this, _1, _2, _3));
+                               bind(&TablesConfigSection::processConfig, this, _1, _2, _3));
 }
 
 
 void
 TablesConfigSection::ensureTablesAreConfigured()
 {
-  if (m_areTablesConfigured)
-    {
-      return;
-    }
+  if (m_areTablesConfigured) {
+    return;
+  }
 
   NFD_LOG_INFO("Setting CS max packets to " << DEFAULT_CS_MAX_PACKETS);
   m_cs.setLimit(DEFAULT_CS_MAX_PACKETS);
@@ -73,9 +74,9 @@
 }
 
 void
-TablesConfigSection::onConfig(const ConfigSection& configSection,
-                              bool isDryRun,
-                              const std::string& filename)
+TablesConfigSection::processConfig(const ConfigSection& configSection,
+                                   bool isDryRun,
+                                   const std::string& filename)
 {
   // tables
   // {
@@ -83,10 +84,16 @@
   //
   //    strategy_choice
   //    {
-  //       /               /localhost/nfd/strategy/best-route
-  //       /localhost      /localhost/nfd/strategy/multicast
-  //       /localhost/nfd  /localhost/nfd/strategy/best-route
-  //       /ndn/broadcast  /localhost/nfd/strategy/multicast
+  //        /               /localhost/nfd/strategy/best-route
+  //        /localhost      /localhost/nfd/strategy/multicast
+  //        /localhost/nfd  /localhost/nfd/strategy/best-route
+  //        /ndn/broadcast  /localhost/nfd/strategy/multicast
+  //    }
+  //
+  //    network_region
+  //    {
+  //       /example/region1
+  //       /example/region2
   //    }
   // }
 
@@ -95,39 +102,42 @@
   boost::optional<const ConfigSection&> csMaxPacketsNode =
     configSection.get_child_optional("cs_max_packets");
 
-  if (csMaxPacketsNode)
-    {
-      boost::optional<size_t> valCsMaxPackets =
-        configSection.get_optional<size_t>("cs_max_packets");
+  if (csMaxPacketsNode) {
+    boost::optional<size_t> valCsMaxPackets =
+      configSection.get_optional<size_t>("cs_max_packets");
 
-      if (!valCsMaxPackets)
-        {
-          BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for option \"cs_max_packets\""
-                                                  " in \"tables\" section"));
-        }
-
-      nCsMaxPackets = *valCsMaxPackets;
+    if (!valCsMaxPackets) {
+      BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for option \"cs_max_packets\""
+                                              " in \"tables\" section"));
     }
 
+    nCsMaxPackets = *valCsMaxPackets;
+  }
+
   boost::optional<const ConfigSection&> strategyChoiceSection =
     configSection.get_child_optional("strategy_choice");
 
-  if (strategyChoiceSection)
-    {
-      processSectionStrategyChoice(*strategyChoiceSection, isDryRun);
-    }
+  if (strategyChoiceSection) {
+    processStrategyChoiceSection(*strategyChoiceSection, isDryRun);
+  }
 
-  if (!isDryRun)
-    {
-      NFD_LOG_INFO("Setting CS max packets to " << nCsMaxPackets);
+  boost::optional<const ConfigSection&> networkRegionSection =
+    configSection.get_child_optional("network_region");
 
-      m_cs.setLimit(nCsMaxPackets);
-      m_areTablesConfigured = true;
-    }
+  if (networkRegionSection) {
+    processNetworkRegionSection(*networkRegionSection, isDryRun);
+  }
+
+  if (!isDryRun) {
+    NFD_LOG_INFO("Setting CS max packets to " << nCsMaxPackets);
+
+    m_cs.setLimit(nCsMaxPackets);
+    m_areTablesConfigured = true;
+  }
 }
 
 void
-TablesConfigSection::processSectionStrategyChoice(const ConfigSection& configSection,
+TablesConfigSection::processStrategyChoiceSection(const ConfigSection& configSection,
                                                   bool isDryRun)
 {
   // strategy_choice
@@ -140,49 +150,65 @@
 
   std::map<Name, Name> choices;
 
-  for (const auto& prefixAndStrategy : configSection)
-    {
-      const Name prefix(prefixAndStrategy.first);
-      if (choices.find(prefix) != choices.end())
-        {
-          BOOST_THROW_EXCEPTION(ConfigFile::Error("Duplicate strategy choice for prefix \"" +
-                                                  prefix.toUri() + "\" in \"strategy_choice\" "
-                                                  "section"));
-        }
-
-      const std::string strategyString(prefixAndStrategy.second.get_value<std::string>());
-      if (strategyString.empty())
-        {
-          BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid strategy choice \"\" for prefix \"" +
-                                                  prefix.toUri() + "\" in \"strategy_choice\" "
-                                                  "section"));
-        }
-
-      const Name strategyName(strategyString);
-      if (!m_strategyChoice.hasStrategy(strategyName))
-        {
-          BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid strategy choice \"" +
-                                                  strategyName.toUri() + "\" for prefix \"" +
-                                                  prefix.toUri() + "\" in \"strategy_choice\" "
-                                                  "section"));
-        }
-
-      choices[prefix] = strategyName;
+  for (const auto& prefixAndStrategy : configSection) {
+    const Name prefix(prefixAndStrategy.first);
+    if (choices.find(prefix) != choices.end()) {
+      BOOST_THROW_EXCEPTION(ConfigFile::Error("Duplicate strategy choice for prefix \"" +
+                                              prefix.toUri() + "\" in \"strategy_choice\" "
+                                              "section"));
     }
 
-
-  for (const auto& prefixAndStrategy : choices)
-    {
-      if (!isDryRun && !m_strategyChoice.insert(prefixAndStrategy.first, prefixAndStrategy.second))
-        {
-          BOOST_THROW_EXCEPTION(ConfigFile::Error("Failed to set strategy \"" +
-                                                  prefixAndStrategy.second.toUri() + "\" for "
-                                                  "prefix \"" + prefixAndStrategy.first.toUri() +
-                                                  "\" in \"strategy_choicev\""));
-        }
+    const std::string strategyString(prefixAndStrategy.second.get_value<std::string>());
+    if (strategyString.empty()) {
+      BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid strategy choice \"\" for prefix \"" +
+                                              prefix.toUri() + "\" in \"strategy_choice\" "
+                                              "section"));
     }
+
+    const Name strategyName(strategyString);
+    if (!m_strategyChoice.hasStrategy(strategyName)) {
+      BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid strategy choice \"" +
+                                              strategyName.toUri() + "\" for prefix \"" +
+                                              prefix.toUri() + "\" in \"strategy_choice\" "
+                                              "section"));
+    }
+
+    choices[prefix] = strategyName;
+  }
+
+
+  for (const auto& prefixAndStrategy : choices) {
+    if (!isDryRun && !m_strategyChoice.insert(prefixAndStrategy.first, prefixAndStrategy.second)) {
+      BOOST_THROW_EXCEPTION(ConfigFile::Error("Failed to set strategy \"" +
+                                              prefixAndStrategy.second.toUri() + "\" for "
+                                              "prefix \"" + prefixAndStrategy.first.toUri() +
+                                              "\" in \"strategy_choicev\""));
+    }
+  }
 }
 
+void
+TablesConfigSection::processNetworkRegionSection(const ConfigSection& configSection,
+                                                 bool isDryRun)
+{
+  // network_region
+  // {
+  //    /example/region1
+  //    /example/region2
+  // }
+
+  if (!isDryRun) {
+    m_networkRegionTable.clear();
+  }
+
+  for (const auto& pair : configSection) {
+    const Name region(pair.first);
+
+    if (!isDryRun)  {
+      m_networkRegionTable.insert(region);
+    }
+  }
+}
 
 
 } // namespace nfd
diff --git a/daemon/mgmt/tables-config-section.hpp b/daemon/mgmt/tables-config-section.hpp
index 3f132f7..82cb877 100644
--- a/daemon/mgmt/tables-config-section.hpp
+++ b/daemon/mgmt/tables-config-section.hpp
@@ -1,12 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -30,12 +30,19 @@
 #include "table/pit.hpp"
 #include "table/cs.hpp"
 #include "table/measurements.hpp"
+#include "table/network-region-table.hpp"
 #include "table/strategy-choice.hpp"
 
 #include "core/config-file.hpp"
 
 namespace nfd {
 
+/**
+ * \brief Provides parsing for `tables` configuration file section.
+ *
+ * This class enables configuration of CS, PIT, FIB, Strategy Choice, Measurements, and
+ * Network Region tables.
+ */
 class TablesConfigSection
 {
 public:
@@ -43,7 +50,8 @@
                       Pit& pit,
                       Fib& fib,
                       StrategyChoice& strategyChoice,
-                      Measurements& measurements);
+                      Measurements& measurements,
+                      NetworkRegionTable& networkRegionTable);
 
   void
   setConfigFile(ConfigFile& configFile);
@@ -54,20 +62,25 @@
 private:
 
   void
-  onConfig(const ConfigSection& configSection,
-           bool isDryRun,
-           const std::string& filename);
+  processConfig(const ConfigSection& configSection,
+                bool isDryRun,
+                const std::string& filename);
 
   void
-  processSectionStrategyChoice(const ConfigSection& configSection,
+  processStrategyChoiceSection(const ConfigSection& configSection,
                                bool isDryRun);
 
+  void
+  processNetworkRegionSection(const ConfigSection& configSection,
+                              bool isDryRun);
+
 private:
   Cs& m_cs;
   // Pit& m_pit;
   // Fib& m_fib;
   StrategyChoice& m_strategyChoice;
   // Measurements& m_measurements;
+  NetworkRegionTable& m_networkRegionTable;
 
   bool m_areTablesConfigured;
 
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index d880ebb..262bbf5 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -147,7 +147,8 @@
                                    m_forwarder->getPit(),
                                    m_forwarder->getFib(),
                                    m_forwarder->getStrategyChoice(),
-                                   m_forwarder->getMeasurements());
+                                   m_forwarder->getMeasurements(),
+                                   m_forwarder->getNetworkRegionTable());
   tablesConfig.setConfigFile(config);
 
   m_internalFace->getValidator().setConfigFile(config);
@@ -189,7 +190,8 @@
                                    m_forwarder->getPit(),
                                    m_forwarder->getFib(),
                                    m_forwarder->getStrategyChoice(),
-                                   m_forwarder->getMeasurements());
+                                   m_forwarder->getMeasurements(),
+                                   m_forwarder->getNetworkRegionTable());
 
   tablesConfig.setConfigFile(config);
 
diff --git a/daemon/table/network-region-table.hpp b/daemon/table/network-region-table.hpp
index 499c356..2a423a7 100644
--- a/daemon/table/network-region-table.hpp
+++ b/daemon/table/network-region-table.hpp
@@ -33,6 +33,9 @@
 /** \brief stores a collection of producer region names
  *
  *  This table is used in forwarding to process Interests with Link objects.
+ *
+ *  NetworkRegionTable exposes a set-like API, including methods `insert`, `clear`,
+ *  `find`, `size`, `begin`, and `end`.
  */
 class NetworkRegionTable : public std::set<Name>
 {
diff --git a/nfd.conf.sample.in b/nfd.conf.sample.in
index 65d9def..24407c7 100644
--- a/nfd.conf.sample.in
+++ b/nfd.conf.sample.in
@@ -58,6 +58,16 @@
     /localhost/nfd  /localhost/nfd/strategy/best-route
     /ndn/broadcast  /localhost/nfd/strategy/multicast
   }
+
+  ; Declare network region names
+  ; These are used for mobility support.  An Interest carrying a Link object is
+  ; assumed to have reached the producer region if any delegation name in the
+  ; Link object is a prefix of any region name.
+  network_region
+  {
+    ; /example/region1
+    ; /example/region2
+  }
 }
 
 ; The face_system section defines what faces and channels are created.
diff --git a/tests/daemon/mgmt/tables-config-section.t.cpp b/tests/daemon/mgmt/tables-config-section.t.cpp
index 1735154..5d9b636 100644
--- a/tests/daemon/mgmt/tables-config-section.t.cpp
+++ b/tests/daemon/mgmt/tables-config-section.t.cpp
@@ -33,8 +33,6 @@
 namespace nfd {
 namespace tests {
 
-NFD_LOG_INIT("MgmtTablesConfigSection");
-
 class TablesConfigSectionFixture : protected BaseFixture
 {
 public:
@@ -45,7 +43,8 @@
     , m_fib(m_forwarder.getFib())
     , m_strategyChoice(m_forwarder.getStrategyChoice())
     , m_measurements(m_forwarder.getMeasurements())
-    , m_tablesConfig(m_cs, m_pit, m_fib, m_strategyChoice, m_measurements)
+    , m_networkRegionTable(m_forwarder.getNetworkRegionTable())
+    , m_tablesConfig(m_cs, m_pit, m_fib, m_strategyChoice, m_measurements, m_networkRegionTable)
   {
     m_tablesConfig.setConfigFile(m_config);
   }
@@ -56,19 +55,6 @@
     m_config.parse(CONFIG, isDryRun, "dummy-config");
   }
 
-  bool
-  validateException(const std::runtime_error& exception, const std::string& expectedMsg)
-  {
-    if (exception.what() != expectedMsg)
-      {
-        NFD_LOG_DEBUG("exception.what(): " << exception.what());
-        NFD_LOG_DEBUG("msg:            : " << expectedMsg);
-
-        return false;
-      }
-    return true;
-  }
-
 protected:
   Forwarder m_forwarder;
 
@@ -77,12 +63,14 @@
   Fib& m_fib;
   StrategyChoice& m_strategyChoice;
   Measurements& m_measurements;
+  NetworkRegionTable& m_networkRegionTable;
 
   TablesConfigSection m_tablesConfig;
   ConfigFile m_config;
 };
 
-BOOST_FIXTURE_TEST_SUITE(MgmtTableConfigSection, TablesConfigSectionFixture)
+BOOST_FIXTURE_TEST_SUITE(Mgmt, TablesConfigSectionFixture)
+BOOST_AUTO_TEST_SUITE(TestTablesConfigSection)
 
 BOOST_AUTO_TEST_CASE(ConfigureTablesWithDefaults)
 {
@@ -113,6 +101,30 @@
   BOOST_CHECK_EQUAL(defaultLimit, m_cs.getLimit());
 }
 
+BOOST_AUTO_TEST_CASE(MissingTablesSection)
+{
+  const std::string CONFIG =
+    "not_tables\n"
+    "{\n"
+    "  some_other_field 0\n"
+    "}\n";
+
+  ConfigFile passiveConfig(&ConfigFile::ignoreUnknownSection);
+
+  const size_t initialLimit = m_cs.getLimit();
+
+  passiveConfig.parse(CONFIG, true, "dummy-config");
+  BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
+
+  passiveConfig.parse(CONFIG, false, "dummy-config");
+  BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
+
+  m_tablesConfig.ensureTablesAreConfigured();
+  BOOST_CHECK_NE(initialLimit, m_cs.getLimit());
+}
+
+BOOST_AUTO_TEST_SUITE(Cs)
+
 BOOST_AUTO_TEST_CASE(ValidCsMaxPackets)
 {
   const std::string CONFIG =
@@ -141,18 +153,8 @@
     "  cs_max_packets\n"
     "}\n";
 
-  const std::string expectedMsg =
-    "Invalid value for option \"cs_max_packets\" in \"tables\" section";
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
+  BOOST_CHECK_THROW(runConfig(CONFIG, true), ConfigFile::Error);
+  BOOST_CHECK_THROW(runConfig(CONFIG, false), ConfigFile::Error);
 }
 
 BOOST_AUTO_TEST_CASE(InvalidValueCsMaxPackets)
@@ -163,31 +165,24 @@
     "  cs_max_packets invalid\n"
     "}\n";
 
-  const std::string expectedMsg =
-    "Invalid value for option \"cs_max_packets\" in \"tables\" section";
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
-
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
+  BOOST_CHECK_THROW(runConfig(CONFIG, true), ConfigFile::Error);
+  BOOST_CHECK_THROW(runConfig(CONFIG, false), ConfigFile::Error);
 }
 
-BOOST_AUTO_TEST_CASE(ConfigStrategy)
+BOOST_AUTO_TEST_SUITE_END() // Cs
+
+BOOST_AUTO_TEST_SUITE(ConfigStrategy)
+
+BOOST_AUTO_TEST_CASE(Unversioned)
 {
   const std::string CONFIG =
     "tables\n"
     "{\n"
-    "strategy_choice\n"
-    "{\n"
-    "  / /localhost/nfd/strategy/test-strategy-a\n"
-    "  /a /localhost/nfd/strategy/test-strategy-b\n"
-    "}\n"
+    "  strategy_choice\n"
+    "  {\n"
+    "    / /localhost/nfd/strategy/test-strategy-a\n"
+    "    /a /localhost/nfd/strategy/test-strategy-b\n"
+    "  }\n"
     "}\n";
 
   m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
@@ -195,7 +190,7 @@
   m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
                                                       "/localhost/nfd/strategy/test-strategy-b"));
 
-  runConfig(CONFIG, true);
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
   {
     fw::Strategy& rootStrategy = m_strategyChoice.findEffectiveStrategy("/");
     BOOST_REQUIRE_NE(rootStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
@@ -206,7 +201,7 @@
     BOOST_REQUIRE_NE(aStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
   }
 
-  runConfig(CONFIG, false);
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
   {
     fw::Strategy& rootStrategy = m_strategyChoice.findEffectiveStrategy("/");
     BOOST_REQUIRE_EQUAL(rootStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
@@ -216,7 +211,7 @@
   }
 }
 
-BOOST_AUTO_TEST_CASE(ConfigVersionedStrategy)
+BOOST_AUTO_TEST_CASE(Versioned)
 {
   const std::string CONFIG =
     "tables\n"
@@ -237,7 +232,7 @@
   m_strategyChoice.install(version1);
   m_strategyChoice.install(version2);
 
-  runConfig(CONFIG, true);
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
   {
     fw::Strategy& testLatestStrategy = m_strategyChoice.findEffectiveStrategy("/test/latest");
     BOOST_REQUIRE_NE(testLatestStrategy.getName(),
@@ -252,7 +247,7 @@
                      "/localhost/nfd/strategy/test-strategy-a/%FD%02");
   }
 
-  runConfig(CONFIG, false);
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
   {
     fw::Strategy& testLatestStrategy = m_strategyChoice.findEffectiveStrategy("/test/latest");
     BOOST_REQUIRE_EQUAL(testLatestStrategy.getName(),
@@ -264,74 +259,52 @@
   }
 }
 
-BOOST_AUTO_TEST_CASE(InvalidStrategy)
+BOOST_AUTO_TEST_CASE(NonExisting)
 {
   const std::string CONFIG =
     "tables\n"
     "{\n"
-    "strategy_choice\n"
-    "{\n"
-    "  / /localhost/nfd/strategy/test-doesnotexist\n"
-    "}\n"
+    "  strategy_choice\n"
+    "  {\n"
+    "    / /localhost/nfd/strategy/test-doesnotexist\n"
+    "  }\n"
     "}\n";
 
 
-  const std::string expectedMsg =
-    "Invalid strategy choice \"/localhost/nfd/strategy/test-doesnotexist\" "
-    "for prefix \"/\" in \"strategy_choice\" section";
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
+  BOOST_CHECK_THROW(runConfig(CONFIG, true), ConfigFile::Error);
+  BOOST_CHECK_THROW(runConfig(CONFIG, false), ConfigFile::Error);
 }
 
-BOOST_AUTO_TEST_CASE(MissingStrategyPrefix)
+BOOST_AUTO_TEST_CASE(MissingPrefix)
 {
   const std::string CONFIG =
     "tables\n"
     "{\n"
-    "strategy_choice\n"
-    "{\n"
-    "  /localhost/nfd/strategy/test-strategy-a\n"
-    "}\n"
+    "  strategy_choice\n"
+    "  {\n"
+    "    /localhost/nfd/strategy/test-strategy-a\n"
+    "  }\n"
     "}\n";
 
 
   m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
                                                       "/localhost/nfd/strategy/test-strategy-a"));
 
-
-  const std::string expectedMsg = "Invalid strategy choice \"\" for prefix "
-    "\"/localhost/nfd/strategy/test-strategy-a\" in \"strategy_choice\" section";
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
+  BOOST_CHECK_THROW(runConfig(CONFIG, true), ConfigFile::Error);
+  BOOST_CHECK_THROW(runConfig(CONFIG, false), ConfigFile::Error);
 }
 
-BOOST_AUTO_TEST_CASE(DuplicateStrategy)
+BOOST_AUTO_TEST_CASE(Duplicate)
 {
   const std::string CONFIG =
     "tables\n"
     "{\n"
-    "strategy_choice\n"
-    "{\n"
-    "  / /localhost/nfd/strategy/test-strategy-a\n"
-    "  /a /localhost/nfd/strategy/test-strategy-b\n"
-    "  / /localhost/nfd/strategy/test-strategy-b\n"
-    "}\n"
+    "  strategy_choice\n"
+    "  {\n"
+    "    / /localhost/nfd/strategy/test-strategy-a\n"
+    "    /a /localhost/nfd/strategy/test-strategy-b\n"
+    "    / /localhost/nfd/strategy/test-strategy-b\n"
+    "  }\n"
     "}\n";
 
   m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
@@ -339,61 +312,77 @@
   m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
                                                       "/localhost/nfd/strategy/test-strategy-b"));
 
-  const std::string expectedMsg =
-    "Duplicate strategy choice for prefix \"/\" in \"strategy_choice\" section";
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
-
-  BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
-                        ConfigFile::Error,
-                        bind(&TablesConfigSectionFixture::validateException,
-                             this, _1, expectedMsg));
+  BOOST_CHECK_THROW(runConfig(CONFIG, true), ConfigFile::Error);
+  BOOST_CHECK_THROW(runConfig(CONFIG, false), ConfigFile::Error);
 }
 
-class IgnoreNotTablesSection
-{
-public:
-  void
-  operator()(const std::string& filename,
-             const std::string& sectionName,
-             const ConfigSection& section,
-             bool isDryRun)
+BOOST_AUTO_TEST_SUITE_END() // StrategyChoice
 
-  {
-    // Ignore "not_tables" section
-    if (sectionName == "not_tables")
-      {
-        // do nothing
-      }
-  }
-};
+BOOST_AUTO_TEST_SUITE(NetworkRegion)
 
-BOOST_AUTO_TEST_CASE(MissingTablesSection)
+BOOST_AUTO_TEST_CASE(Basic)
 {
   const std::string CONFIG =
-    "not_tables\n"
+    "tables\n"
     "{\n"
-    "  some_other_field 0\n"
+    "  network_region\n"
+    "  {\n"
+    "    /test/regionA\n"
+    "    /test/regionB/component\n"
+    "  }\n"
     "}\n";
 
-  ConfigFile passiveConfig((IgnoreNotTablesSection()));
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
+  BOOST_CHECK_EQUAL(m_networkRegionTable.size(), 0);
 
-  const size_t initialLimit = m_cs.getLimit();
+  BOOST_CHECK(m_networkRegionTable.find("/test/regionA") == m_networkRegionTable.end());
+  BOOST_CHECK(m_networkRegionTable.find("/test/regionB/component") == m_networkRegionTable.end());
 
-  passiveConfig.parse(CONFIG, true, "dummy-config");
-  BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
+  BOOST_CHECK_EQUAL(m_networkRegionTable.size(), 2);
 
-  passiveConfig.parse(CONFIG, false, "dummy-config");
-  BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
-
-  m_tablesConfig.ensureTablesAreConfigured();
-  BOOST_CHECK_NE(initialLimit, m_cs.getLimit());
+  BOOST_CHECK(m_networkRegionTable.find("/test/regionA") != m_networkRegionTable.end());
+  BOOST_CHECK(m_networkRegionTable.find("/test/regionB/component") != m_networkRegionTable.end());
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_CASE(Reload)
+{
+  const std::string CONFIG1 =
+    "tables\n"
+    "{\n"
+    "  network_region\n"
+    "  {\n"
+    "    /some/region\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG1, true));
+  BOOST_CHECK(m_networkRegionTable.find("/some/region") == m_networkRegionTable.end());
+
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG1, false));
+  BOOST_CHECK(m_networkRegionTable.find("/some/region") != m_networkRegionTable.end());
+
+  const std::string CONFIG2 =
+    "tables\n"
+    "{\n"
+    "  network_region\n"
+    "  {\n"
+    "    /different/region\n"
+    "  }\n"
+    "}\n";
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG2, true));
+  BOOST_CHECK(m_networkRegionTable.find("/some/region") != m_networkRegionTable.end());
+  BOOST_CHECK(m_networkRegionTable.find("/different/region") == m_networkRegionTable.end());
+
+  BOOST_REQUIRE_NO_THROW(runConfig(CONFIG2, false));
+  BOOST_CHECK(m_networkRegionTable.find("/some/region") == m_networkRegionTable.end());
+  BOOST_CHECK(m_networkRegionTable.find("/different/region") != m_networkRegionTable.end());
+}
+
+BOOST_AUTO_TEST_SUITE_END() // NetworkRegion
+
+BOOST_AUTO_TEST_SUITE_END() // TestTableConfigSection
+BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
 } // namespace tests
 } // namespace nfd
