rib: Merge source code of NRD

Change-Id: I44dce9db7ad079661d509349bef07b1acb389b58
Refs: #1486
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..e54f6a3
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,45 @@
+# For Ubuntu only
+language: cpp
+os:
+  - linux
+compiler:
+  - gcc
+notifications:
+  email:
+    on_success: always
+    on_failure: always
+before_install:
+  - travis_retry sudo add-apt-repository -y ppa:named-data/ppa
+  - travis_retry sudo apt-get update
+  - travis_retry sudo apt-get install -qq ndnx-dev
+  - travis_retry sudo apt-get install -qq libboost1.48-all-dev
+  - travis_retry sudo apt-get install -qq libcrypto++-dev
+  - travis_retry sudo apt-get install -qq libsqlite3-dev
+  - travis_retry git clone git://github.com/named-data/ndn-cpp-dev ndn-cpp
+  - cd ndn-cpp
+  - ./waf configure
+  - ./waf -j1
+  - sudo ./waf install
+  - sudo ldconfig
+  - cd ..
+  - ndnsec-keygen /tmp/key | ndnsec-install-cert -
+script:
+  - ./waf configure --with-tests
+  - ./waf -j1
+  - sudo ./waf install
+  - ./build/unit-tests
+# Tutorial for setting up notifications:
+# http://docs.travis-ci.com/user/notifications/
+# Here's a simple example for email notifications:
+#
+# notifications:
+#   email:
+#     recipients:
+#       - one@example.com
+#       - other@example.com
+#     on_success: [always|never|change] # default: change
+#     on_failure: [always|never|change] # default: always
+#
+# There are also other types of notifications available, including:
+# IRC, Campfire, Flowdock, HipChat, and Webhook.
+# For more infomation about notifications, please visit the link above.
diff --git a/.waf-tools/boost.py b/.waf-tools/boost.py
index e54f513..305945a 100644
--- a/.waf-tools/boost.py
+++ b/.waf-tools/boost.py
@@ -61,6 +61,14 @@
 #include <boost/version.hpp>
 int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
 '''
+BOOST_SYSTEM_CODE = '''
+#include <boost/system/error_code.hpp>
+int main() { boost::system::error_code c; }
+'''
+BOOST_THREAD_CODE = '''
+#include <boost/thread.hpp>
+int main() { boost::thread t; }
+'''
 
 # toolsets from {boost_dir}/tools/build/v2/tools/common.jam
 PLATFORM = Utils.unversioned_sys_platform()
@@ -96,10 +104,10 @@
 
 	opt.add_option('--boost-includes', type='string',
 				   default='', dest='boost_includes',
-				   help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_47_0/stage/include''')
+				   help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_55_0/stage/include''')
 	opt.add_option('--boost-libs', type='string',
 				   default='', dest='boost_libs',
-				   help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_47_0/stage/lib''')
+				   help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_55_0/stage/lib''')
 	opt.add_option('--boost-static', action='store_true',
 				   default=False, dest='boost_static',
 				   help='link with static boost libraries (.lib/.a)')
@@ -136,10 +144,10 @@
 		except (OSError, IOError):
 			Logs.error("Could not read the file %r" % node.abspath())
 		else:
-			re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
+			re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.+)"', re.M)
 			m1 = re_but1.search(txt)
 
-			re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+"(.*)"', re.M)
+			re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d+)', re.M)
 			m2 = re_but2.search(txt)
 
 			if m1 and m2:
@@ -310,19 +318,13 @@
 	def try_link():
 		if 'system' in params['lib']:
 			self.check_cxx(
-			 fragment="\n".join([
-			  '#include <boost/system/error_code.hpp>',
-			  'int main() { boost::system::error_code c; }',
-			 ]),
+			 fragment=BOOST_SYSTEM_CODE,
 			 use=var,
 			 execute=False,
 			)
 		if 'thread' in params['lib']:
 			self.check_cxx(
-			 fragment="\n".join([
-			  '#include <boost/thread.hpp>',
-			  'int main() { boost::thread t; }',
-			 ]),
+			 fragment=BOOST_THREAD_CODE,
 			 use=var,
 			 execute=False,
 			)
diff --git a/.waf-tools/coverage.py b/.waf-tools/coverage.py
index eac7608..0a3db65 100644
--- a/.waf-tools/coverage.py
+++ b/.waf-tools/coverage.py
@@ -1,9 +1,13 @@
 # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+#
+# Copyright (c) 2014, Regents of the University of California
+#
+# GPL 3.0 license, see the COPYING.md file for more information
 
 from waflib import TaskGen
 
 def options(opt):
-    opt.add_option('--with-coverage',action='store_true',default=False,dest='with_coverage',
+    opt.add_option('--with-coverage', action='store_true', default=False, dest='with_coverage',
                    help='''Set compiler flags for gcc to enable code coverage information''')
 
 def configure(conf):
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
new file mode 100644
index 0000000..9f7843e
--- /dev/null
+++ b/.waf-tools/default-compiler-flags.py
@@ -0,0 +1,59 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+#
+# Copyright (c) 2014, Regents of the University of California
+#
+# GPL 3.0 license, see the COPYING.md file for more information
+
+from waflib import Logs, Configure
+
+def options(opt):
+    opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug',
+                   help='''Compile in debugging mode without all optimizations (-O0)''')
+
+def configure(conf):
+    areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
+    defaultFlags = []
+
+    if conf.options.use_cxx11:
+        defaultFlags += ['-std=c++0x', '-std=c++11']
+    else:
+        defaultFlags += ['-std=c++03']
+
+    defaultFlags += ['-pedantic', '-Wall', '-Wno-long-long']
+
+    if conf.options.debug:
+        conf.define('_DEBUG', 1)
+        defaultFlags += ['-O0',
+                         '-Og', # gcc >= 4.8
+                         '-g3',
+                         '-fcolor-diagnostics', # clang
+                         '-fdiagnostics-color', # gcc >= 4.9
+                         '-Werror'
+                        ]
+        if areCustomCxxflagsPresent:
+            missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
+            if len(missingFlags) > 0:
+                Logs.warn("Selected debug mode, but CXXFLAGS is set to a custom value '%s'"
+                          % " ".join(conf.env.CXXFLAGS))
+                Logs.warn("Default flags '%s' are not activated" % " ".join(missingFlags))
+        else:
+            conf.add_supported_cxxflags(defaultFlags)
+    else:
+        defaultFlags += ['-O2', '-g']
+        if not areCustomCxxflagsPresent:
+            conf.add_supported_cxxflags(defaultFlags)
+
+@Configure.conf
+def add_supported_cxxflags(self, cxxflags):
+    """
+    Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
+    """
+    self.start_msg('Checking allowed flags for c++ compiler')
+
+    supportedFlags = []
+    for flag in cxxflags:
+        if self.check_cxx(cxxflags=[flag], mandatory=False):
+            supportedFlags += [flag]
+
+    self.end_msg(' '.join(supportedFlags))
+    self.env.CXXFLAGS = supportedFlags + self.env.CXXFLAGS
diff --git a/.waf-tools/dependency-checker.py b/.waf-tools/dependency-checker.py
new file mode 100644
index 0000000..5751c62
--- /dev/null
+++ b/.waf-tools/dependency-checker.py
@@ -0,0 +1,28 @@
+# encoding: utf-8
+
+from waflib import Options, Logs
+from waflib.Configure import conf
+
+def addDependencyOptions(self, opt, name, extraHelp=''):
+    opt.add_option('--with-%s' % name, type='string', default=None,
+                   dest='with_%s' % name,
+                   help='Path to %s, e.g., /usr/local %s' % (name, extraHelp))
+setattr(Options.OptionsContext, "addDependencyOptions", addDependencyOptions)
+
+@conf
+def checkDependency(self, name, **kw):
+    root = kw.get('path', getattr(Options.options, 'with_%s' % name))
+    kw['msg'] = kw.get('msg', 'Checking for %s library' % name)
+    kw['uselib_store'] = kw.get('uselib_store', name.upper())
+    kw['define_name'] = kw.get('define_name', 'HAVE_%s' % kw['uselib_store'])
+    kw['mandatory'] = kw.get('mandatory', True)
+
+    if root:
+        isOk = self.check_cxx(cxxflags="-I%s/include" % root,
+                              linkflags="-L%s/lib" % root,
+                              **kw)
+    else:
+        isOk = self.check_cxx(**kw)
+
+    if isOk:
+        self.env[kw['define_name']] = True
diff --git a/.waf-tools/doxygen.py b/.waf-tools/doxygen.py
index aebb511..ac8c70b 100644
--- a/.waf-tools/doxygen.py
+++ b/.waf-tools/doxygen.py
@@ -21,11 +21,15 @@
 	def build(bld):
 		if bld.env.DOXYGEN:
 			bld(features="doxygen", doxyfile='Doxyfile', ...)
+
+        def doxygen(bld):
+		if bld.env.DOXYGEN:
+			bld(features="doxygen", doxyfile='Doxyfile', ...)
 """
 
 from fnmatch import fnmatchcase
 import os, os.path, re, stat
-from waflib import Task, Utils, Node, Logs, Errors
+from waflib import Task, Utils, Node, Logs, Errors, Build
 from waflib.TaskGen import feature
 
 DOXY_STR = '"${DOXYGEN}" - '
@@ -202,3 +206,9 @@
 
 	conf.find_program('doxygen', var='DOXYGEN', mandatory=False)
 	conf.find_program('tar', var='TAR', mandatory=False)
+
+# doxygen docs
+from waflib.Build import BuildContext
+class doxy(BuildContext):
+    cmd = "doxygen"
+    fun = "doxygen"
diff --git a/.waf-tools/sphinx_build.py b/.waf-tools/sphinx_build.py
new file mode 100644
index 0000000..09f67f8
--- /dev/null
+++ b/.waf-tools/sphinx_build.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Hans-Martin von Gaudecker, 2012
+
+import os
+from waflib import Node, Task, TaskGen, Errors, Logs, Build, Utils
+
+class sphinx_build(Task.Task):
+    color = 'BLUE'
+    run_str = '${SPHINX_BUILD} -q -b ${BUILDERNAME} -d ${DOCTREEDIR} ${SRCDIR} ${OUTDIR}'
+
+    def __str__(self):
+        env = self.env
+        src_str = ' '.join([a.nice_path()for a in self.inputs])
+        tgt_str = ' '.join([a.nice_path()for a in self.outputs])
+        if self.outputs: sep = ' -> '
+        else: sep = ''
+        return'%s [%s]: %s%s%s\n'%(self.__class__.__name__.replace('_task',''),
+                                   self.env['BUILDERNAME'], src_str, sep, tgt_str)
+
+@TaskGen.extension('.py', '.rst')
+def sig_hook(self, node):
+    node.sig=Utils.h_file(node.abspath())
+
+@TaskGen.feature("sphinx")
+@TaskGen.before_method("process_source")
+def apply_sphinx(self):
+    """Set up the task generator with a Sphinx instance and create a task."""
+
+    inputs = []
+    for i in Utils.to_list(self.source):
+        if not isinstance(i, Node.Node):
+            node = self.path.find_node(node)
+        else:
+            node = i
+        if not node:
+            raise ValueError('[%s] file not found' % i)
+        inputs.append(node)
+
+    task = self.create_task('sphinx_build', inputs)
+
+    conf = self.path.find_node(self.config)
+    task.inputs.append(conf)
+
+    confdir = conf.parent.abspath()
+    buildername = getattr(self, "builder", "html")
+    srcdir = getattr(self, "srcdir", confdir)
+    outdir = self.path.find_or_declare(getattr(self, "outdir", buildername)).get_bld()
+    doctreedir = getattr(self, "doctreedir", os.path.join(outdir.abspath(), ".doctrees"))
+
+    task.env['BUILDERNAME'] = buildername
+    task.env['SRCDIR'] = srcdir
+    task.env['DOCTREEDIR'] = doctreedir
+    task.env['OUTDIR'] = outdir.abspath()
+
+    import imp
+    confData = imp.load_source('sphinx_conf', conf.abspath())
+
+    if buildername == "man":
+        for i in confData.man_pages:
+            target = outdir.find_or_declare('%s.%d' % (i[1], i[4]))
+            task.outputs.append(target)
+
+            if self.install_path:
+                self.bld.install_files("%s/man%d/" % (self.install_path, i[4]), target)
+    else:
+        task.outputs.append(outdir)
+
+def configure(conf):
+    conf.find_program('sphinx-build', var='SPHINX_BUILD', mandatory=False)
+
+# sphinx docs
+from waflib.Build import BuildContext
+class sphinx(BuildContext):
+    cmd = "sphinx"
+    fun = "sphinx"
diff --git a/.waf-tools/unix-socket.py b/.waf-tools/unix-socket.py
new file mode 100644
index 0000000..d3c6b31
--- /dev/null
+++ b/.waf-tools/unix-socket.py
@@ -0,0 +1,35 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+#
+# Copyright (c) 2014, Regents of the University of California
+#
+# GPL 3.0 license, see the COPYING.md file for more information
+
+from waflib import Options
+
+BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK = '''
+#include <iostream>
+#include <boost/asio.hpp>
+int main() {
+#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
+    return 0;
+#else
+#error "Unix sockets are not available on this platform"
+#endif
+    return 0;
+}
+'''
+
+def addUnixOptions(self, opt):
+    opt.add_option('--force-unix-socket', action='store_true', default=False,
+                   dest='force_unix_socket', help='''Forcefully enable UNIX sockets support''')
+setattr(Options.OptionsContext, "addUnixOptions", addUnixOptions)
+
+def configure(conf):
+    def boost_asio_has_local_sockets():
+        return conf.check_cxx(msg='Checking if UNIX sockets are supported',
+                              fragment=BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK,
+                              use='BOOST NDN_CPP RT', mandatory=False)
+
+    if conf.options.force_unix_socket or boost_asio_has_local_sockets():
+        conf.define('HAVE_UNIX_SOCKETS', 1)
+        conf.env['HAVE_UNIX_SOCKETS'] = True
diff --git a/AUTHORS.md b/AUTHORS.md
new file mode 100644
index 0000000..cad7c8b
--- /dev/null
+++ b/AUTHORS.md
@@ -0,0 +1,58 @@
+NFD Authors
+===========
+
+NFD is an open source project started in late 2013, includes contributions
+from many people around the world, and open for new contributions from new
+volunteers.
+
+
+## Project technical leads:
+
+* Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+* Junxiao Shi         <http://www.cs.arizona.edu/people/shijunxiao/>
+
+
+## Technical advisors:
+
+* Beichuan Zhang      <http://www.cs.arizona.edu/~bzhang/>
+* Lixia Zhang         <http://www.cs.ucla.edu/~lixia/>
+
+
+## All project authors and contributors and their affiliations:
+
+* University of California, Los Angeles
+
+    * Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+    * Ilya Moiseenko      <http://ilyamoiseenko.com/>
+    * Yingdi Yu           <http://irl.cs.ucla.edu/~yingdi/web/index.html>
+    * Wentao Shang        <http://irl.cs.ucla.edu/~wentao/>
+    * Lixia Zhang         <http://www.cs.ucla.edu/~lixia/>
+
+* The University of Arizona
+
+    * Junxiao Shi         <http://www.cs.arizona.edu/people/shijunxiao/>
+    * Yi Huang            <ethanhuang1991@gmail.com>
+    * Jerald Paul Abraham <http://www.cs.arizona.edu/people/jeraldabraham/>
+    * Beichuan Zhang      <http://www.cs.arizona.edu/~bzhang/>
+
+* Colorado State University
+
+    * Steve DiBenedetto     <http://www.cs.colostate.edu/~dibenede/>
+    * Christos Papadopoulos <http://www.cs.colostate.edu/~christos/>
+
+* University Pierre & Marie Curie, Sorbonne University
+
+    * Davide Pesavento    <http://www.lip6.fr/actualite/personnes-fiche.php?ident=D1469>
+    * Giulio Grassi       <http://www.lip6.fr/actualite/personnes-fiche.php?ident=D1461>
+    * Giovanni Pau        <http://www.cs.ucla.edu/~gpau/Giovanni_Paus_Home_Page/Home.html>
+
+* Beijing Institute of Technology
+
+    * Hang Zhang          <http://netlab.bit.edu.cn/z_hang>
+    * Tian Song           <http://cs.bit.edu.cn/songtian>
+
+* Washington University in St. Louis
+
+    * Haowei Yuan         <http://www.cse.wustl.edu/~yuanh/>
+    * Hila Ben Abraham    <http://research.engineering.wustl.edu/~abrahamh/>
+    * Patrick Crowley     <http://www.arl.wustl.edu/~pcrowley/>
diff --git a/COPYING.md b/COPYING.md
new file mode 100644
index 0000000..d799430
--- /dev/null
+++ b/COPYING.md
@@ -0,0 +1,677 @@
+GNU GENERAL PUBLIC LICENSE
+==========================
+Version 3, 29 June 2007
+=======================
+
+> Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+  Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+# Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+# TERMS AND CONDITIONS
+
+## 0. Definitions.
+
+  _"This License"_ refers to version 3 of the GNU General Public License.
+
+  _"Copyright"_ also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  _"The Program"_ refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as _"you"_.  _"Licensees"_ and
+"recipients" may be individuals or organizations.
+
+  To _"modify"_ a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a _"modified version"_ of the
+earlier work or a work _"based on"_ the earlier work.
+
+  A _"covered work"_ means either the unmodified Program or a work based
+on the Program.
+
+  To _"propagate"_ a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To _"convey"_ a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+## 1. Source Code.
+
+  The _"source code"_ for a work means the preferred form of the work
+for making modifications to it. _"Object code"_ means any non-source
+form of a work.
+
+  A _"Standard Interface"_ means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The _"System Libraries"_ of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The _"Corresponding Source"_ for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+## 2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+## 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+## 4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+## 5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+## 6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A _"User Product"_ is either (1) a _"consumer product"_, which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  _"Installation Information"_ for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+## 7. Additional Terms.
+
+  _"Additional permissions"_ are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+## 8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+## 9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+## 10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An _"entity transaction"_ is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+## 11. Patents.
+
+  A _"contributor"_ is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's _"essential patent claims"_ are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+## 12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+## 13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+## 14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+## 15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+## 16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+## 17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+# END OF TERMS AND CONDITIONS
+--------------------------------------------------------------------------
+
+
+# How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program 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.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type 'show c' for details.
+
+  The hypothetical commands _'show w'_ and _'show c'_ should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/INSTALL.md b/INSTALL.md
index 868a8d1..cf8bfcc 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,16 +1,86 @@
+NFD: NDN Forwarding Daemon
+==========================
+
 ## Prerequisites
 
-* Boost libraries >= 1.48
-* [NDN-CPP-dev library](https://github.com/named-data/ndn-cpp-dev)
-* `pkg-config`
+* [ndn-cpp-dev library](https://github.com/named-data/ndn-cpp-dev) and
+  its requirements:
+
+    * `libcrypto`
+    * `libsqlite3`
+    * `libcrypto++`
+    * `pkg-config`
+    * Boost libraries (>= 1.48)
+    * OSX Security framework (on OSX platform only)
+
+    Refer to https://github.com/named-data/ndn-cpp-dev/blob/master/INSTALL.md
+    for detailed installation instructions.
+
+* `libpcap`
+
+    Comes with base on OS X 10.8 and 10.9:
+
+    On Ubuntu >= 12.04:
+
+        sudo apt-get install libpcap-dev
+
+To build manpages and API documentation:
+
+* `doxygen`
+* `graphviz`
+* `python-sphinx`
+
+    On OS X 10.8 and 10.9 with macports:
+
+        sudo port install doxygen graphviz py27-sphinx sphinx_select
+        sudo port select sphinx py27-sphinx
+
+    On Ubuntu >= 12.04:
+
+        sudo apt-get install doxygen graphviz python-sphinx
+
 
 ## Build
 
-The following commands should be used to build NRD:
+The following commands should be used to build NFD:
 
     ./waf configure
     ./waf
-
-If NRD needs to be installed
-
     sudo ./waf install
+
+Refer to `README.md` file for more options that can be used during `configure` stage and
+how to properly configure and run NFD.
+
+In some configurations, configuration step may require small modification.  For example,
+on OSX that uses macports (correct the path if macports was not installed in the default
+path `/opt/local`):
+
+    export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH
+    ./waf configure
+    ./waf
+    sudo ./waf install
+
+On some Linux distributions (e.g., Fedora 20):
+
+    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:$PKG_CONFIG_PATH
+    ./waf configure
+    ./waf
+    sudo ./waf install
+
+# Building API documentation
+
+The following commands can be used to build API documentation in `build/docs/doxygen`
+
+    ./waf doxygen
+
+Note that manpages are automatically created and installed during the normal build process
+(e.g., during `./waf` and `./waf install`), if `python-sphinx` module is detected during
+`./waf configure` stage.  By default, manpages are installed into `${PREFIX}/share/man`
+(where default value for `PREFIX` is `/usr/local`).  This location can be changed during
+`./waf configure` stage using `--prefix`, `--datarootdir`, or `--mandir` options.
+
+For more details, refer to `./waf --help`.
+
+Additional documentation in `build/docs` can be built using (requires `python-sphinx` package)
+
+    ./waf sphinx
diff --git a/README-dev.md b/README-dev.md
new file mode 100644
index 0000000..b4cba89
--- /dev/null
+++ b/README-dev.md
@@ -0,0 +1,74 @@
+Requirements
+---------------------
+
+Include the following header into all `.hpp` and `.cpp` files:
+
+    /* -*- 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
+     *
+     * This file is part of NFD (Named Data Networking Forwarding Daemon).
+     * See AUTHORS.md for complete list of NFD authors and contributors.
+     *
+     * NFD 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.
+     *
+     * NFD 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
+     * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+     ////// [optional part] //////
+     *
+     * \author Author's Name <email@domain>
+     * \author Other Author's Name <another.email@domain>
+     ////// [end of optional part] //////
+     **/
+
+Recommendations
+---------------
+
+NFD code is subject to the code style, defined here:
+http://redmine.named-data.net/projects/nfd/wiki/CodeStyle
+
+Running unit-tests
+------------------
+
+To run unit tests, NFD needs to be configured and build with unit test support:
+
+    ./waf configure --with-tests
+    ./waf
+
+The simplest way to run tests, is just to run the compiled binary without any parameters:
+
+    ./build/unit-tests
+
+However, Boost.Test framework is very flexible and allow a number of
+run-time customization of what tests should be run.  For example, it
+is possible to choose to run only specific test suite or only a
+specific test case within a suite:
+
+    # Run only skeleton test suite (see tests/test-skeleton.cpp)
+    ./build/unit-tests -t TestSkeleton
+
+    # Run only test cast Test1 from skeleton suite
+    ./build/unit-tests -t TestSkeleton/Test1
+
+By default, Boost.Test framework will produce verbose output only when
+test case fails.  If it is desired to see verbose output (result of
+each test assertion), add ``-l all`` option to ``./build/unit-tests``
+command:
+
+    ./build/unit-tests -l all
+
+There are many more command line options available, information about
+which can be obtained either from the command line using ``--help``
+switch, or online on Boost.Test library website
+(http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/).
diff --git a/README.md b/README.md
index 469599f..04aadb5 100644
--- a/README.md
+++ b/README.md
@@ -1,69 +1,92 @@
-NRD (NDN Routing Daemon)
-========================
-NRD works in parallel with NFD and provides services for prefix registration.
-
-For installation details please see INSTALL.md.
+NFD - Named Data Networking Forwarding Daemon
+==============================================================
 
 ## Default Paths
 
 This README uses `SYSCONFDIR` when referring to the default locations of
-various configuration files.  By default, `SYSCONFDIR` is set to
-`/usr/local/etc`.  If you override just `PREFIX`, then `SYSCONFDIR` will
+various NFD configuration files.  By default, `SYSCONFDIR` is set to
+`/usr/local/etc`.  If you override `PREFIX`, then `SYSCONFDIR` will
 default to `PREFIX/etc`.
 
-You may override `SYSCONFDIR` and/or `PREFIX` by specifying their
-corresponding options during configuration:
+You may override `SYSCONFDIR` and `PREFIX` by specifying their
+corresponding options during installation:
 
     ./waf configure --prefix <path/for/prefix> --sysconfdir <some/other/path>
 
-## Running and Configuring NRD
+Refer to `INSTALL.md` for more detailed instructions on how to compile
+and install NFD.
 
-NRD's runtime settings may be modified via configuration file.  After
+## Running and Configuring NFD
+
+NFD's runtime settings may be modified via configuration file.  After
 installation, a working sample configuration is provided at
-`SYSCONFDIR/ndn/nrd.conf.sample`. At startup, NRD will attempt to
-read the default configuration file from following location:
-`SYSCONFDIR/ndn/nrd.conf`.
+`SYSCONFDIR/ndn/nfd.conf.sample`.  At startup, NFD will attempt to
+read the default configuration file location:
+`SYSCONFDIR/ndn/nfd.conf`.
 
 You may also specify an alternative configuration file location
-by running NRD with:
+by running NFD with:
 
-    nrd --config </path/to/nrd.conf>
+    nfd --config </path/to/nfd.conf>
 
-Currently, nrd.conf contains only a security section, which is well documented
-in the sample configuration file.
+Once again, note that you may simply copy or rename the provided
+sample configuration and have an **almost** fully configured NFD.
+However, this NFD will be unable to add FIB entries or perform
+other typical operation tasks until you authorize an NDN certificate
+with the appropriate privileges.
 
-## Starting experiments
+## Installing an NDN Certificate for Command Authentication
 
-1. Build, install and setup NFD by following the directions provided in
-README.md in NFD root folder.
+Many NFD management protocols require signed commands to be processed
+(e.g. FIB modification, Face creation/destructions, etc.). You will
+need an NDN certificate to use any application that issues signed
+commands.
 
-2. Create certificates by following the instructions in NFD's README.md
+If you do not already have NDN certificate, you can generate one with
+the following commands:
 
-3. Build and install NRD by following the directions in INSTALL.md
+**Generate and install a self-signed identity certificate**:
 
-4. Create nrd.conf file. You can simply copy the provided sample file in
-`SYSCONFDIR/ndn/nrd.conf`.
+    ndnsec-keygen /`whoami` | ndnsec-install-cert -
 
-5. Setup the trust-anchors in nrd.conf. Ideally, the prefix registration
-Interest should be signed by application/user key, and this application/user
-key should be used as trust-anchor. However, currently the default certificate
-is used to sign the registration Interests. Therefore, for initial testing the
-default certificate should be set as the trust-anchor. For doing so, the default
-certificate should be copied in the same folder where the nrd.conf is.
-Secondly, the trust-anchor should point to the copied certificate in nrd.conf.
-To know the id of default certificate you can use:
+Note that the argument to ndnsec-key will be the identity name of the
+new key (in this case, `/your-username`). Identity names are
+hierarchical NDN names and may have multiple components
+(e.g. `/ndn/ucla/edu/alice`).  You may create additional keys and
+identities as you see fit.
 
-    ~$ ndnsec-get-default
+**Dump the NDN certificate to a file**:
 
-6. Start NFD (assuming the NFD's conf file exist in `SYSCONFDIR/ndn/nfd.conf`):
+The following commands assume that you have not modified
+`PREFIX` or `SYSCONFDIR` If you have, please substitute
+`/usr/local/etc` for the appropriate value (the overriden
+`SYSCONFDIR` or `PREFIX/etc` if you changed `PREFIX`).
 
-    ~$ nfd
+    sudo mkdir -p /usr/local/etc/ndn/keys
+    ndnsec-cert-dump -i /`whoami` > default.ndncert
+    sudo mv default.ndncert /usr/local/etc/ndn/keys/default.ndncert
 
-7. Start NRD (assuming the conf file exist in `SYSCONFDIR/ndn/nrd.conf`):
+## Running NFD with Ethernet Face Support
 
-    ~$ nrd
+The ether configuration file section contains settings for Ethernet
+faces and channels.  These settings will **NOT** work without root or
+setting the appropriate permissions:
 
-8. Try to connect any application to NFD. For example, producer application that is provided
-ndn-cpp-dev examples.
+    sudo setcap cap_net_raw,cap_net_admin=eip /full/path/nfd
 
+You may need to install a package to use setcap:
 
+**Ubuntu:**
+
+    sudo apt-get install libcap2-bin
+
+**Mac OS X:**
+
+    curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
+    tar zxvf ChmodBPF.tar.gz
+    open ChmodBPF/Install\ ChmodBPF.app
+
+or manually:
+
+    sudo chgrp admin /dev/bpf*
+    sudo chmod g+rw /dev/bpf*
diff --git a/common.hpp b/common.hpp
new file mode 100644
index 0000000..ec7a612
--- /dev/null
+++ b/common.hpp
@@ -0,0 +1,82 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_COMMON_HPP
+#define NFD_COMMON_HPP
+
+#include "config.hpp"
+
+#ifdef WITH_TESTS
+#define VIRTUAL_WITH_TESTS virtual
+#define PUBLIC_WITH_TESTS_ELSE_PROTECTED public
+#define PUBLIC_WITH_TESTS_ELSE_PRIVATE public
+#define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
+#else
+#define VIRTUAL_WITH_TESTS
+#define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
+#define PUBLIC_WITH_TESTS_ELSE_PRIVATE private
+#define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
+#endif
+
+#include <ndn-cpp-dev/common.hpp>
+#include <ndn-cpp-dev/interest.hpp>
+#include <ndn-cpp-dev/data.hpp>
+
+#include <boost/assert.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/ref.hpp>
+#include <boost/scoped_ptr.hpp>
+
+namespace nfd {
+
+using boost::noncopyable;
+using boost::scoped_ptr;
+
+using ndn::shared_ptr;
+using ndn::weak_ptr;
+using ndn::enable_shared_from_this;
+using ndn::make_shared;
+using ndn::static_pointer_cast;
+using ndn::dynamic_pointer_cast;
+using ndn::const_pointer_cast;
+using ndn::function;
+using ndn::bind;
+
+using ndn::Interest;
+using ndn::Data;
+using ndn::Name;
+using ndn::Exclude;
+using ndn::Block;
+
+namespace tlv {
+using namespace ndn::Tlv;
+}
+
+namespace name = ndn::name;
+namespace time = ndn::time;
+
+} // namespace nfd
+
+#endif // NFD_COMMON_HPP
diff --git a/core/city-hash.cpp b/core/city-hash.cpp
new file mode 100644
index 0000000..e0bebb4
--- /dev/null
+++ b/core/city-hash.cpp
@@ -0,0 +1,628 @@
+// Copyright (c) 2011 Google, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+// CityHash, by Geoff Pike and Jyrki Alakuijala
+//
+// This file provides CityHash64() and related functions.
+//
+// It's probably possible to create even faster hash functions by
+// writing a program that systematically explores some of the space of
+// possible hash functions, by using SIMD instructions, or by
+// compromising on hash quality.
+
+//#include "config.h"
+#include "city-hash.hpp"
+#include <algorithm>
+#include <string.h>  // for memcpy and memset
+
+using namespace std;
+
+
+static uint64 UNALIGNED_LOAD64(const char *p) {
+  uint64 result;
+  memcpy(&result, p, sizeof(result));
+  return result;
+}
+
+static uint32 UNALIGNED_LOAD32(const char *p) {
+  uint32 result;
+  memcpy(&result, p, sizeof(result));
+  return result;
+}
+
+#ifdef _MSC_VER
+
+#include <stdlib.h>
+#define bswap_32(x) _byteswap_ulong(x)
+#define bswap_64(x) _byteswap_uint64(x)
+
+#elif defined(__APPLE__)
+
+// Mac OS X / Darwin features
+#include <libkern/OSByteOrder.h>
+#define bswap_32(x) OSSwapInt32(x)
+#define bswap_64(x) OSSwapInt64(x)
+
+#elif defined(__NetBSD__)
+
+#include <sys/types.h>
+#include <machine/bswap.h>
+#if defined(__BSWAP_RENAME) && !defined(__bswap_32)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+#endif
+
+#else
+
+#include <byteswap.h>
+
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#define uint32_in_expected_order(x) (bswap_32(x))
+#define uint64_in_expected_order(x) (bswap_64(x))
+#else
+#define uint32_in_expected_order(x) (x)
+#define uint64_in_expected_order(x) (x)
+#endif
+
+#if !defined(LIKELY)
+#if HAVE_BUILTIN_EXPECT
+#define LIKELY(x) (__builtin_expect(!!(x), 1))
+#else
+#define LIKELY(x) (x)
+#endif
+#endif
+
+static uint64 Fetch64(const char *p) {
+  return uint64_in_expected_order(UNALIGNED_LOAD64(p));
+}
+
+static uint32 Fetch32(const char *p) {
+  return uint32_in_expected_order(UNALIGNED_LOAD32(p));
+}
+
+// Some primes between 2^63 and 2^64 for various uses.
+static const uint64 k0 = 0xc3a5c85c97cb3127ULL;
+static const uint64 k1 = 0xb492b66fbe98f273ULL;
+static const uint64 k2 = 0x9ae16a3b2f90404fULL;
+
+// Magic numbers for 32-bit hashing.  Copied from Murmur3.
+static const uint32_t c1 = 0xcc9e2d51;
+static const uint32_t c2 = 0x1b873593;
+
+// A 32-bit to 32-bit integer hash copied from Murmur3.
+static uint32 fmix(uint32 h)
+{
+  h ^= h >> 16;
+  h *= 0x85ebca6b;
+  h ^= h >> 13;
+  h *= 0xc2b2ae35;
+  h ^= h >> 16;
+  return h;
+}
+
+static uint32 Rotate32(uint32 val, int shift) {
+  // Avoid shifting by 32: doing so yields an undefined result.
+  return shift == 0 ? val : ((val >> shift) | (val << (32 - shift)));
+}
+
+#undef PERMUTE3
+#define PERMUTE3(a, b, c) do { std::swap(a, b); std::swap(a, c); } while (0)
+
+static uint32 Mur(uint32 a, uint32 h) {
+  // Helper from Murmur3 for combining two 32-bit values.
+  a *= c1;
+  a = Rotate32(a, 17);
+  a *= c2;
+  h ^= a;
+  h = Rotate32(h, 19);
+  return h * 5 + 0xe6546b64;
+}
+
+static uint32 Hash32Len13to24(const char *s, size_t len) {
+  uint32 a = Fetch32(s - 4 + (len >> 1));
+  uint32 b = Fetch32(s + 4);
+  uint32 c = Fetch32(s + len - 8);
+  uint32 d = Fetch32(s + (len >> 1));
+  uint32 e = Fetch32(s);
+  uint32 f = Fetch32(s + len - 4);
+  uint32 h = len;
+
+  return fmix(Mur(f, Mur(e, Mur(d, Mur(c, Mur(b, Mur(a, h)))))));
+}
+
+static uint32 Hash32Len0to4(const char *s, size_t len) {
+  uint32 b = 0;
+  uint32 c = 9;
+  for (size_t i = 0; i < len; i++) {
+    signed char v = s[i];
+    b = b * c1 + v;
+    c ^= b;
+  }
+  return fmix(Mur(b, Mur(len, c)));
+}
+
+static uint32 Hash32Len5to12(const char *s, size_t len) {
+  uint32 a = len, b = len * 5, c = 9, d = b;
+  a += Fetch32(s);
+  b += Fetch32(s + len - 4);
+  c += Fetch32(s + ((len >> 1) & 4));
+  return fmix(Mur(c, Mur(b, Mur(a, d))));
+}
+
+uint32 CityHash32(const char *s, size_t len) {
+  if (len <= 24) {
+    return len <= 12 ?
+        (len <= 4 ? Hash32Len0to4(s, len) : Hash32Len5to12(s, len)) :
+        Hash32Len13to24(s, len);
+  }
+
+  // len > 24
+  uint32 h = len, g = c1 * len, f = g;
+  uint32 a0 = Rotate32(Fetch32(s + len - 4) * c1, 17) * c2;
+  uint32 a1 = Rotate32(Fetch32(s + len - 8) * c1, 17) * c2;
+  uint32 a2 = Rotate32(Fetch32(s + len - 16) * c1, 17) * c2;
+  uint32 a3 = Rotate32(Fetch32(s + len - 12) * c1, 17) * c2;
+  uint32 a4 = Rotate32(Fetch32(s + len - 20) * c1, 17) * c2;
+  h ^= a0;
+  h = Rotate32(h, 19);
+  h = h * 5 + 0xe6546b64;
+  h ^= a2;
+  h = Rotate32(h, 19);
+  h = h * 5 + 0xe6546b64;
+  g ^= a1;
+  g = Rotate32(g, 19);
+  g = g * 5 + 0xe6546b64;
+  g ^= a3;
+  g = Rotate32(g, 19);
+  g = g * 5 + 0xe6546b64;
+  f += a4;
+  f = Rotate32(f, 19);
+  f = f * 5 + 0xe6546b64;
+  size_t iters = (len - 1) / 20;
+  do {
+    uint32 a0 = Rotate32(Fetch32(s) * c1, 17) * c2;
+    uint32 a1 = Fetch32(s + 4);
+    uint32 a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2;
+    uint32 a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2;
+    uint32 a4 = Fetch32(s + 16);
+    h ^= a0;
+    h = Rotate32(h, 18);
+    h = h * 5 + 0xe6546b64;
+    f += a1;
+    f = Rotate32(f, 19);
+    f = f * c1;
+    g += a2;
+    g = Rotate32(g, 18);
+    g = g * 5 + 0xe6546b64;
+    h ^= a3 + a1;
+    h = Rotate32(h, 19);
+    h = h * 5 + 0xe6546b64;
+    g ^= a4;
+    g = bswap_32(g) * 5;
+    h += a4 * 5;
+    h = bswap_32(h);
+    f += a0;
+    PERMUTE3(f, h, g);
+    s += 20;
+  } while (--iters != 0);
+  g = Rotate32(g, 11) * c1;
+  g = Rotate32(g, 17) * c1;
+  f = Rotate32(f, 11) * c1;
+  f = Rotate32(f, 17) * c1;
+  h = Rotate32(h + g, 19);
+  h = h * 5 + 0xe6546b64;
+  h = Rotate32(h, 17) * c1;
+  h = Rotate32(h + f, 19);
+  h = h * 5 + 0xe6546b64;
+  h = Rotate32(h, 17) * c1;
+  return h;
+}
+
+// Bitwise right rotate.  Normally this will compile to a single
+// instruction, especially if the shift is a manifest constant.
+static uint64 Rotate(uint64 val, int shift) {
+  // Avoid shifting by 64: doing so yields an undefined result.
+  return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
+}
+
+static uint64 ShiftMix(uint64 val) {
+  return val ^ (val >> 47);
+}
+
+static uint64 HashLen16(uint64 u, uint64 v) {
+  return Hash128to64(uint128(u, v));
+}
+
+static uint64 HashLen16(uint64 u, uint64 v, uint64 mul) {
+  // Murmur-inspired hashing.
+  uint64 a = (u ^ v) * mul;
+  a ^= (a >> 47);
+  uint64 b = (v ^ a) * mul;
+  b ^= (b >> 47);
+  b *= mul;
+  return b;
+}
+
+static uint64 HashLen0to16(const char *s, size_t len) {
+  if (len >= 8) {
+    uint64 mul = k2 + len * 2;
+    uint64 a = Fetch64(s) + k2;
+    uint64 b = Fetch64(s + len - 8);
+    uint64 c = Rotate(b, 37) * mul + a;
+    uint64 d = (Rotate(a, 25) + b) * mul;
+    return HashLen16(c, d, mul);
+  }
+  if (len >= 4) {
+    uint64 mul = k2 + len * 2;
+    uint64 a = Fetch32(s);
+    return HashLen16(len + (a << 3), Fetch32(s + len - 4), mul);
+  }
+  if (len > 0) {
+    uint8 a = s[0];
+    uint8 b = s[len >> 1];
+    uint8 c = s[len - 1];
+    uint32 y = static_cast<uint32>(a) + (static_cast<uint32>(b) << 8);
+    uint32 z = len + (static_cast<uint32>(c) << 2);
+    return ShiftMix(y * k2 ^ z * k0) * k2;
+  }
+  return k2;
+}
+
+// This probably works well for 16-byte strings as well, but it may be overkill
+// in that case.
+static uint64 HashLen17to32(const char *s, size_t len) {
+  uint64 mul = k2 + len * 2;
+  uint64 a = Fetch64(s) * k1;
+  uint64 b = Fetch64(s + 8);
+  uint64 c = Fetch64(s + len - 8) * mul;
+  uint64 d = Fetch64(s + len - 16) * k2;
+  return HashLen16(Rotate(a + b, 43) + Rotate(c, 30) + d,
+                   a + Rotate(b + k2, 18) + c, mul);
+}
+
+// Return a 16-byte hash for 48 bytes.  Quick and dirty.
+// Callers do best to use "random-looking" values for a and b.
+static pair<uint64, uint64> WeakHashLen32WithSeeds(
+    uint64 w, uint64 x, uint64 y, uint64 z, uint64 a, uint64 b) {
+  a += w;
+  b = Rotate(b + a + z, 21);
+  uint64 c = a;
+  a += x;
+  a += y;
+  b += Rotate(a, 44);
+  return make_pair(a + z, b + c);
+}
+
+// Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.
+static pair<uint64, uint64> WeakHashLen32WithSeeds(
+    const char* s, uint64 a, uint64 b) {
+  return WeakHashLen32WithSeeds(Fetch64(s),
+                                Fetch64(s + 8),
+                                Fetch64(s + 16),
+                                Fetch64(s + 24),
+                                a,
+                                b);
+}
+
+// Return an 8-byte hash for 33 to 64 bytes.
+static uint64 HashLen33to64(const char *s, size_t len) {
+  uint64 mul = k2 + len * 2;
+  uint64 a = Fetch64(s) * k2;
+  uint64 b = Fetch64(s + 8);
+  uint64 c = Fetch64(s + len - 24);
+  uint64 d = Fetch64(s + len - 32);
+  uint64 e = Fetch64(s + 16) * k2;
+  uint64 f = Fetch64(s + 24) * 9;
+  uint64 g = Fetch64(s + len - 8);
+  uint64 h = Fetch64(s + len - 16) * mul;
+  uint64 u = Rotate(a + g, 43) + (Rotate(b, 30) + c) * 9;
+  uint64 v = ((a + g) ^ d) + f + 1;
+  uint64 w = bswap_64((u + v) * mul) + h;
+  uint64 x = Rotate(e + f, 42) + c;
+  uint64 y = (bswap_64((v + w) * mul) + g) * mul;
+  uint64 z = e + f + c;
+  a = bswap_64((x + z) * mul + y) + b;
+  b = ShiftMix((z + a) * mul + d + h) * mul;
+  return b + x;
+}
+
+uint64 CityHash64(const char *s, size_t len) {
+  if (len <= 32) {
+    if (len <= 16) {
+      return HashLen0to16(s, len);
+    } else {
+      return HashLen17to32(s, len);
+    }
+  } else if (len <= 64) {
+    return HashLen33to64(s, len);
+  }
+
+  // For strings over 64 bytes we hash the end first, and then as we
+  // loop we keep 56 bytes of state: v, w, x, y, and z.
+  uint64 x = Fetch64(s + len - 40);
+  uint64 y = Fetch64(s + len - 16) + Fetch64(s + len - 56);
+  uint64 z = HashLen16(Fetch64(s + len - 48) + len, Fetch64(s + len - 24));
+  pair<uint64, uint64> v = WeakHashLen32WithSeeds(s + len - 64, len, z);
+  pair<uint64, uint64> w = WeakHashLen32WithSeeds(s + len - 32, y + k1, x);
+  x = x * k1 + Fetch64(s);
+
+  // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+  len = (len - 1) & ~static_cast<size_t>(63);
+  do {
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    len -= 64;
+  } while (len != 0);
+  return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z,
+                   HashLen16(v.second, w.second) + x);
+}
+
+uint64 CityHash64WithSeed(const char *s, size_t len, uint64 seed) {
+  return CityHash64WithSeeds(s, len, k2, seed);
+}
+
+uint64 CityHash64WithSeeds(const char *s, size_t len,
+                           uint64 seed0, uint64 seed1) {
+  return HashLen16(CityHash64(s, len) - seed0, seed1);
+}
+
+// A subroutine for CityHash128().  Returns a decent 128-bit hash for strings
+// of any length representable in signed long.  Based on City and Murmur.
+static uint128 CityMurmur(const char *s, size_t len, uint128 seed) {
+  uint64 a = Uint128Low64(seed);
+  uint64 b = Uint128High64(seed);
+  uint64 c = 0;
+  uint64 d = 0;
+  signed long l = len - 16;
+  if (l <= 0) {  // len <= 16
+    a = ShiftMix(a * k1) * k1;
+    c = b * k1 + HashLen0to16(s, len);
+    d = ShiftMix(a + (len >= 8 ? Fetch64(s) : c));
+  } else {  // len > 16
+    c = HashLen16(Fetch64(s + len - 8) + k1, a);
+    d = HashLen16(b + len, c + Fetch64(s + len - 16));
+    a += d;
+    do {
+      a ^= ShiftMix(Fetch64(s) * k1) * k1;
+      a *= k1;
+      b ^= a;
+      c ^= ShiftMix(Fetch64(s + 8) * k1) * k1;
+      c *= k1;
+      d ^= c;
+      s += 16;
+      l -= 16;
+    } while (l > 0);
+  }
+  a = HashLen16(a, c);
+  b = HashLen16(d, b);
+  return uint128(a ^ b, HashLen16(b, a));
+}
+
+uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed) {
+  if (len < 128) {
+    return CityMurmur(s, len, seed);
+  }
+
+  // We expect len >= 128 to be the common case.  Keep 56 bytes of state:
+  // v, w, x, y, and z.
+  pair<uint64, uint64> v, w;
+  uint64 x = Uint128Low64(seed);
+  uint64 y = Uint128High64(seed);
+  uint64 z = len * k1;
+  v.first = Rotate(y ^ k1, 49) * k1 + Fetch64(s);
+  v.second = Rotate(v.first, 42) * k1 + Fetch64(s + 8);
+  w.first = Rotate(y + z, 35) * k1 + x;
+  w.second = Rotate(x + Fetch64(s + 88), 53) * k1;
+
+  // This is the same inner loop as CityHash64(), manually unrolled.
+  do {
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    len -= 128;
+  } while (LIKELY(len >= 128));
+  x += Rotate(v.first + z, 49) * k0;
+  y = y * k0 + Rotate(w.second, 37);
+  z = z * k0 + Rotate(w.first, 27);
+  w.first *= 9;
+  v.first *= k0;
+  // If 0 < len < 128, hash up to 4 chunks of 32 bytes each from the end of s.
+  for (size_t tail_done = 0; tail_done < len; ) {
+    tail_done += 32;
+    y = Rotate(x + y, 42) * k0 + v.second;
+    w.first += Fetch64(s + len - tail_done + 16);
+    x = x * k0 + w.first;
+    z += w.second + Fetch64(s + len - tail_done);
+    w.second += v.first;
+    v = WeakHashLen32WithSeeds(s + len - tail_done, v.first + z, v.second);
+    v.first *= k0;
+  }
+  // At this point our 56 bytes of state should contain more than
+  // enough information for a strong 128-bit hash.  We use two
+  // different 56-byte-to-8-byte hashes to get a 16-byte final result.
+  x = HashLen16(x, v.first);
+  y = HashLen16(y + z, w.first);
+  return uint128(HashLen16(x + v.second, w.second) + y,
+                 HashLen16(x + w.second, y + v.second));
+}
+
+uint128 CityHash128(const char *s, size_t len) {
+  return len >= 16 ?
+      CityHash128WithSeed(s + 16, len - 16,
+                          uint128(Fetch64(s), Fetch64(s + 8) + k0)) :
+      CityHash128WithSeed(s, len, uint128(k0, k1));
+}
+
+#ifdef __SSE4_2__
+#include <citycrc.h>
+#include <nmmintrin.h>
+
+// Requires len >= 240.
+static void CityHashCrc256Long(const char *s, size_t len,
+                               uint32 seed, uint64 *result) {
+  uint64 a = Fetch64(s + 56) + k0;
+  uint64 b = Fetch64(s + 96) + k0;
+  uint64 c = result[0] = HashLen16(b, len);
+  uint64 d = result[1] = Fetch64(s + 120) * k0 + len;
+  uint64 e = Fetch64(s + 184) + seed;
+  uint64 f = 0;
+  uint64 g = 0;
+  uint64 h = c + d;
+  uint64 x = seed;
+  uint64 y = 0;
+  uint64 z = 0;
+
+  // 240 bytes of input per iter.
+  size_t iters = len / 240;
+  len -= iters * 240;
+  do {
+#undef CHUNK
+#define CHUNK(r)                                \
+    PERMUTE3(x, z, y);                          \
+    b += Fetch64(s);                            \
+    c += Fetch64(s + 8);                        \
+    d += Fetch64(s + 16);                       \
+    e += Fetch64(s + 24);                       \
+    f += Fetch64(s + 32);                       \
+    a += b;                                     \
+    h += f;                                     \
+    b += c;                                     \
+    f += d;                                     \
+    g += e;                                     \
+    e += z;                                     \
+    g += x;                                     \
+    z = _mm_crc32_u64(z, b + g);                \
+    y = _mm_crc32_u64(y, e + h);                \
+    x = _mm_crc32_u64(x, f + a);                \
+    e = Rotate(e, r);                           \
+    c += e;                                     \
+    s += 40
+
+    CHUNK(0); PERMUTE3(a, h, c);
+    CHUNK(33); PERMUTE3(a, h, f);
+    CHUNK(0); PERMUTE3(b, h, f);
+    CHUNK(42); PERMUTE3(b, h, d);
+    CHUNK(0); PERMUTE3(b, h, e);
+    CHUNK(33); PERMUTE3(a, h, e);
+  } while (--iters > 0);
+
+  while (len >= 40) {
+    CHUNK(29);
+    e ^= Rotate(a, 20);
+    h += Rotate(b, 30);
+    g ^= Rotate(c, 40);
+    f += Rotate(d, 34);
+    PERMUTE3(c, h, g);
+    len -= 40;
+  }
+  if (len > 0) {
+    s = s + len - 40;
+    CHUNK(33);
+    e ^= Rotate(a, 43);
+    h += Rotate(b, 42);
+    g ^= Rotate(c, 41);
+    f += Rotate(d, 40);
+  }
+  result[0] ^= h;
+  result[1] ^= g;
+  g += h;
+  a = HashLen16(a, g + z);
+  x += y << 32;
+  b += x;
+  c = HashLen16(c, z) + h;
+  d = HashLen16(d, e + result[0]);
+  g += e;
+  h += HashLen16(x, f);
+  e = HashLen16(a, d) + g;
+  z = HashLen16(b, c) + a;
+  y = HashLen16(g, h) + c;
+  result[0] = e + z + y + x;
+  a = ShiftMix((a + y) * k0) * k0 + b;
+  result[1] += a + result[0];
+  a = ShiftMix(a * k0) * k0 + c;
+  result[2] = a + result[1];
+  a = ShiftMix((a + e) * k0) * k0;
+  result[3] = a + result[2];
+}
+
+// Requires len < 240.
+static void CityHashCrc256Short(const char *s, size_t len, uint64 *result) {
+  char buf[240];
+  memcpy(buf, s, len);
+  memset(buf + len, 0, 240 - len);
+  CityHashCrc256Long(buf, 240, ~static_cast<uint32>(len), result);
+}
+
+void CityHashCrc256(const char *s, size_t len, uint64 *result) {
+  if (LIKELY(len >= 240)) {
+    CityHashCrc256Long(s, len, 0, result);
+  } else {
+    CityHashCrc256Short(s, len, result);
+  }
+}
+
+uint128 CityHashCrc128WithSeed(const char *s, size_t len, uint128 seed) {
+  if (len <= 900) {
+    return CityHash128WithSeed(s, len, seed);
+  } else {
+    uint64 result[4];
+    CityHashCrc256(s, len, result);
+    uint64 u = Uint128High64(seed) + result[0];
+    uint64 v = Uint128Low64(seed) + result[1];
+    return uint128(HashLen16(u, v + result[2]),
+                   HashLen16(Rotate(v, 32), u * k0 + result[3]));
+  }
+}
+
+uint128 CityHashCrc128(const char *s, size_t len) {
+  if (len <= 900) {
+    return CityHash128(s, len);
+  } else {
+    uint64 result[4];
+    CityHashCrc256(s, len, result);
+    return uint128(result[2], result[3]);
+  }
+}
+
+#endif
diff --git a/core/city-hash.hpp b/core/city-hash.hpp
new file mode 100644
index 0000000..54a90cb
--- /dev/null
+++ b/core/city-hash.hpp
@@ -0,0 +1,112 @@
+// Copyright (c) 2011 Google, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+// CityHash, by Geoff Pike and Jyrki Alakuijala
+//
+// http://code.google.com/p/cityhash/
+//
+// This file provides a few functions for hashing strings.  All of them are
+// high-quality functions in the sense that they pass standard tests such
+// as Austin Appleby's SMHasher.  They are also fast.
+//
+// For 64-bit x86 code, on short strings, we don't know of anything faster than
+// CityHash64 that is of comparable quality.  We believe our nearest competitor
+// is Murmur3.  For 64-bit x86 code, CityHash64 is an excellent choice for hash
+// tables and most other hashing (excluding cryptography).
+//
+// For 64-bit x86 code, on long strings, the picture is more complicated.
+// On many recent Intel CPUs, such as Nehalem, Westmere, Sandy Bridge, etc.,
+// CityHashCrc128 appears to be faster than all competitors of comparable
+// quality.  CityHash128 is also good but not quite as fast.  We believe our
+// nearest competitor is Bob Jenkins' Spooky.  We don't have great data for
+// other 64-bit CPUs, but for long strings we know that Spooky is slightly
+// faster than CityHash on some relatively recent AMD x86-64 CPUs, for example.
+// Note that CityHashCrc128 is declared in citycrc.h.
+//
+// For 32-bit x86 code, we don't know of anything faster than CityHash32 that
+// is of comparable quality.  We believe our nearest competitor is Murmur3A.
+// (On 64-bit CPUs, it is typically faster to use the other CityHash variants.)
+//
+// Functions in the CityHash family are not suitable for cryptography.
+//
+// Please see CityHash's README file for more details on our performance
+// measurements and so on.
+//
+// WARNING: This code has been only lightly tested on big-endian platforms!
+// It is known to work well on little-endian platforms that have a small penalty
+// for unaligned reads, such as current Intel and AMD moderate-to-high-end CPUs.
+// It should work on all 32-bit and 64-bit platforms that allow unaligned reads;
+// bug reports are welcome.
+//
+// By the way, for some hash functions, given strings a and b, the hash
+// of a+b is easily derived from the hashes of a and b.  This property
+// doesn't hold for any hash functions in this file.
+
+#ifndef CITY_HASH_HPP
+#define CITY_HASH_HPP
+
+#include <stdlib.h>  // for size_t.
+#include <stdint.h>
+#include <utility>
+
+typedef uint8_t uint8;
+typedef uint32_t uint32;
+typedef uint64_t uint64;
+typedef std::pair<uint64, uint64> uint128;
+
+inline uint64 Uint128Low64(const uint128& x) { return x.first; }
+inline uint64 Uint128High64(const uint128& x) { return x.second; }
+
+// Hash function for a byte array.
+uint64 CityHash64(const char *buf, size_t len);
+
+// Hash function for a byte array.  For convenience, a 64-bit seed is also
+// hashed into the result.
+uint64 CityHash64WithSeed(const char *buf, size_t len, uint64 seed);
+
+// Hash function for a byte array.  For convenience, two seeds are also
+// hashed into the result.
+uint64 CityHash64WithSeeds(const char *buf, size_t len,
+                           uint64 seed0, uint64 seed1);
+
+// Hash function for a byte array.
+uint128 CityHash128(const char *s, size_t len);
+
+// Hash function for a byte array.  For convenience, a 128-bit seed is also
+// hashed into the result.
+uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed);
+
+// Hash function for a byte array.  Most useful in 32-bit binaries.
+uint32 CityHash32(const char *buf, size_t len);
+
+// Hash 128 input bits down to 64 bits of output.
+// This is intended to be a reasonably good hash function.
+inline uint64 Hash128to64(const uint128& x) {
+  // Murmur-inspired hashing.
+  const uint64 kMul = 0x9ddfea08eb382d69ULL;
+  uint64 a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul;
+  a ^= (a >> 47);
+  uint64 b = (Uint128High64(x) ^ a) * kMul;
+  b ^= (b >> 47);
+  b *= kMul;
+  return b;
+}
+
+#endif  // CITY_HASH_H_
diff --git a/core/config-file.cpp b/core/config-file.cpp
new file mode 100644
index 0000000..436c480
--- /dev/null
+++ b/core/config-file.cpp
@@ -0,0 +1,125 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "config-file.hpp"
+#include "logger.hpp"
+
+#include <boost/property_tree/info_parser.hpp>
+#include <fstream>
+
+namespace nfd {
+
+NFD_LOG_INIT("ConfigFile");
+
+ConfigFile::ConfigFile()
+{
+}
+
+void
+ConfigFile::addSectionHandler(const std::string& sectionName,
+                              ConfigSectionHandler subscriber)
+{
+  m_subscriptions[sectionName] = subscriber;
+}
+
+void
+ConfigFile::parse(const std::string& filename, bool isDryRun)
+{
+  std::ifstream inputFile;
+  inputFile.open(filename.c_str());
+  if (!inputFile.good() || !inputFile.is_open())
+    {
+      std::string msg = "Failed to read configuration file: ";
+      msg += filename;
+      throw Error(msg);
+    }
+  parse(inputFile, isDryRun, filename);
+  inputFile.close();
+}
+
+void
+ConfigFile::parse(const std::string& input, bool isDryRun, const std::string& filename)
+{
+  std::istringstream inputStream(input);
+  parse(inputStream, isDryRun, filename);
+}
+
+
+void
+ConfigFile::parse(std::istream& input, bool isDryRun, const std::string& filename)
+{
+  try
+    {
+      boost::property_tree::read_info(input, m_global);
+    }
+  catch (const boost::property_tree::info_parser_error& error)
+    {
+      std::stringstream msg;
+      msg << "Failed to parse configuration file";
+      msg << " " << filename;
+      msg << " " << error.message() << " line " << error.line();
+      throw Error(msg.str());
+    }
+
+  process(isDryRun, filename);
+}
+
+void
+ConfigFile::process(bool isDryRun, const std::string& filename)
+{
+  BOOST_ASSERT(!filename.empty());
+  // NFD_LOG_DEBUG("processing..." << ((isDryRun)?("dry run"):("")));
+
+  if (m_global.begin() == m_global.end())
+    {
+      std::string msg = "Error processing configuration file";
+      msg += ": ";
+      msg += filename;
+      msg += " no data";
+      throw Error(msg);
+    }
+
+  for (ConfigSection::const_iterator i = m_global.begin(); i != m_global.end(); ++i)
+    {
+      const std::string& sectionName = i->first;
+      const ConfigSection& section = i->second;
+
+      SubscriptionTable::iterator subscriberIt = m_subscriptions.find(sectionName);
+      if (subscriberIt != m_subscriptions.end())
+        {
+          ConfigSectionHandler subscriber = subscriberIt->second;
+          subscriber(section, isDryRun, filename);
+        }
+      else
+        {
+          std::string msg = "Error processing configuration file";
+          msg += " ";
+          msg += filename;
+          msg += " no module subscribed for section: " + sectionName;
+          throw Error(msg);
+        }
+    }
+}
+
+}
diff --git a/core/config-file.hpp b/core/config-file.hpp
new file mode 100644
index 0000000..f3128c4
--- /dev/null
+++ b/core/config-file.hpp
@@ -0,0 +1,107 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_CONFIG_FILE_HPP
+#define NFD_CORE_CONFIG_FILE_HPP
+
+#include "common.hpp"
+
+#include <boost/property_tree/ptree.hpp>
+
+namespace nfd {
+
+typedef boost::property_tree::ptree ConfigSection;
+
+/// \brief callback for config file sections
+typedef function<void(const ConfigSection&, bool, const std::string&)> ConfigSectionHandler;
+
+class ConfigFile : noncopyable
+{
+public:
+
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+
+    }
+  };
+
+  ConfigFile();
+
+  /// \brief setup notification of configuration file sections
+  void
+  addSectionHandler(const std::string& sectionName,
+                    ConfigSectionHandler subscriber);
+
+
+  /**
+   * \param filename file to parse
+   * \param isDryRun true if performing a dry run of configuration, false otherwise
+   * \throws ConfigFile::Error if file not found
+   * \throws ConfigFile::Error if parse error
+   */
+  void
+  parse(const std::string& filename, bool isDryRun);
+
+  /**
+   * \param input configuration (as a string) to parse
+   * \param isDryRun true if performing a dry run of configuration, false otherwise
+   * \param filename optional convenience argument to provide more detailed error messages
+   * \throws ConfigFile::Error if file not found
+   * \throws ConfigFile::Error if parse error
+   */
+  void
+  parse(const std::string& input, bool isDryRun, const std::string& filename);
+
+  /**
+   * \param input stream to parse
+   * \param isDryRun true if performing a dry run of configuration, false otherwise
+   * \param filename optional convenience argument to provide more detailed error messages
+   * \throws ConfigFile::Error if parse error
+   */
+  void
+  parse(std::istream& input, bool isDryRun, const std::string& filename);
+
+private:
+
+  void
+  process(bool isDryRun, const std::string& filename);
+
+private:
+
+  typedef std::map<std::string, ConfigSectionHandler> SubscriptionTable;
+
+  SubscriptionTable m_subscriptions;
+
+  ConfigSection m_global;
+};
+
+} // namespace nfd
+
+
+#endif // NFD_CORE_CONFIG_FILE_HPP
diff --git a/core/ethernet.cpp b/core/ethernet.cpp
new file mode 100644
index 0000000..1aeaca6
--- /dev/null
+++ b/core/ethernet.cpp
@@ -0,0 +1,82 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ethernet.hpp"
+
+#include <stdio.h>
+
+namespace nfd {
+namespace ethernet {
+
+std::string
+Address::toString(char sep) const
+{
+  char s[18]; // 12 digits + 5 separators + null terminator
+  ::snprintf(s, sizeof(s), "%02x%c%02x%c%02x%c%02x%c%02x%c%02x",
+             elems[0], sep, elems[1], sep, elems[2], sep,
+             elems[3], sep, elems[4], sep, elems[5]);
+  return std::string(s);
+}
+
+Address
+Address::fromString(const std::string& str)
+{
+  unsigned short temp[ADDR_LEN];
+  char sep[5][2]; // 5 * (1 separator char + 1 null terminator)
+  int n = 0; // num of chars read from the input string
+
+  // ISO C++98 does not support the 'hh' type modifier
+  /// \todo use SCNx8 (cinttypes) when we enable C++11
+  int ret = ::sscanf(str.c_str(), "%2hx%1[:-]%2hx%1[:-]%2hx%1[:-]%2hx%1[:-]%2hx%1[:-]%2hx%n",
+                     &temp[0], &sep[0][0], &temp[1], &sep[1][0], &temp[2], &sep[2][0],
+                     &temp[3], &sep[3][0], &temp[4], &sep[4][0], &temp[5], &n);
+
+  if (ret < 11 || static_cast<size_t>(n) != str.length())
+    return Address();
+
+  Address a;
+  for (size_t i = 0; i < ADDR_LEN; ++i)
+    {
+      // check that all separators are actually the same char (: or -)
+      if (i < 5 && sep[i][0] != sep[0][0])
+        return Address();
+
+      // check that each value fits into a uint8_t
+      if (temp[i] > 0xFF)
+        return Address();
+
+      a[i] = static_cast<uint8_t>(temp[i]);
+    }
+
+  return a;
+}
+
+std::ostream&
+operator<<(std::ostream& o, const Address& a)
+{
+  return o << a.toString();
+}
+
+} // namespace ethernet
+} // namespace nfd
diff --git a/core/ethernet.hpp b/core/ethernet.hpp
new file mode 100644
index 0000000..56888f6
--- /dev/null
+++ b/core/ethernet.hpp
@@ -0,0 +1,167 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_ETHERNET_HPP
+#define NFD_CORE_ETHERNET_HPP
+
+#include "common.hpp"
+
+#include <boost/array.hpp>
+
+#define ETHERTYPE_NDN 0x8624
+
+namespace nfd {
+namespace ethernet {
+
+const size_t ADDR_LEN     = 6;      ///< Octets in one Ethernet address
+const size_t TYPE_LEN     = 2;      ///< Octets in Ethertype field
+const size_t HDR_LEN      = 14;     ///< Total octets in Ethernet header (without 802.1Q tag)
+const size_t TAG_LEN      = 4;      ///< Octets in 802.1Q tag (TPID + priority + VLAN)
+const size_t MIN_DATA_LEN = 46;     ///< Min octets in Ethernet payload (assuming no 802.1Q tag)
+const size_t MAX_DATA_LEN = 1500;   ///< Max octets in Ethernet payload
+const size_t CRC_LEN      = 4;      ///< Octets in Ethernet frame check sequence
+
+
+class Address : public boost::array<uint8_t, ADDR_LEN>
+{
+public:
+  /// Constructs a null Ethernet address (00:00:00:00:00:00)
+  Address();
+
+  /// Constructs a new Ethernet address with the given octets
+  Address(uint8_t a1, uint8_t a2, uint8_t a3,
+          uint8_t a4, uint8_t a5, uint8_t a6);
+
+  /// Constructs a new Ethernet address with the given octets
+  explicit
+  Address(const uint8_t octets[ADDR_LEN]);
+
+  /// Copy constructor
+  Address(const Address& address);
+
+  /// True if this is a broadcast address (ff:ff:ff:ff:ff:ff)
+  bool
+  isBroadcast() const;
+
+  /// True if this is a multicast address
+  bool
+  isMulticast() const;
+
+  /// True if this is a null address (00:00:00:00:00:00)
+  bool
+  isNull() const;
+
+  /**
+   * @brief Converts the address to a human-readable string
+   *
+   * @param sep A character used to visually separate the octets,
+   *            usually ':' (the default value) or '-'
+   */
+  std::string
+  toString(char sep = ':') const;
+
+  /**
+   * @brief Creates an Address from a string containing an Ethernet address
+   *        in hexadecimal notation, with colons or hyphens as separators
+   *
+   * @param str The string to be parsed
+   * @return Always an instance of Address, which will be null
+   *         if the parsing fails
+   */
+  static Address
+  fromString(const std::string& str);
+};
+
+/// Returns the Ethernet broadcast address (ff:ff:ff:ff:ff:ff)
+inline Address
+getBroadcastAddress()
+{
+  static Address bcast(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+  return bcast;
+}
+
+/// Returns the default Ethernet multicast address for NDN
+inline Address
+getDefaultMulticastAddress()
+{
+  static Address mcast(0x01, 0x00, 0x5E, 0x00, 0x17, 0xAA);
+  return mcast;
+}
+
+inline
+Address::Address()
+{
+  assign(0);
+}
+
+inline
+Address::Address(uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6)
+{
+  elems[0] = a1;
+  elems[1] = a2;
+  elems[2] = a3;
+  elems[3] = a4;
+  elems[4] = a5;
+  elems[5] = a6;
+}
+
+inline
+Address::Address(const uint8_t octets[])
+{
+  std::copy(octets, octets + size(), begin());
+}
+
+inline
+Address::Address(const Address& address)
+{
+  std::copy(address.begin(), address.end(), begin());
+}
+
+inline bool
+Address::isBroadcast() const
+{
+  return elems[0] == 0xFF && elems[1] == 0xFF && elems[2] == 0xFF &&
+         elems[3] == 0xFF && elems[4] == 0xFF && elems[5] == 0xFF;
+}
+
+inline bool
+Address::isMulticast() const
+{
+  return (elems[0] & 1) != 0;
+}
+
+inline bool
+Address::isNull() const
+{
+  return elems[0] == 0x0 && elems[1] == 0x0 && elems[2] == 0x0 &&
+         elems[3] == 0x0 && elems[4] == 0x0 && elems[5] == 0x0;
+}
+
+std::ostream&
+operator<<(std::ostream& o, const Address& a);
+
+} // namespace ethernet
+} // namespace nfd
+
+#endif // NFD_FACE_ETHERNET_HPP
diff --git a/core/event-emitter.hpp b/core/event-emitter.hpp
new file mode 100644
index 0000000..35925f9
--- /dev/null
+++ b/core/event-emitter.hpp
@@ -0,0 +1,343 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_EVENT_EMITTER_HPP
+#define NFD_CORE_EVENT_EMITTER_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+
+struct empty {};
+
+/** \class EventEmitter
+ *  \brief provides a lightweight event system
+ *
+ *  To declare an event:
+ *    EventEmitter<TArgs> m_eventName;
+ *  To subscribe to an event:
+ *    eventSource->m_eventName += eventHandler;
+ *    Multiple functions can subscribe to the same event.
+ *  To trigger an event:
+ *    m_eventName(args);
+ *  To clear event subscriptions:
+ *    m_eventName.clear();
+ */
+
+// four arguments
+template<typename T1 = empty, typename T2 = empty,
+    typename T3 = empty, typename T4 = empty>
+class EventEmitter : noncopyable
+{
+public:
+  /// represents a handler that can subscribe to the event
+  typedef function<void(const T1&, const T2&,
+                               const T3&, const T4&)> Handler;
+
+  /// adds an subscription
+  void
+  operator+=(Handler handler);
+
+  /// returns true if there is no subscription,
+  /// otherwise returns false
+  bool
+  isEmpty();
+
+  /// clears all subscriptions
+  void
+  clear();
+
+  /// triggers the event
+  void
+  operator()(const T1& a1, const T2& a2, const T3& a3, const T4& a4);
+
+private:
+  /// stores all subscribed handlers
+  std::vector<Handler> m_handlers;
+};
+
+// zero argument
+template<>
+class EventEmitter<empty, empty, empty, empty> : noncopyable
+{
+public:
+  typedef function<void()> Handler;
+
+  void
+  operator+=(Handler handler);
+
+  bool
+  isEmpty();
+
+  void
+  clear();
+
+  void
+  operator()();
+
+private:
+  std::vector<Handler> m_handlers;
+};
+
+
+// one argument
+template<typename T1>
+class EventEmitter<T1, empty, empty, empty> : noncopyable
+{
+public:
+  typedef function<void(const T1&)> Handler;
+
+  void
+  operator+=(Handler handler);
+
+  bool
+  isEmpty();
+
+  void
+  clear();
+
+  void
+  operator()(const T1& a1);
+
+private:
+  std::vector<Handler> m_handlers;
+};
+
+
+// two arguments
+template<typename T1, typename T2>
+class EventEmitter<T1, T2, empty, empty> : noncopyable
+{
+public:
+  typedef function<void(const T1&, const T2&)> Handler;
+
+  void
+  operator+=(Handler handler);
+
+  bool
+  isEmpty();
+
+  void
+  clear();
+
+  void
+  operator()(const T1& a1, const T2& a2);
+
+private:
+  std::vector<Handler> m_handlers;
+};
+
+
+// three arguments
+template<typename T1, typename T2, typename T3>
+class EventEmitter<T1, T2, T3, empty> : noncopyable
+{
+public:
+  typedef function<void(const T1&, const T2&, const T3&)> Handler;
+
+  void
+  operator+=(Handler handler);
+
+  bool
+  isEmpty();
+
+  void
+  clear();
+
+  void
+  operator()(const T1& a1, const T2& a2, const T3& a3);
+
+private:
+  std::vector<Handler> m_handlers;
+};
+
+
+// zero argument
+
+inline void
+EventEmitter<empty, empty, empty, empty>::operator+=(Handler handler)
+{
+  m_handlers.push_back(handler);
+}
+
+inline bool
+EventEmitter<empty, empty, empty, empty>::isEmpty()
+{
+  return m_handlers.empty();
+}
+
+inline void
+EventEmitter<empty, empty, empty, empty>::clear()
+{
+  return m_handlers.clear();
+}
+
+inline void
+EventEmitter<empty, empty, empty, empty>::operator()()
+{
+  std::vector<Handler>::iterator it;
+  for (it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+    (*it)();
+  }
+}
+
+// one argument
+
+template<typename T1>
+inline void
+EventEmitter<T1, empty, empty, empty>::operator+=(Handler handler)
+{
+  m_handlers.push_back(handler);
+}
+
+template<typename T1>
+inline bool
+EventEmitter<T1, empty, empty, empty>::isEmpty()
+{
+  return m_handlers.empty();
+}
+
+template<typename T1>
+inline void
+EventEmitter<T1, empty, empty, empty>::clear()
+{
+  return m_handlers.clear();
+}
+
+template<typename T1>
+inline void
+EventEmitter<T1, empty, empty, empty>::operator()(const T1& a1)
+{
+  typename std::vector<Handler>::iterator it;
+  for (it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+    (*it)(a1);
+  }
+}
+
+// two arguments
+
+template<typename T1, typename T2>
+inline void
+EventEmitter<T1, T2, empty, empty>::operator+=(Handler handler)
+{
+  m_handlers.push_back(handler);
+}
+
+template<typename T1, typename T2>
+inline bool
+EventEmitter<T1, T2, empty, empty>::isEmpty()
+{
+  return m_handlers.empty();
+}
+
+template<typename T1, typename T2>
+inline void
+EventEmitter<T1, T2, empty, empty>::clear()
+{
+  return m_handlers.clear();
+}
+
+template<typename T1, typename T2>
+inline void
+EventEmitter<T1, T2, empty, empty>::operator()
+    (const T1& a1, const T2& a2)
+{
+  typename std::vector<Handler>::iterator it;
+  for (it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+    (*it)(a1, a2);
+  }
+}
+
+// three arguments
+
+template<typename T1, typename T2, typename T3>
+inline void
+EventEmitter<T1, T2, T3, empty>::operator+=(Handler handler)
+{
+  m_handlers.push_back(handler);
+}
+
+template<typename T1, typename T2, typename T3>
+inline bool
+EventEmitter<T1, T2, T3, empty>::isEmpty()
+{
+  return m_handlers.empty();
+}
+
+template<typename T1, typename T2, typename T3>
+inline void
+EventEmitter<T1, T2, T3, empty>::clear()
+{
+  return m_handlers.clear();
+}
+
+template<typename T1, typename T2, typename T3>
+inline void
+EventEmitter<T1, T2, T3, empty>::operator()
+    (const T1& a1, const T2& a2, const T3& a3)
+{
+  typename std::vector<Handler>::iterator it;
+  for (it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+    (*it)(a1, a2, a3);
+  }
+}
+
+// four arguments
+
+template<typename T1, typename T2, typename T3, typename T4>
+inline void
+EventEmitter<T1, T2, T3, T4>::operator+=(Handler handler)
+{
+  m_handlers.push_back(handler);
+}
+
+template<typename T1, typename T2, typename T3, typename T4>
+inline bool
+EventEmitter<T1, T2, T3, T4>::isEmpty()
+{
+  return m_handlers.empty();
+}
+
+template<typename T1, typename T2, typename T3, typename T4>
+inline void
+EventEmitter<T1, T2, T3, T4>::clear()
+{
+  return m_handlers.clear();
+}
+
+template<typename T1, typename T2, typename T3, typename T4>
+inline void
+EventEmitter<T1, T2, T3, T4>::operator()
+    (const T1& a1, const T2& a2, const T3& a3, const T4& a4)
+{
+  typename std::vector<Handler>::iterator it;
+  for (it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+    (*it)(a1, a2, a3, a4);
+  }
+}
+
+
+} // namespace nfd
+
+#endif // NFD_CORE_EVENT_EMITTER_HPP
diff --git a/core/face-uri.cpp b/core/face-uri.cpp
new file mode 100644
index 0000000..7eaaddd
--- /dev/null
+++ b/core/face-uri.cpp
@@ -0,0 +1,151 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-uri.hpp"
+#include "core/logger.hpp"
+
+#ifdef HAVE_LIBPCAP
+#include "ethernet.hpp"
+#endif // HAVE_LIBPCAP
+
+#include <boost/regex.hpp>
+
+NFD_LOG_INIT("FaceUri");
+
+namespace nfd {
+
+FaceUri::FaceUri(const std::string& uri)
+{
+  if (!parse(uri)) {
+    throw Error("Malformed URI: " + uri);
+  }
+}
+
+FaceUri::FaceUri(const char* uri)
+{
+  if (!parse(uri)) {
+    throw Error("Malformed URI: " + std::string(uri));
+  }
+}
+
+bool
+FaceUri::parse(const std::string& uri)
+{
+  m_scheme.clear();
+  m_host.clear();
+  m_isV6 = false;
+  m_port.clear();
+  m_path.clear();
+
+  static const boost::regex protocolExp("(\\w+\\d?)://([^/]*)(\\/[^?]*)?");
+  boost::smatch protocolMatch;
+  if (!boost::regex_match(uri, protocolMatch, protocolExp)) {
+    return false;
+  }
+  m_scheme = protocolMatch[1];
+  const std::string& authority = protocolMatch[2];
+  m_path = protocolMatch[3];
+
+  // pattern for IPv6 address enclosed in [ ], with optional port number
+  static const boost::regex v6Exp("^\\[([a-fA-F0-9:]+)\\](?:\\:(\\d+))?$");
+  // pattern for Ethernet address in standard hex-digits-and-colons notation
+  static const boost::regex etherExp("^((?:[a-fA-F0-9]{1,2}\\:){5}(?:[a-fA-F0-9]{1,2}))$");
+  // pattern for IPv4/hostname/fd/ifname, with optional port number
+  static const boost::regex v4HostExp("^([^:]+)(?:\\:(\\d+))?$");
+
+  if (authority.empty()) {
+    // UNIX, internal
+  }
+  else {
+    boost::smatch match;
+    m_isV6 = boost::regex_match(authority, match, v6Exp);
+    if (m_isV6 ||
+        boost::regex_match(authority, match, etherExp) ||
+        boost::regex_match(authority, match, v4HostExp)) {
+      m_host = match[1];
+      m_port = match[2];
+    }
+    else {
+      return false;
+    }
+  }
+
+  NFD_LOG_DEBUG("URI [" << uri << "] parsed into: " <<
+                m_scheme << ", " << m_host << ", " << m_port << ", " << m_path);
+  return true;
+}
+
+FaceUri::FaceUri(const boost::asio::ip::tcp::endpoint& endpoint)
+{
+  m_isV6 = endpoint.address().is_v6();
+  m_scheme = m_isV6 ? "tcp6" : "tcp4";
+  m_host = endpoint.address().to_string();
+  m_port = boost::lexical_cast<std::string>(endpoint.port());
+}
+
+FaceUri::FaceUri(const boost::asio::ip::udp::endpoint& endpoint)
+{
+  m_isV6 = endpoint.address().is_v6();
+  m_scheme = m_isV6 ? "udp6" : "udp4";
+  m_host = endpoint.address().to_string();
+  m_port = boost::lexical_cast<std::string>(endpoint.port());
+}
+
+#ifdef HAVE_UNIX_SOCKETS
+FaceUri::FaceUri(const boost::asio::local::stream_protocol::endpoint& endpoint)
+  : m_isV6(false)
+{
+  m_scheme = "unix";
+  m_path = endpoint.path();
+}
+#endif // HAVE_UNIX_SOCKETS
+
+FaceUri
+FaceUri::fromFd(int fd)
+{
+  FaceUri uri;
+  uri.m_scheme = "fd";
+  uri.m_host = boost::lexical_cast<std::string>(fd);
+  return uri;
+}
+
+#ifdef HAVE_LIBPCAP
+FaceUri::FaceUri(const ethernet::Address& address)
+  : m_isV6(false)
+{
+  m_scheme = "ether";
+  m_host = address.toString();
+}
+#endif // HAVE_LIBPCAP
+
+FaceUri
+FaceUri::fromDev(const std::string& ifname)
+{
+  FaceUri uri;
+  uri.m_scheme = "dev";
+  uri.m_host = ifname;
+  return uri;
+}
+
+} // namespace nfd
diff --git a/core/face-uri.hpp b/core/face-uri.hpp
new file mode 100644
index 0000000..487f8f8
--- /dev/null
+++ b/core/face-uri.hpp
@@ -0,0 +1,191 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_FACE_URI_H
+#define NFD_CORE_FACE_URI_H
+
+#include "common.hpp"
+
+namespace nfd {
+
+#ifdef HAVE_LIBPCAP
+namespace ethernet {
+class Address;
+} // namespace ethernet
+#endif // HAVE_LIBPCAP
+
+/** \brief represents the underlying protocol and address used by a Face
+ *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#FaceUri
+ */
+class FaceUri
+{
+public:
+  class Error : public std::invalid_argument
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::invalid_argument(what)
+    {
+    }
+  };
+
+  FaceUri();
+
+  /** \brief construct by parsing
+   *
+   *  \param uri scheme://host[:port]/path
+   *  \throw FaceUri::Error if URI cannot be parsed
+   */
+  explicit
+  FaceUri(const std::string& uri);
+
+  // This overload is needed so that calls with string literal won't be
+  // resolved to boost::asio::local::stream_protocol::endpoint overload.
+  explicit
+  FaceUri(const char* uri);
+
+  /// exception-safe parsing
+  bool
+  parse(const std::string& uri);
+
+public: // scheme-specific construction
+  /// construct tcp4 or tcp6 canonical FaceUri
+  explicit
+  FaceUri(const boost::asio::ip::tcp::endpoint& endpoint);
+
+  /// construct udp4 or udp6 canonical FaceUri
+  explicit
+  FaceUri(const boost::asio::ip::udp::endpoint& endpoint);
+
+#ifdef HAVE_UNIX_SOCKETS
+  /// construct unix canonical FaceUri
+  explicit
+  FaceUri(const boost::asio::local::stream_protocol::endpoint& endpoint);
+#endif // HAVE_UNIX_SOCKETS
+
+  /// create fd FaceUri from file descriptor
+  static FaceUri
+  fromFd(int fd);
+
+#ifdef HAVE_LIBPCAP
+  /// construct ether canonical FaceUri
+  explicit
+  FaceUri(const ethernet::Address& address);
+#endif // HAVE_LIBPCAP
+
+  /// create dev FaceUri from network device name
+  static FaceUri
+  fromDev(const std::string& ifname);
+
+public: // getters
+  /// get scheme (protocol)
+  const std::string&
+  getScheme() const;
+
+  /// get host (domain)
+  const std::string&
+  getHost() const;
+
+  /// get port
+  const std::string&
+  getPort() const;
+
+  /// get path
+  const std::string&
+  getPath() const;
+
+  /// write as a string
+  std::string
+  toString() const;
+
+private:
+  std::string m_scheme;
+  std::string m_host;
+  /// whether to add [] around host when writing string
+  bool m_isV6;
+  std::string m_port;
+  std::string m_path;
+
+  friend std::ostream& operator<<(std::ostream& os, const FaceUri& uri);
+};
+
+inline
+FaceUri::FaceUri()
+  : m_isV6(false)
+{
+}
+
+inline const std::string&
+FaceUri::getScheme() const
+{
+  return m_scheme;
+}
+
+inline const std::string&
+FaceUri::getHost() const
+{
+  return m_host;
+}
+
+inline const std::string&
+FaceUri::getPort() const
+{
+  return m_port;
+}
+
+inline const std::string&
+FaceUri::getPath() const
+{
+  return m_path;
+}
+
+inline std::string
+FaceUri::toString() const
+{
+  std::ostringstream os;
+  os << *this;
+  return os.str();
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const FaceUri& uri)
+{
+  os << uri.m_scheme << "://";
+  if (uri.m_isV6) {
+    os << "[" << uri.m_host << "]";
+  }
+  else {
+    os << uri.m_host;
+  }
+  if (!uri.m_port.empty()) {
+    os << ":" << uri.m_port;
+  }
+  os << uri.m_path;
+  return os;
+}
+
+} // namespace nfd
+
+#endif // NFD_CORE_FACE_URI_H
diff --git a/core/global-io.cpp b/core/global-io.cpp
new file mode 100644
index 0000000..f8d8270
--- /dev/null
+++ b/core/global-io.cpp
@@ -0,0 +1,53 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "global-io.hpp"
+
+namespace nfd {
+
+namespace scheduler {
+// defined in scheduler.cpp
+void
+resetGlobalScheduler();
+} // namespace scheduler
+
+static shared_ptr<boost::asio::io_service> g_ioService;
+
+boost::asio::io_service&
+getGlobalIoService()
+{
+  if (!static_cast<bool>(g_ioService)) {
+    g_ioService = make_shared<boost::asio::io_service>();
+  }
+  return *g_ioService;
+}
+
+void
+resetGlobalIoService()
+{
+  scheduler::resetGlobalScheduler();
+  g_ioService.reset();
+}
+
+} // namespace nfd
diff --git a/core/global-io.hpp b/core/global-io.hpp
new file mode 100644
index 0000000..d5030ab
--- /dev/null
+++ b/core/global-io.hpp
@@ -0,0 +1,48 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_GLOBAL_IO_HPP
+#define NFD_CORE_GLOBAL_IO_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+
+/** \return the global io_service instance
+ */
+boost::asio::io_service&
+getGlobalIoService();
+
+#ifdef WITH_TESTS
+/** \brief delete the global io_service instance
+ *
+ *  It will be recreated at the next invocation of getGlobalIoService.
+ */
+void
+resetGlobalIoService();
+#endif
+
+} // namespace nfd
+
+#endif // NFD_CORE_GLOBAL_IO_HPP
diff --git a/core/logger-factory.cpp b/core/logger-factory.cpp
new file mode 100644
index 0000000..3a738eb
--- /dev/null
+++ b/core/logger-factory.cpp
@@ -0,0 +1,196 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "logger-factory.hpp"
+
+namespace nfd {
+
+LoggerFactory&
+LoggerFactory::getInstance()
+{
+  static LoggerFactory globalLoggerFactory;
+
+  return globalLoggerFactory;
+}
+
+LoggerFactory::LoggerFactory()
+  : m_defaultLevel(LOG_INFO)
+{
+  m_levelNames["NONE"] = LOG_NONE;
+  m_levelNames["ERROR"] = LOG_ERROR;
+  m_levelNames["WARN"] = LOG_WARN;
+  m_levelNames["INFO"] = LOG_INFO;
+  m_levelNames["DEBUG"] = LOG_DEBUG;
+  m_levelNames["TRACE"] = LOG_TRACE;
+  m_levelNames["ALL"] = LOG_ALL;
+}
+
+void
+LoggerFactory::setConfigFile(ConfigFile& config)
+{
+  config.addSectionHandler("log", bind(&LoggerFactory::onConfig, this, _1, _2, _3));
+}
+
+LogLevel
+LoggerFactory::parseLevel(const std::string& level)
+{
+  std::string upperLevel = level;
+  boost::to_upper(upperLevel);
+
+  // std::cerr << "parsing level: " << upperLevel << std::endl;;
+  // std::cerr << "# levels: " << m_levelNames.size() << std::endl;
+  // std::cerr << m_levelNames.begin()->first << std::endl;
+
+  LevelMap::const_iterator levelIt = m_levelNames.find(upperLevel);
+  if (levelIt != m_levelNames.end())
+    {
+      return levelIt->second;
+    }
+  try
+    {
+      uint32_t levelNo = boost::lexical_cast<uint32_t>(level);
+
+      if ((LOG_NONE <= levelNo && levelNo <= LOG_TRACE) ||
+          levelNo == LOG_ALL)
+        {
+          return static_cast<LogLevel>(levelNo);
+        }
+    }
+  catch (const boost::bad_lexical_cast& error)
+    {
+    }
+  throw LoggerFactory::Error("Unsupported logging level \"" +
+                             level + "\"");
+}
+
+
+void
+LoggerFactory::onConfig(const ConfigSection& section,
+                        bool isDryRun,
+                        const std::string& filename)
+{
+// log
+// {
+//   ; default_level specifies the logging level for modules
+//   ; that are not explicitly named. All debugging levels
+//   ; listed above the selected value are enabled.
+//
+//   default_level INFO
+//
+//   ; You may also override the default for specific modules:
+//
+//   FibManager DEBUG
+//   Forwarder WARN
+// }
+
+  // std::cerr << "loading logging configuration" << std::endl;
+  for (ConfigSection::const_iterator item = section.begin();
+       item != section.end();
+       ++item)
+    {
+      std::string levelString;
+      try
+        {
+          levelString = item->second.get_value<std::string>();
+        }
+      catch (const boost::property_tree::ptree_error& error)
+        {
+        }
+
+      if (levelString.empty())
+        {
+          throw LoggerFactory::Error("No logging level found for option \"" + item->first + "\"");
+        }
+
+      LogLevel level = parseLevel(levelString);
+
+      if (item->first == "default_level")
+        {
+          if (!isDryRun)
+            {
+              setDefaultLevel(level);
+            }
+        }
+      else
+        {
+          LoggerMap::iterator loggerIt = m_loggers.find(item->first);
+          if (loggerIt == m_loggers.end())
+            {
+              throw LoggerFactory::Error("Invalid module name \"" +
+                                         item->first + "\" in configuration file");
+            }
+
+          if (!isDryRun)
+            {
+              // std::cerr << "changing level for module " << item->first << " to " << level << std::endl;
+              loggerIt->second.setLogLevel(level);
+            }
+        }
+    }
+}
+
+void
+LoggerFactory::setDefaultLevel(LogLevel level)
+{
+  // std::cerr << "changing to default_level " << level << std::endl;
+
+  m_defaultLevel = level;
+  for (LoggerMap::iterator i = m_loggers.begin(); i != m_loggers.end(); ++i)
+    {
+      // std::cerr << "changing " << i->first << " to default " << m_defaultLevel << std::endl;
+      i->second.setLogLevel(m_defaultLevel);
+    }
+}
+
+Logger&
+LoggerFactory::create(const std::string& moduleName)
+{
+  return LoggerFactory::getInstance().createLogger(moduleName);
+}
+
+Logger&
+LoggerFactory::createLogger(const std::string& moduleName)
+{
+  // std::cerr << "creating logger for " << moduleName
+  //           << " with level " << m_defaultLevel << std::endl;
+
+  std::pair<LoggerMap::iterator, bool> loggerIt =
+    m_loggers.insert(NameAndLogger(moduleName, Logger(moduleName, m_defaultLevel)));
+
+  return loggerIt.first->second;
+}
+
+std::list<std::string>
+LoggerFactory::getModules() const
+{
+  std::list<std::string> modules;
+  for (LoggerMap::const_iterator i = m_loggers.begin(); i != m_loggers.end(); ++i)
+    {
+      modules.push_back(i->first);
+    }
+
+  return modules;
+}
+
+} // namespace nfd
diff --git a/core/logger-factory.hpp b/core/logger-factory.hpp
new file mode 100644
index 0000000..b5aa31d
--- /dev/null
+++ b/core/logger-factory.hpp
@@ -0,0 +1,107 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_LOGGER_FACTORY_HPP
+#define NFD_CORE_LOGGER_FACTORY_HPP
+
+#include "common.hpp"
+#include "config-file.hpp"
+#include "logger.hpp"
+
+namespace nfd {
+
+class LoggerFactory : noncopyable
+{
+public:
+
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& error)
+      : std::runtime_error(error)
+    {
+    }
+  };
+
+  static LoggerFactory&
+  getInstance();
+
+  void
+  setConfigFile(ConfigFile& config);
+
+  void
+  onConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
+
+  std::list<std::string>
+  getModules() const;
+
+  static Logger&
+  create(const std::string& moduleName);
+
+
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+
+  // these methods are used during unit-testing
+
+  LogLevel
+  getDefaultLevel() const;
+
+  void
+  setDefaultLevel(LogLevel level);
+
+private:
+
+  LoggerFactory();
+
+  Logger&
+  createLogger(const std::string& moduleName);
+
+  LogLevel
+  parseLevel(const std::string& level);
+
+private:
+
+  typedef std::map<std::string, LogLevel> LevelMap;
+  typedef std::pair<std::string, LogLevel> NameAndLevel;
+
+  LevelMap m_levelNames;
+
+  typedef std::map<std::string, Logger> LoggerMap;
+  typedef std::pair<std::string, Logger> NameAndLogger;
+
+  LoggerMap m_loggers;
+
+  LogLevel m_defaultLevel;
+};
+
+inline LogLevel
+LoggerFactory::getDefaultLevel() const
+{
+  return m_defaultLevel;
+}
+
+} // namespace nfd
+
+#endif // NFD_CORE_LOGGER_FACTORY_HPP
diff --git a/core/logger.hpp b/core/logger.hpp
new file mode 100644
index 0000000..907ce7e
--- /dev/null
+++ b/core/logger.hpp
@@ -0,0 +1,176 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_LOGGER_HPP
+#define NFD_CORE_LOGGER_HPP
+
+#include "common.hpp"
+#include <ndn-cpp-dev/util/time.hpp>
+
+/// \todo use when we enable C++11 (see todo in now())
+// #include <cinttypes>
+
+namespace nfd {
+
+enum LogLevel {
+  LOG_NONE           = 0, // no messages
+  LOG_ERROR          = 1, // serious error messages
+  LOG_WARN           = 2, // warning messages
+  LOG_INFO           = 3, // informational messages
+  LOG_DEBUG          = 4, // debug messages
+  LOG_TRACE          = 5, // trace messages (most verbose)
+  // LOG_FATAL is not a level and is logged unconditionally
+  LOG_ALL            = 255 // all messages
+};
+
+class Logger
+{
+public:
+
+  Logger(const std::string& name, LogLevel level)
+    : m_moduleName(name)
+    , m_enabledLogLevel(level)
+  {
+  }
+
+  bool
+  isEnabled(LogLevel level) const
+  {
+    // std::cerr << m_moduleName <<
+    //   " enabled = " << m_enabledLogLevel
+    //           << " level = " << level << std::endl;
+    return (m_enabledLogLevel >= level);
+  }
+
+  void
+  setLogLevel(LogLevel level)
+  {
+    m_enabledLogLevel = level;
+  }
+
+  const std::string&
+  getName() const
+  {
+    return m_moduleName;
+  }
+
+  void
+  setName(const std::string& name)
+  {
+    m_moduleName = name;
+  }
+
+  /// \brief return a string representation of time since epoch: seconds.microseconds
+  static std::string
+  now()
+  {
+    using namespace ndn::time;
+
+    static const microseconds::rep ONE_SECOND = 1000000;
+    microseconds::rep microseconds_since_epoch =
+      duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+    // 10 (whole seconds) + '.' + 6 (fraction) + 1 (\0)
+    char buffer[10 + 1 + 6 + 1];
+    ::snprintf(buffer, sizeof(buffer), "%lld.%06lld",
+               static_cast<long long int>(microseconds_since_epoch / ONE_SECOND),
+               static_cast<long long int>(microseconds_since_epoch % ONE_SECOND));
+
+    /// \todo use this version when we enable C++11 to avoid casting
+    // ::snprintf(buffer, sizeof(buffer), "%" PRIdLEAST64 ".%06" PRIdLEAST64,
+    //            microseconds_since_epoch / ONE_SECOND,
+    //            microseconds_since_epoch % ONE_SECOND);
+
+    return std::string(buffer);
+  }
+
+private:
+  std::string m_moduleName;
+  LogLevel    m_enabledLogLevel;
+};
+
+inline std::ostream&
+operator<<(std::ostream& output, const Logger& logger)
+{
+  output << logger.getName();
+  return output;
+}
+
+} // namespace nfd
+
+#include "core/logger-factory.hpp"
+
+namespace nfd {
+
+#define NFD_LOG_INIT(name) \
+static nfd::Logger& g_logger = nfd::LoggerFactory::create(name)
+
+#define NFD_LOG_INCLASS_DECLARE() \
+static nfd::Logger& g_logger
+
+#define NFD_LOG_INCLASS_DEFINE(cls, name) \
+nfd::Logger& cls::g_logger = nfd::LoggerFactory::create(name)
+
+#define NFD_LOG_INCLASS_TEMPLATE_DEFINE(cls, name) \
+template<class T>                                  \
+nfd::Logger& cls<T>::g_logger = nfd::LoggerFactory::create(name)
+
+#define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name) \
+template<>                                                                        \
+nfd::Logger& cls<specialization>::g_logger = nfd::LoggerFactory::create(name)
+
+#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name) \
+template<>                                                                 \
+nfd::Logger& cls<s1, s2>::g_logger = nfd::LoggerFactory::create(name)
+
+
+#define NFD_LOG(level, expression)                                      \
+do {                                                                    \
+  if (g_logger.isEnabled(::nfd::LOG_##level))                           \
+    std::clog << ::nfd::Logger::now() << " "#level": "                  \
+              << "[" << g_logger << "] " << expression << "\n";         \
+} while (false)
+
+#define NFD_LOG_TRACE(expression) NFD_LOG(TRACE, expression)
+#define NFD_LOG_DEBUG(expression) NFD_LOG(DEBUG, expression)
+#define NFD_LOG_INFO(expression) NFD_LOG(INFO, expression)
+#define NFD_LOG_ERROR(expression) NFD_LOG(ERROR, expression)
+
+// specialize WARN because the message is "WARNING" instead of "WARN"
+#define NFD_LOG_WARN(expression)                                        \
+do {                                                                    \
+  if (g_logger.isEnabled(::nfd::LOG_WARN))                              \
+    std::clog << ::nfd::Logger::now() << " WARNING: "                   \
+              << "[" << g_logger << "] " << expression << "\n";         \
+} while (false)
+
+#define NFD_LOG_FATAL(expression)                                       \
+do {                                                                    \
+  std::clog << ::nfd::Logger::now() << " FATAL: "                       \
+            << "[" << g_logger << "] " << expression << "\n";           \
+} while (false)
+
+} //namespace nfd
+
+#endif
diff --git a/core/map-value-iterator.hpp b/core/map-value-iterator.hpp
new file mode 100644
index 0000000..1dfdd5c
--- /dev/null
+++ b/core/map-value-iterator.hpp
@@ -0,0 +1,87 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_MAP_VALUE_ITERATOR_H
+#define NFD_CORE_MAP_VALUE_ITERATOR_H
+
+#include "common.hpp"
+#include <boost/iterator/transform_iterator.hpp>
+
+namespace nfd {
+
+/** \class MapValueIterator
+ *  \brief ForwardIterator to iterator over map values
+ */
+template<typename Map>
+class MapValueIterator
+  : public boost::transform_iterator<
+             function<const typename Map::mapped_type&(const typename Map::value_type&)>,
+             typename Map::const_iterator>
+{
+public:
+  explicit
+  MapValueIterator(typename Map::const_iterator it)
+    : boost::transform_iterator<
+        function<const typename Map::mapped_type&(const typename Map::value_type&)>,
+        typename Map::const_iterator>(it, &takeSecond)
+  {
+  }
+
+private:
+  static const typename Map::mapped_type&
+  takeSecond(const typename Map::value_type& pair)
+  {
+    return pair.second;
+  }
+};
+
+/** \class MapValueReverseIterator
+ *  \brief ReverseIterator to iterator over map values
+ */
+template<typename Map>
+class MapValueReverseIterator
+  : public boost::transform_iterator<
+             function<const typename Map::mapped_type&(const typename Map::value_type&)>,
+             typename Map::const_reverse_iterator>
+{
+public:
+  explicit
+  MapValueReverseIterator(typename Map::const_reverse_iterator it)
+    : boost::transform_iterator<
+             function<const typename Map::mapped_type&(const typename Map::value_type&)>,
+             typename Map::const_reverse_iterator>(it, &takeSecond)
+  {
+  }
+
+private:
+  static const typename Map::mapped_type&
+  takeSecond(const typename Map::value_type& pair)
+  {
+    return pair.second;
+  }
+};
+
+} // namespace nfd
+
+#endif // NFD_CORE_MAP_VALUE_ITERATOR_H
diff --git a/core/network-interface.cpp b/core/network-interface.cpp
new file mode 100644
index 0000000..df47ac5
--- /dev/null
+++ b/core/network-interface.cpp
@@ -0,0 +1,139 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "network-interface.hpp"
+#include "core/logger.hpp"
+
+#include <boost/foreach.hpp>
+
+#include <arpa/inet.h>   // for inet_ntop()
+#include <netinet/in.h>  // for struct sockaddr_in{,6}
+#include <ifaddrs.h>     // for getifaddrs()
+
+#if defined(__linux__)
+#include <net/if_arp.h>        // for ARPHRD_* constants
+#include <netpacket/packet.h>  // for struct sockaddr_ll
+#elif defined(__APPLE__) || defined(__FreeBSD__)
+#include <net/if_dl.h>         // for struct sockaddr_dl
+#else
+#error Platform not supported
+#endif
+
+NFD_LOG_INIT("NetworkInterfaceInfo");
+
+namespace nfd {
+
+std::list< shared_ptr<NetworkInterfaceInfo> >
+listNetworkInterfaces()
+{
+  typedef std::map< std::string, shared_ptr<NetworkInterfaceInfo> > InterfacesMap;
+  InterfacesMap ifmap;
+
+  ifaddrs* ifa_list;
+  if (::getifaddrs(&ifa_list) < 0)
+    throw std::runtime_error("getifaddrs() failed");
+
+  for (ifaddrs* ifa = ifa_list; ifa != 0; ifa = ifa->ifa_next)
+    {
+      shared_ptr<NetworkInterfaceInfo> netif;
+      std::string ifname(ifa->ifa_name);
+      InterfacesMap::iterator i = ifmap.find(ifname);
+      if (i == ifmap.end())
+        {
+          netif = make_shared<NetworkInterfaceInfo>();
+          netif->name = ifname;
+          netif->flags = ifa->ifa_flags;
+          ifmap[ifname] = netif;
+        }
+      else
+        {
+          netif = i->second;
+        }
+
+      if (!ifa->ifa_addr)
+        continue;
+
+      switch (ifa->ifa_addr->sa_family)
+        {
+        case AF_INET: {
+            const sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ifa->ifa_addr);
+            char address[INET_ADDRSTRLEN];
+            if (::inet_ntop(AF_INET, &sin->sin_addr, address, sizeof(address)))
+              netif->ipv4Addresses.push_back(boost::asio::ip::address_v4::from_string(address));
+            else
+              NFD_LOG_WARN("inet_ntop() failed on " << ifname);
+          }
+          break;
+        case AF_INET6: {
+            const sockaddr_in6* sin6 = reinterpret_cast<sockaddr_in6*>(ifa->ifa_addr);
+            char address[INET6_ADDRSTRLEN];
+            if (::inet_ntop(AF_INET6, &sin6->sin6_addr, address, sizeof(address)))
+              netif->ipv6Addresses.push_back(boost::asio::ip::address_v6::from_string(address));
+            else
+              NFD_LOG_WARN("inet_ntop() failed on " << ifname);
+          }
+          break;
+#if defined(__linux__)
+        case AF_PACKET: {
+            const sockaddr_ll* sll = reinterpret_cast<sockaddr_ll*>(ifa->ifa_addr);
+            netif->index = sll->sll_ifindex;
+            if (sll->sll_hatype == ARPHRD_ETHER && sll->sll_halen == ethernet::ADDR_LEN)
+              netif->etherAddress = ethernet::Address(sll->sll_addr);
+            else if (sll->sll_hatype != ARPHRD_LOOPBACK)
+              NFD_LOG_WARN("Unrecognized hardware address on " << ifname);
+          }
+          break;
+#elif defined(__APPLE__) || defined(__FreeBSD__)
+        case AF_LINK: {
+            const sockaddr_dl* sdl = reinterpret_cast<sockaddr_dl*>(ifa->ifa_addr);
+            netif->index = sdl->sdl_index;
+            netif->etherAddress = ethernet::Address(reinterpret_cast<uint8_t*>(LLADDR(sdl)));
+          }
+          break;
+#endif
+        }
+
+      if (netif->isBroadcastCapable() && ifa->ifa_broadaddr != 0)
+        {
+          const sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ifa->ifa_broadaddr);
+
+          char address[INET_ADDRSTRLEN];
+          if (::inet_ntop(AF_INET, &sin->sin_addr, address, sizeof(address)))
+            netif->broadcastAddress = boost::asio::ip::address_v4::from_string(address);
+          else
+            NFD_LOG_WARN("inet_ntop() failed on " << ifname);
+        }
+    }
+
+  ::freeifaddrs(ifa_list);
+
+  std::list< shared_ptr<NetworkInterfaceInfo> > list;
+  BOOST_FOREACH(InterfacesMap::value_type elem, ifmap) {
+    list.push_back(elem.second);
+  }
+
+  return list;
+}
+
+} // namespace nfd
diff --git a/core/network-interface.hpp b/core/network-interface.hpp
new file mode 100644
index 0000000..08824fa
--- /dev/null
+++ b/core/network-interface.hpp
@@ -0,0 +1,90 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_NETWORK_INTERFACE_HPP
+#define NFD_CORE_NETWORK_INTERFACE_HPP
+
+#include "common.hpp"
+#include "ethernet.hpp"
+
+#include <net/if.h>
+
+namespace nfd {
+
+class NetworkInterfaceInfo
+{
+public:
+
+  int index;
+  std::string name;
+  ethernet::Address etherAddress;
+  std::vector<boost::asio::ip::address_v4> ipv4Addresses;
+  std::vector<boost::asio::ip::address_v6> ipv6Addresses;
+  boost::asio::ip::address_v4 broadcastAddress;
+  unsigned int flags;
+
+  bool
+  isLoopback() const;
+
+  bool
+  isMulticastCapable() const;
+
+  bool
+  isBroadcastCapable() const;
+
+  bool
+  isUp() const;
+
+};
+
+inline bool
+NetworkInterfaceInfo::isLoopback() const
+{
+  return (flags & IFF_LOOPBACK) != 0;
+}
+
+inline bool
+NetworkInterfaceInfo::isMulticastCapable() const
+{
+  return (flags & IFF_MULTICAST) != 0;
+}
+
+inline bool
+NetworkInterfaceInfo::isBroadcastCapable() const
+{
+  return (flags & IFF_BROADCAST) != 0;
+}
+
+inline bool
+NetworkInterfaceInfo::isUp() const
+{
+  return (flags & IFF_UP) != 0;
+}
+
+std::list< shared_ptr<NetworkInterfaceInfo> >
+listNetworkInterfaces();
+
+} // namespace nfd
+
+#endif // NFD_CORE_NETWORK_INTERFACE_HPP
diff --git a/core/resolver.hpp b/core/resolver.hpp
new file mode 100644
index 0000000..d4dc31c
--- /dev/null
+++ b/core/resolver.hpp
@@ -0,0 +1,214 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_RESOLVER_H
+#define NFD_CORE_RESOLVER_H
+
+#include "common.hpp"
+#include "core/global-io.hpp"
+#include "core/scheduler.hpp"
+
+namespace nfd {
+namespace resolver {
+
+typedef function<bool (const boost::asio::ip::address& address)> AddressSelector;
+
+struct AnyAddress {
+  bool
+  operator()(const boost::asio::ip::address& address)
+  {
+    return true;
+  }
+};
+
+struct Ipv4Address {
+  bool
+  operator()(const boost::asio::ip::address& address)
+  {
+    return address.is_v4();
+  }
+};
+
+struct Ipv6Address {
+  bool
+  operator()(const boost::asio::ip::address& address)
+  {
+    return address.is_v6();
+  }
+};
+
+} // namespace resolver
+
+template<class Protocol>
+class Resolver
+{
+public:
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : std::runtime_error(what) {}
+  };
+
+  typedef function<void (const typename Protocol::endpoint& endpoint)> SuccessCallback;
+  typedef function<void (const std::string& reason)> ErrorCallback;
+
+  typedef boost::asio::ip::basic_resolver< Protocol > resolver;
+
+  /** \brief Asynchronously resolve host and port
+   *
+   * If an address selector predicate is specified, then each resolved IP address
+   * is checked against the predicate.
+   *
+   * Available address selector predicates:
+   *
+   * - resolver::AnyAddress()
+   * - resolver::Ipv4Address()
+   * - resolver::Ipv6Address()
+   */
+  static void
+  asyncResolve(const std::string& host, const std::string& port,
+               const SuccessCallback& onSuccess,
+               const ErrorCallback& onError,
+               const nfd::resolver::AddressSelector& addressSelector = nfd::resolver::AnyAddress(),
+               const time::seconds& timeout = time::seconds(4))
+  {
+    shared_ptr<Resolver> resolver =
+      shared_ptr<Resolver>(new Resolver(onSuccess, onError,
+                                        addressSelector));
+
+    resolver->asyncResolve(host, port, timeout, resolver);
+    // resolver will be destroyed when async operation finishes or global IO service stops
+  }
+
+  /** \brief Synchronously resolve host and port
+   *
+   * If an address selector predicate is specified, then each resolved IP address
+   * is checked against the predicate.
+   *
+   * Available address selector predicates:
+   *
+   * - resolver::AnyAddress()
+   * - resolver::Ipv4Address()
+   * - resolver::Ipv6Address()
+   */
+  static typename Protocol::endpoint
+  syncResolve(const std::string& host, const std::string& port,
+              const nfd::resolver::AddressSelector& addressSelector = nfd::resolver::AnyAddress())
+  {
+    Resolver resolver(SuccessCallback(), ErrorCallback(), addressSelector);
+
+    typename resolver::query query(host, port
+#if not defined(__FreeBSD__)
+                                   , resolver::query::all_matching
+#endif
+                                   );
+
+    typename resolver::iterator remoteEndpoint = resolver.m_resolver.resolve(query);
+    typename resolver::iterator end;
+    for (; remoteEndpoint != end; ++remoteEndpoint)
+      {
+        if (addressSelector(typename Protocol::endpoint(*remoteEndpoint).address()))
+          return *remoteEndpoint;
+      }
+    throw Error("No endpoint matching the specified address selector found");
+  }
+
+private:
+  Resolver(const SuccessCallback& onSuccess,
+           const ErrorCallback& onError,
+           const nfd::resolver::AddressSelector& addressSelector)
+    : m_resolver(getGlobalIoService())
+    , m_addressSelector(addressSelector)
+    , m_onSuccess(onSuccess)
+    , m_onError(onError)
+  {
+  }
+
+  void
+  asyncResolve(const std::string& host, const std::string& port,
+               const time::seconds& timeout,
+               const shared_ptr<Resolver>& self)
+  {
+    typename resolver::query query(host, port
+#if not defined(__FreeBSD__)
+                                   , resolver::query::all_matching
+#endif
+                                   );
+
+    m_resolver.async_resolve(query,
+                             bind(&Resolver::onResolveSuccess, this, _1, _2, self));
+
+    m_resolveTimeout = scheduler::schedule(timeout,
+                                           bind(&Resolver::onResolveError, this,
+                                                "Timeout", self));
+  }
+
+  void
+  onResolveSuccess(const boost::system::error_code& error,
+                   typename resolver::iterator remoteEndpoint,
+                   const shared_ptr<Resolver>& self)
+  {
+    scheduler::cancel(m_resolveTimeout);
+
+    if (error)
+      {
+        if (error == boost::system::errc::operation_canceled)
+          return;
+
+        return m_onError("Remote endpoint hostname or port cannot be resolved: " +
+                         error.category().message(error.value()));
+      }
+
+    typename resolver::iterator end;
+    for (; remoteEndpoint != end; ++remoteEndpoint)
+      {
+        if (m_addressSelector(typename Protocol::endpoint(*remoteEndpoint).address()))
+          return m_onSuccess(*remoteEndpoint);
+      }
+
+    m_onError("No endpoint matching the specified address selector found");
+  }
+
+  void
+  onResolveError(const std::string& errorInfo,
+                 const shared_ptr<Resolver>& self)
+  {
+    m_resolver.cancel();
+    m_onError(errorInfo);
+  }
+
+private:
+  resolver m_resolver;
+  EventId m_resolveTimeout;
+
+  nfd::resolver::AddressSelector m_addressSelector;
+  SuccessCallback m_onSuccess;
+  ErrorCallback m_onError;
+};
+
+typedef Resolver<boost::asio::ip::tcp> TcpResolver;
+typedef Resolver<boost::asio::ip::udp> UdpResolver;
+
+} // namespace nfd
+
+#endif // NFD_CORE_RESOLVER_H
diff --git a/core/scheduler.cpp b/core/scheduler.cpp
new file mode 100644
index 0000000..fb09557
--- /dev/null
+++ b/core/scheduler.cpp
@@ -0,0 +1,61 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "scheduler.hpp"
+#include "global-io.hpp"
+
+namespace nfd {
+namespace scheduler {
+
+static shared_ptr<Scheduler> g_scheduler;
+
+inline Scheduler&
+getGlobalScheduler()
+{
+  if (!static_cast<bool>(g_scheduler)) {
+    g_scheduler = make_shared<Scheduler>(boost::ref(getGlobalIoService()));
+  }
+  return *g_scheduler;
+}
+
+EventId
+schedule(const time::nanoseconds& after, const Scheduler::Event& event)
+{
+  return getGlobalScheduler().scheduleEvent(after, event);
+}
+
+void
+cancel(const EventId& eventId)
+{
+  getGlobalScheduler().cancelEvent(eventId);
+}
+
+void
+resetGlobalScheduler()
+{
+  g_scheduler.reset();
+}
+
+} // namespace scheduler
+} // namespace nfd
diff --git a/core/scheduler.hpp b/core/scheduler.hpp
new file mode 100644
index 0000000..f275c69
--- /dev/null
+++ b/core/scheduler.hpp
@@ -0,0 +1,57 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_CORE_SCHEDULER_HPP
+#define NFD_CORE_SCHEDULER_HPP
+
+#include "common.hpp"
+#include <ndn-cpp-dev/util/scheduler.hpp>
+
+namespace nfd {
+namespace scheduler {
+
+using ndn::Scheduler;
+
+/** \class EventId
+ *  \brief Opaque type (shared_ptr) representing ID of a scheduled event
+ */
+using ndn::EventId;
+
+/** \brief schedule an event
+ */
+EventId
+schedule(const time::nanoseconds& after, const Scheduler::Event& event);
+
+/** \brief cancel a scheduled event
+ */
+void
+cancel(const EventId& eventId);
+
+} // namespace scheduler
+
+using scheduler::EventId;
+
+} // namespace nfd
+
+#endif // NFD_CORE_SCHEDULER_HPP
diff --git a/daemon/face/channel.cpp b/daemon/face/channel.cpp
new file mode 100644
index 0000000..d161504
--- /dev/null
+++ b/daemon/face/channel.cpp
@@ -0,0 +1,39 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "channel.hpp"
+
+namespace nfd {
+
+Channel::~Channel()
+{
+}
+
+void
+Channel::setUri(const FaceUri& uri)
+{
+  m_uri = uri;
+}
+
+} // namespace nfd
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
new file mode 100644
index 0000000..810d726
--- /dev/null
+++ b/daemon/face/channel.hpp
@@ -0,0 +1,68 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_CHANNEL_HPP
+#define NFD_DAEMON_FACE_CHANNEL_HPP
+
+#include "face.hpp"
+
+namespace nfd {
+
+class Channel : noncopyable
+{
+public:
+  /** \brief Prototype for the callback called when face is created
+   *         (as a response to incoming connection or after connection
+   *         is established)
+   */
+  typedef function<void(const shared_ptr<Face>& newFace)> FaceCreatedCallback;
+
+  /** \brief Prototype for the callback that is called when face is failed to
+   *         get created
+   */
+  typedef function<void(const std::string& reason)> ConnectFailedCallback;
+
+  virtual
+  ~Channel();
+
+  const FaceUri&
+  getUri() const;
+
+protected:
+  void
+  setUri(const FaceUri& uri);
+
+private:
+  FaceUri m_uri;
+};
+
+inline const FaceUri&
+Channel::getUri() const
+{
+  return m_uri;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_CHANNEL_HPP
diff --git a/daemon/face/datagram-face.hpp b/daemon/face/datagram-face.hpp
new file mode 100644
index 0000000..e6a6929
--- /dev/null
+++ b/daemon/face/datagram-face.hpp
@@ -0,0 +1,337 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
+#define NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
+
+#include "face.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+template <class Protocol>
+class DatagramFace : public Face
+{
+public:
+  typedef Protocol protocol;
+
+  /** \brief Construct datagram face
+   *
+   * \param socket      Protocol-specific socket for the created face
+   * \param isOnDemand  If true, the face can be closed after it remains
+   *                    unused for a certain amount of time
+   */
+  DatagramFace(const FaceUri& remoteUri, const FaceUri& localUri,
+               const shared_ptr<typename protocol::socket>& socket,
+               bool isOnDemand);
+
+  virtual
+  ~DatagramFace();
+
+  // from Face
+  virtual void
+  sendInterest(const Interest& interest);
+
+  virtual void
+  sendData(const Data& data);
+
+  virtual void
+  close();
+
+  void
+  handleSend(const boost::system::error_code& error,
+             const Block& wire);
+
+  void
+  handleReceive(const boost::system::error_code& error,
+                size_t nBytesReceived);
+
+  /**
+   * \brief Set m_hasBeenUsedRecently to false
+   */
+  void
+  resetRecentUsage();
+
+  bool
+  hasBeenUsedRecently() const;
+
+  void
+  setOnDemand(bool isOnDemand);
+
+protected:
+  void
+  receiveDatagram(const uint8_t* buffer,
+                  size_t nBytesReceived,
+                  const boost::system::error_code& error);
+
+  void
+  keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face);
+
+  void
+  closeSocket();
+
+protected:
+  shared_ptr<typename protocol::socket> m_socket;
+  uint8_t m_inputBuffer[MAX_NDN_PACKET_SIZE];
+  bool m_hasBeenUsedRecently;
+
+  NFD_LOG_INCLASS_DECLARE();
+};
+
+
+template <class T>
+inline
+DatagramFace<T>::DatagramFace(const FaceUri& remoteUri, const FaceUri& localUri,
+                              const shared_ptr<typename DatagramFace::protocol::socket>& socket,
+                              bool isOnDemand)
+  : Face(remoteUri, localUri)
+  , m_socket(socket)
+{
+  setOnDemand(isOnDemand);
+
+  m_socket->async_receive(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE), 0,
+                          bind(&DatagramFace<T>::handleReceive, this, _1, _2));
+}
+
+template <class T>
+inline
+DatagramFace<T>::~DatagramFace()
+{
+}
+
+template <class T>
+inline void
+DatagramFace<T>::sendInterest(const Interest& interest)
+{
+  this->onSendInterest(interest);
+  m_socket->async_send(boost::asio::buffer(interest.wireEncode().wire(),
+                                           interest.wireEncode().size()),
+                       bind(&DatagramFace<T>::handleSend, this, _1, interest.wireEncode()));
+
+  // anything else should be done here?
+}
+
+template <class T>
+inline void
+DatagramFace<T>::sendData(const Data& data)
+{
+  this->onSendData(data);
+  m_socket->async_send(boost::asio::buffer(data.wireEncode().wire(),
+                                           data.wireEncode().size()),
+                       bind(&DatagramFace<T>::handleSend, this, _1, data.wireEncode()));
+
+  // anything else should be done here?
+}
+
+template <class T>
+inline void
+DatagramFace<T>::handleSend(const boost::system::error_code& error,
+                            const Block& wire)
+{
+  if (error != 0) {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    if (!m_socket->is_open())
+    {
+      onFail("Tunnel closed");
+      return;
+    }
+
+    NFD_LOG_WARN("[id:" << this->getId()
+                  << ",endpoint:" << m_socket->local_endpoint()
+                  << "] Send operation failed, closing socket: "
+                  << error.category().message(error.value()));
+
+    closeSocket();
+
+    if (error == boost::asio::error::eof)
+    {
+      onFail("Tunnel closed");
+    }
+    else
+    {
+      onFail("Send operation failed, closing socket: " +
+             error.category().message(error.value()));
+    }
+    return;
+  }
+
+  NFD_LOG_TRACE("[id:" << this->getId()
+                << ",endpoint:" << m_socket->local_endpoint()
+                << "] Successfully sent: " << wire.size() << " bytes");
+  // do nothing (needed to retain validity of wire memory block
+}
+
+template <class T>
+inline void
+DatagramFace<T>::close()
+{
+  if (!m_socket->is_open())
+    return;
+
+  NFD_LOG_INFO("[id:" << this->getId()
+               << ",endpoint:" << m_socket->local_endpoint()
+               << "] Close tunnel");
+
+  closeSocket();
+  onFail("Close tunnel");
+}
+
+template <class T>
+inline void
+DatagramFace<T>::handleReceive(const boost::system::error_code& error,
+                               size_t nBytesReceived)
+{
+  NFD_LOG_DEBUG("handleReceive: " << nBytesReceived);
+  receiveDatagram(m_inputBuffer, nBytesReceived, error);
+  if (m_socket->is_open())
+    m_socket->async_receive(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE), 0,
+                            bind(&DatagramFace<T>::handleReceive, this, _1, _2));
+}
+
+template <class T>
+inline void
+DatagramFace<T>::receiveDatagram(const uint8_t* buffer,
+                                 size_t nBytesReceived,
+                                 const boost::system::error_code& error)
+{
+  if (error != 0 || nBytesReceived == 0) {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    // this should be unnecessary, but just in case
+    if (!m_socket->is_open())
+    {
+      onFail("Tunnel closed");
+      return;
+    }
+
+    NFD_LOG_WARN("[id:" << this->getId()
+                 << ",endpoint:" << m_socket->local_endpoint()
+                 << "] Receive operation failed: "
+                 << error.category().message(error.value()));
+
+    closeSocket();
+
+    if (error == boost::asio::error::eof)
+    {
+      onFail("Tunnel closed");
+    }
+    else
+    {
+      onFail("Receive operation failed, closing socket: " +
+             error.category().message(error.value()));
+    }
+    return;
+  }
+
+  NFD_LOG_TRACE("[id:" << this->getId()
+                << ",endpoint:" << m_socket->local_endpoint()
+                << "] Received: " << nBytesReceived << " bytes");
+
+  Block element;
+  bool isOk = Block::fromBuffer(buffer, nBytesReceived, element);
+  if (!isOk)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Failed to parse incoming packet");
+      // This message won't extend the face lifetime
+      return;
+    }
+
+  if (element.size() != nBytesReceived)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Received datagram size and decoded "
+                   << "element size don't match");
+      // This message won't extend the face lifetime
+      return;
+    }
+
+  if (!this->decodeAndDispatchInput(element))
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Received unrecognized block of type ["
+                   << element.type() << "]");
+      // This message won't extend the face lifetime
+      return;
+    }
+
+  m_hasBeenUsedRecently = true;
+}
+
+
+template <class T>
+inline void
+DatagramFace<T>::keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face)
+{
+}
+
+template <class T>
+inline void
+DatagramFace<T>::closeSocket()
+{
+  NFD_LOG_DEBUG("closeSocket  " << m_socket->local_endpoint());
+  boost::asio::io_service& io = m_socket->get_io_service();
+
+  // use the non-throwing variants and ignore errors, if any
+  boost::system::error_code error;
+  m_socket->shutdown(protocol::socket::shutdown_both, error);
+  m_socket->close(error);
+  // after this, handlers will be called with an error code
+
+  // ensure that the Face object is alive at least until all pending
+  // handlers are dispatched
+  io.post(bind(&DatagramFace<T>::keepFaceAliveUntilAllHandlersExecuted,
+               this, this->shared_from_this()));
+}
+
+template <class T>
+inline void
+DatagramFace<T>::setOnDemand(bool isOnDemand)
+{
+  Face::setOnDemand(isOnDemand);
+}
+
+template <class T>
+inline void
+DatagramFace<T>::resetRecentUsage()
+{
+  m_hasBeenUsedRecently = false;
+}
+
+template <class T>
+inline bool
+DatagramFace<T>::hasBeenUsedRecently() const
+{
+  return m_hasBeenUsedRecently;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
new file mode 100644
index 0000000..fb278d3
--- /dev/null
+++ b/daemon/face/ethernet-face.cpp
@@ -0,0 +1,313 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ethernet-face.hpp"
+#include "core/logger.hpp"
+#include "core/network-interface.hpp"
+
+#include <pcap/pcap.h>
+
+#include <cstring>        // for std::strncpy()
+#include <arpa/inet.h>    // for htons() and ntohs()
+#include <net/ethernet.h> // for struct ether_header
+#include <net/if.h>       // for struct ifreq
+#include <stdio.h>        // for snprintf()
+#include <sys/ioctl.h>    // for ioctl()
+#include <unistd.h>       // for dup()
+
+namespace nfd {
+
+NFD_LOG_INIT("EthernetFace");
+
+EthernetFace::EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
+                           const shared_ptr<NetworkInterfaceInfo>& interface,
+                           const ethernet::Address& address)
+  : Face(FaceUri(address), FaceUri::fromDev(interface->name))
+  , m_socket(socket)
+  , m_interfaceName(interface->name)
+  , m_srcAddress(interface->etherAddress)
+  , m_destAddress(address)
+{
+  NFD_LOG_INFO("Creating ethernet face on " << m_interfaceName << ": "
+               << m_srcAddress << " <--> " << m_destAddress);
+  pcapInit();
+
+  int fd = pcap_get_selectable_fd(m_pcap);
+  if (fd < 0)
+    throw Error("pcap_get_selectable_fd() failed");
+
+  // need to duplicate the fd, otherwise both pcap_close()
+  // and stream_descriptor::close() will try to close the
+  // same fd and one of them will fail
+  m_socket->assign(::dup(fd));
+
+  m_interfaceMtu = getInterfaceMtu();
+  NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName
+                << "] Interface MTU is: " << m_interfaceMtu);
+
+  char filter[100];
+  ::snprintf(filter, sizeof(filter),
+             "(ether proto 0x%x) && (ether dst %s) && (not ether src %s)",
+             ETHERTYPE_NDN,
+             m_destAddress.toString().c_str(),
+             m_srcAddress.toString().c_str());
+  setPacketFilter(filter);
+
+  m_socket->async_read_some(boost::asio::null_buffers(),
+                            bind(&EthernetFace::handleRead, this,
+                                 boost::asio::placeholders::error,
+                                 boost::asio::placeholders::bytes_transferred));
+}
+
+EthernetFace::~EthernetFace()
+{
+  close();
+}
+
+void
+EthernetFace::sendInterest(const Interest& interest)
+{
+  onSendInterest(interest);
+  sendPacket(interest.wireEncode());
+}
+
+void
+EthernetFace::sendData(const Data& data)
+{
+  onSendData(data);
+  sendPacket(data.wireEncode());
+}
+
+void
+EthernetFace::close()
+{
+  if (m_pcap)
+    {
+      boost::system::error_code error;
+      m_socket->close(error); // ignore errors
+      pcap_close(m_pcap);
+      m_pcap = 0;
+    }
+}
+
+void
+EthernetFace::pcapInit()
+{
+  char errbuf[PCAP_ERRBUF_SIZE];
+  errbuf[0] = '\0';
+  m_pcap = pcap_create(m_interfaceName.c_str(), errbuf);
+  if (!m_pcap)
+    throw Error("pcap_create(): " + std::string(errbuf));
+
+  /// \todo Do not rely on promisc mode, see task #1278
+  if (!m_destAddress.isBroadcast())
+    pcap_set_promisc(m_pcap, 1);
+
+  if (pcap_activate(m_pcap) < 0)
+    throw Error("pcap_activate() failed");
+
+  if (pcap_set_datalink(m_pcap, DLT_EN10MB) < 0)
+    throw Error("pcap_set_datalink(): " + std::string(pcap_geterr(m_pcap)));
+
+  if (pcap_setdirection(m_pcap, PCAP_D_IN) < 0)
+    // no need to throw on failure, BPF will filter unwanted packets anyway
+    NFD_LOG_WARN("pcap_setdirection(): " << pcap_geterr(m_pcap));
+}
+
+void
+EthernetFace::setPacketFilter(const char* filterString)
+{
+  bpf_program filter;
+  if (pcap_compile(m_pcap, &filter, filterString, 1, PCAP_NETMASK_UNKNOWN) < 0)
+    throw Error("pcap_compile(): " + std::string(pcap_geterr(m_pcap)));
+
+  int ret = pcap_setfilter(m_pcap, &filter);
+  pcap_freecode(&filter);
+  if (ret < 0)
+    throw Error("pcap_setfilter(): " + std::string(pcap_geterr(m_pcap)));
+}
+
+void
+EthernetFace::sendPacket(const ndn::Block& block)
+{
+  if (!m_pcap)
+    {
+      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                   << "] Trying to send on closed face");
+      onFail("Face closed");
+      return;
+    }
+
+  /// \todo Fragmentation
+  if (block.size() > m_interfaceMtu)
+    {
+      NFD_LOG_ERROR("[id:" << getId() << ",endpoint:" << m_interfaceName
+                    << "] Fragmentation not implemented: dropping packet larger than MTU");
+      return;
+    }
+
+  /// \todo Right now there is no reserve when packet is received, but
+  ///       we should reserve some space at the beginning and at the end
+  ndn::EncodingBuffer buffer(block);
+
+  // pad with zeroes if the payload is too short
+  if (block.size() < ethernet::MIN_DATA_LEN)
+    {
+      static const uint8_t padding[ethernet::MIN_DATA_LEN] = {0};
+      buffer.appendByteArray(padding, ethernet::MIN_DATA_LEN - block.size());
+    }
+
+  // construct and prepend the ethernet header
+  static uint16_t ethertype = htons(ETHERTYPE_NDN);
+  buffer.prependByteArray(reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN);
+  buffer.prependByteArray(m_srcAddress.data(), m_srcAddress.size());
+  buffer.prependByteArray(m_destAddress.data(), m_destAddress.size());
+
+  // send the packet
+  int sent = pcap_inject(m_pcap, buffer.buf(), buffer.size());
+  if (sent < 0)
+    {
+      throw Error("pcap_inject(): " + std::string(pcap_geterr(m_pcap)));
+    }
+  else if (static_cast<size_t>(sent) < buffer.size())
+    {
+      throw Error("Failed to send packet");
+    }
+
+  NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
+                << "] Successfully sent: " << buffer.size() << " bytes");
+}
+
+void
+EthernetFace::handleRead(const boost::system::error_code& error, size_t)
+{
+  if (error)
+    return processErrorCode(error);
+
+  pcap_pkthdr* pktHeader;
+  const uint8_t* packet;
+  int ret = pcap_next_ex(m_pcap, &pktHeader, &packet);
+  if (ret < 0)
+    {
+      throw Error("pcap_next_ex(): " + std::string(pcap_geterr(m_pcap)));
+    }
+  else if (ret == 0)
+    {
+      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                   << "] pcap_next_ex() timed out");
+    }
+  else
+    {
+      size_t length = pktHeader->caplen;
+      if (length < ethernet::HDR_LEN + ethernet::MIN_DATA_LEN)
+        throw Error("Received packet is too short");
+
+      const ether_header* eh = reinterpret_cast<const ether_header*>(packet);
+      if (ntohs(eh->ether_type) != ETHERTYPE_NDN)
+        throw Error("Unrecognized ethertype");
+
+      packet += ethernet::HDR_LEN;
+      length -= ethernet::HDR_LEN;
+      NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
+                    << "] Received: " << length << " bytes");
+
+      /// \todo Reserve space in front and at the back
+      ///       of the underlying buffer
+      Block element;
+      bool isOk = Block::fromBuffer(packet, length, element);
+      if (isOk)
+        {
+          if (!decodeAndDispatchInput(element))
+            {
+              NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                           << "] Received unrecognized block of type " << element.type());
+              // ignore unknown packet
+            }
+        }
+      else
+        {
+          NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                       << "] Received block is invalid or too large to process");
+        }
+    }
+
+  m_socket->async_read_some(boost::asio::null_buffers(),
+                            bind(&EthernetFace::handleRead, this,
+                                 boost::asio::placeholders::error,
+                                 boost::asio::placeholders::bytes_transferred));
+}
+
+void
+EthernetFace::processErrorCode(const boost::system::error_code& error)
+{
+  if (error == boost::system::errc::operation_canceled)
+    // when socket is closed by someone
+    return;
+
+  if (!m_pcap)
+    {
+      onFail("Face closed");
+      return;
+    }
+
+  std::string msg;
+  if (error == boost::asio::error::eof)
+    {
+      msg = "Face closed";
+      NFD_LOG_INFO("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
+    }
+  else
+    {
+      msg = "Receive operation failed, closing face: " + error.category().message(error.value());
+      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
+    }
+
+  close();
+  onFail(msg);
+}
+
+size_t
+EthernetFace::getInterfaceMtu() const
+{
+  size_t mtu = ethernet::MAX_DATA_LEN;
+
+#ifdef SIOCGIFMTU
+  ifreq ifr = {};
+  std::strncpy(ifr.ifr_name, m_interfaceName.c_str(), sizeof(ifr.ifr_name) - 1);
+
+  if (::ioctl(m_socket->native_handle(), SIOCGIFMTU, &ifr) < 0)
+    {
+      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                   << "] Failed to get interface MTU, assuming " << mtu);
+    }
+  else
+    {
+      mtu = std::min(mtu, static_cast<size_t>(ifr.ifr_mtu));
+    }
+#endif
+
+  return mtu;
+}
+
+} // namespace nfd
diff --git a/daemon/face/ethernet-face.hpp b/daemon/face/ethernet-face.hpp
new file mode 100644
index 0000000..381493c
--- /dev/null
+++ b/daemon/face/ethernet-face.hpp
@@ -0,0 +1,113 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_ETHERNET_FACE_HPP
+#define NFD_DAEMON_FACE_ETHERNET_FACE_HPP
+
+#include "ethernet.hpp"
+#include "face.hpp"
+
+#ifndef HAVE_LIBPCAP
+#error "Cannot include this file when libpcap is not available"
+#endif
+
+// forward declarations
+struct pcap;
+typedef pcap pcap_t;
+
+namespace nfd {
+
+class NetworkInterfaceInfo;
+
+/**
+ * \brief Implementation of Face abstraction that uses raw
+ *        Ethernet frames as underlying transport mechanism
+ */
+class EthernetFace : public Face
+{
+public:
+  /**
+   * \brief EthernetFace-related error
+   */
+  struct Error : public Face::Error
+  {
+    Error(const std::string& what) : Face::Error(what) {}
+  };
+
+  EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
+               const shared_ptr<NetworkInterfaceInfo>& interface,
+               const ethernet::Address& address);
+
+  virtual
+  ~EthernetFace();
+
+  /// send an Interest
+  virtual void
+  sendInterest(const Interest& interest);
+
+  /// send a Data
+  virtual void
+  sendData(const Data& data);
+
+  /**
+   * \brief Close the face
+   *
+   * This terminates all communication on the face and cause
+   * onFail() method event to be invoked
+   */
+  virtual void
+  close();
+
+private:
+  void
+  pcapInit();
+
+  void
+  setPacketFilter(const char* filterString);
+
+  void
+  sendPacket(const ndn::Block& block);
+
+  void
+  handleRead(const boost::system::error_code& error,
+             size_t nBytesRead);
+
+  void
+  processErrorCode(const boost::system::error_code& error);
+
+  size_t
+  getInterfaceMtu() const;
+
+private:
+  shared_ptr<boost::asio::posix::stream_descriptor> m_socket;
+  std::string m_interfaceName;
+  ethernet::Address m_srcAddress;
+  ethernet::Address m_destAddress;
+  size_t m_interfaceMtu;
+  pcap_t* m_pcap;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_ETHERNET_FACE_HPP
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
new file mode 100644
index 0000000..6809e6c
--- /dev/null
+++ b/daemon/face/ethernet-factory.cpp
@@ -0,0 +1,89 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ethernet-factory.hpp"
+#include "core/logger.hpp"
+#include "core/global-io.hpp"
+#include "core/network-interface.hpp"
+
+#include <boost/algorithm/string/predicate.hpp>
+#include <pcap/pcap.h>
+
+namespace nfd {
+
+NFD_LOG_INIT("EthernetFactory");
+
+shared_ptr<EthernetFace>
+EthernetFactory::createMulticastFace(const shared_ptr<NetworkInterfaceInfo> &interface,
+                                     const ethernet::Address &address)
+{
+  if (!address.isMulticast())
+    throw Error(address.toString() + " is not a multicast address");
+
+  const std::string& name = interface->name;
+  shared_ptr<EthernetFace> face = findMulticastFace(name, address);
+  if (face)
+    return face;
+
+  shared_ptr<boost::asio::posix::stream_descriptor> socket =
+    make_shared<boost::asio::posix::stream_descriptor>(boost::ref(getGlobalIoService()));
+
+  face = make_shared<EthernetFace>(boost::cref(socket),
+                                   boost::cref(interface),
+                                   boost::cref(address));
+  face->onFail += bind(&EthernetFactory::afterFaceFailed,
+                       this, name, address);
+  m_multicastFaces[std::make_pair(name, address)] = face;
+
+  return face;
+}
+
+void
+EthernetFactory::afterFaceFailed(const std::string& interfaceName,
+                                 const ethernet::Address& address)
+{
+  NFD_LOG_DEBUG("afterFaceFailed: " << interfaceName << "/" << address);
+  m_multicastFaces.erase(std::make_pair(interfaceName, address));
+}
+
+shared_ptr<EthernetFace>
+EthernetFactory::findMulticastFace(const std::string& interfaceName,
+                                   const ethernet::Address& address) const
+{
+  MulticastFacesMap::const_iterator i = m_multicastFaces.find(std::make_pair(interfaceName, address));
+  if (i != m_multicastFaces.end())
+    return i->second;
+  else
+    return shared_ptr<EthernetFace>();
+}
+
+void
+EthernetFactory::createFace(const FaceUri& uri,
+                            const FaceCreatedCallback& onCreated,
+                            const FaceConnectFailedCallback& onConnectFailed)
+{
+  throw Error("EthernetFactory does not support 'createFace' operation");
+}
+
+} // namespace nfd
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
new file mode 100644
index 0000000..738164a
--- /dev/null
+++ b/daemon/face/ethernet-factory.hpp
@@ -0,0 +1,96 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
+#define NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
+
+#include "ethernet-face.hpp"
+#include "protocol-factory.hpp"
+
+namespace nfd {
+
+class NetworkInterfaceInfo;
+
+class EthernetFactory : public ProtocolFactory
+{
+public:
+  /**
+   * \brief Exception of EthernetFactory
+   */
+  struct Error : public ProtocolFactory::Error
+  {
+    Error(const std::string& what) : ProtocolFactory::Error(what) {}
+  };
+
+  // from ProtocolFactory
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
+  /**
+   * \brief Create an EthernetFace to communicate with the given multicast group
+   *
+   * If this method is called twice with the same interface and group, only
+   * one face will be created. Instead, the second call will just retrieve
+   * the existing face.
+   *
+   * \param interface Local network interface
+   * \param address   Ethernet broadcast/multicast destination address
+   *
+   * \returns always a valid shared pointer to an EthernetFace object,
+   *          an exception will be thrown if the creation fails
+   *
+   * \throws EthernetFactory::Error or EthernetFace::Error
+   */
+  shared_ptr<EthernetFace>
+  createMulticastFace(const shared_ptr<NetworkInterfaceInfo>& interface,
+                      const ethernet::Address& address);
+
+private:
+  void
+  afterFaceFailed(const std::string& interfaceName,
+                  const ethernet::Address& address);
+
+  /**
+   * \brief Look up EthernetFace using specified interface and address
+   *
+   * \returns shared pointer to the existing EthernetFace object or
+   *          empty shared pointer when such face does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<EthernetFace>
+  findMulticastFace(const std::string& interfaceName,
+                    const ethernet::Address& address) const;
+
+private:
+  typedef std::map< std::pair<std::string, ethernet::Address>,
+                    shared_ptr<EthernetFace> > MulticastFacesMap;
+  MulticastFacesMap m_multicastFaces;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
diff --git a/daemon/face/face-counter.hpp b/daemon/face/face-counter.hpp
new file mode 100644
index 0000000..152c5a1
--- /dev/null
+++ b/daemon/face/face-counter.hpp
@@ -0,0 +1,142 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_FACE_COUNTER_HPP
+#define NFD_DAEMON_FACE_FACE_COUNTER_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+
+/** \class FaceCounter
+ *  \brief represents a counter on face
+ *
+ *  \todo This class should be noncopyable
+ */
+typedef uint64_t FaceCounter;
+
+
+/** \brief contains counters on face
+ */
+class FaceCounters : noncopyable
+{
+public:
+  FaceCounters();
+
+  /// incoming Interest (total packets since Face establishment)
+  const FaceCounter&
+  getNInInterests() const;
+
+  FaceCounter&
+  getNInInterests();
+
+  /// incoming Data (total packets since Face establishment)
+  const FaceCounter&
+  getNInDatas() const;
+
+  FaceCounter&
+  getNInDatas();
+
+  /// outgoing Interest (total packets since Face establishment)
+  const FaceCounter&
+  getNOutInterests() const;
+
+  FaceCounter&
+  getNOutInterests();
+
+  /// outgoing Data (total packets since Face establishment)
+  const FaceCounter&
+  getNOutDatas() const;
+
+  FaceCounter&
+  getNOutDatas();
+
+private:
+  FaceCounter m_nInInterests;
+  FaceCounter m_nInDatas;
+  FaceCounter m_outInterests;
+  FaceCounter m_outDatas;
+};
+
+inline
+FaceCounters::FaceCounters()
+  : m_nInInterests(0)
+  , m_nInDatas(0)
+  , m_outInterests(0)
+  , m_outDatas(0)
+{
+}
+
+inline const FaceCounter&
+FaceCounters::getNInInterests() const
+{
+  return m_nInInterests;
+}
+
+inline FaceCounter&
+FaceCounters::getNInInterests()
+{
+  return m_nInInterests;
+}
+
+inline const FaceCounter&
+FaceCounters::getNInDatas() const
+{
+  return m_nInDatas;
+}
+
+inline FaceCounter&
+FaceCounters::getNInDatas()
+{
+  return m_nInDatas;
+}
+
+inline const FaceCounter&
+FaceCounters::getNOutInterests() const
+{
+  return m_outInterests;
+}
+
+inline FaceCounter&
+FaceCounters::getNOutInterests()
+{
+  return m_outInterests;
+}
+
+inline const FaceCounter&
+FaceCounters::getNOutDatas() const
+{
+  return m_outDatas;
+}
+
+inline FaceCounter&
+FaceCounters::getNOutDatas()
+{
+  return m_outDatas;
+}
+
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_FACE_COUNTER_HPP
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
new file mode 100644
index 0000000..d0d42db
--- /dev/null
+++ b/daemon/face/face.cpp
@@ -0,0 +1,113 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+static inline void
+increaseCounter(FaceCounter& counter)
+{
+  ++counter;
+}
+
+Face::Face(const FaceUri& remoteUri, const FaceUri& localUri, bool isLocal)
+  : m_id(INVALID_FACEID)
+  , m_isLocal(isLocal)
+  , m_remoteUri(remoteUri)
+  , m_localUri(localUri)
+  , m_isOnDemand(false)
+{
+  onReceiveInterest += bind(&increaseCounter, boost::ref(m_counters.getNInInterests()));
+  onReceiveData     += bind(&increaseCounter, boost::ref(m_counters.getNInDatas()));
+  onSendInterest    += bind(&increaseCounter, boost::ref(m_counters.getNOutInterests()));
+  onSendData        += bind(&increaseCounter, boost::ref(m_counters.getNOutDatas()));
+}
+
+Face::~Face()
+{
+}
+
+FaceId
+Face::getId() const
+{
+  return m_id;
+}
+
+// this method is private and should be used only by the Forwarder
+void
+Face::setId(FaceId faceId)
+{
+  m_id = faceId;
+}
+
+void
+Face::setDescription(const std::string& description)
+{
+  m_description = description;
+}
+
+const std::string&
+Face::getDescription() const
+{
+  return m_description;
+}
+
+bool
+Face::isMultiAccess() const
+{
+  return false;
+}
+
+bool
+Face::isUp() const
+{
+  return true;
+}
+
+bool
+Face::decodeAndDispatchInput(const Block& element)
+{
+  /// \todo Ensure lazy field decoding process
+
+  if (element.type() == tlv::Interest)
+    {
+      shared_ptr<Interest> i = make_shared<Interest>();
+      i->wireDecode(element);
+      this->onReceiveInterest(*i);
+    }
+  else if (element.type() == tlv::Data)
+    {
+      shared_ptr<Data> d = make_shared<Data>();
+      d->wireDecode(element);
+      this->onReceiveData(*d);
+    }
+  else
+    return false;
+
+  return true;
+}
+
+} //namespace nfd
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
new file mode 100644
index 0000000..c5e6ee8
--- /dev/null
+++ b/daemon/face/face.hpp
@@ -0,0 +1,224 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_FACE_HPP
+#define NFD_DAEMON_FACE_FACE_HPP
+
+#include "common.hpp"
+#include "core/event-emitter.hpp"
+#include "core/face-uri.hpp"
+#include "face-counter.hpp"
+
+namespace nfd {
+
+/** \class FaceId
+ *  \brief identifies a face
+ */
+typedef int FaceId;
+
+const FaceId INVALID_FACEID = -1;
+
+const size_t MAX_NDN_PACKET_SIZE = 8800;
+
+
+/** \brief represents a face
+ */
+class Face : noncopyable, public enable_shared_from_this<Face>
+{
+public:
+  /**
+   * \brief Face-related error
+   */
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
+  Face(const FaceUri& remoteUri, const FaceUri& localUri, bool isLocal = false);
+
+  virtual
+  ~Face();
+
+  /// fires when an Interest is received
+  EventEmitter<Interest> onReceiveInterest;
+
+  /// fires when a Data is received
+  EventEmitter<Data> onReceiveData;
+
+  /// fires when an Interest is sent out
+  EventEmitter<Interest> onSendInterest;
+
+  /// fires when a Data is sent out
+  EventEmitter<Data> onSendData;
+
+  /// fires when face disconnects or fails to perform properly
+  EventEmitter<std::string/*reason*/> onFail;
+
+  /// send an Interest
+  virtual void
+  sendInterest(const Interest& interest) = 0;
+
+  /// send a Data
+  virtual void
+  sendData(const Data& data) = 0;
+
+  /** \brief Close the face
+   *
+   *  This terminates all communication on the face and cause
+   *  onFail() method event to be invoked
+   */
+  virtual void
+  close() = 0;
+
+public: // attributes
+  FaceId
+  getId() const;
+
+  /** \brief Set the description
+   *
+   *  This is typically invoked by mgmt on set description command
+   */
+  virtual void
+  setDescription(const std::string& description);
+
+  /// Get the description
+  virtual const std::string&
+  getDescription() const;
+
+  /** \brief Get whether face is connected to a local app
+   */
+  bool
+  isLocal() const;
+
+  /** \brief Get whether packets sent this Face may reach multiple peers
+   *
+   *  In this base class this property is always false.
+   */
+  virtual bool
+  isMultiAccess() const;
+
+  /** \brief Get whether underlying communication is up
+   *
+   *  In this base class this property is always true.
+   */
+  virtual bool
+  isUp() const;
+
+  /** \brief Get whether face is created on demand or explicitly via FaceManagement protocol
+   */
+  bool
+  isOnDemand() const;
+
+  const FaceCounters&
+  getCounters() const;
+
+  /** \return a FaceUri that represents the remote endpoint
+   */
+  const FaceUri&
+  getRemoteUri() const;
+
+  /** \return a FaceUri that represents the local endpoint (NFD side)
+   */
+  const FaceUri&
+  getLocalUri() const;
+
+protected:
+  // this is a non-virtual method
+  bool
+  decodeAndDispatchInput(const Block& element);
+
+  FaceCounters&
+  getMutableCounters();
+
+  void
+  setOnDemand(bool isOnDemand);
+
+private:
+  void
+  setId(FaceId faceId);
+
+private:
+  FaceId m_id;
+  std::string m_description;
+  bool m_isLocal; // for scoping purposes
+  FaceCounters m_counters;
+  FaceUri m_remoteUri;
+  FaceUri m_localUri;
+  bool m_isOnDemand;
+
+  // allow setting FaceId
+  friend class FaceTable;
+};
+
+
+inline bool
+Face::isLocal() const
+{
+  return m_isLocal;
+}
+
+inline const FaceCounters&
+Face::getCounters() const
+{
+  return m_counters;
+}
+
+inline FaceCounters&
+Face::getMutableCounters()
+{
+  return m_counters;
+}
+
+inline const FaceUri&
+Face::getRemoteUri() const
+{
+  return m_remoteUri;
+}
+
+inline const FaceUri&
+Face::getLocalUri() const
+{
+  return m_localUri;
+}
+
+inline void
+Face::setOnDemand(bool isOnDemand)
+{
+  m_isOnDemand = isOnDemand;
+}
+
+inline bool
+Face::isOnDemand() const
+{
+  return m_isOnDemand;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_FACE_HPP
diff --git a/daemon/face/local-face.hpp b/daemon/face/local-face.hpp
new file mode 100644
index 0000000..f992231
--- /dev/null
+++ b/daemon/face/local-face.hpp
@@ -0,0 +1,203 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_LOCAL_FACE_HPP
+#define NFD_DAEMON_FACE_LOCAL_FACE_HPP
+
+#include "face.hpp"
+#include <ndn-cpp-dev/management/nfd-control-parameters.hpp>
+
+namespace nfd {
+
+using ndn::nfd::LocalControlFeature;
+using ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID;
+using ndn::nfd::LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID;
+
+/** \brief represents a face
+ */
+class LocalFace : public Face
+{
+public:
+  LocalFace(const FaceUri& remoteUri, const FaceUri& localUri);
+
+  /** \brief get whether any LocalControlHeader feature is enabled
+   *
+   * \returns true if any feature is enabled.
+   */
+  bool
+  isLocalControlHeaderEnabled() const;
+
+  /** \brief get whether a specific LocalControlHeader feature is enabled
+   *
+   *  \param feature The feature.
+   *  \returns true if the specified feature is enabled.
+   */
+  bool
+  isLocalControlHeaderEnabled(LocalControlFeature feature) const;
+
+  /** \brief enable or disable a LocalControlHeader feature
+   *
+   *  \param feature The feature. Cannot be LOCAL_CONTROL_FEATURE_ANY
+   *                                     or LOCAL_CONTROL_FEATURE_MAX
+   */
+  void
+  setLocalControlHeaderFeature(LocalControlFeature feature, bool enabled = true);
+
+public:
+
+  static const size_t LOCAL_CONTROL_FEATURE_MAX = 3; /// upper bound of LocalControlFeature enum
+  static const size_t LOCAL_CONTROL_FEATURE_ANY = 0; /// any feature
+
+protected:
+  // statically overridden from Face
+
+  /** \brief Decode block into Interest/Data, considering potential LocalControlHeader
+   *
+   *  If LocalControlHeader is present, the encoded data is filtered out, based
+   *  on enabled features on the face.
+   */
+  bool
+  decodeAndDispatchInput(const Block& element);
+
+  // LocalFace-specific methods
+
+  /** \brief Check if LocalControlHeader needs to be included, taking into account
+   *         both set parameters in supplied LocalControlHeader and features
+   *         enabled on the local face.
+   */
+  bool
+  isEmptyFilteredLocalControlHeader(const ndn::nfd::LocalControlHeader& header) const;
+
+  /** \brief Create LocalControlHeader, considering enabled features
+   */
+  template<class Packet>
+  Block
+  filterAndEncodeLocalControlHeader(const Packet& packet);
+
+private:
+  std::vector<bool> m_localControlHeaderFeatures;
+};
+
+inline
+LocalFace::LocalFace(const FaceUri& remoteUri, const FaceUri& localUri)
+  : Face(remoteUri, localUri, true)
+  , m_localControlHeaderFeatures(LocalFace::LOCAL_CONTROL_FEATURE_MAX)
+{
+}
+
+inline bool
+LocalFace::isLocalControlHeaderEnabled() const
+{
+  return m_localControlHeaderFeatures[LOCAL_CONTROL_FEATURE_ANY];
+}
+
+inline bool
+LocalFace::isLocalControlHeaderEnabled(LocalControlFeature feature) const
+{
+  BOOST_ASSERT(0 < feature && feature < m_localControlHeaderFeatures.size());
+  return m_localControlHeaderFeatures[feature];
+}
+
+inline void
+LocalFace::setLocalControlHeaderFeature(LocalControlFeature feature, bool enabled/* = true*/)
+{
+  BOOST_ASSERT(0 < feature && feature < m_localControlHeaderFeatures.size());
+
+  m_localControlHeaderFeatures[feature] = enabled;
+
+  m_localControlHeaderFeatures[LOCAL_CONTROL_FEATURE_ANY] =
+    std::find(m_localControlHeaderFeatures.begin() + 1,
+              m_localControlHeaderFeatures.end(), true) <
+              m_localControlHeaderFeatures.end();
+  // 'find(..) < .end()' instead of 'find(..) != .end()' due to LLVM Bug 16816
+}
+
+inline bool
+LocalFace::decodeAndDispatchInput(const Block& element)
+{
+  const Block& payload = ndn::nfd::LocalControlHeader::getPayload(element);
+
+  // If received LocalControlHeader, but it is not enabled on the face
+  if ((&payload != &element) && !this->isLocalControlHeaderEnabled())
+    return false;
+
+  if (payload.type() == tlv::Interest)
+    {
+      shared_ptr<Interest> i = make_shared<Interest>();
+      i->wireDecode(payload);
+      if (&payload != &element)
+        {
+          i->getLocalControlHeader().wireDecode(element,
+            false,
+            this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+        }
+
+      this->onReceiveInterest(*i);
+    }
+  else if (payload.type() == tlv::Data)
+    {
+      shared_ptr<Data> d = make_shared<Data>();
+      d->wireDecode(payload);
+
+      /// \todo Uncomment and correct the following when we have more
+      ///       options in LocalControlHeader that apply for incoming
+      ///       Data packets (if ever)
+      // if (&payload != &element)
+      //   {
+      //
+      //     d->getLocalControlHeader().wireDecode(element,
+      //       false,
+      //       false);
+      //   }
+
+      this->onReceiveData(*d);
+    }
+  else
+    return false;
+
+  return true;
+}
+
+inline bool
+LocalFace::isEmptyFilteredLocalControlHeader(const ndn::nfd::LocalControlHeader& header) const
+{
+  if (!this->isLocalControlHeaderEnabled())
+    return true;
+
+  return header.empty(this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
+                      false);
+}
+
+template<class Packet>
+inline Block
+LocalFace::filterAndEncodeLocalControlHeader(const Packet& packet)
+{
+  return packet.getLocalControlHeader().wireEncode(packet,
+           this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
+           false);
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_LOCAL_FACE_HPP
diff --git a/daemon/face/multicast-udp-face.cpp b/daemon/face/multicast-udp-face.cpp
new file mode 100644
index 0000000..75c691e
--- /dev/null
+++ b/daemon/face/multicast-udp-face.cpp
@@ -0,0 +1,83 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "multicast-udp-face.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("MulticastUdpFace");
+
+MulticastUdpFace::MulticastUdpFace(const shared_ptr<MulticastUdpFace::protocol::socket>& socket,
+                                   const MulticastUdpFace::protocol::endpoint& localEndpoint)
+  : DatagramFace<protocol>(FaceUri(socket->local_endpoint()),
+                           FaceUri(localEndpoint),
+                           socket, false)
+  , m_multicastGroup(m_socket->local_endpoint())
+{
+  NFD_LOG_INFO("Creating multicast UDP face for group " << m_multicastGroup);
+}
+
+const MulticastUdpFace::protocol::endpoint&
+MulticastUdpFace::getMulticastGroup() const
+{
+  return m_multicastGroup;
+}
+
+void
+MulticastUdpFace::sendInterest(const Interest& interest)
+{
+  onSendInterest(interest);
+
+  NFD_LOG_DEBUG("Sending interest");
+  m_socket->async_send_to(boost::asio::buffer(interest.wireEncode().wire(),
+                                              interest.wireEncode().size()),
+                          m_multicastGroup,
+                          bind(&DatagramFace<protocol>::handleSend, this, _1, interest.wireEncode()));
+
+  // anything else should be done here?
+}
+
+void
+MulticastUdpFace::sendData(const Data& data)
+{
+  /// \todo After this method implements duplicate suppression, onSendData event should
+  ///       be triggered only when data is actually sent out
+  onSendData(data);
+
+  NFD_LOG_DEBUG("Sending data");
+  m_socket->async_send_to(boost::asio::buffer(data.wireEncode().wire(),
+                                              data.wireEncode().size()),
+                          m_multicastGroup,
+                          bind(&DatagramFace<protocol>::handleSend, this, _1, data.wireEncode()));
+
+  // anything else should be done here?
+}
+
+bool
+MulticastUdpFace::isMultiAccess() const
+{
+  return true;
+}
+
+} // namespace nfd
diff --git a/daemon/face/multicast-udp-face.hpp b/daemon/face/multicast-udp-face.hpp
new file mode 100644
index 0000000..3a5c75d
--- /dev/null
+++ b/daemon/face/multicast-udp-face.hpp
@@ -0,0 +1,64 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
+#define NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
+
+#include "datagram-face.hpp"
+
+namespace nfd {
+
+/**
+ * \brief Implementation of Face abstraction that uses
+ *        multicast UDP as underlying transport mechanism
+ */
+class MulticastUdpFace : public DatagramFace<boost::asio::ip::udp>
+{
+public:
+  /**
+   * \brief Creates a UDP-based face for multicast communication
+   */
+  MulticastUdpFace(const shared_ptr<protocol::socket>& socket,
+                   const protocol::endpoint& localEndpoint);
+
+  const protocol::endpoint&
+  getMulticastGroup() const;
+
+  // from Face
+  virtual void
+  sendInterest(const Interest& interest);
+
+  virtual void
+  sendData(const Data& data);
+
+  virtual bool
+  isMultiAccess() const;
+
+private:
+  protocol::endpoint m_multicastGroup;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
diff --git a/daemon/face/ndnlp-parse.cpp b/daemon/face/ndnlp-parse.cpp
new file mode 100644
index 0000000..21d959f
--- /dev/null
+++ b/daemon/face/ndnlp-parse.cpp
@@ -0,0 +1,92 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ndnlp-parse.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+void
+NdnlpData::wireDecode(const Block& wire)
+{
+  if (wire.type() != tlv::NdnlpData) {
+    throw ParseError("top element is not NdnlpData");
+  }
+  wire.parse();
+  const Block::element_container& elements = wire.elements();
+  if (elements.size() < 2) {
+    throw ParseError("NdnlpData element has incorrect number of children");
+  }
+
+  const Block& sequenceElement = elements.front();
+  if (sequenceElement.type() != tlv::NdnlpSequence) {
+    throw ParseError("NdnlpSequence element is missing");
+  }
+  if (sequenceElement.value_size() != sizeof(uint64_t)) {
+    throw ParseError("NdnlpSequence element has incorrect length");
+  }
+  m_seq = be64toh(*reinterpret_cast<const uint64_t*>(&*sequenceElement.value_begin()));
+
+  const Block& payloadElement = elements.back();
+  if (payloadElement.type() != tlv::NdnlpPayload) {
+    throw ParseError("NdnlpPayload element is missing");
+  }
+  m_payload = payloadElement;
+
+  if (elements.size() == 2) { // single wire packet
+    m_fragIndex = 0;
+    m_fragCount = 1;
+    return;
+  }
+  if (elements.size() != 4) {
+    throw ParseError("NdnlpData element has incorrect number of children");
+  }
+
+  const Block& fragIndexElement = elements.at(1);
+  if (fragIndexElement.type() != tlv::NdnlpFragIndex) {
+    throw ParseError("NdnlpFragIndex element is missing");
+  }
+  uint64_t fragIndex = ndn::readNonNegativeInteger(fragIndexElement);
+  if (fragIndex > std::numeric_limits<uint16_t>::max()) {
+    throw ParseError("NdnlpFragIndex is too large");
+  }
+  m_fragIndex = static_cast<uint16_t>(fragIndex);
+
+  const Block& fragCountElement = elements.at(2);
+  if (fragCountElement.type() != tlv::NdnlpFragCount) {
+    throw ParseError("NdnlpFragCount element is missing");
+  }
+  uint64_t fragCount = ndn::readNonNegativeInteger(fragCountElement);
+  if (fragCount > std::numeric_limits<uint16_t>::max()) {
+    throw ParseError("NdnlpFragCount is too large");
+  }
+  m_fragCount = static_cast<uint16_t>(fragCount);
+
+  if (m_fragIndex >= m_fragCount) {
+    throw ParseError("NdnlpFragIndex must be less than NdnlpFragCount");
+  }
+}
+
+} // namespace ndnlp
+} // namespace nfd
diff --git a/daemon/face/ndnlp-parse.hpp b/daemon/face/ndnlp-parse.hpp
new file mode 100644
index 0000000..f40c910
--- /dev/null
+++ b/daemon/face/ndnlp-parse.hpp
@@ -0,0 +1,70 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_NDNLP_PARSE_HPP
+#define NFD_DAEMON_FACE_NDNLP_PARSE_HPP
+
+#include "common.hpp"
+#include "ndnlp-tlv.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+struct ParseError : public std::runtime_error
+{
+  ParseError(const std::string& what)
+    : std::runtime_error(what)
+  {
+  }
+};
+
+/** \brief represents a NdnlpData packet
+ *
+ *  NdnlpData ::= NDNLP-DATA-TYPE TLV-LENGTH
+ *                  NdnlpSequence
+ *                  NdnlpFragIndex?
+ *                  NdnlpFragCount?
+ *                  NdnlpPayload
+ */
+class NdnlpData
+{
+public:
+  /** \brief parse a NdnlpData packet
+   *
+   *  \exception ParseError packet is malformated
+   */
+  void
+  wireDecode(const Block& wire);
+
+public:
+  uint64_t m_seq;
+  uint16_t m_fragIndex;
+  uint16_t m_fragCount;
+  Block m_payload;
+};
+
+} // namespace ndnlp
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_NDNLP_PARSE_HPP
diff --git a/daemon/face/ndnlp-partial-message-store.cpp b/daemon/face/ndnlp-partial-message-store.cpp
new file mode 100644
index 0000000..54a5537
--- /dev/null
+++ b/daemon/face/ndnlp-partial-message-store.cpp
@@ -0,0 +1,137 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ndnlp-partial-message-store.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+PartialMessage::PartialMessage()
+  : m_fragCount(0)
+  , m_received(0)
+  , m_totalLength(0)
+{
+}
+
+bool
+PartialMessage::add(uint16_t fragIndex, uint16_t fragCount, const Block& payload)
+{
+  if (m_received == 0) { // first packet
+    m_fragCount = fragCount;
+    m_payloads.resize(fragCount);
+  }
+
+  if (m_fragCount != fragCount || fragIndex >= m_fragCount) {
+    return false;
+  }
+
+  if (!m_payloads[fragIndex].empty()) { // duplicate
+    return false;
+  }
+
+  m_payloads[fragIndex] = payload;
+  ++m_received;
+  m_totalLength += payload.value_size();
+  return true;
+}
+
+bool
+PartialMessage::isComplete() const
+{
+  return m_received == m_fragCount;
+}
+
+Block
+PartialMessage::reassemble()
+{
+  BOOST_ASSERT(this->isComplete());
+
+  ndn::BufferPtr buffer = make_shared<ndn::Buffer>(m_totalLength);
+  uint8_t* buf = buffer->get();
+  for (std::vector<Block>::const_iterator it = m_payloads.begin();
+       it != m_payloads.end(); ++it) {
+    const Block& payload = *it;
+    memcpy(buf, payload.value(), payload.value_size());
+    buf += payload.value_size();
+  }
+
+  return Block(buffer);
+}
+
+PartialMessageStore::PartialMessageStore(const time::nanoseconds& idleDuration)
+  : m_idleDuration(idleDuration)
+{
+}
+
+PartialMessageStore::~PartialMessageStore()
+{
+}
+
+void
+PartialMessageStore::receiveNdnlpData(const Block& pkt)
+{
+  NdnlpData parsed;
+  parsed.wireDecode(pkt);
+  if (parsed.m_fragCount == 1) { // single fragment
+    this->onReceive(parsed.m_payload.blockFromValue());
+    return;
+  }
+
+  uint64_t messageIdentifier = parsed.m_seq - parsed.m_fragIndex;
+  shared_ptr<PartialMessage> pm = m_partialMessages[messageIdentifier];
+  if (!static_cast<bool>(pm)) {
+    m_partialMessages[messageIdentifier] = pm = make_shared<PartialMessage>();
+  }
+  this->scheduleCleanup(messageIdentifier, pm);
+
+  pm->add(parsed.m_fragIndex, parsed.m_fragCount, parsed.m_payload);
+  if (pm->isComplete()) {
+    this->onReceive(pm->reassemble());
+    this->cleanup(messageIdentifier);
+  }
+}
+
+void
+PartialMessageStore::scheduleCleanup(uint64_t messageIdentifier,
+                                     shared_ptr<PartialMessage> partialMessage)
+{
+  partialMessage->m_expiry = scheduler::schedule(m_idleDuration,
+    bind(&PartialMessageStore::cleanup, this, messageIdentifier));
+}
+
+void
+PartialMessageStore::cleanup(uint64_t messageIdentifier)
+{
+  std::map<uint64_t, shared_ptr<PartialMessage> >::iterator it =
+    m_partialMessages.find(messageIdentifier);
+  if (it == m_partialMessages.end()) {
+    return;
+  }
+
+  scheduler::cancel(it->second->m_expiry);
+  m_partialMessages.erase(it);
+}
+
+} // namespace ndnlp
+} // namespace nfd
diff --git a/daemon/face/ndnlp-partial-message-store.hpp b/daemon/face/ndnlp-partial-message-store.hpp
new file mode 100644
index 0000000..7b2733a
--- /dev/null
+++ b/daemon/face/ndnlp-partial-message-store.hpp
@@ -0,0 +1,106 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
+#define NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
+
+#include "ndnlp-parse.hpp"
+#include "core/event-emitter.hpp"
+#include "core/scheduler.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+/** \brief represents a partially received message
+ */
+class PartialMessage : noncopyable
+{
+public:
+  PartialMessage();
+
+  bool
+  add(uint16_t fragIndex, uint16_t fragCount, const Block& payload);
+
+  bool
+  isComplete() const;
+
+  /** \brief reassemble network layer packet
+   *
+   *  isComplete() must be true before calling this method
+   *
+   *  \exception ndn::Block::Error packet is malformated
+   *  \return network layer packet
+   */
+  Block
+  reassemble();
+
+public:
+  EventId m_expiry;
+
+private:
+  size_t m_fragCount;
+  size_t m_received;
+  std::vector<Block> m_payloads;
+  size_t m_totalLength;
+};
+
+/** \brief provides reassembly feature at receiver
+ */
+class PartialMessageStore : noncopyable
+{
+public:
+  explicit
+  PartialMessageStore(const time::nanoseconds& idleDuration = time::milliseconds(100));
+
+  virtual
+  ~PartialMessageStore();
+
+  /** \brief receive a NdnlpData packet
+   *
+   *  \exception ParseError NDNLP packet is malformated
+   *  \exception ndn::Block::Error network layer packet is malformated
+   */
+  void
+  receiveNdnlpData(const Block& pkt);
+
+  /// fires when network layer packet is received
+  EventEmitter<Block> onReceive;
+
+private:
+  void
+  scheduleCleanup(uint64_t messageIdentifier, shared_ptr<PartialMessage> partialMessage);
+
+  void
+  cleanup(uint64_t messageIdentifier);
+
+private:
+  std::map<uint64_t, shared_ptr<PartialMessage> > m_partialMessages;
+
+  time::nanoseconds m_idleDuration;
+};
+
+} // namespace ndnlp
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
diff --git a/daemon/face/ndnlp-sequence-generator.cpp b/daemon/face/ndnlp-sequence-generator.cpp
new file mode 100644
index 0000000..842a319
--- /dev/null
+++ b/daemon/face/ndnlp-sequence-generator.cpp
@@ -0,0 +1,50 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ndnlp-sequence-generator.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+SequenceBlock::SequenceBlock(uint64_t start, size_t count)
+  : m_start(start)
+  , m_count(count)
+{
+}
+
+SequenceGenerator::SequenceGenerator()
+  : m_next(0)
+{
+}
+
+SequenceBlock
+SequenceGenerator::nextBlock(size_t count)
+{
+  SequenceBlock sb(m_next, count);
+  m_next += count;
+  return sb;
+}
+
+} // namespace ndnlp
+} // namespace nfd
diff --git a/daemon/face/ndnlp-sequence-generator.hpp b/daemon/face/ndnlp-sequence-generator.hpp
new file mode 100644
index 0000000..a3baa6b
--- /dev/null
+++ b/daemon/face/ndnlp-sequence-generator.hpp
@@ -0,0 +1,90 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
+#define NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+/** \brief represents a block of sequence numbers
+ */
+class SequenceBlock
+{
+public:
+  SequenceBlock(uint64_t start, size_t count);
+
+  /** \return{ the pos-th sequence number }
+   */
+  uint64_t
+  operator[](size_t pos) const;
+
+  size_t
+  count() const;
+
+private:
+  uint64_t m_start;
+  size_t m_count;
+};
+
+inline uint64_t
+SequenceBlock::operator[](size_t pos) const
+{
+  if (pos >= m_count)
+    throw std::out_of_range("pos");
+  return m_start + static_cast<uint64_t>(pos);
+}
+
+inline size_t
+SequenceBlock::count() const
+{
+  return m_count;
+}
+
+/** \class SequenceGenerator
+ *  \brief generates sequence numbers
+ */
+class SequenceGenerator : noncopyable
+{
+public:
+  SequenceGenerator();
+
+  /** \brief generates a block of consecutive sequence numbers
+   *
+   *  This block must not overlap with a recent block.
+   */
+  SequenceBlock
+  nextBlock(size_t count);
+
+private:
+  /// next sequence number
+  uint64_t m_next;
+};
+
+} // namespace ndnlp
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
diff --git a/daemon/face/ndnlp-slicer.cpp b/daemon/face/ndnlp-slicer.cpp
new file mode 100644
index 0000000..22d8c3b
--- /dev/null
+++ b/daemon/face/ndnlp-slicer.cpp
@@ -0,0 +1,130 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ndnlp-slicer.hpp"
+
+#include <ndn-cpp-dev/encoding/encoding-buffer.hpp>
+
+namespace nfd {
+namespace ndnlp {
+
+Slicer::Slicer(size_t mtu)
+  : m_mtu(mtu)
+{
+  this->estimateOverhead();
+}
+
+Slicer::~Slicer()
+{
+}
+
+template<bool T>
+static inline size_t
+Slicer_encodeFragment(ndn::EncodingImpl<T>& blk,
+                      uint64_t seq, uint16_t fragIndex, uint16_t fragCount,
+                      const uint8_t* payload, size_t payloadSize)
+{
+  size_t totalLength = 0;
+
+  // NdnlpPayload
+  size_t payloadLength = blk.prependByteArray(payload, payloadSize);
+  totalLength += payloadLength;
+  totalLength += blk.prependVarNumber(payloadLength);
+  totalLength += blk.prependVarNumber(tlv::NdnlpPayload);
+
+  bool needFragIndexAndCount = fragCount > 1;
+  if (needFragIndexAndCount) {
+    // NdnlpFragCount
+    size_t fragCountLength = blk.prependNonNegativeInteger(fragCount);
+    totalLength += fragCountLength;
+    totalLength += blk.prependVarNumber(fragCountLength);
+    totalLength += blk.prependVarNumber(tlv::NdnlpFragCount);
+
+    // NdnlpFragIndex
+    size_t fragIndexLength = blk.prependNonNegativeInteger(fragIndex);
+    totalLength += fragIndexLength;
+    totalLength += blk.prependVarNumber(fragIndexLength);
+    totalLength += blk.prependVarNumber(tlv::NdnlpFragIndex);
+  }
+
+  // NdnlpSequence
+  uint64_t sequenceBE = htobe64(seq);
+  size_t sequenceLength = blk.prependByteArray(
+    reinterpret_cast<uint8_t*>(&sequenceBE), sizeof(sequenceBE));
+  totalLength += sequenceLength;
+  totalLength += blk.prependVarNumber(sequenceLength);
+  totalLength += blk.prependVarNumber(tlv::NdnlpSequence);
+
+  // NdnlpData
+  totalLength += blk.prependVarNumber(totalLength);
+  totalLength += blk.prependVarNumber(tlv::NdnlpData);
+
+  return totalLength;
+}
+
+void
+Slicer::estimateOverhead()
+{
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = Slicer_encodeFragment(estimator,
+                         0, 0, 2, 0, m_mtu);
+
+  size_t overhead = estimatedSize - m_mtu;
+  m_maxPayload = m_mtu - overhead;
+}
+
+PacketArray
+Slicer::slice(const Block& block)
+{
+  BOOST_ASSERT(block.hasWire());
+  const uint8_t* networkPacket = block.wire();
+  size_t networkPacketSize = block.size();
+
+  uint16_t fragCount = static_cast<uint16_t>(
+                         (networkPacketSize / m_maxPayload) +
+                         (networkPacketSize % m_maxPayload == 0 ? 0 : 1)
+                       );
+  PacketArray pa = make_shared<std::vector<Block> >();
+  pa->reserve(fragCount);
+  SequenceBlock seqBlock = m_seqgen.nextBlock(fragCount);
+
+  for (uint16_t fragIndex = 0; fragIndex < fragCount; ++fragIndex) {
+    size_t payloadOffset = fragIndex * m_maxPayload;
+    const uint8_t* payload = networkPacket + payloadOffset;
+    size_t payloadSize = std::min(m_maxPayload, networkPacketSize - payloadOffset);
+
+    ndn::EncodingBuffer buffer(m_mtu, 0);
+    size_t pktSize = Slicer_encodeFragment(buffer,
+      seqBlock[fragIndex], fragIndex, fragCount, payload, payloadSize);
+
+    BOOST_ASSERT(pktSize <= m_mtu);
+
+    pa->push_back(buffer.block());
+  }
+
+  return pa;
+}
+
+} // namespace ndnlp
+} // namespace nfd
diff --git a/daemon/face/ndnlp-slicer.hpp b/daemon/face/ndnlp-slicer.hpp
new file mode 100644
index 0000000..9442a07
--- /dev/null
+++ b/daemon/face/ndnlp-slicer.hpp
@@ -0,0 +1,68 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_NDNLP_SLICER_HPP
+#define NFD_DAEMON_FACE_NDNLP_SLICER_HPP
+
+#include "ndnlp-tlv.hpp"
+#include "ndnlp-sequence-generator.hpp"
+
+namespace nfd {
+namespace ndnlp {
+
+typedef shared_ptr<std::vector<Block> > PacketArray;
+
+/** \brief provides fragmentation feature at sender
+ */
+class Slicer : noncopyable
+{
+public:
+  explicit
+  Slicer(size_t mtu);
+
+  virtual
+  ~Slicer();
+
+  PacketArray
+  slice(const Block& block);
+
+private:
+  /// estimate the size of NDNLP header and maximum payload size per packet
+  void
+  estimateOverhead();
+
+private:
+  SequenceGenerator m_seqgen;
+
+  /// maximum packet size
+  size_t m_mtu;
+
+  /// maximum payload size
+  size_t m_maxPayload;
+};
+
+} // namespace ndnlp
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_NDNLP_SLICER_HPP
diff --git a/daemon/face/ndnlp-tlv.hpp b/daemon/face/ndnlp-tlv.hpp
new file mode 100644
index 0000000..0c41f52
--- /dev/null
+++ b/daemon/face/ndnlp-tlv.hpp
@@ -0,0 +1,43 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_NDNLP_TLV_HPP
+#define NFD_DAEMON_FACE_NDNLP_TLV_HPP
+
+namespace nfd {
+namespace tlv {
+
+enum
+{
+  NdnlpData      = 80,
+  NdnlpSequence  = 81,
+  NdnlpFragIndex = 82,
+  NdnlpFragCount = 83,
+  NdnlpPayload   = 84
+};
+
+} // namespace tlv
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_NDNLP_TLV_HPP
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
new file mode 100644
index 0000000..8d61f9c
--- /dev/null
+++ b/daemon/face/protocol-factory.hpp
@@ -0,0 +1,75 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_PROTOCOL_FACTORY_HPP
+#define NFD_DAEMON_FACE_PROTOCOL_FACTORY_HPP
+
+#include "common.hpp"
+#include "core/face-uri.hpp"
+
+namespace nfd {
+
+class Face;
+
+/**
+ * \brief Prototype for the callback called when face is created
+ *        (as a response to incoming connection or after connection
+ *        is established)
+ */
+typedef function<void(const shared_ptr<Face>& newFace)> FaceCreatedCallback;
+
+/**
+ * \brief Prototype for the callback that is called when face is failed to
+ *        get created
+ */
+typedef function<void(const std::string& reason)> FaceConnectFailedCallback;
+
+
+class ProtocolFactory
+{
+public:
+  /**
+   * \brief Base class for all exceptions thrown by channel factories
+   */
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : std::runtime_error(what) {}
+  };
+
+  /** \brief Try to create Face using the supplied Face URI
+   *
+   * This method should automatically choose channel, based on supplied Face URI
+   * and create face.
+   *
+   * \throws Factory::Error if Factory does not support connect operation
+   */
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed) = 0;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_PROTOCOL_FACTORY_HPP
diff --git a/daemon/face/stream-face.hpp b/daemon/face/stream-face.hpp
new file mode 100644
index 0000000..daf8ddf
--- /dev/null
+++ b/daemon/face/stream-face.hpp
@@ -0,0 +1,380 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_STREAM_FACE_HPP
+#define NFD_DAEMON_FACE_STREAM_FACE_HPP
+
+#include "face.hpp"
+#include "local-face.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+// forward declaration
+template<class T, class U, class V> struct StreamFaceSenderImpl;
+
+template<class Protocol, class FaceBase = Face>
+class StreamFace : public FaceBase
+{
+public:
+  typedef Protocol protocol;
+
+  /**
+   * \brief Create instance of StreamFace
+   */
+  StreamFace(const FaceUri& remoteUri, const FaceUri& localUri,
+             const shared_ptr<typename protocol::socket>& socket,
+             bool isOnDemand);
+
+  virtual
+  ~StreamFace();
+
+  // from Face
+  virtual void
+  sendInterest(const Interest& interest);
+
+  virtual void
+  sendData(const Data& data);
+
+  virtual void
+  close();
+
+protected:
+  void
+  processErrorCode(const boost::system::error_code& error);
+
+  void
+  handleSend(const boost::system::error_code& error,
+             const Block& header, const Block& payload);
+  void
+  handleSend(const boost::system::error_code& error,
+             const Block& wire);
+
+  void
+  handleReceive(const boost::system::error_code& error,
+                std::size_t bytes_recvd);
+
+  void
+  keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face);
+
+  void
+  closeSocket();
+
+protected:
+  shared_ptr<typename protocol::socket> m_socket;
+
+private:
+  uint8_t m_inputBuffer[MAX_NDN_PACKET_SIZE];
+  std::size_t m_inputBufferSize;
+
+  friend struct StreamFaceSenderImpl<Protocol, FaceBase, Interest>;
+  friend struct StreamFaceSenderImpl<Protocol, FaceBase, Data>;
+
+  NFD_LOG_INCLASS_DECLARE();
+};
+
+// All inherited classes must use
+// NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamFace, <specialization-parameter>, "Name");
+
+
+/** \brief Class allowing validation of the StreamFace use
+ *
+ *  For example, partial specialization based on boost::asio::ip::tcp should check
+ *  that local endpoint is loopback
+ *
+ *  @throws Face::Error if validation failed
+ */
+template<class Protocol, class U>
+struct StreamFaceValidator
+{
+  static void
+  validateSocket(typename Protocol::socket& socket)
+  {
+  }
+};
+
+
+template<class T, class FaceBase>
+inline
+StreamFace<T, FaceBase>::StreamFace(const FaceUri& remoteUri, const FaceUri& localUri,
+                const shared_ptr<typename StreamFace::protocol::socket>& socket,
+                bool isOnDemand)
+  : FaceBase(remoteUri, localUri)
+  , m_socket(socket)
+  , m_inputBufferSize(0)
+{
+  FaceBase::setOnDemand(isOnDemand);
+  StreamFaceValidator<T, FaceBase>::validateSocket(*socket);
+  m_socket->async_receive(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE), 0,
+                          bind(&StreamFace<T, FaceBase>::handleReceive, this, _1, _2));
+}
+
+template<class T, class U>
+inline
+StreamFace<T, U>::~StreamFace()
+{
+}
+
+template<class Protocol, class FaceBase, class Packet>
+struct StreamFaceSenderImpl
+{
+  static void
+  send(StreamFace<Protocol, FaceBase>& face, const Packet& packet)
+  {
+    face.m_socket->async_send(boost::asio::buffer(packet.wireEncode().wire(),
+                                                  packet.wireEncode().size()),
+                              bind(&StreamFace<Protocol, FaceBase>::handleSend,
+                                   &face, _1, packet.wireEncode()));
+  }
+};
+
+// partial specialization (only classes can be partially specialized)
+template<class Protocol, class Packet>
+struct StreamFaceSenderImpl<Protocol, LocalFace, Packet>
+{
+  static void
+  send(StreamFace<Protocol, LocalFace>& face, const Packet& packet)
+  {
+    using namespace boost::asio;
+
+    if (face.isEmptyFilteredLocalControlHeader(packet.getLocalControlHeader()))
+      {
+        const Block& payload = packet.wireEncode();
+        face.m_socket->async_send(buffer(payload.wire(), payload.size()),
+                                  bind(&StreamFace<Protocol, LocalFace>::handleSend,
+                                       &face, _1, packet.wireEncode()));
+      }
+    else
+      {
+        Block header = face.filterAndEncodeLocalControlHeader(packet);
+        const Block& payload = packet.wireEncode();
+
+        std::vector<const_buffer> buffers;
+        buffers.reserve(2);
+        buffers.push_back(buffer(header.wire(),  header.size()));
+        buffers.push_back(buffer(payload.wire(), payload.size()));
+
+        face.m_socket->async_send(buffers,
+                                  bind(&StreamFace<Protocol, LocalFace>::handleSend,
+                                       &face, _1, header, payload));
+      }
+  }
+};
+
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::sendInterest(const Interest& interest)
+{
+  this->onSendInterest(interest);
+  StreamFaceSenderImpl<T, U, Interest>::send(*this, interest);
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::sendData(const Data& data)
+{
+  this->onSendData(data);
+  StreamFaceSenderImpl<T, U, Data>::send(*this, data);
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::close()
+{
+  if (!m_socket->is_open())
+    return;
+
+  NFD_LOG_INFO("[id:" << this->getId()
+               << ",endpoint:" << m_socket->local_endpoint()
+               << "] Close connection");
+
+  closeSocket();
+  this->onFail("Close connection");
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::processErrorCode(const boost::system::error_code& error)
+{
+  if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+    return;
+
+  if (!m_socket->is_open())
+    {
+      this->onFail("Connection closed");
+      return;
+    }
+
+  if (error == boost::asio::error::eof)
+    {
+      NFD_LOG_INFO("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Connection closed");
+    }
+  else
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Send or receive operation failed, closing socket: "
+                   << error.category().message(error.value()));
+    }
+
+  closeSocket();
+
+  if (error == boost::asio::error::eof)
+    {
+      this->onFail("Connection closed");
+    }
+  else
+    {
+      this->onFail("Send or receive operation failed, closing socket: " +
+                   error.category().message(error.value()));
+    }
+}
+
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::handleSend(const boost::system::error_code& error,
+                             const Block& wire)
+{
+  if (error)
+    return processErrorCode(error);
+
+  NFD_LOG_TRACE("[id:" << this->getId()
+                << ",endpoint:" << m_socket->local_endpoint()
+                << "] Successfully sent: " << wire.size() << " bytes");
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::handleSend(const boost::system::error_code& error,
+                             const Block& header, const Block& payload)
+{
+  if (error)
+    return processErrorCode(error);
+
+  NFD_LOG_TRACE("[id:" << this->getId()
+                << ",endpoint:" << m_socket->local_endpoint()
+                << "] Successfully sent: " << (header.size()+payload.size()) << " bytes");
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::handleReceive(const boost::system::error_code& error,
+                             std::size_t bytes_recvd)
+{
+  if (error)
+    return processErrorCode(error);
+
+  NFD_LOG_TRACE("[id:" << this->getId()
+                << ",endpoint:" << m_socket->local_endpoint()
+                << "] Received: " << bytes_recvd << " bytes");
+
+  m_inputBufferSize += bytes_recvd;
+  // do magic
+
+  std::size_t offset = 0;
+
+  bool isOk = true;
+  Block element;
+  while(m_inputBufferSize - offset > 0)
+    {
+      isOk = Block::fromBuffer(m_inputBuffer + offset, m_inputBufferSize - offset, element);
+      if (!isOk)
+        break;
+
+      offset += element.size();
+
+      BOOST_ASSERT(offset <= m_inputBufferSize);
+
+      if (!this->decodeAndDispatchInput(element))
+        {
+          NFD_LOG_WARN("[id:" << this->getId()
+                       << ",endpoint:" << m_socket->local_endpoint()
+                       << "] Received unrecognized block of type ["
+                       << element.type() << "]");
+          // ignore unknown packet and proceed
+        }
+    }
+  if (!isOk && m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Failed to parse incoming packet or it is too large to process, "
+                   << "closing down the face");
+
+      closeSocket();
+      this->onFail("Failed to parse incoming packet or it is too large to process, "
+                   "closing down the face");
+      return;
+    }
+
+  if (offset > 0)
+    {
+      if (offset != m_inputBufferSize)
+        {
+          std::copy(m_inputBuffer + offset, m_inputBuffer + m_inputBufferSize,
+                    m_inputBuffer);
+          m_inputBufferSize -= offset;
+        }
+      else
+        {
+          m_inputBufferSize = 0;
+        }
+    }
+
+  m_socket->async_receive(boost::asio::buffer(m_inputBuffer + m_inputBufferSize,
+                                              MAX_NDN_PACKET_SIZE - m_inputBufferSize), 0,
+                          bind(&StreamFace<T, U>::handleReceive, this, _1, _2));
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face)
+{
+}
+
+template<class T, class U>
+inline void
+StreamFace<T, U>::closeSocket()
+{
+  boost::asio::io_service& io = m_socket->get_io_service();
+
+  // use the non-throwing variants and ignore errors, if any
+  boost::system::error_code error;
+  m_socket->shutdown(protocol::socket::shutdown_both, error);
+  m_socket->close(error);
+  // after this, handlers will be called with an error code
+
+  // ensure that the Face object is alive at least until all pending
+  // handlers are dispatched
+  io.post(bind(&StreamFace<T, U>::keepFaceAliveUntilAllHandlersExecuted,
+               this, this->shared_from_this()));
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_STREAM_FACE_HPP
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
new file mode 100644
index 0000000..708f36b
--- /dev/null
+++ b/daemon/face/tcp-channel.cpp
@@ -0,0 +1,272 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "tcp-channel.hpp"
+#include "core/global-io.hpp"
+#include "core/face-uri.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("TcpChannel");
+
+using namespace boost::asio;
+
+TcpChannel::TcpChannel(const tcp::Endpoint& localEndpoint)
+  : m_localEndpoint(localEndpoint)
+  , m_isListening(false)
+{
+  this->setUri(FaceUri(localEndpoint));
+}
+
+TcpChannel::~TcpChannel()
+{
+}
+
+void
+TcpChannel::listen(const FaceCreatedCallback& onFaceCreated,
+                   const ConnectFailedCallback& onAcceptFailed,
+                   int backlog/* = tcp::acceptor::max_connections*/)
+{
+  m_acceptor = make_shared<ip::tcp::acceptor>(boost::ref(getGlobalIoService()));
+  m_acceptor->open(m_localEndpoint.protocol());
+  m_acceptor->set_option(ip::tcp::acceptor::reuse_address(true));
+  if (m_localEndpoint.address().is_v6())
+    {
+      m_acceptor->set_option(ip::v6_only(true));
+    }
+  m_acceptor->bind(m_localEndpoint);
+  m_acceptor->listen(backlog);
+
+  shared_ptr<ip::tcp::socket> clientSocket =
+    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+  m_acceptor->async_accept(*clientSocket,
+                           bind(&TcpChannel::handleSuccessfulAccept, this, _1,
+                                clientSocket,
+                                onFaceCreated, onAcceptFailed));
+
+  m_isListening = true;
+}
+
+void
+TcpChannel::connect(const tcp::Endpoint& remoteEndpoint,
+                    const TcpChannel::FaceCreatedCallback& onFaceCreated,
+                    const TcpChannel::ConnectFailedCallback& onConnectFailed,
+                    const time::seconds& timeout/* = time::seconds(4)*/)
+{
+  ChannelFaceMap::iterator i = m_channelFaces.find(remoteEndpoint);
+  if (i != m_channelFaces.end()) {
+    onFaceCreated(i->second);
+    return;
+  }
+
+  shared_ptr<ip::tcp::socket> clientSocket =
+    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+
+  shared_ptr<ndn::monotonic_deadline_timer> connectTimeoutTimer =
+    make_shared<ndn::monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
+
+  clientSocket->async_connect(remoteEndpoint,
+                              bind(&TcpChannel::handleSuccessfulConnect, this, _1,
+                                   clientSocket, connectTimeoutTimer,
+                                   onFaceCreated, onConnectFailed));
+
+  connectTimeoutTimer->expires_from_now(timeout);
+  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this, _1,
+                                       clientSocket, connectTimeoutTimer,
+                                       onConnectFailed));
+}
+
+void
+TcpChannel::connect(const std::string& remoteHost, const std::string& remotePort,
+                    const TcpChannel::FaceCreatedCallback& onFaceCreated,
+                    const TcpChannel::ConnectFailedCallback& onConnectFailed,
+                    const time::seconds& timeout/* = time::seconds(4)*/)
+{
+  shared_ptr<ip::tcp::socket> clientSocket =
+    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+
+  shared_ptr<ndn::monotonic_deadline_timer> connectTimeoutTimer =
+    make_shared<ndn::monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
+
+  ip::tcp::resolver::query query(remoteHost, remotePort);
+  shared_ptr<ip::tcp::resolver> resolver =
+    make_shared<ip::tcp::resolver>(boost::ref(getGlobalIoService()));
+
+  resolver->async_resolve(query,
+                          bind(&TcpChannel::handleEndpointResolution, this, _1, _2,
+                               clientSocket, connectTimeoutTimer,
+                               onFaceCreated, onConnectFailed,
+                               resolver));
+
+  connectTimeoutTimer->expires_from_now(timeout);
+  connectTimeoutTimer->async_wait(bind(&TcpChannel::handleFailedConnect, this, _1,
+                                       clientSocket, connectTimeoutTimer,
+                                       onConnectFailed));
+}
+
+size_t
+TcpChannel::size() const
+{
+  return m_channelFaces.size();
+}
+
+void
+TcpChannel::createFace(const shared_ptr<ip::tcp::socket>& socket,
+                       const FaceCreatedCallback& onFaceCreated,
+                       bool isOnDemand)
+{
+  tcp::Endpoint remoteEndpoint = socket->remote_endpoint();
+
+  shared_ptr<Face> face;
+  if (socket->local_endpoint().address().is_loopback())
+    face = make_shared<TcpLocalFace>(boost::cref(socket), isOnDemand);
+  else
+    face = make_shared<TcpFace>(boost::cref(socket), isOnDemand);
+
+  face->onFail += bind(&TcpChannel::afterFaceFailed, this, remoteEndpoint);
+
+  onFaceCreated(face);
+  m_channelFaces[remoteEndpoint] = face;
+}
+
+void
+TcpChannel::afterFaceFailed(tcp::Endpoint &remoteEndpoint)
+{
+  NFD_LOG_DEBUG("afterFaceFailed: " << remoteEndpoint);
+  m_channelFaces.erase(remoteEndpoint);
+}
+
+void
+TcpChannel::handleSuccessfulAccept(const boost::system::error_code& error,
+                                   const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                                   const FaceCreatedCallback& onFaceCreated,
+                                   const ConnectFailedCallback& onAcceptFailed)
+{
+  if (error) {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    NFD_LOG_DEBUG("Connect to remote endpoint failed: "
+                  << error.category().message(error.value()));
+
+    if (static_cast<bool>(onAcceptFailed))
+      onAcceptFailed("Connect to remote endpoint failed: " +
+                     error.category().message(error.value()));
+    return;
+  }
+
+  // prepare accepting the next connection
+  shared_ptr<ip::tcp::socket> clientSocket =
+    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+  m_acceptor->async_accept(*clientSocket,
+                           bind(&TcpChannel::handleSuccessfulAccept, this, _1,
+                                clientSocket,
+                                onFaceCreated, onAcceptFailed));
+
+  NFD_LOG_DEBUG("[" << m_localEndpoint << "] "
+                "<< Connection from " << socket->remote_endpoint());
+  createFace(socket, onFaceCreated, true);
+}
+
+void
+TcpChannel::handleSuccessfulConnect(const boost::system::error_code& error,
+                                    const shared_ptr<ip::tcp::socket>& socket,
+                                    const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                                    const FaceCreatedCallback& onFaceCreated,
+                                    const ConnectFailedCallback& onConnectFailed)
+{
+  timer->cancel();
+
+  if (error) {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    socket->close();
+
+    NFD_LOG_DEBUG("Connect to remote endpoint failed: "
+                  << error.category().message(error.value()));
+
+    onConnectFailed("Connect to remote endpoint failed: " +
+                    error.category().message(error.value()));
+    return;
+  }
+
+  NFD_LOG_DEBUG("[" << m_localEndpoint << "] "
+                ">> Connection to " << socket->remote_endpoint());
+
+  createFace(socket, onFaceCreated, false);
+}
+
+void
+TcpChannel::handleFailedConnect(const boost::system::error_code& error,
+                                const shared_ptr<ip::tcp::socket>& socket,
+                                const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                                const ConnectFailedCallback& onConnectFailed)
+{
+  if (error) { // e.g., cancelled
+    return;
+  }
+
+  NFD_LOG_DEBUG("Connect to remote endpoint timed out: "
+                << error.category().message(error.value()));
+
+  onConnectFailed("Connect to remote endpoint timed out: " +
+                  error.category().message(error.value()));
+  socket->close(); // abort the connection
+}
+
+void
+TcpChannel::handleEndpointResolution(const boost::system::error_code& error,
+                                     ip::tcp::resolver::iterator remoteEndpoint,
+                                     const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                                     const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                                     const FaceCreatedCallback& onFaceCreated,
+                                     const ConnectFailedCallback& onConnectFailed,
+                                     const shared_ptr<ip::tcp::resolver>& resolver)
+{
+  if (error ||
+      remoteEndpoint == ip::tcp::resolver::iterator())
+    {
+      if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+        return;
+
+      socket->close();
+      timer->cancel();
+
+      NFD_LOG_DEBUG("Remote endpoint hostname or port cannot be resolved: "
+                    << error.category().message(error.value()));
+
+      onConnectFailed("Remote endpoint hostname or port cannot be resolved: " +
+                      error.category().message(error.value()));
+      return;
+    }
+
+  // got endpoint, now trying to connect (only try the first resolution option)
+  socket->async_connect(*remoteEndpoint,
+                        bind(&TcpChannel::handleSuccessfulConnect, this, _1,
+                             socket, timer,
+                             onFaceCreated, onConnectFailed));
+}
+
+} // namespace nfd
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
new file mode 100644
index 0000000..4398ee7
--- /dev/null
+++ b/daemon/face/tcp-channel.hpp
@@ -0,0 +1,164 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_TCP_CHANNEL_HPP
+#define NFD_DAEMON_FACE_TCP_CHANNEL_HPP
+
+#include "channel.hpp"
+#include <ndn-cpp-dev/util/monotonic_deadline_timer.hpp>
+#include "tcp-face.hpp"
+
+namespace nfd {
+
+namespace tcp {
+typedef boost::asio::ip::tcp::endpoint Endpoint;
+} // namespace tcp
+
+/**
+ * \brief Class implementing TCP-based channel to create faces
+ *
+ * Channel can create faces as a response to incoming TCP
+ * connections (TcpChannel::listen needs to be called for that
+ * to work) or explicitly after using TcpChannel::connect method.
+ */
+class TcpChannel : public Channel
+{
+public:
+  /**
+   * \brief Create TCP channel for the local endpoint
+   *
+   * To enable creation faces upon incoming connections,
+   * one needs to explicitly call TcpChannel::listen method.
+   */
+  explicit
+  TcpChannel(const tcp::Endpoint& localEndpoint);
+
+  virtual
+  ~TcpChannel();
+
+  /**
+   * \brief Enable listening on the local endpoint, accept connections,
+   *        and create faces when remote host makes a connection
+   * \param onFaceCreated  Callback to notify successful creation of the face
+   * \param onAcceptFailed Callback to notify when channel fails (accept call
+   *                       returns an error)
+   * \param backlog        The maximum length of the queue of pending incoming
+   *                       connections
+   */
+  void
+  listen(const FaceCreatedCallback& onFaceCreated,
+         const ConnectFailedCallback& onAcceptFailed,
+         int backlog = boost::asio::ip::tcp::acceptor::max_connections);
+
+  /**
+   * \brief Create a face by establishing connection to remote endpoint
+   */
+  void
+  connect(const tcp::Endpoint& remoteEndpoint,
+          const FaceCreatedCallback& onFaceCreated,
+          const ConnectFailedCallback& onConnectFailed,
+          const time::seconds& timeout = time::seconds(4));
+
+  /**
+   * \brief Create a face by establishing connection to the specified
+   *        remote host and remote port
+   *
+   * This method will never block and will return immediately. All
+   * necessary hostname and port resolution and connection will happen
+   * in asynchronous mode.
+   *
+   * If connection cannot be established within specified timeout, it
+   * will be aborted.
+   */
+  void
+  connect(const std::string& remoteHost, const std::string& remotePort,
+          const FaceCreatedCallback& onFaceCreated,
+          const ConnectFailedCallback& onConnectFailed,
+          const time::seconds& timeout = time::seconds(4));
+
+  /**
+   * \brief Get number of faces in the channel
+   */
+  size_t
+  size() const;
+
+  bool
+  isListening() const;
+
+private:
+  void
+  createFace(const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+             const FaceCreatedCallback& onFaceCreated,
+             bool isOnDemand);
+
+  void
+  afterFaceFailed(tcp::Endpoint &endpoint);
+
+  void
+  handleSuccessfulAccept(const boost::system::error_code& error,
+                         const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                         const FaceCreatedCallback& onFaceCreated,
+                         const ConnectFailedCallback& onConnectFailed);
+
+  void
+  handleSuccessfulConnect(const boost::system::error_code& error,
+                          const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                          const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                          const FaceCreatedCallback& onFaceCreated,
+                          const ConnectFailedCallback& onConnectFailed);
+
+  void
+  handleFailedConnect(const boost::system::error_code& error,
+                      const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                      const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                      const ConnectFailedCallback& onConnectFailed);
+
+  void
+  handleEndpointResolution(const boost::system::error_code& error,
+                           boost::asio::ip::tcp::resolver::iterator remoteEndpoint,
+                           const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+                           const shared_ptr<ndn::monotonic_deadline_timer>& timer,
+                           const FaceCreatedCallback& onFaceCreated,
+                           const ConnectFailedCallback& onConnectFailed,
+                           const shared_ptr<boost::asio::ip::tcp::resolver>& resolver);
+
+private:
+  tcp::Endpoint m_localEndpoint;
+
+  typedef std::map< tcp::Endpoint, shared_ptr<Face> > ChannelFaceMap;
+  ChannelFaceMap m_channelFaces;
+
+  bool m_isListening;
+  shared_ptr<boost::asio::ip::tcp::acceptor> m_acceptor;
+};
+
+inline bool
+TcpChannel::isListening() const
+{
+  return m_isListening;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP
diff --git a/daemon/face/tcp-face.cpp b/daemon/face/tcp-face.cpp
new file mode 100644
index 0000000..6428b03
--- /dev/null
+++ b/daemon/face/tcp-face.cpp
@@ -0,0 +1,50 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "tcp-face.hpp"
+
+namespace nfd {
+
+NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamFace, TcpFace::protocol, "TcpFace");
+
+NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(StreamFace,
+                                                TcpLocalFace::protocol, LocalFace,
+                                                "TcpLocalFace");
+
+TcpFace::TcpFace(const shared_ptr<TcpFace::protocol::socket>& socket, bool isOnDemand)
+  : StreamFace<protocol>(FaceUri(socket->remote_endpoint()),
+                         FaceUri(socket->local_endpoint()),
+                         socket, isOnDemand)
+{
+}
+
+TcpLocalFace::TcpLocalFace(const shared_ptr<TcpLocalFace::protocol::socket>& socket,
+                           bool isOnDemand)
+  : StreamFace<protocol, LocalFace>(FaceUri(socket->remote_endpoint()),
+                                    FaceUri(socket->local_endpoint()),
+                                    socket, isOnDemand)
+{
+}
+
+} // namespace nfd
diff --git a/daemon/face/tcp-face.hpp b/daemon/face/tcp-face.hpp
new file mode 100644
index 0000000..a522ac4
--- /dev/null
+++ b/daemon/face/tcp-face.hpp
@@ -0,0 +1,80 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_TCP_FACE_HPP
+#define NFD_DAEMON_FACE_TCP_FACE_HPP
+
+#include "stream-face.hpp"
+
+namespace nfd {
+
+/**
+ * \brief Implementation of Face abstraction that uses TCP
+ *        as underlying transport mechanism
+ */
+class TcpFace : public StreamFace<boost::asio::ip::tcp>
+{
+public:
+  explicit
+  TcpFace(const shared_ptr<protocol::socket>& socket, bool isOnDemand);
+};
+
+//
+
+/**
+ * \brief Implementation of Face abstraction that uses TCP
+ *        as underlying transport mechanism and is used for
+ *        local communication (can enable LocalControlHeader)
+ */
+class TcpLocalFace : public StreamFace<boost::asio::ip::tcp, LocalFace>
+{
+public:
+  explicit
+  TcpLocalFace(const shared_ptr<protocol::socket>& socket, bool isOnDemand);
+};
+
+
+/** \brief Class validating use of TcpLocalFace
+ */
+template<>
+struct StreamFaceValidator<boost::asio::ip::tcp, LocalFace>
+{
+  /** Check that local endpoint is loopback
+   *
+   *  @throws Face::Error if validation failed
+   */
+  static void
+  validateSocket(boost::asio::ip::tcp::socket& socket)
+  {
+    if (!socket.local_endpoint().address().is_loopback() ||
+        !socket.remote_endpoint().address().is_loopback())
+      {
+        throw Face::Error("TcpLocalFace can be created only on loopback interface");
+      }
+  }
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_TCP_FACE_HPP
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
new file mode 100644
index 0000000..07d7a86
--- /dev/null
+++ b/daemon/face/tcp-factory.cpp
@@ -0,0 +1,195 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "tcp-factory.hpp"
+#include "core/resolver.hpp"
+#include "core/logger.hpp"
+#include "core/network-interface.hpp"
+
+NFD_LOG_INIT("TcpFactory");
+
+namespace nfd {
+
+TcpFactory::TcpFactory(const std::string& defaultPort/* = "6363"*/)
+  : m_defaultPort(defaultPort)
+{
+
+}
+
+void
+TcpFactory::prohibitEndpoint(const tcp::Endpoint& endpoint)
+{
+  using namespace boost::asio::ip;
+
+  static const address_v4 ALL_V4_ENDPOINT(address_v4::from_string("0.0.0.0"));
+  static const address_v6 ALL_V6_ENDPOINT(address_v6::from_string("::"));
+
+  const address& address = endpoint.address();
+
+  if (address.is_v4() && address == ALL_V4_ENDPOINT)
+    {
+      prohibitAllIpv4Endpoints(endpoint.port());
+    }
+  else if (endpoint.address().is_v6() && address == ALL_V6_ENDPOINT)
+    {
+      prohibitAllIpv6Endpoints(endpoint.port());
+    }
+
+  NFD_LOG_TRACE("prohibiting TCP " <<
+                endpoint.address().to_string() << ":" << endpoint.port());
+
+  m_prohibitedEndpoints.insert(endpoint);
+}
+
+void
+TcpFactory::prohibitAllIpv4Endpoints(const uint16_t port)
+{
+  using namespace boost::asio::ip;
+
+  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
+
+  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+       i != nicList.end();
+       ++i)
+    {
+      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+      const std::vector<address_v4>& ipv4Addresses = nic->ipv4Addresses;
+
+      for (std::vector<address_v4>::const_iterator j = ipv4Addresses.begin();
+           j != ipv4Addresses.end();
+           ++j)
+        {
+          prohibitEndpoint(tcp::Endpoint(*j, port));
+        }
+    }
+}
+
+void
+TcpFactory::prohibitAllIpv6Endpoints(const uint16_t port)
+{
+  using namespace boost::asio::ip;
+
+  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
+
+  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+       i != nicList.end();
+       ++i)
+    {
+      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+      const std::vector<address_v6>& ipv6Addresses = nic->ipv6Addresses;
+
+      for (std::vector<address_v6>::const_iterator j = ipv6Addresses.begin();
+           j != ipv6Addresses.end();
+           ++j)
+        {
+          prohibitEndpoint(tcp::Endpoint(*j, port));
+        }
+    }
+}
+
+shared_ptr<TcpChannel>
+TcpFactory::createChannel(const tcp::Endpoint& endpoint)
+{
+  shared_ptr<TcpChannel> channel = findChannel(endpoint);
+  if(static_cast<bool>(channel))
+    return channel;
+
+  channel = make_shared<TcpChannel>(boost::cref(endpoint));
+  m_channels[endpoint] = channel;
+  prohibitEndpoint(endpoint);
+
+  NFD_LOG_DEBUG("Channel [" << endpoint << "] created");
+  return channel;
+}
+
+shared_ptr<TcpChannel>
+TcpFactory::createChannel(const std::string& localHost, const std::string& localPort)
+{
+  return createChannel(TcpResolver::syncResolve(localHost, localPort));
+}
+
+shared_ptr<TcpChannel>
+TcpFactory::findChannel(const tcp::Endpoint& localEndpoint)
+{
+  ChannelMap::iterator i = m_channels.find(localEndpoint);
+  if (i != m_channels.end())
+    return i->second;
+  else
+    return shared_ptr<TcpChannel>();
+}
+
+void
+TcpFactory::createFace(const FaceUri& uri,
+                       const FaceCreatedCallback& onCreated,
+                       const FaceConnectFailedCallback& onConnectFailed)
+{
+  resolver::AddressSelector addressSelector = resolver::AnyAddress();
+  if (uri.getScheme() == "tcp4")
+    addressSelector = resolver::Ipv4Address();
+  else if (uri.getScheme() == "tcp6")
+    addressSelector = resolver::Ipv6Address();
+
+  if (!uri.getPath().empty())
+    {
+      onConnectFailed("Invalid URI");
+    }
+
+  TcpResolver::asyncResolve(uri.getHost(),
+                            uri.getPort().empty() ? m_defaultPort : uri.getPort(),
+                            bind(&TcpFactory::continueCreateFaceAfterResolve, this, _1,
+                                 onCreated, onConnectFailed),
+                            onConnectFailed,
+                            addressSelector);
+}
+
+void
+TcpFactory::continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
+                                           const FaceCreatedCallback& onCreated,
+                                           const FaceConnectFailedCallback& onConnectFailed)
+{
+  if (m_prohibitedEndpoints.find(endpoint) != m_prohibitedEndpoints.end())
+    {
+      onConnectFailed("Requested endpoint is prohibited "
+                      "(reserved by this NFD or disallowed by face management protocol)");
+      return;
+    }
+
+  // very simple logic for now
+
+  for (ChannelMap::iterator channel = m_channels.begin();
+       channel != m_channels.end();
+       ++channel)
+    {
+      if ((channel->first.address().is_v4() && endpoint.address().is_v4()) ||
+          (channel->first.address().is_v6() && endpoint.address().is_v6()))
+        {
+          channel->second->connect(endpoint, onCreated, onConnectFailed);
+          return;
+        }
+    }
+  onConnectFailed("No channels available to connect to "
+                  + boost::lexical_cast<std::string>(endpoint));
+}
+
+} // namespace nfd
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
new file mode 100644
index 0000000..afcc9dd
--- /dev/null
+++ b/daemon/face/tcp-factory.hpp
@@ -0,0 +1,125 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_TCP_FACTORY_HPP
+#define NFD_DAEMON_FACE_TCP_FACTORY_HPP
+
+#include "protocol-factory.hpp"
+#include "tcp-channel.hpp"
+
+namespace nfd {
+
+class TcpFactory : public ProtocolFactory
+{
+public:
+  /**
+   * \brief Exception of TcpFactory
+   */
+  struct Error : public ProtocolFactory::Error
+  {
+    Error(const std::string& what) : ProtocolFactory::Error(what) {}
+  };
+
+  explicit
+  TcpFactory(const std::string& defaultPort = "6363");
+
+  /**
+   * \brief Create TCP-based channel using tcp::Endpoint
+   *
+   * tcp::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.
+   *
+   * If this method called twice with the same endpoint, only one channel
+   * will be created.  The second call will just retrieve the existing
+   * channel.
+   *
+   * \returns always a valid pointer to a TcpChannel object, an exception
+   *          is thrown if it cannot be created.
+   *
+   * \throws TcpFactory::Error
+   *
+   * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__tcp/endpoint.html
+   *      for details on ways to create tcp::Endpoint
+   */
+  shared_ptr<TcpChannel>
+  createChannel(const tcp::Endpoint& localEndpoint);
+
+  /**
+   * \brief Create TCP-based channel using specified host and port number
+   *
+   * This method will attempt to resolve the provided host and port numbers
+   * and will throw TcpFactory::Error when channel cannot be created.
+   *
+   * Note that this call will **BLOCK** until resolution is done or failed.
+   *
+   * \throws TcpFactory::Error or std::runtime_error
+   */
+  shared_ptr<TcpChannel>
+  createChannel(const std::string& localHost, const std::string& localPort);
+
+  // from Factory
+
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
+private:
+
+  void
+  prohibitEndpoint(const tcp::Endpoint& endpoint);
+
+  void
+  prohibitAllIpv4Endpoints(const uint16_t port);
+
+  void
+  prohibitAllIpv6Endpoints(const uint16_t port);
+
+  /**
+   * \brief Look up TcpChannel using specified local endpoint
+   *
+   * \returns shared pointer to the existing TcpChannel object
+   *          or empty shared pointer when such channel does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<TcpChannel>
+  findChannel(const tcp::Endpoint& localEndpoint);
+
+  void
+  continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
+                                 const FaceCreatedCallback& onCreated,
+                                 const FaceConnectFailedCallback& onConnectFailed);
+
+private:
+  typedef std::map< tcp::Endpoint, shared_ptr<TcpChannel> > ChannelMap;
+  ChannelMap m_channels;
+
+  std::string m_defaultPort;
+
+  std::set<tcp::Endpoint> m_prohibitedEndpoints;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
new file mode 100644
index 0000000..ca052a2
--- /dev/null
+++ b/daemon/face/udp-channel.cpp
@@ -0,0 +1,269 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "udp-channel.hpp"
+#include "core/global-io.hpp"
+#include "core/face-uri.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("UdpChannel");
+
+using namespace boost::asio;
+
+UdpChannel::UdpChannel(const udp::Endpoint& localEndpoint,
+                       const time::seconds& timeout)
+  : m_localEndpoint(localEndpoint)
+  , m_isListening(false)
+  , m_idleFaceTimeout(timeout)
+{
+  /// \todo the reuse_address works as we want in Linux, but in other system could be different.
+  ///       We need to check this
+  ///       (SO_REUSEADDR doesn't behave uniformly in different OS)
+
+  m_socket = make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+  m_socket->open(m_localEndpoint.protocol());
+  m_socket->set_option(boost::asio::ip::udp::socket::reuse_address(true));
+  if (m_localEndpoint.address().is_v6())
+    {
+      m_socket->set_option(ip::v6_only(true));
+    }
+
+  try {
+    m_socket->bind(m_localEndpoint);
+  }
+  catch (boost::system::system_error& e) {
+    //The bind failed, so the socket is useless now
+    m_socket->close();
+    throw Error("Failed to properly configure the socket. "
+                "UdpChannel creation aborted, check the address (" + std::string(e.what()) + ")");
+  }
+
+  this->setUri(FaceUri(localEndpoint));
+
+  //setting the timeout to close the idle faces
+  m_closeIdleFaceEvent = scheduler::schedule(m_idleFaceTimeout,
+                                bind(&UdpChannel::closeIdleFaces, this));
+}
+
+UdpChannel::~UdpChannel()
+{
+  scheduler::cancel(m_closeIdleFaceEvent);
+}
+
+void
+UdpChannel::listen(const FaceCreatedCallback& onFaceCreated,
+                   const ConnectFailedCallback& onListenFailed)
+{
+  if (m_isListening) {
+    throw Error("Listen already called on this channel");
+  }
+  m_isListening = true;
+
+  onFaceCreatedNewPeerCallback = onFaceCreated;
+  onConnectFailedNewPeerCallback = onListenFailed;
+
+  m_socket->async_receive_from(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE),
+                               m_newRemoteEndpoint,
+                               bind(&UdpChannel::newPeer, this,
+                                    boost::asio::placeholders::error,
+                                    boost::asio::placeholders::bytes_transferred));
+}
+
+
+void
+UdpChannel::connect(const udp::Endpoint& remoteEndpoint,
+                    const FaceCreatedCallback& onFaceCreated,
+                    const ConnectFailedCallback& onConnectFailed)
+{
+  ChannelFaceMap::iterator i = m_channelFaces.find(remoteEndpoint);
+  if (i != m_channelFaces.end()) {
+    i->second->setOnDemand(false);
+    onFaceCreated(i->second);
+    return;
+  }
+
+  //creating a new socket for the face that will be created soon
+  shared_ptr<ip::udp::socket> clientSocket =
+    make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+
+  clientSocket->open(m_localEndpoint.protocol());
+  clientSocket->set_option(ip::udp::socket::reuse_address(true));
+
+  try {
+    clientSocket->bind(m_localEndpoint);
+    clientSocket->connect(remoteEndpoint); //@todo connect or async_connect
+    //(since there is no handshake the connect shouldn't block). If we go for
+    //async_connect, make sure that if in the meantime we receive a UDP pkt from
+    //that endpoint nothing bad happen (it's difficult, but it could happen)
+  }
+  catch (boost::system::system_error& e) {
+    clientSocket->close();
+    onConnectFailed("Failed to configure socket (" + std::string(e.what()) + ")");
+    return;
+  }
+  createFace(clientSocket, onFaceCreated, false);
+}
+
+void
+UdpChannel::connect(const std::string& remoteHost,
+                    const std::string& remotePort,
+                    const FaceCreatedCallback& onFaceCreated,
+                    const ConnectFailedCallback& onConnectFailed)
+{
+  ip::udp::resolver::query query(remoteHost, remotePort);
+  shared_ptr<ip::udp::resolver> resolver =
+  make_shared<ip::udp::resolver>(boost::ref(getGlobalIoService()));
+
+  resolver->async_resolve(query,
+                          bind(&UdpChannel::handleEndpointResolution, this, _1, _2,
+                               onFaceCreated, onConnectFailed,
+                               resolver));
+}
+
+void
+UdpChannel::handleEndpointResolution(const boost::system::error_code& error,
+                                      ip::udp::resolver::iterator remoteEndpoint,
+                                      const FaceCreatedCallback& onFaceCreated,
+                                      const ConnectFailedCallback& onConnectFailed,
+                                      const shared_ptr<ip::udp::resolver>& resolver)
+{
+  if (error != 0 ||
+      remoteEndpoint == ip::udp::resolver::iterator())
+  {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    NFD_LOG_DEBUG("Remote endpoint hostname or port cannot be resolved: "
+                    << error.category().message(error.value()));
+
+    onConnectFailed("Remote endpoint hostname or port cannot be resolved: " +
+                      error.category().message(error.value()));
+      return;
+  }
+
+  connect(*remoteEndpoint, onFaceCreated, onConnectFailed);
+}
+
+size_t
+UdpChannel::size() const
+{
+  return m_channelFaces.size();
+}
+
+
+shared_ptr<UdpFace>
+UdpChannel::createFace(const shared_ptr<ip::udp::socket>& socket,
+                       const FaceCreatedCallback& onFaceCreated,
+                       bool isOnDemand)
+{
+  udp::Endpoint remoteEndpoint = socket->remote_endpoint();
+
+  shared_ptr<UdpFace> face = make_shared<UdpFace>(boost::cref(socket), isOnDemand);
+  face->onFail += bind(&UdpChannel::afterFaceFailed, this, remoteEndpoint);
+
+  onFaceCreated(face);
+  m_channelFaces[remoteEndpoint] = face;
+  return face;
+}
+
+void
+UdpChannel::newPeer(const boost::system::error_code& error,
+                    std::size_t nBytesReceived)
+{
+  NFD_LOG_DEBUG("UdpChannel::newPeer from " << m_newRemoteEndpoint);
+
+  shared_ptr<UdpFace> face;
+
+  ChannelFaceMap::iterator i = m_channelFaces.find(m_newRemoteEndpoint);
+  if (i != m_channelFaces.end()) {
+    //The face already exists.
+    //Usually this shouldn't happen, because the channel creates a Udpface
+    //as soon as it receives a pkt from a new endpoint and then the
+    //traffic is dispatched by the kernel directly to the face.
+    //However, if the node receives multiple packets from the same endpoint
+    //"at the same time", while the channel is creating the face the kernel
+    //could dispatch the other pkts to the channel because the face is not yet
+    //ready. In this case, the channel has to pass the pkt to the face
+
+    NFD_LOG_DEBUG("The creation of the face for the remote endpoint "
+                  << m_newRemoteEndpoint
+                  << " is in progress");
+
+    face = i->second;
+  }
+  else {
+    shared_ptr<ip::udp::socket> clientSocket =
+      make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+    clientSocket->open(m_localEndpoint.protocol());
+    clientSocket->set_option(ip::udp::socket::reuse_address(true));
+    clientSocket->bind(m_localEndpoint);
+    clientSocket->connect(m_newRemoteEndpoint);
+
+    face = createFace(clientSocket,
+                      onFaceCreatedNewPeerCallback,
+                      true);
+  }
+
+  //Passing the message to the correspondent face
+  face->handleFirstReceive(m_inputBuffer, nBytesReceived, error);
+
+  m_socket->async_receive_from(boost::asio::buffer(m_inputBuffer, MAX_NDN_PACKET_SIZE),
+                               m_newRemoteEndpoint,
+                               bind(&UdpChannel::newPeer, this,
+                                    boost::asio::placeholders::error,
+                                    boost::asio::placeholders::bytes_transferred));
+}
+
+
+void
+UdpChannel::afterFaceFailed(udp::Endpoint &endpoint)
+{
+  NFD_LOG_DEBUG("afterFaceFailed: " << endpoint);
+  m_channelFaces.erase(endpoint);
+}
+
+void
+UdpChannel::closeIdleFaces()
+{
+  ChannelFaceMap::iterator next =  m_channelFaces.begin();
+
+  while (next != m_channelFaces.end()) {
+    ChannelFaceMap::iterator it = next;
+    next++;
+    if (it->second->isOnDemand() &&
+        !it->second->hasBeenUsedRecently()) {
+      //face has been idle since the last time closeIdleFaces
+      //has been called. Going to close it
+      NFD_LOG_DEBUG("Found idle face id: " << it->second->getId());
+      it->second->close();
+    } else {
+      it->second->resetRecentUsage();
+    }
+  }
+  m_closeIdleFaceEvent = scheduler::schedule(m_idleFaceTimeout,
+                                             bind(&UdpChannel::closeIdleFaces, this));
+}
+
+} // namespace nfd
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
new file mode 100644
index 0000000..f97c3a3
--- /dev/null
+++ b/daemon/face/udp-channel.hpp
@@ -0,0 +1,185 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UDP_CHANNEL_HPP
+#define NFD_DAEMON_FACE_UDP_CHANNEL_HPP
+
+#include "channel.hpp"
+#include "core/global-io.hpp"
+#include "core/scheduler.hpp"
+#include "udp-face.hpp"
+
+namespace nfd {
+
+namespace udp {
+typedef boost::asio::ip::udp::endpoint Endpoint;
+} // namespace udp
+
+/**
+ * \brief Class implementing UDP-based channel to create faces
+ *
+ *
+ */
+class UdpChannel : public Channel
+{
+public:
+  /**
+   * \brief Exception of UdpChannel
+   */
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : runtime_error(what) {}
+  };
+
+  /**
+   * \brief Create UDP channel for the local endpoint
+   *
+   * To enable creation of faces upon incoming connections,
+   * one needs to explicitly call UdpChannel::listen method.
+   * The created socket is bound to the localEndpoint.
+   * reuse_address option is set
+   *
+   * \throw UdpChannel::Error if bind on the socket fails
+   */
+  UdpChannel(const udp::Endpoint& localEndpoint,
+             const time::seconds& timeout);
+
+  virtual
+  ~UdpChannel();
+
+  /**
+   * \brief Enable listening on the local endpoint, accept connections,
+   *        and create faces when remote host makes a connection
+   * \param onFaceCreated  Callback to notify successful creation of the face
+   * \param onAcceptFailed Callback to notify when channel fails
+   *
+   * \throws UdpChannel::Error if called multiple times
+   */
+  void
+  listen(const FaceCreatedCallback& onFaceCreated,
+         const ConnectFailedCallback& onAcceptFailed);
+
+  /**
+   * \brief Create a face by establishing connection to remote endpoint
+   *
+   * \throw UdpChannel::Error if bind or connect on the socket fail
+   */
+  void
+  connect(const udp::Endpoint& remoteEndpoint,
+          const FaceCreatedCallback& onFaceCreated,
+          const ConnectFailedCallback& onConnectFailed);
+  /**
+   * \brief Create a face by establishing connection to the specified
+   *        remote host and remote port
+   *
+   * This method will never block and will return immediately. All
+   * necessary hostname and port resolution and connection will happen
+   * in asynchronous mode.
+   *
+   * If connection cannot be established within specified timeout, it
+   * will be aborted.
+   */
+  void
+  connect(const std::string& remoteHost, const std::string& remotePort,
+          const FaceCreatedCallback& onFaceCreated,
+          const ConnectFailedCallback& onConnectFailed);
+
+  /**
+   * \brief Get number of faces in the channel
+   */
+  size_t
+  size() const;
+
+private:
+  shared_ptr<UdpFace>
+  createFace(const shared_ptr<boost::asio::ip::udp::socket>& socket,
+             const FaceCreatedCallback& onFaceCreated,
+             bool isOnDemand);
+  void
+  afterFaceFailed(udp::Endpoint& endpoint);
+
+  /**
+   * \brief The UdpChannel has received a new pkt from a remote endpoint not yet
+   *        associated with any UdpFace
+   */
+  void
+  newPeer(const boost::system::error_code& error,
+                   std::size_t nBytesReceived);
+
+  void
+  handleEndpointResolution(const boost::system::error_code& error,
+                           boost::asio::ip::udp::resolver::iterator remoteEndpoint,
+                           const FaceCreatedCallback& onFaceCreated,
+                           const ConnectFailedCallback& onConnectFailed,
+                           const shared_ptr<boost::asio::ip::udp::resolver>& resolver);
+
+  void
+  closeIdleFaces();
+
+private:
+  udp::Endpoint m_localEndpoint;
+
+  /**
+   * \brief Endpoint used to store the information about the last new remote endpoint
+   */
+  udp::Endpoint m_newRemoteEndpoint;
+
+  /**
+   * Callbacks for face creation.
+   * New communications are detected using async_receive_from.
+   * Its handler has a fixed signature. No space for the face callback
+   */
+  FaceCreatedCallback onFaceCreatedNewPeerCallback;
+
+  // @todo remove the onConnectFailedNewPeerCallback if it remains unused
+  ConnectFailedCallback onConnectFailedNewPeerCallback;
+
+  /**
+   * \brief Socket used to "accept" new communication
+   **/
+  shared_ptr<boost::asio::ip::udp::socket> m_socket;
+
+  uint8_t m_inputBuffer[MAX_NDN_PACKET_SIZE];
+
+  typedef std::map< udp::Endpoint, shared_ptr<UdpFace> > ChannelFaceMap;
+  ChannelFaceMap m_channelFaces;
+
+  /**
+   * \brief If true, it means the function listen has already been called
+   */
+  bool m_isListening;
+
+  /**
+   * \brief every time m_idleFaceTimeout expires all the idle (and on-demand)
+   *        faces will be removed
+   */
+  time::seconds m_idleFaceTimeout;
+
+  EventId m_closeIdleFaceEvent;
+
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
diff --git a/daemon/face/udp-face.cpp b/daemon/face/udp-face.cpp
new file mode 100644
index 0000000..71e1582
--- /dev/null
+++ b/daemon/face/udp-face.cpp
@@ -0,0 +1,60 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "udp-face.hpp"
+
+namespace nfd {
+
+NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(DatagramFace, UdpFace::protocol, "UdpFace");
+
+UdpFace::UdpFace(const shared_ptr<UdpFace::protocol::socket>& socket, bool isOnDemand)
+  : DatagramFace<protocol>(FaceUri(socket->remote_endpoint()),
+                           FaceUri(socket->local_endpoint()),
+                           socket, isOnDemand)
+{
+}
+
+void
+UdpFace::handleFirstReceive(const uint8_t* buffer,
+                            std::size_t nBytesReceived,
+                            const boost::system::error_code& error)
+{
+  NFD_LOG_TRACE("handleFirstReceive");
+
+  // Checking if the received message size is too big.
+  // This check is redundant, since in the actual implementation
+  // a packet cannot be larger than MAX_NDN_PACKET_SIZE.
+  if (!error && (nBytesReceived > MAX_NDN_PACKET_SIZE))
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Received message too big. Maximum size is "
+                   << MAX_NDN_PACKET_SIZE );
+      return;
+    }
+
+  receiveDatagram(buffer, nBytesReceived, error);
+}
+
+} // namespace nfd
diff --git a/daemon/face/udp-face.hpp b/daemon/face/udp-face.hpp
new file mode 100644
index 0000000..ec11682
--- /dev/null
+++ b/daemon/face/udp-face.hpp
@@ -0,0 +1,53 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UDP_FACE_HPP
+#define NFD_DAEMON_FACE_UDP_FACE_HPP
+
+#include "datagram-face.hpp"
+
+namespace nfd {
+
+/**
+ * \brief Implementation of Face abstraction that uses UDP
+ *        as underlying transport mechanism
+ */
+class UdpFace : public DatagramFace<boost::asio::ip::udp>
+{
+public:
+  UdpFace(const shared_ptr<protocol::socket>& socket,
+          bool isOnDemand);
+
+  /**
+   * \brief Manages the first datagram received by the UdpChannel socket set on listening
+   */
+  void
+  handleFirstReceive(const uint8_t* buffer,
+                     std::size_t nBytesReceived,
+                     const boost::system::error_code& error);
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UDP_FACE_HPP
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
new file mode 100644
index 0000000..cac94a2
--- /dev/null
+++ b/daemon/face/udp-factory.cpp
@@ -0,0 +1,336 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "udp-factory.hpp"
+#include "core/global-io.hpp"
+#include "core/resolver.hpp"
+#include "core/network-interface.hpp"
+
+namespace nfd {
+
+using namespace boost::asio;
+
+NFD_LOG_INIT("UdpFactory");
+
+UdpFactory::UdpFactory(const std::string& defaultPort/* = "6363"*/)
+  : m_defaultPort(defaultPort)
+{
+}
+
+
+
+void
+UdpFactory::prohibitEndpoint(const udp::Endpoint& endpoint)
+{
+  using namespace boost::asio::ip;
+
+  static const address_v4 ALL_V4_ENDPOINT(address_v4::from_string("0.0.0.0"));
+  static const address_v6 ALL_V6_ENDPOINT(address_v6::from_string("::"));
+
+  const address& address = endpoint.address();
+
+  if (address.is_v4() && address == ALL_V4_ENDPOINT)
+    {
+      prohibitAllIpv4Endpoints(endpoint.port());
+    }
+  else if (endpoint.address().is_v6() && address == ALL_V6_ENDPOINT)
+    {
+      prohibitAllIpv6Endpoints(endpoint.port());
+    }
+
+  NFD_LOG_TRACE("prohibiting UDP " <<
+                endpoint.address().to_string() << ":" << endpoint.port());
+
+  m_prohibitedEndpoints.insert(endpoint);
+}
+
+void
+UdpFactory::prohibitAllIpv4Endpoints(const uint16_t port)
+{
+  using namespace boost::asio::ip;
+
+  static const address_v4 INVALID_BROADCAST(address_v4::from_string("0.0.0.0"));
+
+  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
+
+  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+       i != nicList.end();
+       ++i)
+    {
+      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+      const std::vector<address_v4>& ipv4Addresses = nic->ipv4Addresses;
+
+      for (std::vector<address_v4>::const_iterator j = ipv4Addresses.begin();
+           j != ipv4Addresses.end();
+           ++j)
+        {
+          prohibitEndpoint(udp::Endpoint(*j, port));
+        }
+
+      if (nic->isBroadcastCapable() && nic->broadcastAddress != INVALID_BROADCAST)
+        {
+          NFD_LOG_TRACE("prohibiting broadcast address: " << nic->broadcastAddress.to_string());
+          prohibitEndpoint(udp::Endpoint(nic->broadcastAddress, port));
+        }
+    }
+
+  prohibitEndpoint(udp::Endpoint(address::from_string("255.255.255.255"), port));
+}
+
+void
+UdpFactory::prohibitAllIpv6Endpoints(const uint16_t port)
+{
+  using namespace boost::asio::ip;
+
+  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
+
+  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+       i != nicList.end();
+       ++i)
+    {
+      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+      const std::vector<address_v6>& ipv6Addresses = nic->ipv6Addresses;
+
+      for (std::vector<address_v6>::const_iterator j = ipv6Addresses.begin();
+           j != ipv6Addresses.end();
+           ++j)
+        {
+          prohibitEndpoint(udp::Endpoint(*j, port));
+        }
+    }
+}
+
+shared_ptr<UdpChannel>
+UdpFactory::createChannel(const udp::Endpoint& endpoint,
+                          const time::seconds& timeout)
+{
+  NFD_LOG_DEBUG("Creating unicast " << endpoint);
+
+  shared_ptr<UdpChannel> channel = findChannel(endpoint);
+  if (static_cast<bool>(channel))
+    return channel;
+
+
+  //checking if the endpoint is already in use for multicast face
+  shared_ptr<MulticastUdpFace> multicast = findMulticastFace(endpoint);
+  if (static_cast<bool>(multicast))
+    throw Error("Cannot create the requested UDP unicast channel, local "
+                "endpoint is already allocated for a UDP multicast face");
+
+  if (endpoint.address().is_multicast()) {
+    throw Error("This method is only for unicast channel. The provided "
+                "endpoint is multicast. Use createMulticastFace to "
+                "create a multicast face");
+  }
+
+  channel = make_shared<UdpChannel>(boost::cref(endpoint),
+                                    timeout);
+  m_channels[endpoint] = channel;
+  prohibitEndpoint(endpoint);
+
+  return channel;
+}
+
+shared_ptr<UdpChannel>
+UdpFactory::createChannel(const std::string& localHost,
+                          const std::string& localPort,
+                          const time::seconds& timeout)
+{
+  return createChannel(UdpResolver::syncResolve(localHost, localPort),
+                       timeout);
+}
+
+shared_ptr<MulticastUdpFace>
+UdpFactory::createMulticastFace(const udp::Endpoint& localEndpoint,
+                                const udp::Endpoint& multicastEndpoint)
+{
+  //checking if the local and musticast endpoint are already in use for a multicast face
+  shared_ptr<MulticastUdpFace> multicastFace = findMulticastFace(localEndpoint);
+  if (static_cast<bool>(multicastFace)) {
+    if (multicastFace->getMulticastGroup() == multicastEndpoint)
+      return multicastFace;
+    else
+      throw Error("Cannot create the requested UDP multicast face, local "
+                  "endpoint is already allocated for a UDP multicast face "
+                  "on a different multicast group");
+  }
+
+  //checking if the local endpoint is already in use for an unicast channel
+  shared_ptr<UdpChannel> unicast = findChannel(localEndpoint);
+  if (static_cast<bool>(unicast)) {
+    throw Error("Cannot create the requested UDP multicast face, local "
+                "endpoint is already allocated for a UDP unicast channel");
+  }
+
+  if (m_prohibitedEndpoints.find(multicastEndpoint) != m_prohibitedEndpoints.end()) {
+    throw Error("Cannot create the requested UDP multicast face, "
+                "remote endpoint is owned by this NFD instance");
+  }
+
+  if (localEndpoint.address().is_v6() || multicastEndpoint.address().is_v6()) {
+    throw Error("IPv6 multicast is not supported yet. Please provide an IPv4 address");
+  }
+
+  if (localEndpoint.port() != multicastEndpoint.port()) {
+    throw Error("Cannot create the requested UDP multicast face, "
+                "both endpoints should have the same port number. ");
+  }
+
+  if (!multicastEndpoint.address().is_multicast()) {
+    throw Error("Cannot create the requested UDP multicast face, "
+                "the multicast group given as input is not a multicast address");
+  }
+
+  shared_ptr<ip::udp::socket> clientSocket =
+    make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+
+  clientSocket->open(multicastEndpoint.protocol());
+
+  clientSocket->set_option(ip::udp::socket::reuse_address(true));
+
+  try {
+    clientSocket->bind(multicastEndpoint);
+
+    if (localEndpoint.address() != ip::address::from_string("0.0.0.0")) {
+      clientSocket->set_option(ip::multicast::outbound_interface(localEndpoint.address().to_v4()));
+    }
+    clientSocket->set_option(ip::multicast::join_group(multicastEndpoint.address().to_v4(),
+                                                       localEndpoint.address().to_v4()));
+  }
+  catch (boost::system::system_error& e) {
+    std::stringstream msg;
+    msg << "Failed to properly configure the socket, check the address (" << e.what() << ")";
+    throw Error(msg.str());
+  }
+
+  clientSocket->set_option(ip::multicast::enable_loopback(false));
+
+  multicastFace = make_shared<MulticastUdpFace>(boost::cref(clientSocket), localEndpoint);
+  multicastFace->onFail += bind(&UdpFactory::afterFaceFailed, this, localEndpoint);
+
+  m_multicastFaces[localEndpoint] = multicastFace;
+
+  return multicastFace;
+}
+
+shared_ptr<MulticastUdpFace>
+UdpFactory::createMulticastFace(const std::string& localIp,
+                                const std::string& multicastIp,
+                                const std::string& multicastPort)
+{
+
+  return createMulticastFace(UdpResolver::syncResolve(localIp,
+                                                      multicastPort),
+                             UdpResolver::syncResolve(multicastIp,
+                                                      multicastPort));
+}
+
+void
+UdpFactory::createFace(const FaceUri& uri,
+                       const FaceCreatedCallback& onCreated,
+                       const FaceConnectFailedCallback& onConnectFailed)
+{
+  resolver::AddressSelector addressSelector = resolver::AnyAddress();
+  if (uri.getScheme() == "udp4")
+    addressSelector = resolver::Ipv4Address();
+  else if (uri.getScheme() == "udp6")
+    addressSelector = resolver::Ipv6Address();
+
+  if (!uri.getPath().empty())
+    {
+      onConnectFailed("Invalid URI");
+    }
+
+  UdpResolver::asyncResolve(uri.getHost(),
+                            uri.getPort().empty() ? m_defaultPort : uri.getPort(),
+                            bind(&UdpFactory::continueCreateFaceAfterResolve, this, _1,
+                                 onCreated, onConnectFailed),
+                            onConnectFailed,
+                            addressSelector);
+
+}
+
+void
+UdpFactory::continueCreateFaceAfterResolve(const udp::Endpoint& endpoint,
+                                           const FaceCreatedCallback& onCreated,
+                                           const FaceConnectFailedCallback& onConnectFailed)
+{
+  if (endpoint.address().is_multicast()) {
+    onConnectFailed("The provided address is multicast. Please use createMulticastFace method");
+    return;
+  }
+
+  if (m_prohibitedEndpoints.find(endpoint) != m_prohibitedEndpoints.end())
+    {
+      onConnectFailed("Requested endpoint is prohibited "
+                      "(reserved by this NFD or disallowed by face management protocol)");
+      return;
+    }
+
+  // very simple logic for now
+
+  for (ChannelMap::iterator channel = m_channels.begin();
+       channel != m_channels.end();
+       ++channel)
+  {
+    if ((channel->first.address().is_v4() && endpoint.address().is_v4()) ||
+        (channel->first.address().is_v6() && endpoint.address().is_v6()))
+    {
+      channel->second->connect(endpoint, onCreated, onConnectFailed);
+      return;
+    }
+  }
+  onConnectFailed("No channels available to connect to "
+                  + boost::lexical_cast<std::string>(endpoint));
+}
+
+shared_ptr<UdpChannel>
+UdpFactory::findChannel(const udp::Endpoint& localEndpoint)
+{
+  ChannelMap::iterator i = m_channels.find(localEndpoint);
+  if (i != m_channels.end())
+    return i->second;
+  else
+    return shared_ptr<UdpChannel>();
+}
+
+shared_ptr<MulticastUdpFace>
+UdpFactory::findMulticastFace(const udp::Endpoint& localEndpoint)
+{
+  MulticastFaceMap::iterator i = m_multicastFaces.find(localEndpoint);
+  if (i != m_multicastFaces.end())
+    return i->second;
+  else
+    return shared_ptr<MulticastUdpFace>();
+}
+
+void
+UdpFactory::afterFaceFailed(udp::Endpoint& endpoint)
+{
+  NFD_LOG_DEBUG("afterFaceFailed: " << endpoint);
+  m_multicastFaces.erase(endpoint);
+}
+
+
+} // namespace nfd
diff --git a/daemon/face/udp-factory.hpp b/daemon/face/udp-factory.hpp
new file mode 100644
index 0000000..8d0494c
--- /dev/null
+++ b/daemon/face/udp-factory.hpp
@@ -0,0 +1,201 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UDP_FACTORY_HPP
+#define NFD_DAEMON_FACE_UDP_FACTORY_HPP
+
+#include "protocol-factory.hpp"
+#include "udp-channel.hpp"
+#include "multicast-udp-face.hpp"
+
+
+namespace nfd {
+
+// @todo The multicast support for ipv6 must be implemented
+
+class UdpFactory : public ProtocolFactory
+{
+public:
+  /**
+   * \brief Exception of UdpFactory
+   */
+  struct Error : public ProtocolFactory::Error
+  {
+    Error(const std::string& what) : ProtocolFactory::Error(what) {}
+  };
+
+  explicit
+  UdpFactory(const std::string& defaultPort = "6363");
+
+  /**
+   * \brief Create UDP-based channel using udp::Endpoint
+   *
+   * udp::Endpoint is really an alias for boost::asio::ip::udp::endpoint.
+   *
+   * If this method called twice with the same endpoint, only one channel
+   * will be created.  The second call will just retrieve the existing
+   * channel.
+   *
+   * If a multicast face is already active on the same local endpoint,
+   * the creation fails and an exception is thrown
+   *
+   * Once a face is created, if it doesn't send/receive anything for
+   * a period of time equal to timeout, it will be destroyed
+   * @todo this funcionality has to be implemented
+   *
+   * \returns always a valid pointer to a UdpChannel object, an exception
+   *          is thrown if it cannot be created.
+   *
+   * \throws UdpFactory::Error
+   *
+   * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__udp/endpoint.html
+   *      for details on ways to create udp::Endpoint
+   */
+  shared_ptr<UdpChannel>
+  createChannel(const udp::Endpoint& localEndpoint,
+         const time::seconds& timeout = time::seconds(600));
+
+  /**
+   * \brief Create UDP-based channel using specified host and port number
+   *
+   * This method will attempt to resolve the provided host and port numbers
+   * and will throw UdpFactory::Error when channel cannot be created.
+   *
+   * Note that this call will **BLOCK** until resolution is done or failed.
+   *
+   * If localHost is a IPv6 address of a specific device, it must be in the form:
+   * ip address%interface name
+   * Example: fe80::5e96:9dff:fe7d:9c8d%en1
+   * Otherwise, you can use ::
+   *
+   * Once a face is created, if it doesn't send/receive anything for
+   * a period of time equal to timeout, it will be destroyed
+   * @todo this funcionality has to be implemented
+   *
+   * \throws UdpChannel::Error if the bind on the socket fails
+   * \throws UdpFactory::Error
+   */
+  shared_ptr<UdpChannel>
+  createChannel(const std::string& localHost,
+         const std::string& localPort,
+         const time::seconds& timeout = time::seconds(600));
+
+  /**
+   * \brief Create MulticastUdpFace using udp::Endpoint
+   *
+   * udp::Endpoint is really an alias for boost::asio::ip::udp::endpoint.
+   *
+   * The face will join the multicast group
+   *
+   * If this method called twice with the same endpoint and group, only one face
+   * will be created.  The second call will just retrieve the existing
+   * channel.
+   *
+   * If an unicast face is already active on the same local NIC and port, the
+   * creation fails and an exception is thrown
+   *
+   * \returns always a valid pointer to a MulticastUdpFace object, an exception
+   *          is thrown if it cannot be created.
+   *
+   * \throws UdpFactory::Error
+   *
+   * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__udp/endpoint.html
+   *      for details on ways to create udp::Endpoint
+   */
+  shared_ptr<MulticastUdpFace>
+  createMulticastFace(const udp::Endpoint& localEndpoint,
+                      const udp::Endpoint& multicastEndpoint);
+
+  shared_ptr<MulticastUdpFace>
+  createMulticastFace(const std::string& localIp,
+                      const std::string& multicastIp,
+                      const std::string& multicastPort);
+
+  // from Factory
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
+protected:
+  typedef std::map< udp::Endpoint, shared_ptr<MulticastUdpFace> > MulticastFaceMap;
+
+  /**
+   * \brief Keeps tracking of the MulticastUdpFace created
+   */
+  MulticastFaceMap m_multicastFaces;
+
+private:
+
+  void
+  prohibitEndpoint(const udp::Endpoint& endpoint);
+
+  void
+  prohibitAllIpv4Endpoints(const uint16_t port);
+
+  void
+  prohibitAllIpv6Endpoints(const uint16_t port);
+
+  void
+  afterFaceFailed(udp::Endpoint& endpoint);
+
+  /**
+   * \brief Look up UdpChannel using specified local endpoint
+   *
+   * \returns shared pointer to the existing UdpChannel object
+   *          or empty shared pointer when such channel does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<UdpChannel>
+  findChannel(const udp::Endpoint& localEndpoint);
+
+
+  /**
+   * \brief Look up multicast UdpFace using specified local endpoint
+   *
+   * \returns shared pointer to the existing multicast MulticastUdpFace object
+   *          or empty shared pointer when such face does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<MulticastUdpFace>
+  findMulticastFace(const udp::Endpoint& localEndpoint);
+
+  void
+  continueCreateFaceAfterResolve(const udp::Endpoint& endpoint,
+                                 const FaceCreatedCallback& onCreated,
+                                 const FaceConnectFailedCallback& onConnectFailed);
+
+  typedef std::map< udp::Endpoint, shared_ptr<UdpChannel> > ChannelMap;
+  ChannelMap m_channels;
+
+  std::string m_defaultPort;
+
+  std::set<udp::Endpoint> m_prohibitedEndpoints;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UDP_FACTORY_HPP
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
new file mode 100644
index 0000000..efdf700
--- /dev/null
+++ b/daemon/face/unix-stream-channel.cpp
@@ -0,0 +1,149 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "unix-stream-channel.hpp"
+#include "core/global-io.hpp"
+
+#include <boost/filesystem.hpp>
+#include <sys/stat.h> // for chmod()
+
+namespace nfd {
+
+NFD_LOG_INIT("UnixStreamChannel");
+
+using namespace boost::asio::local;
+
+UnixStreamChannel::UnixStreamChannel(const unix_stream::Endpoint& endpoint)
+  : m_endpoint(endpoint)
+  , m_isListening(false)
+{
+  setUri(FaceUri(endpoint));
+}
+
+UnixStreamChannel::~UnixStreamChannel()
+{
+  if (m_isListening)
+    {
+      // use the non-throwing variants during destruction
+      // and ignore any errors
+      boost::system::error_code error;
+      m_acceptor->close(error);
+      NFD_LOG_TRACE("[" << m_endpoint << "] Removing socket file");
+      boost::filesystem::remove(m_endpoint.path(), error);
+    }
+}
+
+void
+UnixStreamChannel::listen(const FaceCreatedCallback& onFaceCreated,
+                          const ConnectFailedCallback& onAcceptFailed,
+                          int backlog/* = acceptor::max_connections*/)
+{
+  if (m_isListening) {
+    NFD_LOG_WARN("[" << m_endpoint << "] Already listening");
+    return;
+  }
+
+  namespace fs = boost::filesystem;
+
+  fs::path socketPath(m_endpoint.path());
+  fs::file_type type = fs::symlink_status(socketPath).type();
+
+  if (type == fs::socket_file)
+    {
+      boost::system::error_code error;
+      stream_protocol::socket socket(getGlobalIoService());
+      socket.connect(m_endpoint, error);
+      NFD_LOG_TRACE("[" << m_endpoint << "] connect() on existing socket file returned: "
+                    + error.message());
+      if (!error)
+        {
+          // someone answered, leave the socket alone
+          throw Error("Socket file at " + m_endpoint.path()
+                      + " belongs to another NFD process");
+        }
+      else if (error == boost::system::errc::connection_refused ||
+               error == boost::system::errc::timed_out)
+        {
+          // no one is listening on the remote side,
+          // we can safely remove the socket file
+          NFD_LOG_INFO("[" << m_endpoint << "] Removing stale socket file");
+          fs::remove(socketPath);
+        }
+    }
+  else if (type != fs::file_not_found)
+    {
+      throw Error(m_endpoint.path() + " already exists and is not a socket file");
+    }
+
+  m_acceptor = make_shared<stream_protocol::acceptor>(boost::ref(getGlobalIoService()));
+  m_acceptor->open();
+  m_acceptor->bind(m_endpoint);
+  m_acceptor->listen(backlog);
+  m_isListening = true;
+
+  if (::chmod(m_endpoint.path().c_str(), 0666) < 0)
+    {
+      throw Error("Failed to chmod() socket file at " + m_endpoint.path());
+    }
+
+  shared_ptr<stream_protocol::socket> clientSocket =
+    make_shared<stream_protocol::socket>(boost::ref(getGlobalIoService()));
+
+  m_acceptor->async_accept(*clientSocket,
+                           bind(&UnixStreamChannel::handleSuccessfulAccept, this,
+                                boost::asio::placeholders::error, clientSocket,
+                                onFaceCreated, onAcceptFailed));
+}
+
+void
+UnixStreamChannel::handleSuccessfulAccept(const boost::system::error_code& error,
+                                          const shared_ptr<stream_protocol::socket>& socket,
+                                          const FaceCreatedCallback& onFaceCreated,
+                                          const ConnectFailedCallback& onAcceptFailed)
+{
+  if (error) {
+    if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
+      return;
+
+    NFD_LOG_DEBUG("[" << m_endpoint << "] Connection failed: " << error.message());
+    onAcceptFailed("Connection failed: " + error.message());
+    return;
+  }
+
+  NFD_LOG_DEBUG("[" << m_endpoint << "] << Incoming connection");
+
+  shared_ptr<stream_protocol::socket> clientSocket =
+    make_shared<stream_protocol::socket>(boost::ref(getGlobalIoService()));
+
+  // prepare accepting the next connection
+  m_acceptor->async_accept(*clientSocket,
+                           bind(&UnixStreamChannel::handleSuccessfulAccept, this,
+                                boost::asio::placeholders::error, clientSocket,
+                                onFaceCreated, onAcceptFailed));
+
+  shared_ptr<UnixStreamFace> face = make_shared<UnixStreamFace>(boost::cref(socket));
+  onFaceCreated(face);
+}
+
+} // namespace nfd
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
new file mode 100644
index 0000000..c923c39
--- /dev/null
+++ b/daemon/face/unix-stream-channel.hpp
@@ -0,0 +1,95 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
+#define NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
+
+#include "channel.hpp"
+#include "unix-stream-face.hpp"
+
+namespace nfd {
+
+namespace unix_stream {
+typedef boost::asio::local::stream_protocol::endpoint Endpoint;
+} // namespace unix_stream
+
+/**
+ * \brief Class implementing a local channel to create faces
+ *
+ * Channel can create faces as a response to incoming IPC connections
+ * (UnixStreamChannel::listen needs to be called for that to work).
+ */
+class UnixStreamChannel : public Channel
+{
+public:
+  /**
+   * \brief UnixStreamChannel-related error
+   */
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : std::runtime_error(what) {}
+  };
+
+  /**
+   * \brief Create UnixStream channel for the specified endpoint
+   *
+   * To enable creation of faces upon incoming connections, one
+   * needs to explicitly call UnixStreamChannel::listen method.
+   */
+  explicit
+  UnixStreamChannel(const unix_stream::Endpoint& endpoint);
+
+  virtual
+  ~UnixStreamChannel();
+
+  /**
+   * \brief Enable listening on the local endpoint, accept connections,
+   *        and create faces when a connection is made
+   * \param onFaceCreated  Callback to notify successful creation of the face
+   * \param onAcceptFailed Callback to notify when channel fails (accept call
+   *                       returns an error)
+   * \param backlog        The maximum length of the queue of pending incoming
+   *                       connections
+   */
+  void
+  listen(const FaceCreatedCallback& onFaceCreated,
+         const ConnectFailedCallback& onAcceptFailed,
+         int backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
+
+private:
+  void
+  handleSuccessfulAccept(const boost::system::error_code& error,
+                         const shared_ptr<boost::asio::local::stream_protocol::socket>& socket,
+                         const FaceCreatedCallback& onFaceCreated,
+                         const ConnectFailedCallback& onConnectFailed);
+
+private:
+  unix_stream::Endpoint m_endpoint;
+  shared_ptr<boost::asio::local::stream_protocol::acceptor> m_acceptor;
+  bool m_isListening;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
diff --git a/daemon/face/unix-stream-face.cpp b/daemon/face/unix-stream-face.cpp
new file mode 100644
index 0000000..93ff30e
--- /dev/null
+++ b/daemon/face/unix-stream-face.cpp
@@ -0,0 +1,46 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "unix-stream-face.hpp"
+
+namespace nfd {
+
+// The whole purpose of this file is to specialize the logger,
+// otherwise, everything could be put into the header file.
+
+NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(StreamFace,
+                                                UnixStreamFace::protocol, LocalFace,
+                                                "UnixStreamFace");
+
+BOOST_STATIC_ASSERT((boost::is_same<UnixStreamFace::protocol::socket::native_handle_type,
+                     int>::value));
+
+UnixStreamFace::UnixStreamFace(const shared_ptr<UnixStreamFace::protocol::socket>& socket)
+  : StreamFace<protocol, LocalFace>(FaceUri::fromFd(socket->native_handle()),
+                                    FaceUri(socket->local_endpoint()),
+                                    socket, true)
+{
+}
+
+} // namespace nfd
diff --git a/daemon/face/unix-stream-face.hpp b/daemon/face/unix-stream-face.hpp
new file mode 100644
index 0000000..51482c4
--- /dev/null
+++ b/daemon/face/unix-stream-face.hpp
@@ -0,0 +1,49 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
+#define NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
+
+#include "stream-face.hpp"
+
+#ifndef HAVE_UNIX_SOCKETS
+#error "Cannot include this file when UNIX sockets are not available"
+#endif
+
+namespace nfd {
+
+/**
+ * \brief Implementation of Face abstraction that uses stream-oriented
+ *        Unix domain sockets as underlying transport mechanism
+ */
+class UnixStreamFace : public StreamFace<boost::asio::local::stream_protocol, LocalFace>
+{
+public:
+  explicit
+  UnixStreamFace(const shared_ptr<protocol::socket>& socket);
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
new file mode 100644
index 0000000..96a158a
--- /dev/null
+++ b/daemon/face/unix-stream-factory.cpp
@@ -0,0 +1,65 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "unix-stream-factory.hpp"
+
+#include <boost/filesystem.hpp> // for canonical()
+
+namespace nfd {
+
+shared_ptr<UnixStreamChannel>
+UnixStreamFactory::createChannel(const std::string& unixSocketPath)
+{
+  boost::filesystem::path p(unixSocketPath);
+  p = boost::filesystem::canonical(p.parent_path()) / p.filename();
+  unix_stream::Endpoint endpoint(p.string());
+
+  shared_ptr<UnixStreamChannel> channel = findChannel(endpoint);
+  if (channel)
+    return channel;
+
+  channel = make_shared<UnixStreamChannel>(boost::cref(endpoint));
+  m_channels[endpoint] = channel;
+  return channel;
+}
+
+shared_ptr<UnixStreamChannel>
+UnixStreamFactory::findChannel(const unix_stream::Endpoint& endpoint)
+{
+  ChannelMap::iterator i = m_channels.find(endpoint);
+  if (i != m_channels.end())
+    return i->second;
+  else
+    return shared_ptr<UnixStreamChannel>();
+}
+
+void
+UnixStreamFactory::createFace(const FaceUri& uri,
+                              const FaceCreatedCallback& onCreated,
+                              const FaceConnectFailedCallback& onConnectFailed)
+{
+  throw Error("UnixStreamFactory does not support 'createFace' operation");
+}
+
+} // namespace nfd
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
new file mode 100644
index 0000000..7c9bb85
--- /dev/null
+++ b/daemon/face/unix-stream-factory.hpp
@@ -0,0 +1,85 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
+#define NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
+
+#include "protocol-factory.hpp"
+#include "unix-stream-channel.hpp"
+
+namespace nfd {
+
+class UnixStreamFactory : public ProtocolFactory
+{
+public:
+  /**
+   * \brief Exception of UnixStreamFactory
+   */
+  struct Error : public ProtocolFactory::Error
+  {
+    Error(const std::string& what) : ProtocolFactory::Error(what) {}
+  };
+
+  /**
+   * \brief Create stream-oriented Unix channel using specified socket path
+   *
+   * If this method is called twice with the same path, only one channel
+   * will be created.  The second call will just retrieve the existing
+   * channel.
+   *
+   * \returns always a valid pointer to a UnixStreamChannel object,
+   *          an exception will be thrown if the channel cannot be created.
+   *
+   * \throws UnixStreamFactory::Error
+   */
+  shared_ptr<UnixStreamChannel>
+  createChannel(const std::string& unixSocketPath);
+
+  // from Factory
+
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
+private:
+  /**
+   * \brief Look up UnixStreamChannel using specified endpoint
+   *
+   * \returns shared pointer to the existing UnixStreamChannel object
+   *          or empty shared pointer when such channel does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<UnixStreamChannel>
+  findChannel(const unix_stream::Endpoint& endpoint);
+
+private:
+  typedef std::map< unix_stream::Endpoint, shared_ptr<UnixStreamChannel> > ChannelMap;
+  ChannelMap m_channels;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
diff --git a/daemon/fw/available-strategies.cpp b/daemon/fw/available-strategies.cpp
new file mode 100644
index 0000000..fce0fc5
--- /dev/null
+++ b/daemon/fw/available-strategies.cpp
@@ -0,0 +1,59 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "best-route-strategy.hpp"
+#include "broadcast-strategy.hpp"
+#include "client-control-strategy.hpp"
+#include "ncc-strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+shared_ptr<Strategy>
+makeDefaultStrategy(Forwarder& forwarder)
+{
+  return make_shared<BestRouteStrategy>(boost::ref(forwarder));
+}
+
+template<typename S>
+inline void
+installStrategy(Forwarder& forwarder)
+{
+  StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
+  if (!strategyChoice.hasStrategy(S::STRATEGY_NAME)) {
+    strategyChoice.install(make_shared<S>(boost::ref(forwarder)));
+  }
+}
+
+void
+installStrategies(Forwarder& forwarder)
+{
+  installStrategy<BestRouteStrategy>(forwarder);
+  installStrategy<BroadcastStrategy>(forwarder);
+  installStrategy<ClientControlStrategy>(forwarder);
+  installStrategy<NccStrategy>(forwarder);
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/available-strategies.hpp b/daemon/fw/available-strategies.hpp
new file mode 100644
index 0000000..616a1b4
--- /dev/null
+++ b/daemon/fw/available-strategies.hpp
@@ -0,0 +1,42 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_AVAILABLE_STRATEGIES_HPP
+#define NFD_DAEMON_FW_AVAILABLE_STRATEGIES_HPP
+
+#include "strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+shared_ptr<Strategy>
+makeDefaultStrategy(Forwarder& forwarder);
+
+void
+installStrategies(Forwarder& forwarder);
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_AVAILABLE_STRATEGIES_HPP
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
new file mode 100644
index 0000000..7e91df3
--- /dev/null
+++ b/daemon/fw/best-route-strategy.cpp
@@ -0,0 +1,73 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "best-route-strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+const Name BestRouteStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/best-route");
+
+BestRouteStrategy::BestRouteStrategy(Forwarder& forwarder, const Name& name)
+  : Strategy(forwarder, name)
+{
+}
+
+BestRouteStrategy::~BestRouteStrategy()
+{
+}
+
+static inline bool
+predicate_PitEntry_canForwardTo_NextHop(shared_ptr<pit::Entry> pitEntry,
+                                        const fib::NextHop& nexthop)
+{
+  return pitEntry->canForwardTo(*nexthop.getFace());
+}
+
+void
+BestRouteStrategy::afterReceiveInterest(const Face& inFace,
+                   const Interest& interest,
+                   shared_ptr<fib::Entry> fibEntry,
+                   shared_ptr<pit::Entry> pitEntry)
+{
+  if (pitEntry->hasUnexpiredOutRecords()) {
+    // not a new Interest, don't forward
+    return;
+  }
+
+  const fib::NextHopList& nexthops = fibEntry->getNextHops();
+  fib::NextHopList::const_iterator it = std::find_if(nexthops.begin(), nexthops.end(),
+    bind(&predicate_PitEntry_canForwardTo_NextHop, pitEntry, _1));
+
+  if (it == nexthops.end()) {
+    this->rejectPendingInterest(pitEntry);
+    return;
+  }
+
+  shared_ptr<Face> outFace = it->getFace();
+  this->sendInterest(pitEntry, outFace);
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/best-route-strategy.hpp b/daemon/fw/best-route-strategy.hpp
new file mode 100644
index 0000000..d7737b3
--- /dev/null
+++ b/daemon/fw/best-route-strategy.hpp
@@ -0,0 +1,58 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
+#define NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
+
+#include "strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \class BestRouteStrategy
+ *  \brief a forwarding strategy that forwards Interest
+ *         to the first nexthop
+ */
+class BestRouteStrategy : public Strategy
+{
+public:
+  BestRouteStrategy(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
+
+  virtual
+  ~BestRouteStrategy();
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry);
+
+public:
+  static const Name STRATEGY_NAME;
+};
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
diff --git a/daemon/fw/broadcast-strategy.cpp b/daemon/fw/broadcast-strategy.cpp
new file mode 100644
index 0000000..c619e04
--- /dev/null
+++ b/daemon/fw/broadcast-strategy.cpp
@@ -0,0 +1,62 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "broadcast-strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+const Name BroadcastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/broadcast");
+
+BroadcastStrategy::BroadcastStrategy(Forwarder& forwarder, const Name& name)
+  : Strategy(forwarder, name)
+{
+}
+
+BroadcastStrategy::~BroadcastStrategy()
+{
+}
+
+void
+BroadcastStrategy::afterReceiveInterest(const Face& inFace,
+                   const Interest& interest,
+                   shared_ptr<fib::Entry> fibEntry,
+                   shared_ptr<pit::Entry> pitEntry)
+{
+  const fib::NextHopList& nexthops = fibEntry->getNextHops();
+
+  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
+    shared_ptr<Face> outFace = it->getFace();
+    if (pitEntry->canForwardTo(*outFace)) {
+      this->sendInterest(pitEntry, outFace);
+    }
+  }
+
+  if (!pitEntry->hasUnexpiredOutRecords()) {
+    this->rejectPendingInterest(pitEntry);
+  }
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/broadcast-strategy.hpp b/daemon/fw/broadcast-strategy.hpp
new file mode 100644
index 0000000..b468895
--- /dev/null
+++ b/daemon/fw/broadcast-strategy.hpp
@@ -0,0 +1,58 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_BROADCAST_STRATEGY_HPP
+#define NFD_DAEMON_FW_BROADCAST_STRATEGY_HPP
+
+#include "strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \class BroadcastStrategy
+ *  \brief a forwarding strategy that forwards Interest
+ *         to all nexthops
+ */
+class BroadcastStrategy : public Strategy
+{
+public:
+  BroadcastStrategy(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
+
+  virtual
+  ~BroadcastStrategy();
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry);
+
+public:
+  static const Name STRATEGY_NAME;
+};
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_BROADCAST_STRATEGY_HPP
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
new file mode 100644
index 0000000..f8d83a8
--- /dev/null
+++ b/daemon/fw/client-control-strategy.cpp
@@ -0,0 +1,72 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "client-control-strategy.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+namespace fw {
+
+NFD_LOG_INIT("ClientControlStrategy");
+
+const Name ClientControlStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/client-control");
+
+ClientControlStrategy::ClientControlStrategy(Forwarder& forwarder, const Name& name)
+  : BestRouteStrategy(forwarder, name)
+{
+}
+
+ClientControlStrategy::~ClientControlStrategy()
+{
+}
+
+void
+ClientControlStrategy::afterReceiveInterest(const Face& inFace,
+                                            const Interest& interest,
+                                            shared_ptr<fib::Entry> fibEntry,
+                                            shared_ptr<pit::Entry> pitEntry)
+{
+  // Strategy needn't check whether LocalControlHeader-NextHopFaceId is enabled.
+  // LocalFace does this check.
+  if (!interest.getLocalControlHeader().hasNextHopFaceId()) {
+    this->BestRouteStrategy::afterReceiveInterest(inFace, interest, fibEntry, pitEntry);
+    return;
+  }
+
+  FaceId outFaceId = static_cast<FaceId>(interest.getNextHopFaceId());
+  shared_ptr<Face> outFace = this->getFace(outFaceId);
+  if (!static_cast<bool>(outFace)) {
+    // If outFace doesn't exist, it's better to reject the Interest
+    // than to use BestRouteStrategy.
+    NFD_LOG_WARN("Interest " << interest.getName() <<
+                 " NextHopFaceId=" << outFaceId << " non-existent face");
+    this->rejectPendingInterest(pitEntry);
+    return;
+  }
+
+  this->sendInterest(pitEntry, outFace);
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/client-control-strategy.hpp b/daemon/fw/client-control-strategy.hpp
new file mode 100644
index 0000000..d4810b5
--- /dev/null
+++ b/daemon/fw/client-control-strategy.hpp
@@ -0,0 +1,57 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_CLIENT_CONTROL_STRATEGY_HPP
+#define NFD_DAEMON_FW_CLIENT_CONTROL_STRATEGY_HPP
+
+#include "best-route-strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \brief a forwarding strategy that forwards Interests
+ *         according to NextHopFaceId field in LocalControlHeader
+ */
+class ClientControlStrategy : public BestRouteStrategy
+{
+public:
+  ClientControlStrategy(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
+
+  virtual
+  ~ClientControlStrategy();
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry);
+
+public:
+  static const Name STRATEGY_NAME;
+};
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_CLIENT_CONTROL_STRATEGY_HPP
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
new file mode 100644
index 0000000..ce66a89
--- /dev/null
+++ b/daemon/fw/face-table.cpp
@@ -0,0 +1,92 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-table.hpp"
+#include "forwarder.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("FaceTable");
+
+FaceTable::FaceTable(Forwarder& forwarder)
+  : m_forwarder(forwarder)
+  , m_lastFaceId(0)
+{
+}
+
+FaceTable::~FaceTable()
+{
+
+}
+
+void
+FaceTable::add(shared_ptr<Face> face)
+{
+  if (face->getId() != INVALID_FACEID &&
+      m_faces.count(face->getId()) > 0)
+    {
+      NFD_LOG_DEBUG("Trying to add existing face id=" << face->getId() << " to the face table");
+      return;
+    }
+
+  FaceId faceId = ++m_lastFaceId;
+  face->setId(faceId);
+  m_faces[faceId] = face;
+  NFD_LOG_INFO("Added face id=" << faceId << " remote=" << face->getRemoteUri() <<
+                                              " local=" << face->getLocalUri());
+
+  face->onReceiveInterest += bind(&Forwarder::onInterest,
+                                  &m_forwarder, boost::ref(*face), _1);
+  face->onReceiveData     += bind(&Forwarder::onData,
+                                  &m_forwarder, boost::ref(*face), _1);
+  face->onFail            += bind(&FaceTable::remove,
+                                  this, face);
+
+  this->onAdd(face);
+}
+
+void
+FaceTable::remove(shared_ptr<Face> face)
+{
+  this->onRemove(face);
+
+  FaceId faceId = face->getId();
+  m_faces.erase(faceId);
+  face->setId(INVALID_FACEID);
+  NFD_LOG_INFO("Removed face id=" << faceId << " remote=" << face->getRemoteUri() <<
+                                                 " local=" << face->getLocalUri());
+
+  // XXX This clears all subscriptions, because EventEmitter
+  //     does not support only removing Forwarder's subscription
+  face->onReceiveInterest.clear();
+  face->onReceiveData    .clear();
+  // don't clear onFail because other functions may need to execute
+
+  m_forwarder.getFib().removeNextHopFromAllEntries(face);
+}
+
+
+
+} // namespace nfd
diff --git a/daemon/fw/face-table.hpp b/daemon/fw/face-table.hpp
new file mode 100644
index 0000000..8f7dcb2
--- /dev/null
+++ b/daemon/fw/face-table.hpp
@@ -0,0 +1,141 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_FACE_TABLE_HPP
+#define NFD_DAEMON_FW_FACE_TABLE_HPP
+
+#include "face/face.hpp"
+#include "core/map-value-iterator.hpp"
+
+namespace nfd
+{
+
+class Forwarder;
+
+/** \brief container of all Faces
+ */
+class FaceTable
+{
+public:
+  explicit
+  FaceTable(Forwarder& forwarder);
+
+  VIRTUAL_WITH_TESTS
+  ~FaceTable();
+
+  VIRTUAL_WITH_TESTS void
+  add(shared_ptr<Face> face);
+
+  VIRTUAL_WITH_TESTS shared_ptr<Face>
+  get(FaceId id) const;
+
+  size_t
+  size() const;
+
+public: // enumeration
+  typedef std::map<FaceId, shared_ptr<Face> > FaceMap;
+
+  /** \brief ForwardIterator for shared_ptr<Face>
+   */
+  typedef MapValueIterator<FaceMap> const_iterator;
+
+  /** \brief ReverseIterator for shared_ptr<Face>
+   */
+  typedef MapValueReverseIterator<FaceMap> const_reverse_iterator;
+
+  const_iterator
+  begin() const;
+
+  const_iterator
+  end() const;
+
+  const_reverse_iterator
+  rbegin() const;
+
+  const_reverse_iterator
+  rend() const;
+
+public: // events
+  /** \brief fires after a Face is added
+   */
+  EventEmitter<shared_ptr<Face> > onAdd;
+
+  /** \brief fires before a Face is removed
+   *
+   *  FaceId is valid when this event is fired
+   */
+  EventEmitter<shared_ptr<Face> > onRemove;
+
+private:
+  // remove is private because it's a subscriber of face.onFail event.
+  // face->close() closes a face and would trigger .remove(face)
+  void
+  remove(shared_ptr<Face> face);
+
+private:
+  Forwarder& m_forwarder;
+  FaceId m_lastFaceId;
+  FaceMap m_faces;
+};
+
+inline shared_ptr<Face>
+FaceTable::get(FaceId id) const
+{
+  std::map<FaceId, shared_ptr<Face> >::const_iterator i = m_faces.find(id);
+  return (i == m_faces.end()) ? (shared_ptr<Face>()) : (i->second);
+}
+
+inline size_t
+FaceTable::size() const
+{
+  return m_faces.size();
+}
+
+inline FaceTable::const_iterator
+FaceTable::begin() const
+{
+  return const_iterator(m_faces.begin());
+}
+
+inline FaceTable::const_iterator
+FaceTable::end() const
+{
+  return const_iterator(m_faces.end());
+}
+
+inline FaceTable::const_reverse_iterator
+FaceTable::rbegin() const
+{
+  return const_reverse_iterator(m_faces.rbegin());
+}
+
+inline FaceTable::const_reverse_iterator
+FaceTable::rend() const
+{
+  return const_reverse_iterator(m_faces.rend());
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_FACE_TABLE_HPP
diff --git a/daemon/fw/forwarder-counter.hpp b/daemon/fw/forwarder-counter.hpp
new file mode 100644
index 0000000..be74928
--- /dev/null
+++ b/daemon/fw/forwarder-counter.hpp
@@ -0,0 +1,49 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
+#define NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
+
+#include "face/face-counter.hpp"
+
+namespace nfd {
+
+/** \class ForwarderCounter
+ *  \brief represents a counter on forwarder
+ *
+ *  \todo This class should be noncopyable
+ */
+typedef uint64_t ForwarderCounter;
+
+
+/** \brief contains counters on forwarder
+ */
+class ForwarderCounters : public FaceCounters
+{
+};
+
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
new file mode 100644
index 0000000..6b06d10
--- /dev/null
+++ b/daemon/fw/forwarder.cpp
@@ -0,0 +1,353 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "forwarder.hpp"
+#include "available-strategies.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("Forwarder");
+
+using fw::Strategy;
+
+const Name Forwarder::LOCALHOST_NAME("ndn:/localhost");
+
+Forwarder::Forwarder()
+  : m_faceTable(*this)
+  , m_fib(m_nameTree)
+  , m_pit(m_nameTree)
+  , m_measurements(m_nameTree)
+  , m_strategyChoice(m_nameTree, fw::makeDefaultStrategy(*this))
+{
+  fw::installStrategies(*this);
+}
+
+Forwarder::~Forwarder()
+{
+
+}
+
+void
+Forwarder::onIncomingInterest(Face& inFace, const Interest& interest)
+{
+  // receive Interest
+  NFD_LOG_DEBUG("onIncomingInterest face=" << inFace.getId() <<
+                " interest=" << interest.getName());
+  const_cast<Interest&>(interest).setIncomingFaceId(inFace.getId());
+  m_counters.getNInInterests() ++;
+
+  // /localhost scope control
+  bool isViolatingLocalhost = !inFace.isLocal() &&
+                              LOCALHOST_NAME.isPrefixOf(interest.getName());
+  if (isViolatingLocalhost) {
+    NFD_LOG_DEBUG("onIncomingInterest face=" << inFace.getId() <<
+                  " interest=" << interest.getName() << " violates /localhost");
+    // (drop)
+    return;
+  }
+
+  // PIT insert
+  shared_ptr<pit::Entry> pitEntry = m_pit.insert(interest).first;
+
+  // detect loop and record Nonce
+  bool isLoop = ! pitEntry->addNonce(interest.getNonce());
+  if (isLoop) {
+    // goto Interest loop pipeline
+    this->onInterestLoop(inFace, interest, pitEntry);
+    return;
+  }
+
+  // cancel unsatisfy & straggler timer
+  this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+
+  // is pending?
+  const pit::InRecordCollection& inRecords = pitEntry->getInRecords();
+  bool isPending = inRecords.begin() != inRecords.end();
+  if (!isPending) {
+    // CS lookup
+    const Data* csMatch = m_cs.find(interest);
+    if (csMatch != 0) {
+      // XXX should we lookup PIT for other Interests that also match csMatch?
+
+      // goto outgoing Data pipeline
+      this->onOutgoingData(*csMatch, inFace);
+      return;
+    }
+  }
+
+  // insert InRecord
+  pitEntry->insertOrUpdateInRecord(inFace.shared_from_this(), interest);
+
+  // FIB lookup
+  shared_ptr<fib::Entry> fibEntry = m_fib.findLongestPrefixMatch(*pitEntry);
+
+  // dispatch to strategy
+  this->dispatchToStrategy(pitEntry, bind(&Strategy::afterReceiveInterest, _1,
+    boost::cref(inFace), boost::cref(interest), fibEntry, pitEntry));
+}
+
+void
+Forwarder::onInterestLoop(Face& inFace, const Interest& interest,
+                          shared_ptr<pit::Entry> pitEntry)
+{
+  NFD_LOG_DEBUG("onInterestLoop face=" << inFace.getId() <<
+                " interest=" << interest.getName());
+
+  // (drop)
+}
+
+/** \brief compare two InRecords for picking outgoing Interest
+ *  \return true if b is preferred over a
+ *
+ *  This function should be passed to std::max_element over InRecordCollection.
+ *  The outgoing Interest picked is the last incoming Interest
+ *  that does not come from outFace.
+ *  If all InRecords come from outFace, it's fine to pick that. This happens when
+ *  there's only one InRecord that comes from outFace. The legit use is for
+ *  vehicular network; otherwise, strategy shouldn't send to the sole inFace.
+ */
+static inline bool
+compare_pickInterest(const pit::InRecord& a, const pit::InRecord& b, const Face* outFace)
+{
+  bool isOutFaceA = a.getFace().get() == outFace;
+  bool isOutFaceB = b.getFace().get() == outFace;
+
+  if (!isOutFaceA && isOutFaceB) {
+    return false;
+  }
+  if (isOutFaceA && !isOutFaceB) {
+    return true;
+  }
+
+  return a.getLastRenewed() > b.getLastRenewed();
+}
+
+void
+Forwarder::onOutgoingInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace)
+{
+  NFD_LOG_DEBUG("onOutgoingInterest face=" << outFace.getId() <<
+                " interest=" << pitEntry->getName());
+
+  // scope control
+  if (pitEntry->violatesScope(outFace)) {
+    NFD_LOG_DEBUG("onOutgoingInterest face=" << outFace.getId() <<
+                  " interest=" << pitEntry->getName() << " violates scope");
+    return;
+  }
+
+  // pick Interest
+  const pit::InRecordCollection& inRecords = pitEntry->getInRecords();
+  pit::InRecordCollection::const_iterator pickedInRecord = std::max_element(
+    inRecords.begin(), inRecords.end(), bind(&compare_pickInterest, _1, _2, &outFace));
+  BOOST_ASSERT(pickedInRecord != inRecords.end());
+  const Interest& interest = pickedInRecord->getInterest();
+
+  // insert OutRecord
+  pitEntry->insertOrUpdateOutRecord(outFace.shared_from_this(), interest);
+
+  // set PIT unsatisfy timer
+  this->setUnsatisfyTimer(pitEntry);
+
+  // send Interest
+  outFace.sendInterest(interest);
+  m_counters.getNOutInterests() ++;
+}
+
+void
+Forwarder::onInterestReject(shared_ptr<pit::Entry> pitEntry)
+{
+  NFD_LOG_DEBUG("onInterestReject interest=" << pitEntry->getName());
+
+  // set PIT straggler timer
+  this->setStragglerTimer(pitEntry);
+}
+
+void
+Forwarder::onInterestUnsatisfied(shared_ptr<pit::Entry> pitEntry)
+{
+  NFD_LOG_DEBUG("onInterestUnsatisfied interest=" << pitEntry->getName());
+
+  // invoke PIT unsatisfied callback
+  this->dispatchToStrategy(pitEntry, bind(&Strategy::beforeExpirePendingInterest, _1,
+    pitEntry));
+
+  // PIT delete
+  m_pit.erase(pitEntry);
+}
+
+void
+Forwarder::onIncomingData(Face& inFace, const Data& data)
+{
+  // receive Data
+  NFD_LOG_DEBUG("onIncomingData face=" << inFace.getId() << " data=" << data.getName());
+  const_cast<Data&>(data).setIncomingFaceId(inFace.getId());
+  m_counters.getNInDatas() ++;
+
+  // /localhost scope control
+  bool isViolatingLocalhost = !inFace.isLocal() &&
+                              LOCALHOST_NAME.isPrefixOf(data.getName());
+  if (isViolatingLocalhost) {
+    NFD_LOG_DEBUG("onIncomingData face=" << inFace.getId() <<
+                  " data=" << data.getName() << " violates /localhost");
+    // (drop)
+    return;
+  }
+
+  // PIT match
+  shared_ptr<pit::DataMatchResult> pitMatches = m_pit.findAllDataMatches(data);
+  if (pitMatches->begin() == pitMatches->end()) {
+    // goto Data unsolicited pipeline
+    this->onDataUnsolicited(inFace, data);
+    return;
+  }
+
+  // CS insert
+  m_cs.insert(data);
+
+  std::set<shared_ptr<Face> > pendingDownstreams;
+  // foreach PitEntry
+  for (pit::DataMatchResult::iterator it = pitMatches->begin();
+       it != pitMatches->end(); ++it) {
+    shared_ptr<pit::Entry> pitEntry = *it;
+    NFD_LOG_DEBUG("onIncomingData matching=" << pitEntry->getName());
+
+    // cancel unsatisfy & straggler timer
+    this->cancelUnsatisfyAndStragglerTimer(pitEntry);
+
+    // remember pending downstreams
+    const pit::InRecordCollection& inRecords = pitEntry->getInRecords();
+    for (pit::InRecordCollection::const_iterator it = inRecords.begin();
+                                                 it != inRecords.end(); ++it) {
+      if (it->getExpiry() > time::steady_clock::now()) {
+        pendingDownstreams.insert(it->getFace());
+      }
+    }
+
+    // mark PIT satisfied
+    pitEntry->deleteInRecords();
+    pitEntry->deleteOutRecord(inFace.shared_from_this());
+
+    // set PIT straggler timer
+    this->setStragglerTimer(pitEntry);
+
+    // invoke PIT satisfy callback
+    this->dispatchToStrategy(pitEntry, bind(&Strategy::beforeSatisfyPendingInterest, _1,
+      pitEntry, boost::cref(inFace), boost::cref(data)));
+  }
+
+  // foreach pending downstream
+  for (std::set<shared_ptr<Face> >::iterator it = pendingDownstreams.begin();
+      it != pendingDownstreams.end(); ++it) {
+    // goto outgoing Data pipeline
+    this->onOutgoingData(data, **it);
+  }
+}
+
+void
+Forwarder::onDataUnsolicited(Face& inFace, const Data& data)
+{
+  // accept to cache?
+  bool acceptToCache = inFace.isLocal();
+  if (acceptToCache) {
+    // CS insert
+    m_cs.insert(data, true);
+  }
+
+  NFD_LOG_DEBUG("onDataUnsolicited face=" << inFace.getId() <<
+                " data=" << data.getName() <<
+                (acceptToCache ? " cached" : " not cached"));
+}
+
+void
+Forwarder::onOutgoingData(const Data& data, Face& outFace)
+{
+  NFD_LOG_DEBUG("onOutgoingData face=" << outFace.getId() << " data=" << data.getName());
+
+  // /localhost scope control
+  bool isViolatingLocalhost = !outFace.isLocal() &&
+                              LOCALHOST_NAME.isPrefixOf(data.getName());
+  if (isViolatingLocalhost) {
+    NFD_LOG_DEBUG("onOutgoingData face=" << outFace.getId() <<
+                  " data=" << data.getName() << " violates /localhost");
+    // (drop)
+    return;
+  }
+
+  // TODO traffic manager
+
+  // send Data
+  outFace.sendData(data);
+  m_counters.getNOutDatas() ++;
+}
+
+static inline bool
+compare_InRecord_expiry(const pit::InRecord& a, const pit::InRecord& b)
+{
+  return a.getExpiry() < b.getExpiry();
+}
+
+void
+Forwarder::setUnsatisfyTimer(shared_ptr<pit::Entry> pitEntry)
+{
+  const pit::InRecordCollection& inRecords = pitEntry->getInRecords();
+  pit::InRecordCollection::const_iterator lastExpiring =
+    std::max_element(inRecords.begin(), inRecords.end(),
+    &compare_InRecord_expiry);
+
+  time::steady_clock::TimePoint lastExpiry = lastExpiring->getExpiry();
+  time::nanoseconds lastExpiryFromNow = lastExpiry  - time::steady_clock::now();
+  if (lastExpiryFromNow <= time::seconds(0)) {
+    // TODO all InRecords are already expired; will this happen?
+  }
+
+  scheduler::cancel(pitEntry->m_unsatisfyTimer);
+  pitEntry->m_unsatisfyTimer = scheduler::schedule(lastExpiryFromNow,
+    bind(&Forwarder::onInterestUnsatisfied, this, pitEntry));
+}
+
+void
+Forwarder::setStragglerTimer(shared_ptr<pit::Entry> pitEntry)
+{
+  if (pitEntry->hasUnexpiredOutRecords()) {
+    NFD_LOG_DEBUG("setStragglerTimer " << pitEntry->getName() <<
+                  " cannot set StragglerTimer when an OutRecord is pending");
+    return;
+  }
+
+  time::nanoseconds stragglerTime = time::milliseconds(100);
+
+  scheduler::cancel(pitEntry->m_stragglerTimer);
+  pitEntry->m_stragglerTimer = scheduler::schedule(stragglerTime,
+    bind(&Pit::erase, &m_pit, pitEntry));
+}
+
+void
+Forwarder::cancelUnsatisfyAndStragglerTimer(shared_ptr<pit::Entry> pitEntry)
+{
+  scheduler::cancel(pitEntry->m_unsatisfyTimer);
+  scheduler::cancel(pitEntry->m_stragglerTimer);
+}
+
+} // namespace nfd
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
new file mode 100644
index 0000000..744338a
--- /dev/null
+++ b/daemon/fw/forwarder.hpp
@@ -0,0 +1,270 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_FORWARDER_HPP
+#define NFD_DAEMON_FW_FORWARDER_HPP
+
+#include "common.hpp"
+#include "core/scheduler.hpp"
+#include "forwarder-counter.hpp"
+#include "face-table.hpp"
+#include "table/fib.hpp"
+#include "table/pit.hpp"
+#include "table/cs.hpp"
+#include "table/measurements.hpp"
+#include "table/strategy-choice.hpp"
+
+namespace nfd {
+
+namespace fw {
+class Strategy;
+} // namespace fw
+
+/** \brief main class of NFD
+ *
+ *  Forwarder owns all faces and tables, and implements forwarding pipelines.
+ */
+class Forwarder
+{
+public:
+  Forwarder();
+
+  VIRTUAL_WITH_TESTS
+  ~Forwarder();
+
+  const ForwarderCounters&
+  getCounters() const;
+
+public: // faces
+  FaceTable&
+  getFaceTable();
+
+  /** \brief get existing Face
+   *
+   *  shortcut to .getFaceTable().get(face)
+   */
+  shared_ptr<Face>
+  getFace(FaceId id) const;
+
+  /** \brief add new Face
+   *
+   *  shortcut to .getFaceTable().add(face)
+   */
+  void
+  addFace(shared_ptr<Face> face);
+
+public: // forwarding entrypoints and tables
+  void
+  onInterest(Face& face, const Interest& interest);
+
+  void
+  onData(Face& face, const Data& data);
+
+  NameTree&
+  getNameTree();
+
+  Fib&
+  getFib();
+
+  Pit&
+  getPit();
+
+  Cs&
+  getCs();
+
+  Measurements&
+  getMeasurements();
+
+  StrategyChoice&
+  getStrategyChoice();
+
+PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
+  /** \brief incoming Interest pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onIncomingInterest(Face& inFace, const Interest& interest);
+
+  /** \brief Interest loop pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onInterestLoop(Face& inFace, const Interest& interest,
+                 shared_ptr<pit::Entry> pitEntry);
+
+  /** \brief outgoing Interest pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onOutgoingInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace);
+
+  /** \brief Interest reject pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onInterestReject(shared_ptr<pit::Entry> pitEntry);
+
+  /** \brief Interest unsatisfied pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onInterestUnsatisfied(shared_ptr<pit::Entry> pitEntry);
+
+  /** \brief incoming Data pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onIncomingData(Face& inFace, const Data& data);
+
+  /** \brief Data unsolicited pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onDataUnsolicited(Face& inFace, const Data& data);
+
+  /** \brief outgoing Data pipeline
+   */
+  VIRTUAL_WITH_TESTS void
+  onOutgoingData(const Data& data, Face& outFace);
+
+PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+  VIRTUAL_WITH_TESTS void
+  setUnsatisfyTimer(shared_ptr<pit::Entry> pitEntry);
+
+  VIRTUAL_WITH_TESTS void
+  setStragglerTimer(shared_ptr<pit::Entry> pitEntry);
+
+  VIRTUAL_WITH_TESTS void
+  cancelUnsatisfyAndStragglerTimer(shared_ptr<pit::Entry> pitEntry);
+
+  /// call trigger (method) on the effective strategy of pitEntry
+#ifdef WITH_TESTS
+  virtual void
+  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> trigger);
+#else
+  template<class Function>
+  void
+  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, Function trigger);
+#endif
+
+private:
+  ForwarderCounters m_counters;
+
+  FaceTable m_faceTable;
+
+  // tables
+  NameTree       m_nameTree;
+  Fib            m_fib;
+  Pit            m_pit;
+  Cs             m_cs;
+  Measurements   m_measurements;
+  StrategyChoice m_strategyChoice;
+
+  static const Name LOCALHOST_NAME;
+
+  // allow Strategy (base class) to enter pipelines
+  friend class fw::Strategy;
+};
+
+inline const ForwarderCounters&
+Forwarder::getCounters() const
+{
+  return m_counters;
+}
+
+inline FaceTable&
+Forwarder::getFaceTable()
+{
+  return m_faceTable;
+}
+
+inline shared_ptr<Face>
+Forwarder::getFace(FaceId id) const
+{
+  return m_faceTable.get(id);
+}
+
+inline void
+Forwarder::addFace(shared_ptr<Face> face)
+{
+  m_faceTable.add(face);
+}
+
+inline void
+Forwarder::onInterest(Face& face, const Interest& interest)
+{
+  this->onIncomingInterest(face, interest);
+}
+
+inline void
+Forwarder::onData(Face& face, const Data& data)
+{
+  this->onIncomingData(face, data);
+}
+
+inline NameTree&
+Forwarder::getNameTree()
+{
+  return m_nameTree;
+}
+
+inline Fib&
+Forwarder::getFib()
+{
+  return m_fib;
+}
+
+inline Pit&
+Forwarder::getPit()
+{
+  return m_pit;
+}
+
+inline Cs&
+Forwarder::getCs()
+{
+  return m_cs;
+}
+
+inline Measurements&
+Forwarder::getMeasurements()
+{
+  return m_measurements;
+}
+
+inline StrategyChoice&
+Forwarder::getStrategyChoice()
+{
+  return m_strategyChoice;
+}
+
+#ifdef WITH_TESTS
+inline void
+Forwarder::dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> trigger)
+#else
+template<class Function>
+inline void
+Forwarder::dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, Function trigger)
+#endif
+{
+  fw::Strategy& strategy = m_strategyChoice.findEffectiveStrategy(*pitEntry);
+  trigger(&strategy);
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_FORWARDER_HPP
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
new file mode 100644
index 0000000..6e7a32c
--- /dev/null
+++ b/daemon/fw/ncc-strategy.cpp
@@ -0,0 +1,304 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "ncc-strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+const Name NccStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/ncc");
+
+NccStrategy::NccStrategy(Forwarder& forwarder, const Name& name)
+  : Strategy(forwarder, name)
+{
+}
+
+NccStrategy::~NccStrategy()
+{
+}
+
+const time::microseconds NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000);
+const time::microseconds NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000);
+const time::nanoseconds NccStrategy::MEASUREMENTS_LIFETIME = time::seconds(16);
+
+void
+NccStrategy::afterReceiveInterest(const Face& inFace,
+                                  const Interest& interest,
+                                  shared_ptr<fib::Entry> fibEntry,
+                                  shared_ptr<pit::Entry> pitEntry)
+{
+  const fib::NextHopList& nexthops = fibEntry->getNextHops();
+  if (nexthops.size() == 0) {
+    this->rejectPendingInterest(pitEntry);
+    return;
+  }
+
+  shared_ptr<PitEntryInfo> pitEntryInfo =
+    pitEntry->getOrCreateStrategyInfo<PitEntryInfo>();
+  bool isNewInterest = pitEntryInfo->isNewInterest;
+  if (!isNewInterest) {
+    return;
+  }
+  pitEntryInfo->isNewInterest = false;
+
+  shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
+    this->getMeasurementsEntryInfo(pitEntry);
+
+  time::microseconds deferFirst = DEFER_FIRST_WITHOUT_BEST_FACE;
+  time::microseconds deferRange = DEFER_RANGE_WITHOUT_BEST_FACE;
+  size_t nUpstreams = nexthops.size();
+
+  shared_ptr<Face> bestFace = measurementsEntryInfo->getBestFace();
+  if (static_cast<bool>(bestFace) && fibEntry->hasNextHop(bestFace) &&
+      pitEntry->canForwardTo(*bestFace)) {
+    // TODO Should we use `randlow = 100 + nrand48(h->seed) % 4096U;` ?
+    deferFirst = measurementsEntryInfo->prediction;
+    deferRange = time::microseconds((deferFirst.count() + 1) / 2);
+    --nUpstreams;
+    this->sendInterest(pitEntry, bestFace);
+    pitEntryInfo->bestFaceTimeout = scheduler::schedule(
+      measurementsEntryInfo->prediction,
+      bind(&NccStrategy::timeoutOnBestFace, this, weak_ptr<pit::Entry>(pitEntry)));
+  }
+  else {
+    // use first nexthop
+    this->sendInterest(pitEntry, nexthops.begin()->getFace());
+    // TODO avoid sending to inFace
+  }
+
+  shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
+  if (static_cast<bool>(previousFace) && fibEntry->hasNextHop(previousFace) &&
+      pitEntry->canForwardTo(*previousFace)) {
+    --nUpstreams;
+  }
+
+  if (nUpstreams > 0) {
+    pitEntryInfo->maxInterval = std::max(time::microseconds(1),
+      time::microseconds((2 * deferRange.count() + nUpstreams - 1) / nUpstreams));
+  }
+  pitEntryInfo->propagateTimer = scheduler::schedule(deferFirst,
+    bind(&NccStrategy::doPropagate, this,
+         weak_ptr<pit::Entry>(pitEntry), weak_ptr<fib::Entry>(fibEntry)));
+}
+
+void
+NccStrategy::doPropagate(weak_ptr<pit::Entry> pitEntryWeak, weak_ptr<fib::Entry> fibEntryWeak)
+{
+  shared_ptr<pit::Entry> pitEntry = pitEntryWeak.lock();
+  if (!static_cast<bool>(pitEntry)) {
+    return;
+  }
+  shared_ptr<fib::Entry> fibEntry = fibEntryWeak.lock();
+  if (!static_cast<bool>(fibEntry)) {
+    return;
+  }
+
+  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
+  // pitEntryInfo is guaranteed to exist here, because doPropagate is triggered
+  // from a timer set by NccStrategy.
+  BOOST_ASSERT(static_cast<bool>(pitEntryInfo));
+
+  shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
+    this->getMeasurementsEntryInfo(pitEntry);
+
+  shared_ptr<Face> previousFace = measurementsEntryInfo->previousFace.lock();
+  if (static_cast<bool>(previousFace) && fibEntry->hasNextHop(previousFace) &&
+      pitEntry->canForwardTo(*previousFace)) {
+    this->sendInterest(pitEntry, previousFace);
+  }
+
+  const fib::NextHopList& nexthops = fibEntry->getNextHops();
+  bool isForwarded = false;
+  for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
+    shared_ptr<Face> face = it->getFace();
+    if (pitEntry->canForwardTo(*face)) {
+      isForwarded = true;
+      this->sendInterest(pitEntry, face);
+      break;
+    }
+  }
+
+  if (isForwarded) {
+    static unsigned short seed[3];
+    time::nanoseconds deferNext = time::nanoseconds(nrand48(seed) % pitEntryInfo->maxInterval.count());
+    pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
+    bind(&NccStrategy::doPropagate, this,
+         weak_ptr<pit::Entry>(pitEntry), weak_ptr<fib::Entry>(fibEntry)));
+  }
+}
+
+void
+NccStrategy::timeoutOnBestFace(weak_ptr<pit::Entry> pitEntryWeak)
+{
+  shared_ptr<pit::Entry> pitEntry = pitEntryWeak.lock();
+  if (!static_cast<bool>(pitEntry)) {
+    return;
+  }
+  shared_ptr<measurements::Entry> measurementsEntry = this->getMeasurements().get(*pitEntry);
+
+  for (int i = 0; i < UPDATE_MEASUREMENTS_N_LEVELS; ++i) {
+    if (!static_cast<bool>(measurementsEntry)) {
+      // going out of this strategy's namespace
+      return;
+    }
+    this->getMeasurements().extendLifetime(*measurementsEntry, MEASUREMENTS_LIFETIME);
+
+    shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
+      this->getMeasurementsEntryInfo(measurementsEntry);
+    measurementsEntryInfo->adjustPredictUp();
+
+    measurementsEntry = this->getMeasurements().getParent(measurementsEntry);
+  }
+}
+
+void
+NccStrategy::beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry,
+                                          const Face& inFace, const Data& data)
+{
+  shared_ptr<measurements::Entry> measurementsEntry = this->getMeasurements().get(*pitEntry);
+
+  for (int i = 0; i < UPDATE_MEASUREMENTS_N_LEVELS; ++i) {
+    if (!static_cast<bool>(measurementsEntry)) {
+      // going out of this strategy's namespace
+      return;
+    }
+    this->getMeasurements().extendLifetime(*measurementsEntry, MEASUREMENTS_LIFETIME);
+
+    shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
+      this->getMeasurementsEntryInfo(measurementsEntry);
+    measurementsEntryInfo->updateBestFace(inFace);
+
+    measurementsEntry = this->getMeasurements().getParent(measurementsEntry);
+  }
+
+  shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
+  if (static_cast<bool>(pitEntryInfo)) {
+    scheduler::cancel(pitEntryInfo->propagateTimer);
+  }
+}
+
+shared_ptr<NccStrategy::MeasurementsEntryInfo>
+NccStrategy::getMeasurementsEntryInfo(shared_ptr<pit::Entry> entry)
+{
+  shared_ptr<measurements::Entry> measurementsEntry = this->getMeasurements().get(*entry);
+  return this->getMeasurementsEntryInfo(measurementsEntry);
+}
+
+shared_ptr<NccStrategy::MeasurementsEntryInfo>
+NccStrategy::getMeasurementsEntryInfo(shared_ptr<measurements::Entry> entry)
+{
+  shared_ptr<MeasurementsEntryInfo> info = entry->getStrategyInfo<MeasurementsEntryInfo>();
+  if (static_cast<bool>(info)) {
+    return info;
+  }
+
+  info = make_shared<MeasurementsEntryInfo>();
+  entry->setStrategyInfo(info);
+
+  shared_ptr<measurements::Entry> parentEntry = this->getMeasurements().getParent(entry);
+  if (static_cast<bool>(parentEntry)) {
+    shared_ptr<MeasurementsEntryInfo> parentInfo = this->getMeasurementsEntryInfo(parentEntry);
+    BOOST_ASSERT(static_cast<bool>(parentInfo));
+    info->inheritFrom(*parentInfo);
+  }
+
+  return info;
+}
+
+
+const time::microseconds NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION =
+                                                             time::microseconds(8192);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION =
+                                                             time::microseconds(127);
+const time::microseconds NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION =
+                                                             time::microseconds(160000);
+
+NccStrategy::MeasurementsEntryInfo::MeasurementsEntryInfo()
+  : prediction(INITIAL_PREDICTION)
+{
+}
+
+void
+NccStrategy::MeasurementsEntryInfo::inheritFrom(const MeasurementsEntryInfo& other)
+{
+  this->operator=(other);
+}
+
+shared_ptr<Face>
+NccStrategy::MeasurementsEntryInfo::getBestFace(void) {
+  shared_ptr<Face> best = this->bestFace.lock();
+  if (static_cast<bool>(best)) {
+    return best;
+  }
+  this->bestFace = best = this->previousFace.lock();
+  return best;
+}
+
+void
+NccStrategy::MeasurementsEntryInfo::updateBestFace(const Face& face) {
+  if (this->bestFace.expired()) {
+    this->bestFace = const_cast<Face&>(face).shared_from_this();
+    return;
+  }
+  shared_ptr<Face> bestFace = this->bestFace.lock();
+  if (bestFace.get() == &face) {
+    this->adjustPredictDown();
+  }
+  else {
+    this->previousFace = this->bestFace;
+    this->bestFace = const_cast<Face&>(face).shared_from_this();
+  }
+}
+
+void
+NccStrategy::MeasurementsEntryInfo::adjustPredictDown() {
+  prediction = std::max(MIN_PREDICTION,
+    time::microseconds(prediction.count() - (prediction.count() >> ADJUST_PREDICT_DOWN_SHIFT)));
+}
+
+void
+NccStrategy::MeasurementsEntryInfo::adjustPredictUp() {
+  prediction = std::min(MAX_PREDICTION,
+    time::microseconds(prediction.count() + (prediction.count() >> ADJUST_PREDICT_UP_SHIFT)));
+}
+
+void
+NccStrategy::MeasurementsEntryInfo::ageBestFace() {
+  this->previousFace = this->bestFace;
+  this->bestFace.reset();
+}
+
+NccStrategy::PitEntryInfo::PitEntryInfo()
+  : isNewInterest(true)
+{
+}
+
+NccStrategy::PitEntryInfo::~PitEntryInfo()
+{
+  scheduler::cancel(this->bestFaceTimeout);
+  scheduler::cancel(this->propagateTimer);
+}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/ncc-strategy.hpp b/daemon/fw/ncc-strategy.hpp
new file mode 100644
index 0000000..f78b840
--- /dev/null
+++ b/daemon/fw/ncc-strategy.hpp
@@ -0,0 +1,135 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_NCC_STRATEGY_HPP
+#define NFD_DAEMON_FW_NCC_STRATEGY_HPP
+
+#include "strategy.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \brief a forwarding strategy similar to CCNx 0.7.2
+ */
+class NccStrategy : public Strategy
+{
+public:
+  NccStrategy(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
+
+  virtual
+  ~NccStrategy();
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry);
+
+  virtual void
+  beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry,
+                               const Face& inFace, const Data& data);
+
+protected:
+  /// StrategyInfo on measurements::Entry
+  class MeasurementsEntryInfo : public StrategyInfo
+  {
+  public:
+    MeasurementsEntryInfo();
+
+    void
+    inheritFrom(const MeasurementsEntryInfo& other);
+
+    shared_ptr<Face>
+    getBestFace();
+
+    void
+    updateBestFace(const Face& face);
+
+    void
+    adjustPredictUp();
+
+  private:
+    void
+    adjustPredictDown();
+
+    void
+    ageBestFace();
+
+  public:
+    weak_ptr<Face> bestFace;
+    weak_ptr<Face> previousFace;
+    time::microseconds prediction;
+
+    static const time::microseconds INITIAL_PREDICTION;
+    static const time::microseconds MIN_PREDICTION;
+    static const int ADJUST_PREDICT_DOWN_SHIFT = 7;
+    static const time::microseconds MAX_PREDICTION;
+    static const int ADJUST_PREDICT_UP_SHIFT = 3;
+  };
+
+  /// StrategyInfo on pit::Entry
+  class PitEntryInfo : public StrategyInfo
+  {
+  public:
+    PitEntryInfo();
+
+    virtual
+    ~PitEntryInfo();
+
+  public:
+    bool isNewInterest;
+    EventId bestFaceTimeout;
+    EventId propagateTimer;
+    time::microseconds maxInterval;
+  };
+
+protected:
+  shared_ptr<MeasurementsEntryInfo>
+  getMeasurementsEntryInfo(shared_ptr<measurements::Entry> entry);
+
+  shared_ptr<MeasurementsEntryInfo>
+  getMeasurementsEntryInfo(shared_ptr<pit::Entry> entry);
+
+  /// propagate to another upstream
+  void
+  doPropagate(weak_ptr<pit::Entry> pitEntryWeak, weak_ptr<fib::Entry> fibEntryWeak);
+
+  /// best face did not reply within prediction
+  void
+  timeoutOnBestFace(weak_ptr<pit::Entry> pitEntryWeak);
+
+public:
+  static const Name STRATEGY_NAME;
+
+protected:
+  static const time::microseconds DEFER_FIRST_WITHOUT_BEST_FACE;
+  static const time::microseconds DEFER_RANGE_WITHOUT_BEST_FACE;
+  static const int UPDATE_MEASUREMENTS_N_LEVELS = 2;
+  static const time::nanoseconds MEASUREMENTS_LIFETIME;
+};
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_NCC_STRATEGY_HPP
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
new file mode 100644
index 0000000..d670f10
--- /dev/null
+++ b/daemon/fw/strategy-info.hpp
@@ -0,0 +1,52 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_STRATEGY_INFO_HPP
+#define NFD_DAEMON_FW_STRATEGY_INFO_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \class StrategyInfo
+ *  \brief contains arbitrary information forwarding strategy places on table entries
+ */
+class StrategyInfo
+{
+public:
+  virtual
+  ~StrategyInfo();
+};
+
+
+inline
+StrategyInfo::~StrategyInfo()
+{
+}
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_STRATEGY_INFO_HPP
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
new file mode 100644
index 0000000..fd6ac5f
--- /dev/null
+++ b/daemon/fw/strategy.cpp
@@ -0,0 +1,79 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "strategy.hpp"
+#include "forwarder.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+namespace fw {
+
+NFD_LOG_INIT("Strategy");
+
+Strategy::Strategy(Forwarder& forwarder, const Name& name)
+  : m_name(name)
+  , m_forwarder(forwarder)
+  , m_measurements(m_forwarder.getMeasurements(),
+                   m_forwarder.getStrategyChoice(), this)
+{
+}
+
+Strategy::~Strategy()
+{
+}
+
+void
+Strategy::beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry,
+                                       const Face& inFace, const Data& data)
+{
+  NFD_LOG_DEBUG("beforeSatisfyPendingInterest pitEntry=" << pitEntry->getName() <<
+    " inFace=" << inFace.getId() << " data=" << data.getName());
+}
+
+void
+Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry)
+{
+  NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
+}
+
+//void
+//Strategy::afterAddFibEntry(shared_ptr<fib::Entry> fibEntry)
+//{
+//  NFD_LOG_DEBUG("afterAddFibEntry fibEntry=" << fibEntry->getPrefix());
+//}
+//
+//void
+//Strategy::afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry)
+//{
+//  NFD_LOG_DEBUG("afterUpdateFibEntry fibEntry=" << fibEntry->getPrefix());
+//}
+//
+//void
+//Strategy::beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry)
+//{
+//  NFD_LOG_DEBUG("beforeRemoveFibEntry fibEntry=" << fibEntry->getPrefix());
+//}
+
+} // namespace fw
+} // namespace nfd
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
new file mode 100644
index 0000000..eaeed26
--- /dev/null
+++ b/daemon/fw/strategy.hpp
@@ -0,0 +1,179 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FW_STRATEGY_HPP
+#define NFD_DAEMON_FW_STRATEGY_HPP
+
+#include "forwarder.hpp"
+#include "table/measurements-accessor.hpp"
+
+namespace nfd {
+namespace fw {
+
+/** \brief represents a forwarding strategy
+ */
+class Strategy : public enable_shared_from_this<Strategy>, noncopyable
+{
+public:
+  Strategy(Forwarder& forwarder, const Name& name);
+
+  virtual
+  ~Strategy();
+
+  /// a Name that represent the Strategy program
+  const Name&
+  getName() const;
+
+public: // triggers
+  /** \brief trigger after Interest is received
+   *
+   *  The Interest:
+   *  - does not violate Scope
+   *  - is not looped
+   *  - cannot be satisfied by ContentStore
+   *  - is under a namespace managed by this strategy
+   *
+   *  The strategy should decide whether and where to forward this Interest.
+   *  - If the strategy decides to forward this Interest,
+   *    invoke this->sendInterest one or more times, either now or shortly after
+   *  - If strategy concludes that this Interest cannot be forwarded,
+   *    invoke this->rejectPendingInterest so that PIT entry will be deleted shortly
+   */
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry) =0;
+
+  /** \brief trigger before PIT entry is satisfied
+   *
+   *  In this base class this method does nothing.
+   */
+  virtual void
+  beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry,
+                               const Face& inFace, const Data& data);
+
+  /** \brief trigger before PIT entry expires
+   *
+   *  PIT entry expires when InterestLifetime has elapsed for all InRecords,
+   *  and it is not satisfied by an incoming Data.
+   *
+   *  This trigger is not invoked for PIT entry already satisfied.
+   *
+   *  In this base class this method does nothing.
+   */
+  virtual void
+  beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry);
+
+//  /** \brief trigger after FIB entry is being inserted
+//   *         and becomes managed by this strategy
+//   *
+//   *  In this base class this method does nothing.
+//   */
+//  virtual void
+//  afterAddFibEntry(shared_ptr<fib::Entry> fibEntry);
+//
+//  /** \brief trigger after FIB entry being managed by this strategy is updated
+//   *
+//   *  In this base class this method does nothing.
+//   */
+//  virtual void
+//  afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry);
+//
+//  /** \brief trigger before FIB entry ceises to be managed by this strategy
+//   *         or is being deleted
+//   *
+//   *  In this base class this method does nothing.
+//   */
+//  virtual void
+//  beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry);
+
+protected: // actions
+  /// send Interest to outFace
+  VIRTUAL_WITH_TESTS void
+  sendInterest(shared_ptr<pit::Entry> pitEntry,
+               shared_ptr<Face> outFace);
+
+  /** \brief decide that a pending Interest cannot be forwarded
+   *
+   *  This shall not be called if the pending Interest has been
+   *  forwarded earlier, and does not need to be resent now.
+   */
+  VIRTUAL_WITH_TESTS void
+  rejectPendingInterest(shared_ptr<pit::Entry> pitEntry);
+
+protected: // accessors
+  MeasurementsAccessor&
+  getMeasurements();
+
+  shared_ptr<Face>
+  getFace(FaceId id);
+
+private:
+  Name m_name;
+
+  /** \brief reference to the forwarder
+   *
+   *  Triggers can access forwarder indirectly via actions.
+   */
+  Forwarder& m_forwarder;
+
+  MeasurementsAccessor m_measurements;
+};
+
+inline const Name&
+Strategy::getName() const
+{
+  return m_name;
+}
+
+inline void
+Strategy::sendInterest(shared_ptr<pit::Entry> pitEntry,
+                       shared_ptr<Face> outFace)
+{
+  m_forwarder.onOutgoingInterest(pitEntry, *outFace);
+}
+
+inline void
+Strategy::rejectPendingInterest(shared_ptr<pit::Entry> pitEntry)
+{
+  m_forwarder.onInterestReject(pitEntry);
+}
+
+inline MeasurementsAccessor&
+Strategy::getMeasurements()
+{
+  return m_measurements;
+}
+
+inline shared_ptr<Face>
+Strategy::getFace(FaceId id)
+{
+  return m_forwarder.getFace(id);
+}
+
+} // namespace fw
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_STRATEGY_HPP
diff --git a/daemon/main.cpp b/daemon/main.cpp
new file mode 100644
index 0000000..4ff0264
--- /dev/null
+++ b/daemon/main.cpp
@@ -0,0 +1,296 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include <getopt.h>
+#include <boost/filesystem.hpp>
+
+#include "core/logger.hpp"
+#include "core/global-io.hpp"
+#include "fw/forwarder.hpp"
+#include "mgmt/internal-face.hpp"
+#include "mgmt/fib-manager.hpp"
+#include "mgmt/face-manager.hpp"
+#include "mgmt/strategy-choice-manager.hpp"
+#include "mgmt/status-server.hpp"
+#include "core/config-file.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("Main");
+
+struct ProgramOptions
+{
+  bool showUsage;
+  bool showModules;
+  std::string config;
+};
+
+class Nfd : noncopyable
+{
+public:
+
+  void
+  initialize(const std::string& configFile)
+  {
+    initializeLogging(configFile);
+
+    m_forwarder = make_shared<Forwarder>();
+
+    initializeManagement(configFile);
+  }
+
+
+  void
+  initializeLogging(const std::string& configFile)
+  {
+    ConfigFile config;
+    LoggerFactory::getInstance().setConfigFile(config);
+
+    for (size_t i = 0; i < N_SUPPORTED_CONFIG_SECTIONS; ++i)
+      {
+        if (SUPPORTED_CONFIG_SECTIONS[i] != "log")
+          {
+            config.addSectionHandler(SUPPORTED_CONFIG_SECTIONS[i],
+                                     bind(std::plus<int>(), 0, 0)); // no-op.
+          }
+      }
+
+    config.parse(configFile, true);
+    config.parse(configFile, false);
+  }
+
+  void
+  initializeManagement(const std::string& configFile)
+  {
+    m_internalFace = make_shared<InternalFace>();
+
+    m_fibManager = make_shared<FibManager>(boost::ref(m_forwarder->getFib()),
+                                           bind(&Forwarder::getFace, m_forwarder.get(), _1),
+                                           m_internalFace);
+
+    m_faceManager = make_shared<FaceManager>(boost::ref(m_forwarder->getFaceTable()),
+                                             m_internalFace);
+
+    m_strategyChoiceManager =
+      make_shared<StrategyChoiceManager>(boost::ref(m_forwarder->getStrategyChoice()),
+                                         m_internalFace);
+
+    m_statusServer = make_shared<StatusServer>(m_internalFace,
+                                               boost::ref(*m_forwarder));
+
+    ConfigFile config;
+    m_internalFace->getValidator().setConfigFile(config);
+
+    m_forwarder->addFace(m_internalFace);
+
+    m_faceManager->setConfigFile(config);
+
+    config.addSectionHandler("log", bind(std::plus<int>(), 0, 0)); // no-op
+
+    // parse config file
+    config.parse(configFile, true);
+    config.parse(configFile, false);
+
+    // add FIB entry for NFD Management Protocol
+    shared_ptr<fib::Entry> entry = m_forwarder->getFib().insert("/localhost/nfd").first;
+    entry->addNextHop(m_internalFace, 0);
+  }
+
+  static void
+  printUsage(std::ostream& os, const std::string& programName)
+  {
+    os << "Usage: \n"
+       << "  " << programName << " [options]\n"
+       << "\n"
+       << "Run NFD forwarding daemon\n"
+       << "\n"
+       << "Options:\n"
+       << "  [--help]   - print this help message\n"
+       << "  [--modules] - list available logging modules\n"
+       << "  [--config /path/to/nfd.conf] - path to configuration file "
+       << "(default: " << DEFAULT_CONFIG_FILE << ")\n"
+      ;
+  }
+
+  static void
+  printModules(std::ostream& os)
+  {
+    using namespace std;
+
+    os << "Available logging modules: \n";
+
+    list<string> modules(LoggerFactory::getInstance().getModules());
+    for (list<string>::const_iterator i = modules.begin(); i != modules.end(); ++i)
+      {
+        os << *i << "\n";
+      }
+  }
+
+  static bool
+  parseCommandLine(int argc, char** argv, ProgramOptions& options)
+  {
+    options.showUsage = false;
+    options.showModules = false;
+    options.config = DEFAULT_CONFIG_FILE;
+
+    while (true) {
+      int optionIndex = 0;
+      static ::option longOptions[] = {
+        { "help"   , no_argument      , 0, 0 },
+        { "modules", no_argument      , 0, 0 },
+        { "config" , required_argument, 0, 0 },
+        { 0        , 0                , 0, 0 }
+      };
+      int c = getopt_long_only(argc, argv, "", longOptions, &optionIndex);
+      if (c == -1)
+        break;
+
+      switch (c) {
+        case 0:
+          switch (optionIndex) {
+            case 0: // help
+              options.showUsage = true;
+              break;
+            case 1: // modules
+              options.showModules = true;
+              break;
+            case 2: // config
+              options.config = ::optarg;
+              break;
+            default:
+              return false;
+          }
+          break;
+      }
+    }
+    return true;
+  }
+
+  void
+  terminate(const boost::system::error_code& error,
+            int signalNo,
+            boost::asio::signal_set& signalSet)
+  {
+    if (error)
+      return;
+
+    if (signalNo == SIGINT ||
+        signalNo == SIGTERM)
+      {
+        getGlobalIoService().stop();
+        std::cout << "Caught signal '" << strsignal(signalNo) << "', exiting..." << std::endl;
+      }
+    else
+      {
+        /// \todo May be try to reload config file (at least security section)
+        signalSet.async_wait(bind(&Nfd::terminate, this, _1, _2,
+                                  boost::ref(signalSet)));
+      }
+  }
+
+private:
+  shared_ptr<Forwarder> m_forwarder;
+
+  shared_ptr<InternalFace>          m_internalFace;
+  shared_ptr<FibManager>            m_fibManager;
+  shared_ptr<FaceManager>           m_faceManager;
+  shared_ptr<StrategyChoiceManager> m_strategyChoiceManager;
+  shared_ptr<StatusServer>          m_statusServer;
+
+  static const std::string SUPPORTED_CONFIG_SECTIONS[];
+  static const size_t      N_SUPPORTED_CONFIG_SECTIONS;
+};
+
+const std::string Nfd::SUPPORTED_CONFIG_SECTIONS[] =
+  {
+    "log",
+    "face_system",
+    "authorizations",
+  };
+
+const size_t Nfd::N_SUPPORTED_CONFIG_SECTIONS =
+  sizeof(SUPPORTED_CONFIG_SECTIONS) / sizeof(std::string);
+
+} // namespace nfd
+
+int
+main(int argc, char** argv)
+{
+  using namespace nfd;
+
+  ProgramOptions options;
+  bool isCommandLineValid = Nfd::parseCommandLine(argc, argv, options);
+  if (!isCommandLineValid) {
+    Nfd::printUsage(std::cerr, argv[0]);
+    return 1;
+  }
+  if (options.showUsage) {
+    Nfd::printUsage(std::cout, argv[0]);
+    return 0;
+  }
+
+  if (options.showModules) {
+    Nfd::printModules(std::cout);
+    return 0;
+  }
+
+  Nfd nfdInstance;
+
+  try {
+    nfdInstance.initialize(options.config);
+  }
+  catch (boost::filesystem::filesystem_error& e) {
+    if (e.code() == boost::system::errc::permission_denied) {
+      NFD_LOG_FATAL("Permissions denied for " << e.path1() << ". " <<
+                    argv[0] << " should be run as superuser");
+    }
+    else {
+      NFD_LOG_FATAL(e.what());
+    }
+    return 1;
+  }
+  catch (const std::exception& e) {
+    NFD_LOG_FATAL(e.what());
+    return 2;
+  }
+
+  boost::asio::signal_set signalSet(getGlobalIoService());
+  signalSet.add(SIGINT);
+  signalSet.add(SIGTERM);
+  signalSet.add(SIGHUP);
+  signalSet.add(SIGUSR1);
+  signalSet.add(SIGUSR2);
+  signalSet.async_wait(bind(&Nfd::terminate, &nfdInstance, _1, _2,
+                            boost::ref(signalSet)));
+
+  try {
+    getGlobalIoService().run();
+  }
+  catch (std::exception& e) {
+    NFD_LOG_FATAL(e.what());
+    return 3;
+  }
+
+  return 0;
+}
diff --git a/daemon/mgmt/app-face.cpp b/daemon/mgmt/app-face.cpp
new file mode 100644
index 0000000..2c9c9b5
--- /dev/null
+++ b/daemon/mgmt/app-face.cpp
@@ -0,0 +1,35 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "app-face.hpp"
+
+namespace nfd {
+
+void
+AppFace::sign(Data& data)
+{
+  m_keyChain.sign(data);
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/app-face.hpp b/daemon/mgmt/app-face.hpp
new file mode 100644
index 0000000..1539b9e
--- /dev/null
+++ b/daemon/mgmt/app-face.hpp
@@ -0,0 +1,58 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_APP_FACE_HPP
+#define NFD_DAEMON_MGMT_APP_FACE_HPP
+
+#include "common.hpp"
+
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+namespace nfd {
+
+typedef function<void(const Name&, const Interest&)> OnInterest;
+
+class AppFace
+{
+public:
+  virtual void
+  setInterestFilter(const Name& filter,
+                    OnInterest onInterest) = 0;
+
+  virtual void
+  sign(Data& data);
+
+  virtual void
+  put(const Data& data) = 0;
+
+  virtual
+  ~AppFace() { }
+
+protected:
+  ndn::KeyChain m_keyChain;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_APP_FACE_HPP
diff --git a/daemon/mgmt/command-validator.cpp b/daemon/mgmt/command-validator.cpp
new file mode 100644
index 0000000..ac08228
--- /dev/null
+++ b/daemon/mgmt/command-validator.cpp
@@ -0,0 +1,201 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "command-validator.hpp"
+#include "core/logger.hpp"
+
+#include <ndn-cpp-dev/util/io.hpp>
+#include <ndn-cpp-dev/security/identity-certificate.hpp>
+
+#include <boost/filesystem.hpp>
+#include <fstream>
+
+namespace nfd {
+
+NFD_LOG_INIT("CommandValidator");
+
+CommandValidator::CommandValidator()
+{
+
+}
+
+CommandValidator::~CommandValidator()
+{
+
+}
+
+void
+CommandValidator::setConfigFile(ConfigFile& configFile)
+{
+  configFile.addSectionHandler("authorizations",
+                               bind(&CommandValidator::onConfig, this, _1, _2, _3));
+}
+
+static inline void
+aggregateErrors(std::stringstream& ss, const std::string& msg)
+{
+  if (!ss.str().empty())
+    {
+      ss << "\n";
+    }
+  ss << msg;
+}
+
+void
+CommandValidator::onConfig(const ConfigSection& section,
+                           bool isDryRun,
+                           const std::string& filename)
+{
+  using namespace boost::filesystem;
+
+  const ConfigSection EMPTY_SECTION;
+
+  if (section.begin() == section.end())
+    {
+      throw ConfigFile::Error("No authorize sections found");
+    }
+
+  std::stringstream dryRunErrors;
+  ConfigSection::const_iterator authIt;
+  for (authIt = section.begin(); authIt != section.end(); authIt++)
+    {
+      std::string certfile;
+      try
+        {
+          certfile = authIt->second.get<std::string>("certfile");
+        }
+      catch (const std::runtime_error& e)
+        {
+          std::string msg = "No certfile specified";
+          if (!isDryRun)
+            {
+              throw ConfigFile::Error(msg);
+            }
+          aggregateErrors(dryRunErrors, msg);
+          continue;
+        }
+
+      path certfilePath = absolute(certfile, path(filename).parent_path());
+      NFD_LOG_DEBUG("generated certfile path: " << certfilePath.native());
+
+      std::ifstream in;
+      in.open(certfilePath.c_str());
+      if (!in.is_open())
+        {
+          std::string msg = "Unable to open certificate file " + certfilePath.native();
+          if (!isDryRun)
+            {
+              throw ConfigFile::Error(msg);
+            }
+          aggregateErrors(dryRunErrors, msg);
+          continue;
+        }
+
+      shared_ptr<ndn::IdentityCertificate> id;
+      try
+        {
+          id = ndn::io::load<ndn::IdentityCertificate>(in);
+        }
+      catch(const std::runtime_error& error)
+        {
+          std::string msg = "Malformed certificate file " + certfilePath.native();
+          if (!isDryRun)
+            {
+              throw ConfigFile::Error(msg);
+            }
+          aggregateErrors(dryRunErrors, msg);
+          continue;
+        }
+
+      in.close();
+
+      const ConfigSection* privileges = 0;
+
+      try
+        {
+          privileges = &authIt->second.get_child("privileges");
+        }
+      catch (const std::runtime_error& error)
+        {
+          std::string msg = "No privileges section found for certificate file " +
+            certfile + " (" + id->getPublicKeyName().toUri() + ")";
+          if (!isDryRun)
+            {
+              throw ConfigFile::Error(msg);
+            }
+          aggregateErrors(dryRunErrors, msg);
+          continue;
+        }
+
+      if (privileges->begin() == privileges->end())
+        {
+          NFD_LOG_WARN("No privileges specified for certificate file " << certfile
+                       << " (" << id->getPublicKeyName().toUri() << ")");
+        }
+
+      ConfigSection::const_iterator privIt;
+      for (privIt = privileges->begin(); privIt != privileges->end(); privIt++)
+        {
+          const std::string& privilegeName = privIt->first;
+          if (m_supportedPrivileges.find(privilegeName) != m_supportedPrivileges.end())
+            {
+              NFD_LOG_INFO("Giving privilege \"" << privilegeName
+                           << "\" to identity " << id->getPublicKeyName());
+              if (!isDryRun)
+                {
+                  const std::string regex = "^<localhost><nfd><" + privilegeName + ">";
+                  m_validator.addInterestRule(regex, *id);
+                }
+            }
+          else
+            {
+              // Invalid configuration
+              std::string msg = "Invalid privilege \"" + privilegeName + "\" for certificate file " +
+                certfile + " (" + id->getPublicKeyName().toUri() + ")";
+              if (!isDryRun)
+                {
+                  throw ConfigFile::Error(msg);
+                }
+              aggregateErrors(dryRunErrors, msg);
+            }
+        }
+    }
+
+  if (!dryRunErrors.str().empty())
+    {
+      throw ConfigFile::Error(dryRunErrors.str());
+    }
+}
+
+void
+CommandValidator::addSupportedPrivilege(const std::string& privilege)
+{
+  if (m_supportedPrivileges.find(privilege) != m_supportedPrivileges.end())
+    {
+      throw CommandValidator::Error("Duplicated privilege: " + privilege);
+    }
+  m_supportedPrivileges.insert(privilege);
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/command-validator.hpp b/daemon/mgmt/command-validator.hpp
new file mode 100644
index 0000000..8456db3
--- /dev/null
+++ b/daemon/mgmt/command-validator.hpp
@@ -0,0 +1,116 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_COMMAND_VALIDATOR_HPP
+#define NFD_DAEMON_MGMT_COMMAND_VALIDATOR_HPP
+
+#include "common.hpp"
+#include "config-file.hpp"
+#include <ndn-cpp-dev/util/command-interest-validator.hpp>
+
+namespace nfd {
+
+class CommandValidator
+{
+public:
+
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+
+    }
+  };
+
+  CommandValidator();
+
+  ~CommandValidator();
+
+  void
+  setConfigFile(ConfigFile& configFile);
+
+  /**
+   * \param section "authorizations" section to parse
+   * \param isDryRun true if performing a dry run of configuration, false otherwise
+   * \param filename filename of configuration file
+   * \throws ConfigFile::Error on parse error
+   */
+  void
+  onConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
+
+  /**
+   * \param privilege name of privilege to add
+   * \throws CommandValidator::Error on duplicated privilege
+   */
+  void
+  addSupportedPrivilege(const std::string& privilege);
+
+  void
+  addInterestRule(const std::string& regex,
+                  const ndn::IdentityCertificate& certificate);
+
+  void
+  addInterestRule(const std::string& regex,
+                  const Name& keyName,
+                  const ndn::PublicKey& publicKey);
+
+  void
+  validate(const Interest& interest,
+           const ndn::OnInterestValidated& onValidated,
+           const ndn::OnInterestValidationFailed& onValidationFailed);
+
+private:
+  ndn::CommandInterestValidator m_validator;
+  std::set<std::string> m_supportedPrivileges;
+};
+
+inline void
+CommandValidator::addInterestRule(const std::string& regex,
+                                  const ndn::IdentityCertificate& certificate)
+{
+  m_validator.addInterestRule(regex, certificate);
+}
+
+inline void
+CommandValidator::addInterestRule(const std::string& regex,
+                                  const Name& keyName,
+                                  const ndn::PublicKey& publicKey)
+{
+  m_validator.addInterestRule(regex, keyName, publicKey);
+}
+
+inline void
+CommandValidator::validate(const Interest& interest,
+                           const ndn::OnInterestValidated& onValidated,
+                           const ndn::OnInterestValidationFailed& onValidationFailed)
+{
+  m_validator.validate(interest, onValidated, onValidationFailed);
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_COMMAND_VALIDATOR_HPP
diff --git a/daemon/mgmt/face-flags.hpp b/daemon/mgmt/face-flags.hpp
new file mode 100644
index 0000000..c4809a0
--- /dev/null
+++ b/daemon/mgmt/face-flags.hpp
@@ -0,0 +1,48 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_FACE_FLAGS_HPP
+#define NFD_DAEMON_MGMT_FACE_FLAGS_HPP
+
+#include "face/face.hpp"
+#include <ndn-cpp-dev/management/nfd-face-flags.hpp>
+
+namespace nfd {
+
+inline uint64_t
+getFaceFlags(const Face& face)
+{
+  uint64_t flags = 0;
+  if (face.isLocal()) {
+    flags |= ndn::nfd::FACE_IS_LOCAL;
+  }
+  if (face.isOnDemand()) {
+    flags |= ndn::nfd::FACE_IS_ON_DEMAND;
+  }
+  return flags;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FACE_FLAGS_HPP
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
new file mode 100644
index 0000000..79822f7
--- /dev/null
+++ b/daemon/mgmt/face-manager.cpp
@@ -0,0 +1,879 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-manager.hpp"
+
+#include "face-flags.hpp"
+#include "core/logger.hpp"
+#include "core/face-uri.hpp"
+#include "core/network-interface.hpp"
+#include "fw/face-table.hpp"
+#include "face/tcp-factory.hpp"
+#include "face/udp-factory.hpp"
+#include "core/config-file.hpp"
+
+#ifdef HAVE_UNIX_SOCKETS
+#include "face/unix-stream-factory.hpp"
+#endif // HAVE_UNIX_SOCKETS
+
+#ifdef HAVE_LIBPCAP
+#include "face/ethernet-factory.hpp"
+#endif // HAVE_LIBPCAP
+
+#include <ndn-cpp-dev/management/nfd-face-event-notification.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("FaceManager");
+
+const Name FaceManager::COMMAND_PREFIX("/localhost/nfd/faces");
+
+const size_t FaceManager::COMMAND_UNSIGNED_NCOMPS =
+  FaceManager::COMMAND_PREFIX.size() +
+  1 + // verb
+  1;  // verb parameters
+
+const size_t FaceManager::COMMAND_SIGNED_NCOMPS =
+  FaceManager::COMMAND_UNSIGNED_NCOMPS +
+  4; // (timestamp, nonce, signed info tlv, signature tlv)
+
+const FaceManager::SignedVerbAndProcessor FaceManager::SIGNED_COMMAND_VERBS[] =
+  {
+    SignedVerbAndProcessor(
+                           Name::Component("create"),
+                           &FaceManager::createFace
+                           ),
+
+    SignedVerbAndProcessor(
+                           Name::Component("destroy"),
+                           &FaceManager::destroyFace
+                           ),
+
+    SignedVerbAndProcessor(
+                           Name::Component("enable-local-control"),
+                           &FaceManager::enableLocalControl
+                           ),
+
+    SignedVerbAndProcessor(
+                           Name::Component("disable-local-control"),
+                           &FaceManager::disableLocalControl
+                           ),
+  };
+
+const FaceManager::UnsignedVerbAndProcessor FaceManager::UNSIGNED_COMMAND_VERBS[] =
+  {
+    UnsignedVerbAndProcessor(
+                             Name::Component("list"),
+                             &FaceManager::listFaces
+                             ),
+
+    UnsignedVerbAndProcessor(
+                             Name::Component("events"),
+                             &FaceManager::ignoreUnsignedVerb
+                             ),
+  };
+
+const Name FaceManager::LIST_COMMAND_PREFIX("/localhost/nfd/faces/list");
+const size_t FaceManager::LIST_COMMAND_NCOMPS = LIST_COMMAND_PREFIX.size();
+
+const Name FaceManager::EVENTS_COMMAND_PREFIX("/localhost/nfd/faces/events");
+
+FaceManager::FaceManager(FaceTable& faceTable,
+                         shared_ptr<InternalFace> face)
+  : ManagerBase(face, FACE_MANAGER_PRIVILEGE)
+  , m_faceTable(faceTable)
+  , m_statusPublisher(m_faceTable, m_face, LIST_COMMAND_PREFIX)
+  , m_notificationStream(m_face, EVENTS_COMMAND_PREFIX)
+  , m_signedVerbDispatch(SIGNED_COMMAND_VERBS,
+                         SIGNED_COMMAND_VERBS +
+                         (sizeof(SIGNED_COMMAND_VERBS) / sizeof(SignedVerbAndProcessor)))
+  , m_unsignedVerbDispatch(UNSIGNED_COMMAND_VERBS,
+                           UNSIGNED_COMMAND_VERBS +
+                           (sizeof(UNSIGNED_COMMAND_VERBS) / sizeof(UnsignedVerbAndProcessor)))
+
+{
+  face->setInterestFilter("/localhost/nfd/faces",
+                          bind(&FaceManager::onFaceRequest, this, _2));
+
+  m_faceTable.onAdd    += bind(&FaceManager::onAddFace, this, _1);
+  m_faceTable.onRemove += bind(&FaceManager::onRemoveFace, this, _1);
+}
+
+FaceManager::~FaceManager()
+{
+
+}
+
+void
+FaceManager::setConfigFile(ConfigFile& configFile)
+{
+  configFile.addSectionHandler("face_system",
+                               bind(&FaceManager::onConfig, this, _1, _2, _3));
+}
+
+
+void
+FaceManager::onConfig(const ConfigSection& configSection,
+                      bool isDryRun,
+                      const std::string& filename)
+{
+  bool hasSeenUnix = false;
+  bool hasSeenTcp = false;
+  bool hasSeenUdp = false;
+  bool hasSeenEther = false;
+
+  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
+
+  for (ConfigSection::const_iterator item = configSection.begin();
+       item != configSection.end();
+       ++item)
+    {
+      if (item->first == "unix")
+        {
+          if (hasSeenUnix)
+            throw Error("Duplicate \"unix\" section");
+          hasSeenUnix = true;
+
+          processSectionUnix(item->second, isDryRun);
+        }
+      else if (item->first == "tcp")
+        {
+          if (hasSeenTcp)
+            throw Error("Duplicate \"tcp\" section");
+          hasSeenTcp = true;
+
+          processSectionTcp(item->second, isDryRun);
+        }
+      else if (item->first == "udp")
+        {
+          if (hasSeenUdp)
+            throw Error("Duplicate \"udp\" section");
+          hasSeenUdp = true;
+
+          processSectionUdp(item->second, isDryRun, nicList);
+        }
+      else if (item->first == "ether")
+        {
+          if (hasSeenEther)
+            throw Error("Duplicate \"ether\" section");
+          hasSeenEther = true;
+
+          processSectionEther(item->second, isDryRun, nicList);
+        }
+      else
+        {
+          throw Error("Unrecognized option \"" + item->first + "\"");
+        }
+    }
+}
+
+void
+FaceManager::processSectionUnix(const ConfigSection& configSection, bool isDryRun)
+{
+  // ; the unix section contains settings of UNIX stream faces and channels
+  // unix
+  // {
+  //   listen yes ; set to 'no' to disable UNIX stream listener, default 'yes'
+  //   path /var/run/nfd.sock ; UNIX stream listener path
+  // }
+
+#if defined(HAVE_UNIX_SOCKETS)
+
+  bool needToListen = true;
+  std::string path = "/var/run/nfd.sock";
+
+  for (ConfigSection::const_iterator i = configSection.begin();
+       i != configSection.end();
+       ++i)
+    {
+      if (i->first == "path")
+        {
+          path = i->second.get_value<std::string>();
+        }
+      else if (i->first == "listen")
+        {
+          needToListen = parseYesNo(i, i->first, "unix");
+        }
+      else
+        {
+          throw ConfigFile::Error("Unrecognized option \"" + i->first + "\" in \"unix\" section");
+        }
+    }
+
+  if (!isDryRun)
+    {
+      shared_ptr<UnixStreamFactory> factory = make_shared<UnixStreamFactory>();
+      shared_ptr<UnixStreamChannel> unixChannel = factory->createChannel(path);
+
+      if (needToListen)
+        {
+          // Should acceptFailed callback be used somehow?
+          unixChannel->listen(bind(&FaceTable::add, &m_faceTable, _1),
+                              UnixStreamChannel::ConnectFailedCallback());
+        }
+
+      m_factories.insert(std::make_pair("unix", factory));
+    }
+#else
+  throw ConfigFile::Error("NFD was compiled without UNIX sockets support, cannot process \"unix\" section");
+#endif // HAVE_UNIX_SOCKETS
+
+}
+
+void
+FaceManager::processSectionTcp(const ConfigSection& configSection, bool isDryRun)
+{
+  // ; the tcp section contains settings of TCP faces and channels
+  // tcp
+  // {
+  //   listen yes ; set to 'no' to disable TCP listener, default 'yes'
+  //   port 6363 ; TCP listener port number
+  // }
+
+  std::string port = "6363";
+  bool needToListen = true;
+  bool enableV4 = true;
+  bool enableV6 = true;
+
+  for (ConfigSection::const_iterator i = configSection.begin();
+       i != configSection.end();
+       ++i)
+    {
+      if (i->first == "port")
+        {
+          port = i->second.get_value<std::string>();
+          try
+            {
+              uint16_t portNo = boost::lexical_cast<uint16_t>(port);
+              NFD_LOG_TRACE("TCP port set to " << portNo);
+            }
+          catch (const std::bad_cast& error)
+            {
+              throw ConfigFile::Error("Invalid value for option " +
+                                      i->first + "\" in \"tcp\" section");
+            }
+        }
+      else if (i->first == "listen")
+        {
+          needToListen = parseYesNo(i, i->first, "tcp");
+        }
+      else if (i->first == "enable_v4")
+        {
+          enableV4 = parseYesNo(i, i->first, "tcp");
+        }
+      else if (i->first == "enable_v6")
+        {
+          enableV6 = parseYesNo(i, i->first, "tcp");
+        }
+      else
+        {
+          throw ConfigFile::Error("Unrecognized option \"" + i->first + "\" in \"tcp\" section");
+        }
+    }
+
+  if (!enableV4 && !enableV6)
+    {
+      throw ConfigFile::Error("IPv4 and IPv6 channels have been disabled."
+                              " Remove \"tcp\" section to disable TCP channels or"
+                              " re-enable at least one channel type.");
+    }
+
+  if (!isDryRun)
+    {
+      shared_ptr<TcpFactory> factory = make_shared<TcpFactory>(boost::cref(port));
+      m_factories.insert(std::make_pair("tcp", factory));
+
+      if (enableV4)
+        {
+          shared_ptr<TcpChannel> ipv4Channel = factory->createChannel("0.0.0.0", port);
+          if (needToListen)
+            {
+              // Should acceptFailed callback be used somehow?
+              ipv4Channel->listen(bind(&FaceTable::add, &m_faceTable, _1),
+                                  TcpChannel::ConnectFailedCallback());
+            }
+
+          m_factories.insert(std::make_pair("tcp4", factory));
+        }
+
+      if (enableV6)
+        {
+          shared_ptr<TcpChannel> ipv6Channel = factory->createChannel("::", port);
+          if (needToListen)
+            {
+              // Should acceptFailed callback be used somehow?
+              ipv6Channel->listen(bind(&FaceTable::add, &m_faceTable, _1),
+                                  TcpChannel::ConnectFailedCallback());
+            }
+
+          m_factories.insert(std::make_pair("tcp6", factory));
+        }
+    }
+}
+
+void
+FaceManager::processSectionUdp(const ConfigSection& configSection,
+                               bool isDryRun,
+                               const std::list<shared_ptr<NetworkInterfaceInfo> >& nicList)
+{
+  // ; the udp section contains settings of UDP faces and channels
+  // udp
+  // {
+  //   port 6363 ; UDP unicast port number
+  //   idle_timeout 30 ; idle time (seconds) before closing a UDP unicast face
+  //   keep_alive_interval 25; interval (seconds) between keep-alive refreshes
+
+  //   ; NFD creates one UDP multicast face per NIC
+  //   mcast yes ; set to 'no' to disable UDP multicast, default 'yes'
+  //   mcast_port 56363 ; UDP multicast port number
+  //   mcast_group 224.0.23.170 ; UDP multicast group (IPv4 only)
+  // }
+
+  std::string port = "6363";
+  bool enableV4 = true;
+  bool enableV6 = true;
+  size_t timeout = 30;
+  size_t keepAliveInterval = 25;
+  bool useMcast = true;
+  std::string mcastGroup = "224.0.23.170";
+  std::string mcastPort = "56363";
+
+
+  for (ConfigSection::const_iterator i = configSection.begin();
+       i != configSection.end();
+       ++i)
+    {
+      if (i->first == "port")
+        {
+          port = i->second.get_value<std::string>();
+          try
+            {
+              uint16_t portNo = boost::lexical_cast<uint16_t>(port);
+              NFD_LOG_TRACE("UDP port set to " << portNo);
+            }
+          catch (const std::bad_cast& error)
+            {
+              throw ConfigFile::Error("Invalid value for option " +
+                                      i->first + "\" in \"udp\" section");
+            }
+        }
+      else if (i->first == "enable_v4")
+        {
+          enableV4 = parseYesNo(i, i->first, "udp");
+        }
+      else if (i->first == "enable_v6")
+        {
+          enableV6 = parseYesNo(i, i->first, "udp");
+        }
+      else if (i->first == "idle_timeout")
+        {
+          try
+            {
+              timeout = i->second.get_value<size_t>();
+            }
+          catch (const std::exception& e)
+            {
+              throw ConfigFile::Error("Invalid value for option \"" +
+                                      i->first + "\" in \"udp\" section");
+            }
+        }
+      else if (i->first == "keep_alive_interval")
+        {
+          try
+            {
+              keepAliveInterval = i->second.get_value<size_t>();
+
+              /// \todo Make use of keepAliveInterval
+              (void)(keepAliveInterval);
+            }
+          catch (const std::exception& e)
+            {
+              throw ConfigFile::Error("Invalid value for option \"" +
+                                      i->first + "\" in \"udp\" section");
+            }
+        }
+      else if (i->first == "mcast")
+        {
+          useMcast = parseYesNo(i, i->first, "udp");
+        }
+      else if (i->first == "mcast_port")
+        {
+          mcastPort = i->second.get_value<std::string>();
+          try
+            {
+              uint16_t portNo = boost::lexical_cast<uint16_t>(mcastPort);
+              NFD_LOG_TRACE("UDP multicast port set to " << portNo);
+            }
+          catch (const std::bad_cast& error)
+            {
+              throw ConfigFile::Error("Invalid value for option " +
+                                      i->first + "\" in \"udp\" section");
+            }
+        }
+      else if (i->first == "mcast_group")
+        {
+          using namespace boost::asio::ip;
+          mcastGroup = i->second.get_value<std::string>();
+          try
+            {
+              address mcastGroupTest = address::from_string(mcastGroup);
+              if (!mcastGroupTest.is_v4())
+                {
+                  throw ConfigFile::Error("Invalid value for option \"" +
+                                          i->first + "\" in \"udp\" section");
+                }
+            }
+          catch(const std::runtime_error& e)
+            {
+              throw ConfigFile::Error("Invalid value for option \"" +
+                                      i->first + "\" in \"udp\" section");
+            }
+        }
+      else
+        {
+          throw ConfigFile::Error("Unrecognized option \"" + i->first + "\" in \"udp\" section");
+        }
+    }
+
+  if (!enableV4 && !enableV6)
+    {
+      throw ConfigFile::Error("IPv4 and IPv6 channels have been disabled."
+                              " Remove \"udp\" section to disable UDP channels or"
+                              " re-enable at least one channel type.");
+    }
+  else if (useMcast && !enableV4)
+    {
+      throw ConfigFile::Error("IPv4 multicast requested, but IPv4 channels"
+                              " have been disabled (conflicting configuration options set)");
+    }
+
+  /// \todo what is keep alive interval used for?
+
+  if (!isDryRun)
+    {
+      shared_ptr<UdpFactory> factory = make_shared<UdpFactory>(boost::cref(port));
+      m_factories.insert(std::make_pair("udp", factory));
+
+      if (enableV4)
+        {
+          shared_ptr<UdpChannel> v4Channel =
+            factory->createChannel("0.0.0.0", port, time::seconds(timeout));
+
+          v4Channel->listen(bind(&FaceTable::add, &m_faceTable, _1),
+                            UdpChannel::ConnectFailedCallback());
+
+          m_factories.insert(std::make_pair("udp4", factory));
+        }
+
+      if (enableV6)
+        {
+          shared_ptr<UdpChannel> v6Channel =
+            factory->createChannel("::", port, time::seconds(timeout));
+
+          v6Channel->listen(bind(&FaceTable::add, &m_faceTable, _1),
+                            UdpChannel::ConnectFailedCallback());
+          m_factories.insert(std::make_pair("udp6", factory));
+        }
+
+      if (useMcast && enableV4)
+        {
+          for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+               i != nicList.end();
+               ++i)
+            {
+              const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+              if (nic->isUp() && nic->isMulticastCapable() && !nic->ipv4Addresses.empty())
+                {
+                  shared_ptr<MulticastUdpFace> newFace =
+                    factory->createMulticastFace(nic->ipv4Addresses[0].to_string(),
+                                                 mcastGroup, mcastPort);
+
+                  addCreatedFaceToForwarder(newFace);
+                }
+            }
+        }
+    }
+}
+
+void
+FaceManager::processSectionEther(const ConfigSection& configSection,
+                                 bool isDryRun,
+                                 const std::list<shared_ptr<NetworkInterfaceInfo> >& nicList)
+{
+  // ; the ether section contains settings of Ethernet faces and channels
+  // ether
+  // {
+  //   ; NFD creates one Ethernet multicast face per NIC
+  //   mcast yes ; set to 'no' to disable Ethernet multicast, default 'yes'
+  //   mcast_group 01:00:5E:00:17:AA ; Ethernet multicast group
+  // }
+
+#if defined(HAVE_LIBPCAP)
+
+  using ethernet::Address;
+
+  bool useMcast = true;
+  Address mcastGroup(ethernet::getDefaultMulticastAddress());
+
+  for (ConfigSection::const_iterator i = configSection.begin();
+       i != configSection.end();
+       ++i)
+    {
+      if (i->first == "mcast")
+        {
+          useMcast = parseYesNo(i, i->first, "ether");
+        }
+
+      else if (i->first == "mcast_group")
+        {
+          mcastGroup = Address::fromString(i->second.get_value<std::string>());
+          if (mcastGroup.isNull())
+            {
+              throw ConfigFile::Error("Invalid value for option \"" +
+                                      i->first + "\" in \"ether\" section");
+            }
+        }
+      else
+        {
+          throw ConfigFile::Error("Unrecognized option \"" + i->first + "\" in \"ether\" section");
+        }
+    }
+
+  if (!isDryRun)
+    {
+      shared_ptr<EthernetFactory> factory = make_shared<EthernetFactory>();
+      m_factories.insert(std::make_pair("ether", factory));
+
+      if (useMcast)
+        {
+          for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
+               i != nicList.end();
+               ++i)
+            {
+              const shared_ptr<NetworkInterfaceInfo>& nic = *i;
+              if (nic->isUp() && nic->isMulticastCapable())
+                {
+                  try
+                    {
+                      shared_ptr<EthernetFace> newFace =
+                        factory->createMulticastFace(nic, mcastGroup);
+
+                      addCreatedFaceToForwarder(newFace);
+                    }
+                  catch (const EthernetFactory::Error& factoryError)
+                    {
+                      NFD_LOG_ERROR(factoryError.what() << ", continuing");
+                    }
+                  catch (const EthernetFace::Error& faceError)
+                    {
+                      NFD_LOG_ERROR(faceError.what() << ", continuing");
+                    }
+                }
+            }
+        }
+    }
+#else
+  throw ConfigFile::Error("NFD was compiled without libpcap, cannot process \"ether\" section");
+#endif // HAVE_LIBPCAP
+}
+
+
+void
+FaceManager::onFaceRequest(const Interest& request)
+{
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+  const Name::Component& verb = command.get(COMMAND_PREFIX.size());
+
+  UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb);
+  if (unsignedVerbProcessor != m_unsignedVerbDispatch.end())
+    {
+      NFD_LOG_DEBUG("command result: processing verb: " << verb);
+      (unsignedVerbProcessor->second)(this, boost::cref(request));
+    }
+  else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
+           commandNComps < COMMAND_SIGNED_NCOMPS)
+    {
+      NFD_LOG_DEBUG("command result: unsigned verb: " << command);
+      sendResponse(command, 401, "Signature required");
+    }
+  else if (commandNComps < COMMAND_SIGNED_NCOMPS ||
+           !COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_DEBUG("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+    }
+  else
+    {
+      validate(request,
+               bind(&FaceManager::onValidatedFaceRequest, this, _1),
+               bind(&ManagerBase::onCommandValidationFailed, this, _1, _2));
+    }
+}
+
+void
+FaceManager::onValidatedFaceRequest(const shared_ptr<const Interest>& request)
+{
+  const Name& command = request->getName();
+  const Name::Component& verb = command[COMMAND_PREFIX.size()];
+  const Name::Component& parameterComponent = command[COMMAND_PREFIX.size() + 1];
+
+  SignedVerbDispatchTable::const_iterator signedVerbProcessor = m_signedVerbDispatch.find(verb);
+  if (signedVerbProcessor != m_signedVerbDispatch.end())
+    {
+      ControlParameters parameters;
+      if (!extractParameters(parameterComponent, parameters))
+        {
+          sendResponse(command, 400, "Malformed command");
+          return;
+        }
+
+      NFD_LOG_DEBUG("command result: processing verb: " << verb);
+      (signedVerbProcessor->second)(this, *request, parameters);
+    }
+  else
+    {
+      NFD_LOG_DEBUG("command result: unsupported verb: " << verb);
+      sendResponse(command, 501, "Unsupported command");
+    }
+
+}
+
+void
+FaceManager::addCreatedFaceToForwarder(const shared_ptr<Face>& newFace)
+{
+  m_faceTable.add(newFace);
+
+  //NFD_LOG_DEBUG("Created face " << newFace->getRemoteUri() << " ID " << newFace->getId());
+}
+
+void
+FaceManager::onCreated(const Name& requestName,
+                       ControlParameters& parameters,
+                       const shared_ptr<Face>& newFace)
+{
+  addCreatedFaceToForwarder(newFace);
+  parameters.setFaceId(newFace->getId());
+
+  sendResponse(requestName, 200, "Success", parameters.wireEncode());
+}
+
+void
+FaceManager::onConnectFailed(const Name& requestName, const std::string& reason)
+{
+  NFD_LOG_DEBUG("Failed to create face: " << reason);
+  sendResponse(requestName, 408, reason);
+}
+
+void
+FaceManager::createFace(const Interest& request,
+                        ControlParameters& parameters)
+{
+  const Name& requestName = request.getName();
+  ndn::nfd::FaceCreateCommand command;
+
+  if (!validateParameters(command, parameters))
+    {
+      sendResponse(requestName, 400, "Malformed command");
+      NFD_LOG_TRACE("invalid control parameters URI");
+      return;
+    }
+
+  FaceUri uri;
+  if (!uri.parse(parameters.getUri()))
+    {
+      sendResponse(requestName, 400, "Malformed command");
+      NFD_LOG_TRACE("failed to parse URI");
+      return;
+    }
+
+  FactoryMap::iterator factory = m_factories.find(uri.getScheme());
+  if (factory == m_factories.end())
+    {
+      sendResponse(requestName, 501, "Unsupported protocol");
+      return;
+    }
+
+  try
+    {
+      factory->second->createFace(uri,
+                                  bind(&FaceManager::onCreated,
+                                       this, requestName, parameters, _1),
+                                  bind(&FaceManager::onConnectFailed,
+                                       this, requestName, _1));
+    }
+  catch (const std::runtime_error& error)
+    {
+      std::string errorMessage = "NFD error: ";
+      errorMessage += error.what();
+
+      NFD_LOG_ERROR(errorMessage);
+      sendResponse(requestName, 500, errorMessage);
+    }
+  catch (const std::logic_error& error)
+    {
+      std::string errorMessage = "NFD error: ";
+      errorMessage += error.what();
+
+      NFD_LOG_ERROR(errorMessage);
+      sendResponse(requestName, 500, errorMessage);
+    }
+}
+
+
+void
+FaceManager::destroyFace(const Interest& request,
+                         ControlParameters& parameters)
+{
+  const Name& requestName = request.getName();
+  ndn::nfd::FaceDestroyCommand command;
+
+  if (!validateParameters(command, parameters))
+    {
+      sendResponse(requestName, 400, "Malformed command");
+      return;
+    }
+
+  shared_ptr<Face> target = m_faceTable.get(parameters.getFaceId());
+  if (static_cast<bool>(target))
+    {
+      target->close();
+    }
+
+  sendResponse(requestName, 200, "Success", parameters.wireEncode());
+
+}
+
+void
+FaceManager::onAddFace(shared_ptr<Face> face)
+{
+  ndn::nfd::FaceEventNotification notification;
+  notification.setKind(ndn::nfd::FACE_EVENT_CREATED)
+              .setFaceId(face->getId())
+              .setRemoteUri(face->getRemoteUri().toString())
+              .setLocalUri(face->getLocalUri().toString())
+              .setFlags(getFaceFlags(*face));
+
+  m_notificationStream.postNotification(notification);
+}
+
+void
+FaceManager::onRemoveFace(shared_ptr<Face> face)
+{
+  ndn::nfd::FaceEventNotification notification;
+  notification.setKind(ndn::nfd::FACE_EVENT_DESTROYED)
+              .setFaceId(face->getId())
+              .setRemoteUri(face->getRemoteUri().toString())
+              .setLocalUri(face->getLocalUri().toString())
+              .setFlags(getFaceFlags(*face));
+
+  m_notificationStream.postNotification(notification);
+}
+
+
+bool
+FaceManager::extractLocalControlParameters(const Interest& request,
+                                           ControlParameters& parameters,
+                                           ControlCommand& command,
+                                           shared_ptr<LocalFace>& outFace,
+                                           LocalControlFeature& outFeature)
+{
+  if (!validateParameters(command, parameters))
+    {
+      sendResponse(request.getName(), 400, "Malformed command");
+      return false;
+    }
+
+  shared_ptr<Face> face = m_faceTable.get(request.getIncomingFaceId());
+
+  if (!static_cast<bool>(face))
+    {
+      NFD_LOG_DEBUG("command result: faceid " << request.getIncomingFaceId() << " not found");
+      sendResponse(request.getName(), 410, "Face not found");
+      return false;
+    }
+  else if (!face->isLocal())
+    {
+      NFD_LOG_DEBUG("command result: cannot enable local control on non-local faceid " <<
+                    face->getId());
+      sendResponse(request.getName(), 412, "Face is non-local");
+      return false;
+    }
+
+  outFace = dynamic_pointer_cast<LocalFace>(face);
+  outFeature = static_cast<LocalControlFeature>(parameters.getLocalControlFeature());
+
+  return true;
+}
+
+void
+FaceManager::enableLocalControl(const Interest& request,
+                                ControlParameters& parameters)
+{
+  ndn::nfd::FaceEnableLocalControlCommand command;
+
+
+  shared_ptr<LocalFace> face;
+  LocalControlFeature feature;
+
+  if (extractLocalControlParameters(request, parameters, command, face, feature))
+    {
+      face->setLocalControlHeaderFeature(feature, true);
+      sendResponse(request.getName(), 200, "Success", parameters.wireEncode());
+    }
+}
+
+void
+FaceManager::disableLocalControl(const Interest& request,
+                                 ControlParameters& parameters)
+{
+  ndn::nfd::FaceDisableLocalControlCommand command;
+  shared_ptr<LocalFace> face;
+  LocalControlFeature feature;
+
+  if (extractLocalControlParameters(request, parameters, command, face, feature))
+    {
+      face->setLocalControlHeaderFeature(feature, false);
+      sendResponse(request.getName(), 200, "Success", parameters.wireEncode());
+    }
+}
+
+void
+FaceManager::listFaces(const Interest& request)
+{
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+
+  if (commandNComps < LIST_COMMAND_NCOMPS ||
+      !LIST_COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_DEBUG("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+      return;
+    }
+
+  m_statusPublisher.publish();
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
new file mode 100644
index 0000000..ed33975
--- /dev/null
+++ b/daemon/mgmt/face-manager.hpp
@@ -0,0 +1,227 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_FACE_MANAGER_HPP
+#define NFD_DAEMON_MGMT_FACE_MANAGER_HPP
+
+#include "common.hpp"
+#include "face/local-face.hpp"
+#include "mgmt/manager-base.hpp"
+#include "mgmt/face-status-publisher.hpp"
+#include "mgmt/notification-stream.hpp"
+
+#include <ndn-cpp-dev/management/nfd-control-parameters.hpp>
+#include <ndn-cpp-dev/management/nfd-control-response.hpp>
+
+namespace nfd {
+
+const std::string FACE_MANAGER_PRIVILEGE = "faces";
+
+class ConfigFile;
+class Face;
+class FaceTable;
+class LocalFace;
+class NetworkInterfaceInfo;
+class ProtocolFactory;
+
+class FaceManager : public ManagerBase
+{
+public:
+  class Error : public ManagerBase::Error
+  {
+  public:
+    Error(const std::string& what) : ManagerBase::Error(what) {}
+  };
+
+  /**
+   * \throws FaceManager::Error if localPort is an invalid port number
+   */
+
+  FaceManager(FaceTable& faceTable,
+              shared_ptr<InternalFace> face);
+
+  virtual
+  ~FaceManager();
+
+  /** \brief Subscribe to a face management section(s) for the config file
+   */
+  void
+  setConfigFile(ConfigFile& configFile);
+
+  void
+  onFaceRequest(const Interest& request);
+
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+  void
+  listFaces(const Interest& request);
+
+PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+
+  void
+  onValidatedFaceRequest(const shared_ptr<const Interest>& request);
+
+  VIRTUAL_WITH_TESTS void
+  createFace(const Interest& request,
+             ControlParameters& parameters);
+
+  VIRTUAL_WITH_TESTS void
+  destroyFace(const Interest& request,
+              ControlParameters& parameters);
+
+  VIRTUAL_WITH_TESTS bool
+  extractLocalControlParameters(const Interest& request,
+                                ControlParameters& parameters,
+                                ControlCommand& command,
+                                shared_ptr<LocalFace>& outFace,
+                                LocalControlFeature& outFeature);
+
+  VIRTUAL_WITH_TESTS void
+  enableLocalControl(const Interest& request,
+                     ControlParameters& parambeters);
+
+  VIRTUAL_WITH_TESTS void
+  disableLocalControl(const Interest& request,
+                      ControlParameters& parameters);
+
+  void
+  ignoreUnsignedVerb(const Interest& request);
+
+  void
+  addCreatedFaceToForwarder(const shared_ptr<Face>& newFace);
+
+  void
+  onCreated(const Name& requestName,
+            ControlParameters& parameters,
+            const shared_ptr<Face>& newFace);
+
+  void
+  onConnectFailed(const Name& requestName, const std::string& reason);
+
+  void
+  onAddFace(shared_ptr<Face> face);
+
+  void
+  onRemoveFace(shared_ptr<Face> face);
+
+private:
+  void
+  onConfig(const ConfigSection& configSection, bool isDryRun, const std::string& filename);
+
+  void
+  processSectionUnix(const ConfigSection& configSection, bool isDryRun);
+
+  void
+  processSectionTcp(const ConfigSection& configSection, bool isDryRun);
+
+  void
+  processSectionUdp(const ConfigSection& configSection,
+                    bool isDryRun,
+                    const std::list<shared_ptr<NetworkInterfaceInfo> >& nicList);
+
+  void
+  processSectionEther(const ConfigSection& configSection,
+                      bool isDryRun,
+                      const std::list<shared_ptr<NetworkInterfaceInfo> >& nicList);
+
+  /** \brief parse a config option that can be either "yes" or "no"
+   *  \throw ConfigFile::Error value is neither "yes" nor "no"
+   *  \return true if "yes", false if "no"
+   */
+  bool
+  parseYesNo(const ConfigSection::const_iterator& i,
+             const std::string& optionName,
+             const std::string& sectionName);
+
+private:
+  typedef std::map< std::string/*protocol*/, shared_ptr<ProtocolFactory> > FactoryMap;
+  FactoryMap m_factories;
+  FaceTable& m_faceTable;
+  FaceStatusPublisher m_statusPublisher;
+  NotificationStream m_notificationStream;
+
+  typedef function<void(FaceManager*,
+                        const Interest&,
+                        ControlParameters&)> SignedVerbProcessor;
+
+  typedef std::map<Name::Component, SignedVerbProcessor> SignedVerbDispatchTable;
+  typedef std::pair<Name::Component, SignedVerbProcessor> SignedVerbAndProcessor;
+
+  typedef function<void(FaceManager*, const Interest&)> UnsignedVerbProcessor;
+
+  typedef std::map<Name::Component, UnsignedVerbProcessor> UnsignedVerbDispatchTable;
+  typedef std::pair<Name::Component, UnsignedVerbProcessor> UnsignedVerbAndProcessor;
+
+
+  const SignedVerbDispatchTable m_signedVerbDispatch;
+  const UnsignedVerbDispatchTable m_unsignedVerbDispatch;
+
+  static const Name COMMAND_PREFIX; // /localhost/nfd/faces
+
+  // number of components in an invalid signed command (i.e. should be signed, but isn't)
+  // (/localhost/nfd/faces + verb + parameters) = 5
+  static const size_t COMMAND_UNSIGNED_NCOMPS;
+
+  // number of components in a valid signed command.
+  // (see UNSIGNED_NCOMPS), 9 with signed Interest support.
+  static const size_t COMMAND_SIGNED_NCOMPS;
+
+  static const SignedVerbAndProcessor SIGNED_COMMAND_VERBS[];
+  static const UnsignedVerbAndProcessor UNSIGNED_COMMAND_VERBS[];
+
+  static const Name LIST_COMMAND_PREFIX;
+  static const size_t LIST_COMMAND_NCOMPS;
+
+  static const Name EVENTS_COMMAND_PREFIX;
+};
+
+inline bool
+FaceManager::parseYesNo(const ConfigSection::const_iterator& i,
+                        const std::string& optionName,
+                        const std::string& sectionName)
+{
+  const std::string value = i->second.get_value<std::string>();
+  if (value == "yes")
+    {
+      return true;
+    }
+  else if (value == "no")
+    {
+      return false;
+    }
+
+  throw ConfigFile::Error("Invalid value for option \"" +
+                          optionName + "\" in \"" +
+                          sectionName + "\" section");
+
+}
+
+inline void
+FaceManager::ignoreUnsignedVerb(const Interest& request)
+{
+  // do nothing
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FACE_MANAGER_HPP
diff --git a/daemon/mgmt/face-status-publisher.cpp b/daemon/mgmt/face-status-publisher.cpp
new file mode 100644
index 0000000..3e0ec42
--- /dev/null
+++ b/daemon/mgmt/face-status-publisher.cpp
@@ -0,0 +1,77 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-status-publisher.hpp"
+#include "face-flags.hpp"
+#include "core/logger.hpp"
+#include "fw/face-table.hpp"
+
+#include <ndn-cpp-dev/management/nfd-face-status.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("FaceStatusPublisher");
+
+
+FaceStatusPublisher::FaceStatusPublisher(const FaceTable& faceTable,
+                                         shared_ptr<AppFace> face,
+                                         const Name& prefix)
+  : SegmentPublisher(face, prefix)
+  , m_faceTable(faceTable)
+{
+
+}
+
+
+FaceStatusPublisher::~FaceStatusPublisher()
+{
+
+}
+
+size_t
+FaceStatusPublisher::generate(ndn::EncodingBuffer& outBuffer)
+{
+  size_t totalLength = 0;
+
+  for (FaceTable::const_reverse_iterator i = m_faceTable.rbegin();
+       i != m_faceTable.rend(); ++i) {
+    const shared_ptr<Face>& face = *i;
+    const FaceCounters& counters = face->getCounters();
+
+    ndn::nfd::FaceStatus status;
+    status.setFaceId(face->getId())
+          .setRemoteUri(face->getRemoteUri().toString())
+          .setLocalUri(face->getLocalUri().toString())
+          .setFlags(getFaceFlags(*face))
+          .setNInInterests(counters.getNInInterests())
+          .setNInDatas(counters.getNInDatas())
+          .setNOutInterests(counters.getNOutInterests())
+          .setNOutDatas(counters.getNOutDatas());
+
+    totalLength += status.wireEncode(outBuffer);
+  }
+  return totalLength;
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/face-status-publisher.hpp b/daemon/mgmt/face-status-publisher.hpp
new file mode 100644
index 0000000..935426d
--- /dev/null
+++ b/daemon/mgmt/face-status-publisher.hpp
@@ -0,0 +1,55 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_FACE_STATUS_PUBLISHER_HPP
+#define NFD_DAEMON_MGMT_FACE_STATUS_PUBLISHER_HPP
+
+#include "mgmt/segment-publisher.hpp"
+
+namespace nfd {
+
+class FaceTable;
+
+class FaceStatusPublisher : public SegmentPublisher
+{
+public:
+  FaceStatusPublisher(const FaceTable& faceTable,
+                      shared_ptr<AppFace> face,
+                      const Name& prefix);
+
+  virtual
+  ~FaceStatusPublisher();
+
+protected:
+
+  virtual size_t
+  generate(ndn::EncodingBuffer& outBuffer);
+
+private:
+  const FaceTable& m_faceTable;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FACE_STATUS_PUBLISHER_HPP
diff --git a/daemon/mgmt/fib-enumeration-publisher.cpp b/daemon/mgmt/fib-enumeration-publisher.cpp
new file mode 100644
index 0000000..daa5908
--- /dev/null
+++ b/daemon/mgmt/fib-enumeration-publisher.cpp
@@ -0,0 +1,86 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fib-enumeration-publisher.hpp"
+#include "core/logger.hpp"
+#include "table/fib.hpp"
+
+#include <ndn-cpp-dev/management/nfd-fib-entry.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("FibEnumerationPublisher");
+
+FibEnumerationPublisher::FibEnumerationPublisher(const Fib& fib,
+                                                 shared_ptr<AppFace> face,
+                                                 const Name& prefix)
+  : SegmentPublisher(face, prefix)
+  , m_fib(fib)
+{
+}
+
+FibEnumerationPublisher::~FibEnumerationPublisher()
+{
+}
+
+size_t
+FibEnumerationPublisher::generate(ndn::EncodingBuffer& outBuffer)
+{
+  size_t totalLength = 0;
+
+  /// \todo Enable use of Fib::const_reverse_iterator (when it is available)
+  for (Fib::const_iterator i = m_fib.begin(); i != m_fib.end(); ++i)
+    {
+      const fib::Entry& entry = *i;
+      const Name& prefix = entry.getPrefix();
+      size_t fibEntryLength = 0;
+
+      ndn::nfd::FibEntry tlvEntry;
+      const fib::NextHopList& nextHops = entry.getNextHops();
+
+      for (fib::NextHopList::const_iterator j = nextHops.begin();
+           j != nextHops.end();
+           ++j)
+        {
+          const fib::NextHop& next = *j;
+          ndn::nfd::NextHopRecord nextHopRecord;
+          nextHopRecord.setFaceId(next.getFace()->getId());
+          nextHopRecord.setCost(next.getCost());
+
+          tlvEntry.addNextHopRecord(nextHopRecord);
+        }
+
+      tlvEntry.setPrefix(prefix);
+      fibEntryLength += tlvEntry.wireEncode(outBuffer);
+
+      NFD_LOG_DEBUG("generate: fib entry length = " << fibEntryLength);
+
+      totalLength += fibEntryLength;
+    }
+  NFD_LOG_DEBUG("generate: Total length = " << totalLength);
+  return totalLength;
+}
+
+
+} // namespace nfd
diff --git a/daemon/mgmt/fib-enumeration-publisher.hpp b/daemon/mgmt/fib-enumeration-publisher.hpp
new file mode 100644
index 0000000..2aa7539
--- /dev/null
+++ b/daemon/mgmt/fib-enumeration-publisher.hpp
@@ -0,0 +1,55 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_FIB_ENUMERATION_PUBLISHER_HPP
+#define NFD_DAEMON_MGMT_FIB_ENUMERATION_PUBLISHER_HPP
+
+#include "mgmt/segment-publisher.hpp"
+
+namespace nfd {
+
+class Fib;
+
+class FibEnumerationPublisher : public SegmentPublisher
+{
+public:
+  FibEnumerationPublisher(const Fib& fib,
+                          shared_ptr<AppFace> face,
+                          const Name& prefix);
+
+  virtual
+  ~FibEnumerationPublisher();
+
+protected:
+
+  virtual size_t
+  generate(ndn::EncodingBuffer& outBuffer);
+
+private:
+  const Fib& m_fib;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FIB_ENUMERATION_PUBLISHER_HPP
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
new file mode 100644
index 0000000..26c3c2e
--- /dev/null
+++ b/daemon/mgmt/fib-manager.cpp
@@ -0,0 +1,272 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fib-manager.hpp"
+
+#include "core/logger.hpp"
+#include "table/fib.hpp"
+#include "fw/forwarder.hpp"
+#include "mgmt/internal-face.hpp"
+#include "mgmt/app-face.hpp"
+
+#include <ndn-cpp-dev/encoding/tlv.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("FibManager");
+
+const Name FibManager::COMMAND_PREFIX = "/localhost/nfd/fib";
+
+const size_t FibManager::COMMAND_UNSIGNED_NCOMPS =
+  FibManager::COMMAND_PREFIX.size() +
+  1 + // verb
+  1;  // verb parameters
+
+const size_t FibManager::COMMAND_SIGNED_NCOMPS =
+  FibManager::COMMAND_UNSIGNED_NCOMPS +
+  4; // (timestamp, nonce, signed info tlv, signature tlv)
+
+const FibManager::SignedVerbAndProcessor FibManager::SIGNED_COMMAND_VERBS[] =
+  {
+
+    SignedVerbAndProcessor(
+                           Name::Component("add-nexthop"),
+                           &FibManager::addNextHop
+                           ),
+
+    SignedVerbAndProcessor(
+                           Name::Component("remove-nexthop"),
+                           &FibManager::removeNextHop
+                           ),
+
+  };
+
+const FibManager::UnsignedVerbAndProcessor FibManager::UNSIGNED_COMMAND_VERBS[] =
+  {
+    UnsignedVerbAndProcessor(
+                             Name::Component("list"),
+                             &FibManager::listEntries
+                             ),
+  };
+
+const Name FibManager::LIST_COMMAND_PREFIX("/localhost/nfd/fib/list");
+const size_t FibManager::LIST_COMMAND_NCOMPS = LIST_COMMAND_PREFIX.size();
+
+
+FibManager::FibManager(Fib& fib,
+                       function<shared_ptr<Face>(FaceId)> getFace,
+                       shared_ptr<InternalFace> face)
+  : ManagerBase(face, FIB_PRIVILEGE)
+  , m_managedFib(fib)
+  , m_getFace(getFace)
+  , m_fibEnumerationPublisher(fib, face, LIST_COMMAND_PREFIX)
+  , m_signedVerbDispatch(SIGNED_COMMAND_VERBS,
+                         SIGNED_COMMAND_VERBS +
+                         (sizeof(SIGNED_COMMAND_VERBS) / sizeof(SignedVerbAndProcessor)))
+  , m_unsignedVerbDispatch(UNSIGNED_COMMAND_VERBS,
+                           UNSIGNED_COMMAND_VERBS +
+                           (sizeof(UNSIGNED_COMMAND_VERBS) / sizeof(UnsignedVerbAndProcessor)))
+{
+  face->setInterestFilter("/localhost/nfd/fib",
+                          bind(&FibManager::onFibRequest, this, _2));
+}
+
+FibManager::~FibManager()
+{
+
+}
+
+void
+FibManager::onFibRequest(const Interest& request)
+{
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+  const Name::Component& verb = command.get(COMMAND_PREFIX.size());
+
+  UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb);
+  if (unsignedVerbProcessor != m_unsignedVerbDispatch.end())
+    {
+      NFD_LOG_DEBUG("command result: processing verb: " << verb);
+      (unsignedVerbProcessor->second)(this, boost::cref(request));
+    }
+  else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
+           commandNComps < COMMAND_SIGNED_NCOMPS)
+    {
+      NFD_LOG_DEBUG("command result: unsigned verb: " << command);
+      sendResponse(command, 401, "Signature required");
+    }
+  else if (commandNComps < COMMAND_SIGNED_NCOMPS ||
+           !COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_DEBUG("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+    }
+  else
+    {
+      validate(request,
+               bind(&FibManager::onValidatedFibRequest, this, _1),
+               bind(&ManagerBase::onCommandValidationFailed, this, _1, _2));
+    }
+}
+
+void
+FibManager::onValidatedFibRequest(const shared_ptr<const Interest>& request)
+{
+  const Name& command = request->getName();
+  const Name::Component& verb = command[COMMAND_PREFIX.size()];
+  const Name::Component& parameterComponent = command[COMMAND_PREFIX.size() + 1];
+
+  SignedVerbDispatchTable::const_iterator signedVerbProcessor = m_signedVerbDispatch.find (verb);
+  if (signedVerbProcessor != m_signedVerbDispatch.end())
+    {
+      ControlParameters parameters;
+      if (!extractParameters(parameterComponent, parameters) || !parameters.hasFaceId())
+        {
+          NFD_LOG_DEBUG("command result: malformed verb: " << verb);
+          sendResponse(command, 400, "Malformed command");
+          return;
+        }
+
+      if (parameters.getFaceId() == 0)
+        {
+          parameters.setFaceId(request->getIncomingFaceId());
+        }
+
+      NFD_LOG_DEBUG("command result: processing verb: " << verb);
+      ControlResponse response;
+      (signedVerbProcessor->second)(this, parameters, response);
+      sendResponse(command, response);
+    }
+  else
+    {
+      NFD_LOG_DEBUG("command result: unsupported verb: " << verb);
+      sendResponse(command, 501, "Unsupported command");
+    }
+}
+
+void
+FibManager::addNextHop(ControlParameters& parameters,
+                       ControlResponse& response)
+{
+  ndn::nfd::FibAddNextHopCommand command;
+
+  if (!validateParameters(command, parameters))
+    {
+      NFD_LOG_DEBUG("add-nexthop result: FAIL reason: malformed");
+      setResponse(response, 400, "Malformed command");
+      return;
+    }
+
+  const Name& prefix = parameters.getName();
+  FaceId faceId = parameters.getFaceId();
+  uint64_t cost = parameters.getCost();
+
+  NFD_LOG_TRACE("add-nexthop prefix: " << prefix
+                << " faceid: " << faceId
+                << " cost: " << cost);
+
+  shared_ptr<Face> nextHopFace = m_getFace(faceId);
+  if (static_cast<bool>(nextHopFace))
+    {
+      shared_ptr<fib::Entry> entry = m_managedFib.insert(prefix).first;
+
+      entry->addNextHop(nextHopFace, cost);
+
+      NFD_LOG_DEBUG("add-nexthop result: OK"
+                    << " prefix:" << prefix
+                    << " faceid: " << faceId
+                    << " cost: " << cost);
+
+      setResponse(response, 200, "Success", parameters.wireEncode());
+    }
+  else
+    {
+      NFD_LOG_DEBUG("add-nexthop result: FAIL reason: unknown-faceid: " << faceId);
+      setResponse(response, 410, "Face not found");
+    }
+}
+
+void
+FibManager::removeNextHop(ControlParameters& parameters,
+                          ControlResponse& response)
+{
+  ndn::nfd::FibRemoveNextHopCommand command;
+  if (!validateParameters(command, parameters))
+    {
+      NFD_LOG_DEBUG("remove-nexthop result: FAIL reason: malformed");
+      setResponse(response, 400, "Malformed command");
+      return;
+    }
+
+  NFD_LOG_TRACE("remove-nexthop prefix: " << parameters.getName()
+                << " faceid: " << parameters.getFaceId());
+
+  shared_ptr<Face> faceToRemove = m_getFace(parameters.getFaceId());
+  if (static_cast<bool>(faceToRemove))
+    {
+      shared_ptr<fib::Entry> entry = m_managedFib.findExactMatch(parameters.getName());
+      if (static_cast<bool>(entry))
+        {
+          entry->removeNextHop(faceToRemove);
+          NFD_LOG_DEBUG("remove-nexthop result: OK prefix: " << parameters.getName()
+                        << " faceid: " << parameters.getFaceId());
+
+          if (!entry->hasNextHops())
+            {
+              m_managedFib.erase(*entry);
+            }
+        }
+      else
+        {
+          NFD_LOG_DEBUG("remove-nexthop result: OK, but entry for face id "
+                        << parameters.getFaceId() << " not found");
+        }
+    }
+  else
+    {
+      NFD_LOG_DEBUG("remove-nexthop result: OK, but face id "
+                    << parameters.getFaceId() << " not found");
+    }
+
+  setResponse(response, 200, "Success", parameters.wireEncode());
+}
+
+void
+FibManager::listEntries(const Interest& request)
+{
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+
+  if (commandNComps < LIST_COMMAND_NCOMPS ||
+      !LIST_COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_DEBUG("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+      return;
+    }
+
+  m_fibEnumerationPublisher.publish();
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/fib-manager.hpp b/daemon/mgmt/fib-manager.hpp
new file mode 100644
index 0000000..4591088
--- /dev/null
+++ b/daemon/mgmt/fib-manager.hpp
@@ -0,0 +1,112 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_FIB_MANAGER_HPP
+#define NFD_DAEMON_MGMT_FIB_MANAGER_HPP
+
+#include "common.hpp"
+#include "mgmt/manager-base.hpp"
+#include "mgmt/fib-enumeration-publisher.hpp"
+
+namespace nfd {
+
+class Face;
+class Forwarder;
+class Fib;
+
+const std::string FIB_PRIVILEGE = "fib"; // config file privilege name
+
+class FibManager : public ManagerBase
+{
+public:
+
+  FibManager(Fib& fib,
+             function<shared_ptr<Face>(FaceId)> getFace,
+             shared_ptr<InternalFace> face);
+
+  virtual
+  ~FibManager();
+
+  void
+  onFibRequest(const Interest& request);
+
+private:
+
+  void
+  onValidatedFibRequest(const shared_ptr<const Interest>& request);
+
+  void
+  addNextHop(ControlParameters& parameters,
+             ControlResponse& response);
+
+  void
+  removeNextHop(ControlParameters& parameters,
+                ControlResponse& response);
+
+  void
+  listEntries(const Interest& request);
+
+private:
+
+  Fib& m_managedFib;
+  function<shared_ptr<Face>(FaceId)> m_getFace;
+  FibEnumerationPublisher m_fibEnumerationPublisher;
+
+  typedef function<void(FibManager*,
+                        ControlParameters&,
+                        ControlResponse&)> SignedVerbProcessor;
+
+  typedef std::map<Name::Component, SignedVerbProcessor> SignedVerbDispatchTable;
+
+  typedef std::pair<Name::Component, SignedVerbProcessor> SignedVerbAndProcessor;
+
+  typedef function<void(FibManager*, const Interest&)> UnsignedVerbProcessor;
+
+  typedef std::map<Name::Component, UnsignedVerbProcessor> UnsignedVerbDispatchTable;
+  typedef std::pair<Name::Component, UnsignedVerbProcessor> UnsignedVerbAndProcessor;
+
+
+  const SignedVerbDispatchTable m_signedVerbDispatch;
+  const UnsignedVerbDispatchTable m_unsignedVerbDispatch;
+
+  static const Name COMMAND_PREFIX; // /localhost/nfd/fib
+
+  // number of components in an invalid, but not malformed, unsigned command.
+  // (/localhost/nfd/fib + verb + parameters) = 5
+  static const size_t COMMAND_UNSIGNED_NCOMPS;
+
+  // number of components in a valid signed Interest.
+  // UNSIGNED_NCOMPS + 4 command Interest components = 9
+  static const size_t COMMAND_SIGNED_NCOMPS;
+
+  static const SignedVerbAndProcessor SIGNED_COMMAND_VERBS[];
+  static const UnsignedVerbAndProcessor UNSIGNED_COMMAND_VERBS[];
+
+  static const Name LIST_COMMAND_PREFIX;
+  static const size_t LIST_COMMAND_NCOMPS;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_FIB_MANAGER_HPP
diff --git a/daemon/mgmt/internal-face.cpp b/daemon/mgmt/internal-face.cpp
new file mode 100644
index 0000000..de77009
--- /dev/null
+++ b/daemon/mgmt/internal-face.cpp
@@ -0,0 +1,161 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "internal-face.hpp"
+#include "core/logger.hpp"
+#include "core/global-io.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("InternalFace");
+
+InternalFace::InternalFace()
+  : Face(FaceUri("internal://"), FaceUri("internal://"), true)
+{
+}
+
+void
+InternalFace::sendInterest(const Interest& interest)
+{
+  onSendInterest(interest);
+
+  // Invoke .processInterest a bit later,
+  // to avoid potential problems in forwarding pipelines.
+  weak_ptr<const Interest> interestWeak = interest.shared_from_this();
+  getGlobalIoService().post(bind(&InternalFace::processInterest,
+                                 this, interestWeak));
+}
+
+void
+InternalFace::processInterest(weak_ptr<const Interest> interestWeak)
+{
+  shared_ptr<const Interest> interestPtr = interestWeak.lock();
+  if (!static_cast<bool>(interestPtr)) {
+    // Interest is gone because it's satisfied and removed from PIT
+    NFD_LOG_DEBUG("processInterest: Interest is gone");
+    return;
+  }
+  const Interest& interest = *interestPtr;
+
+  if (m_interestFilters.size() == 0)
+    {
+      NFD_LOG_DEBUG("no Interest filters to match against");
+      return;
+    }
+
+  const Name& interestName(interest.getName());
+  NFD_LOG_DEBUG("received Interest: " << interestName);
+
+  std::map<Name, OnInterest>::const_iterator filter =
+    m_interestFilters.lower_bound(interestName);
+
+  // lower_bound gives us the first Name that is
+  // an exact match OR ordered after interestName.
+  //
+  // If we reach the end of the map, then we need
+  // only check if the before-end element is a match.
+  //
+  // If we match an element, then the current
+  // position or the previous element are potential
+  // matches.
+  //
+  // If we hit begin, the element is either an exact
+  // match or there is no matching prefix in the map.
+
+
+  if (filter == m_interestFilters.end() && filter != m_interestFilters.begin())
+    {
+      // We hit the end, check if the previous element
+      // is a match
+      --filter;
+      if (filter->first.isPrefixOf(interestName))
+        {
+          NFD_LOG_DEBUG("found Interest filter for " << filter->first << " (before end match)");
+          filter->second(interestName, interest);
+        }
+      else
+        {
+          NFD_LOG_DEBUG("no Interest filter found for " << interestName << " (before end)");
+        }
+    }
+  else if (filter->first == interestName)
+    {
+      NFD_LOG_DEBUG("found Interest filter for " << filter->first << " (exact match)");
+      filter->second(interestName, interest);
+    }
+  else if (filter != m_interestFilters.begin())
+    {
+      // the element we found is canonically
+      // ordered after interestName.
+      // Check the previous element.
+      --filter;
+      if (filter->first.isPrefixOf(interestName))
+        {
+          NFD_LOG_DEBUG("found Interest filter for " << filter->first << " (previous match)");
+          filter->second(interestName, interest);
+        }
+      else
+        {
+          NFD_LOG_DEBUG("no Interest filter found for " << interestName << " (previous)");
+        }
+    }
+  else
+    {
+      NFD_LOG_DEBUG("no Interest filter found for " << interestName << " (begin)");
+    }
+  //Drop Interest
+}
+
+void
+InternalFace::sendData(const Data& data)
+{
+  onSendData(data);
+}
+
+void
+InternalFace::close()
+{
+  throw Error("Internal face cannot be closed");
+}
+
+void
+InternalFace::setInterestFilter(const Name& filter,
+                                OnInterest onInterest)
+{
+  NFD_LOG_INFO("registering callback for " << filter);
+  m_interestFilters[filter] = onInterest;
+}
+
+void
+InternalFace::put(const Data& data)
+{
+  onReceiveData(data);
+}
+
+InternalFace::~InternalFace()
+{
+
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/internal-face.hpp b/daemon/mgmt/internal-face.hpp
new file mode 100644
index 0000000..ff89ac8
--- /dev/null
+++ b/daemon/mgmt/internal-face.hpp
@@ -0,0 +1,97 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
+#define NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
+
+#include "face/face.hpp"
+#include "app-face.hpp"
+
+#include "command-validator.hpp"
+
+namespace nfd {
+
+class InternalFace : public Face, public AppFace
+{
+public:
+  /**
+   * \brief InternalFace-related error
+   */
+  class Error : public Face::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : Face::Error(what)
+    {
+    }
+  };
+
+  InternalFace();
+
+  CommandValidator&
+  getValidator();
+
+  virtual
+  ~InternalFace();
+
+  // Overridden Face methods for forwarder
+
+  virtual void
+  sendInterest(const Interest& interest);
+
+  virtual void
+  sendData(const Data& data);
+
+  virtual void
+  close();
+
+  // Methods implementing AppFace interface. Do not invoke from forwarder.
+
+  virtual void
+  setInterestFilter(const Name& filter,
+                    OnInterest onInterest);
+
+  virtual void
+  put(const Data& data);
+
+private:
+  void
+  processInterest(weak_ptr<const Interest> interestWeak);
+
+private:
+  std::map<Name, OnInterest> m_interestFilters;
+  CommandValidator m_validator;
+};
+
+inline CommandValidator&
+InternalFace::getValidator()
+{
+  return m_validator;
+}
+
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_INTERNAL_FACE_HPP
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
new file mode 100644
index 0000000..114e818
--- /dev/null
+++ b/daemon/mgmt/manager-base.cpp
@@ -0,0 +1,126 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "manager-base.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("ManagerBase");
+
+ManagerBase::ManagerBase(shared_ptr<InternalFace> face, const std::string& privilege)
+  : m_face(face)
+{
+  face->getValidator().addSupportedPrivilege(privilege);
+}
+
+ManagerBase::~ManagerBase()
+{
+
+}
+
+bool
+ManagerBase::extractParameters(const Name::Component& parameterComponent,
+                               ControlParameters& extractedParameters)
+{
+  try
+    {
+      Block rawParameters = parameterComponent.blockFromValue();
+      extractedParameters.wireDecode(rawParameters);
+    }
+  catch (const ndn::Tlv::Error& e)
+    {
+      return false;
+    }
+
+  NFD_LOG_DEBUG("Parameters parsed OK");
+  return true;
+}
+
+void
+ManagerBase::sendResponse(const Name& name,
+                          uint32_t code,
+                          const std::string& text)
+{
+  ControlResponse response(code, text);
+  sendResponse(name, response);
+}
+
+void
+ManagerBase::sendResponse(const Name& name,
+                          uint32_t code,
+                          const std::string& text,
+                          const Block& body)
+{
+  ControlResponse response(code, text);
+  response.setBody(body);
+  sendResponse(name, response);
+}
+
+void
+ManagerBase::sendResponse(const Name& name,
+                          const ControlResponse& response)
+{
+  NFD_LOG_DEBUG("responding"
+                << " name: " << name
+                << " code: " << response.getCode()
+                << " text: " << response.getText());
+
+  const Block& encodedControl = response.wireEncode();
+
+  shared_ptr<Data> responseData(make_shared<Data>(name));
+  responseData->setContent(encodedControl);
+
+  m_face->sign(*responseData);
+  m_face->put(*responseData);
+}
+
+bool
+ManagerBase::validateParameters(const ControlCommand& command,
+                                ControlParameters& parameters)
+{
+  try
+    {
+      command.validateRequest(parameters);
+    }
+  catch (const ControlCommand::ArgumentError& error)
+    {
+      return false;
+    }
+
+  command.applyDefaultsToRequest(parameters);
+
+  return true;
+}
+
+void
+ManagerBase::onCommandValidationFailed(const shared_ptr<const Interest>& command,
+                                       const std::string& error)
+{
+  NFD_LOG_DEBUG("command result: unauthorized command: " << *command);
+  sendResponse(command->getName(), 403, "Unauthorized command");
+}
+
+
+} // namespace nfd
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
new file mode 100644
index 0000000..5d19b2a
--- /dev/null
+++ b/daemon/mgmt/manager-base.hpp
@@ -0,0 +1,162 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_MANAGER_BASE_HPP
+#define NFD_DAEMON_MGMT_MANAGER_BASE_HPP
+
+#include "common.hpp"
+
+#include "mgmt/command-validator.hpp"
+#include "mgmt/internal-face.hpp"
+
+#include <ndn-cpp-dev/management/nfd-control-command.hpp>
+#include <ndn-cpp-dev/management/nfd-control-response.hpp>
+#include <ndn-cpp-dev/management/nfd-control-parameters.hpp>
+
+namespace nfd {
+
+using ndn::nfd::ControlCommand;
+using ndn::nfd::ControlResponse;
+using ndn::nfd::ControlParameters;
+
+class InternalFace;
+
+class ManagerBase
+{
+public:
+
+  struct Error : public std::runtime_error
+  {
+    Error(const std::string& what) : std::runtime_error(what) {}
+  };
+
+  ManagerBase(shared_ptr<InternalFace> face, const std::string& privilege);
+
+  virtual
+  ~ManagerBase();
+
+  void
+  onCommandValidationFailed(const shared_ptr<const Interest>& command,
+                            const std::string& error);
+
+protected:
+
+  static bool
+  extractParameters(const Name::Component& parameterComponent,
+                    ControlParameters& extractedParameters);
+
+  void
+  setResponse(ControlResponse& response,
+              uint32_t code,
+              const std::string& text);
+  void
+  setResponse(ControlResponse& response,
+              uint32_t code,
+              const std::string& text,
+              const Block& body);
+
+  void
+  sendResponse(const Name& name,
+               const ControlResponse& response);
+
+  void
+  sendResponse(const Name& name,
+               uint32_t code,
+               const std::string& text);
+
+  void
+  sendResponse(const Name& name,
+               uint32_t code,
+               const std::string& text,
+               const Block& body);
+
+  virtual bool
+  validateParameters(const ControlCommand& command,
+                     ControlParameters& parameters);
+
+PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+  void
+  addInterestRule(const std::string& regex,
+                  const ndn::IdentityCertificate& certificate);
+
+  void
+  addInterestRule(const std::string& regex,
+                  const Name& keyName,
+                  const ndn::PublicKey& publicKey);
+
+  void
+  validate(const Interest& interest,
+           const ndn::OnInterestValidated& onValidated,
+           const ndn::OnInterestValidationFailed& onValidationFailed);
+
+protected:
+  shared_ptr<InternalFace> m_face;
+};
+
+inline void
+ManagerBase::setResponse(ControlResponse& response,
+                         uint32_t code,
+                         const std::string& text)
+{
+  response.setCode(code);
+  response.setText(text);
+}
+
+inline void
+ManagerBase::setResponse(ControlResponse& response,
+                         uint32_t code,
+                         const std::string& text,
+                         const Block& body)
+{
+  setResponse(response, code, text);
+  response.setBody(body);
+}
+
+inline void
+ManagerBase::addInterestRule(const std::string& regex,
+                             const ndn::IdentityCertificate& certificate)
+{
+  m_face->getValidator().addInterestRule(regex, certificate);
+}
+
+inline void
+ManagerBase::addInterestRule(const std::string& regex,
+                             const Name& keyName,
+                             const ndn::PublicKey& publicKey)
+{
+  m_face->getValidator().addInterestRule(regex, keyName, publicKey);
+}
+
+inline void
+ManagerBase::validate(const Interest& interest,
+                      const ndn::OnInterestValidated& onValidated,
+                      const ndn::OnInterestValidationFailed& onValidationFailed)
+{
+  m_face->getValidator().validate(interest, onValidated, onValidationFailed);
+}
+
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_MANAGER_BASE_HPP
diff --git a/daemon/mgmt/notification-stream.hpp b/daemon/mgmt/notification-stream.hpp
new file mode 100644
index 0000000..8d727d7
--- /dev/null
+++ b/daemon/mgmt/notification-stream.hpp
@@ -0,0 +1,79 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+#ifndef NFD_DAEMON_MGMT_NOTIFICATION_STREAM_HPP
+#define NFD_DAEMON_MGMT_NOTIFICATION_STREAM_HPP
+
+#include "mgmt/app-face.hpp"
+
+namespace nfd {
+
+class NotificationStream
+{
+public:
+  NotificationStream(shared_ptr<AppFace> face, const Name& prefix);
+
+  ~NotificationStream();
+
+  template <typename T> void
+  postNotification(const T& notification);
+
+private:
+  shared_ptr<AppFace> m_face;
+  const Name m_prefix;
+  uint64_t m_sequenceNo;
+};
+
+inline
+NotificationStream::NotificationStream(shared_ptr<AppFace> face, const Name& prefix)
+  : m_face(face)
+  , m_prefix(prefix)
+  , m_sequenceNo(0)
+{
+}
+
+template <typename T>
+inline void
+NotificationStream::postNotification(const T& notification)
+{
+  Name dataName(m_prefix);
+  dataName.appendSegment(m_sequenceNo);
+  shared_ptr<Data> data(make_shared<Data>(dataName));
+  data->setContent(notification.wireEncode());
+  data->setFreshnessPeriod(time::seconds(1));
+
+  m_face->sign(*data);
+  m_face->put(*data);
+
+  ++m_sequenceNo;
+}
+
+inline
+NotificationStream::~NotificationStream()
+{
+}
+
+} // namespace nfd
+
+
+#endif // NFD_DAEMON_MGMT_NOTIFICATION_STREAM_HPP
diff --git a/daemon/mgmt/segment-publisher.cpp b/daemon/mgmt/segment-publisher.cpp
new file mode 100644
index 0000000..fd8a16e
--- /dev/null
+++ b/daemon/mgmt/segment-publisher.cpp
@@ -0,0 +1,101 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "segment-publisher.hpp"
+
+#include "core/logger.hpp"
+#include "face/face.hpp"
+
+#include <ndn-cpp-dev/util/time.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("SegmentPublisher");
+
+SegmentPublisher::SegmentPublisher(shared_ptr<AppFace> face,
+                                   const Name& prefix)
+  : m_face(face)
+  , m_prefix(prefix)
+{
+
+}
+
+
+SegmentPublisher::~SegmentPublisher()
+{
+
+}
+
+void
+SegmentPublisher::publish()
+{
+  Name segmentPrefix(m_prefix);
+  segmentPrefix.appendVersion();
+
+  static const size_t  MAX_SEGMENT_SIZE = MAX_NDN_PACKET_SIZE >> 1;
+
+  ndn::EncodingBuffer buffer;
+
+  generate(buffer);
+
+  const uint8_t* rawBuffer = buffer.buf();
+  const uint8_t* segmentBegin = rawBuffer;
+  const uint8_t* end = rawBuffer + buffer.size();
+
+  uint64_t segmentNo = 0;
+  while (segmentBegin < end)
+    {
+      const uint8_t* segmentEnd = segmentBegin + MAX_SEGMENT_SIZE;
+      if (segmentEnd > end)
+        {
+          segmentEnd = end;
+        }
+
+      Name segmentName(segmentPrefix);
+      segmentName.appendSegment(segmentNo);
+
+      shared_ptr<Data> data(make_shared<Data>(segmentName));
+      data->setContent(segmentBegin, segmentEnd - segmentBegin);
+
+      segmentBegin = segmentEnd;
+      if (segmentBegin >= end)
+        {
+          NFD_LOG_DEBUG("final block is " << segmentNo);
+          data->setFinalBlockId(segmentName[-1]);
+        }
+
+      NFD_LOG_DEBUG("publishing segment #" << segmentNo);
+      publishSegment(data);
+      segmentNo++;
+    }
+}
+
+void
+SegmentPublisher::publishSegment(shared_ptr<Data>& data)
+{
+  m_face->sign(*data);
+  m_face->put(*data);
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/segment-publisher.hpp b/daemon/mgmt/segment-publisher.hpp
new file mode 100644
index 0000000..a01ff76
--- /dev/null
+++ b/daemon/mgmt/segment-publisher.hpp
@@ -0,0 +1,65 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_SEGMENT_PUBLISHER_HPP
+#define NFD_DAEMON_MGMT_SEGMENT_PUBLISHER_HPP
+
+#include "common.hpp"
+#include "mgmt/app-face.hpp"
+
+#include <ndn-cpp-dev/encoding/encoding-buffer.hpp>
+
+namespace nfd {
+
+class AppFace;
+
+class SegmentPublisher : noncopyable
+{
+public:
+  SegmentPublisher(shared_ptr<AppFace> face,
+                   const Name& prefix);
+
+  virtual
+  ~SegmentPublisher();
+
+  void
+  publish();
+
+protected:
+
+  virtual size_t
+  generate(ndn::EncodingBuffer& outBuffer) =0;
+
+private:
+  void
+  publishSegment(shared_ptr<Data>& data);
+
+private:
+  shared_ptr<AppFace> m_face;
+  const Name m_prefix;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_SEGMENT_PUBLISHER_HPP
diff --git a/daemon/mgmt/status-server.cpp b/daemon/mgmt/status-server.cpp
new file mode 100644
index 0000000..148061c
--- /dev/null
+++ b/daemon/mgmt/status-server.cpp
@@ -0,0 +1,83 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "status-server.hpp"
+#include "fw/forwarder.hpp"
+#include "version.hpp"
+
+namespace nfd {
+
+const Name StatusServer::DATASET_PREFIX = "ndn:/localhost/nfd/status";
+const time::milliseconds StatusServer::RESPONSE_FRESHNESS = time::milliseconds(5000);
+
+StatusServer::StatusServer(shared_ptr<AppFace> face, Forwarder& forwarder)
+  : m_face(face)
+  , m_forwarder(forwarder)
+  , m_startTimestamp(time::system_clock::now())
+{
+  m_face->setInterestFilter(DATASET_PREFIX, bind(&StatusServer::onInterest, this, _2));
+}
+
+void
+StatusServer::onInterest(const Interest& interest) const
+{
+  Name name(DATASET_PREFIX);
+  name.appendVersion();
+  name.appendSegment(0);
+
+  shared_ptr<Data> data = make_shared<Data>(name);
+  data->setFreshnessPeriod(RESPONSE_FRESHNESS);
+
+  shared_ptr<ndn::nfd::ForwarderStatus> status = this->collectStatus();
+  data->setContent(status->wireEncode());
+
+  m_face->sign(*data);
+  m_face->put(*data);
+}
+
+shared_ptr<ndn::nfd::ForwarderStatus>
+StatusServer::collectStatus() const
+{
+  shared_ptr<ndn::nfd::ForwarderStatus> status = make_shared<ndn::nfd::ForwarderStatus>();
+
+  status->setNfdVersion(NFD_VERSION);
+  status->setStartTimestamp(m_startTimestamp);
+  status->setCurrentTimestamp(time::system_clock::now());
+
+  status->setNNameTreeEntries(m_forwarder.getNameTree().size());
+  status->setNFibEntries(m_forwarder.getFib().size());
+  status->setNPitEntries(m_forwarder.getPit().size());
+  status->setNMeasurementsEntries(m_forwarder.getMeasurements().size());
+  status->setNCsEntries(m_forwarder.getCs().size());
+
+  const ForwarderCounters& counters = m_forwarder.getCounters();
+  status->setNInInterests(counters.getNInInterests());
+  status->setNInDatas(counters.getNInDatas());
+  status->setNOutInterests(counters.getNOutInterests());
+  status->setNOutDatas(counters.getNOutDatas());
+
+  return status;
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/status-server.hpp b/daemon/mgmt/status-server.hpp
new file mode 100644
index 0000000..60cbf39
--- /dev/null
+++ b/daemon/mgmt/status-server.hpp
@@ -0,0 +1,58 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_STATUS_SERVER_HPP
+#define NFD_DAEMON_MGMT_STATUS_SERVER_HPP
+
+#include "mgmt/app-face.hpp"
+#include <ndn-cpp-dev/management/nfd-forwarder-status.hpp>
+
+namespace nfd {
+
+class Forwarder;
+
+class StatusServer : noncopyable
+{
+public:
+  StatusServer(shared_ptr<AppFace> face, Forwarder& forwarder);
+
+private:
+  void
+  onInterest(const Interest& interest) const;
+
+  shared_ptr<ndn::nfd::ForwarderStatus>
+  collectStatus() const;
+
+private:
+  static const Name DATASET_PREFIX;
+  static const time::milliseconds RESPONSE_FRESHNESS;
+
+  shared_ptr<AppFace> m_face;
+  Forwarder& m_forwarder;
+  time::system_clock::TimePoint m_startTimestamp;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_STATUS_SERVER_HPP
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
new file mode 100644
index 0000000..261358a
--- /dev/null
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -0,0 +1,187 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "strategy-choice-manager.hpp"
+#include "table/strategy-choice.hpp"
+#include "core/logger.hpp"
+#include "mgmt/app-face.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("StrategyChoiceManager");
+
+const Name StrategyChoiceManager::COMMAND_PREFIX = "/localhost/nfd/strategy-choice";
+
+const size_t StrategyChoiceManager::COMMAND_UNSIGNED_NCOMPS =
+  StrategyChoiceManager::COMMAND_PREFIX.size() +
+  1 + // verb
+  1;  // verb parameters
+
+const size_t StrategyChoiceManager::COMMAND_SIGNED_NCOMPS =
+  StrategyChoiceManager::COMMAND_UNSIGNED_NCOMPS +
+  4; // (timestamp, nonce, signed info tlv, signature tlv)
+
+StrategyChoiceManager::StrategyChoiceManager(StrategyChoice& strategyChoice,
+                                             shared_ptr<InternalFace> face)
+  : ManagerBase(face, STRATEGY_CHOICE_PRIVILEGE)
+  , m_strategyChoice(strategyChoice)
+{
+  face->setInterestFilter("/localhost/nfd/strategy-choice",
+                          bind(&StrategyChoiceManager::onStrategyChoiceRequest, this, _2));
+}
+
+StrategyChoiceManager::~StrategyChoiceManager()
+{
+
+}
+
+void
+StrategyChoiceManager::onStrategyChoiceRequest(const Interest& request)
+{
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+
+  if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
+      commandNComps < COMMAND_SIGNED_NCOMPS)
+    {
+      NFD_LOG_DEBUG("command result: unsigned verb: " << command);
+      sendResponse(command, 401, "Signature required");
+
+      return;
+    }
+  else if (commandNComps < COMMAND_SIGNED_NCOMPS ||
+           !COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_DEBUG("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+      return;
+    }
+
+  validate(request,
+           bind(&StrategyChoiceManager::onValidatedStrategyChoiceRequest, this, _1),
+           bind(&ManagerBase::onCommandValidationFailed, this, _1, _2));
+}
+
+void
+StrategyChoiceManager::onValidatedStrategyChoiceRequest(const shared_ptr<const Interest>& request)
+{
+  static const Name::Component VERB_SET("set");
+  static const Name::Component VERB_UNSET("unset");
+
+  const Name& command = request->getName();
+  const Name::Component& parameterComponent = command[COMMAND_PREFIX.size() + 1];
+
+  ControlParameters parameters;
+  if (!extractParameters(parameterComponent, parameters))
+    {
+      sendResponse(command, 400, "Malformed command");
+      return;
+    }
+
+  const Name::Component& verb = command[COMMAND_PREFIX.size()];
+  ControlResponse response;
+  if (verb == VERB_SET)
+    {
+      setStrategy(parameters, response);
+    }
+  else if (verb == VERB_UNSET)
+    {
+      unsetStrategy(parameters, response);
+    }
+  else
+    {
+      NFD_LOG_DEBUG("command result: unsupported verb: " << verb);
+      setResponse(response, 501, "Unsupported command");
+    }
+
+  sendResponse(command, response);
+}
+
+void
+StrategyChoiceManager::setStrategy(ControlParameters& parameters,
+                                   ControlResponse& response)
+{
+  ndn::nfd::StrategyChoiceSetCommand command;
+
+  if (!validateParameters(command, parameters))
+    {
+      NFD_LOG_DEBUG("strategy-choice result: FAIL reason: malformed");
+      setResponse(response, 400, "Malformed command");
+      return;
+    }
+
+  const Name& prefix = parameters.getName();
+  const Name& selectedStrategy = parameters.getStrategy();
+
+  if (!m_strategyChoice.hasStrategy(selectedStrategy))
+    {
+      NFD_LOG_DEBUG("strategy-choice result: FAIL reason: unknown-strategy: "
+                    << parameters.getStrategy());
+      setResponse(response, 504, "Unsupported strategy");
+      return;
+    }
+
+  if (m_strategyChoice.insert(prefix, selectedStrategy))
+    {
+      NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
+      setResponse(response, 200, "Success", parameters.wireEncode());
+    }
+  else
+    {
+      NFD_LOG_DEBUG("strategy-choice result: FAIL reason: not-installed");
+      setResponse(response, 405, "Strategy not installed");
+    }
+}
+
+void
+StrategyChoiceManager::unsetStrategy(ControlParameters& parameters,
+                                     ControlResponse& response)
+{
+  ndn::nfd::StrategyChoiceUnsetCommand command;
+
+  if (!validateParameters(command, parameters))
+    {
+      static const Name ROOT_PREFIX;
+      if (parameters.hasName() && parameters.getName() == ROOT_PREFIX)
+        {
+          NFD_LOG_DEBUG("strategy-choice result: FAIL reason: unset-root");
+          setResponse(response, 403, "Cannot unset root prefix strategy");
+        }
+      else
+        {
+          NFD_LOG_DEBUG("strategy-choice result: FAIL reason: malformed");
+          setResponse(response, 400, "Malformed command");
+        }
+      return;
+    }
+
+  m_strategyChoice.erase(parameters.getName());
+
+  NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
+  setResponse(response, 200, "Success", parameters.wireEncode());
+}
+
+
+
+} // namespace nfd
diff --git a/daemon/mgmt/strategy-choice-manager.hpp b/daemon/mgmt/strategy-choice-manager.hpp
new file mode 100644
index 0000000..94cdb11
--- /dev/null
+++ b/daemon/mgmt/strategy-choice-manager.hpp
@@ -0,0 +1,80 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
+#define NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
+
+#include "mgmt/manager-base.hpp"
+
+#include <ndn-cpp-dev/management/nfd-control-parameters.hpp>
+
+namespace nfd {
+
+const std::string STRATEGY_CHOICE_PRIVILEGE = "strategy-choice";
+
+class StrategyChoice;
+
+class StrategyChoiceManager : public ManagerBase
+{
+public:
+  StrategyChoiceManager(StrategyChoice& strategyChoice,
+                        shared_ptr<InternalFace> face);
+
+  virtual
+  ~StrategyChoiceManager();
+
+  void
+  onStrategyChoiceRequest(const Interest& request);
+
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+  void
+  onValidatedStrategyChoiceRequest(const shared_ptr<const Interest>& request);
+
+  void
+  setStrategy(ControlParameters& parameters,
+              ControlResponse& response);
+
+  void
+  unsetStrategy(ControlParameters& parameters,
+                ControlResponse& response);
+
+private:
+
+  StrategyChoice& m_strategyChoice;
+
+  static const Name COMMAND_PREFIX; // /localhost/nfd/strategy-choice
+
+  // number of components in an invalid, but not malformed, unsigned command.
+  // (/localhost/nfd/strategy-choice + verb + parameters) = 5
+  static const size_t COMMAND_UNSIGNED_NCOMPS;
+
+  // number of components in a valid signed Interest.
+  // (see UNSIGNED_NCOMPS), 9 with signed Interest support.
+  static const size_t COMMAND_SIGNED_NCOMPS;
+
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
new file mode 100644
index 0000000..447c710
--- /dev/null
+++ b/daemon/table/cs-entry.cpp
@@ -0,0 +1,112 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ */
+
+#include "cs-entry.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+namespace cs {
+
+NFD_LOG_INIT("CsEntry");
+
+void
+Entry::release()
+{
+  BOOST_ASSERT(m_layerIterators.empty());
+
+  m_dataPacket.reset();
+  m_digest.reset();
+  m_nameWithDigest.clear();
+}
+
+void
+Entry::setData(const Data& data, bool isUnsolicited)
+{
+  m_isUnsolicited = isUnsolicited;
+  m_dataPacket = data.shared_from_this();
+  m_digest.reset();
+
+  updateStaleTime();
+
+  m_nameWithDigest = data.getName();
+  m_nameWithDigest.append(ndn::name::Component(getDigest()));
+}
+
+void
+Entry::setData(const Data& data, bool isUnsolicited, const ndn::ConstBufferPtr& digest)
+{
+  m_dataPacket = data.shared_from_this();
+  m_digest = digest;
+
+  updateStaleTime();
+
+  m_nameWithDigest = data.getName();
+  m_nameWithDigest.append(ndn::name::Component(getDigest()));
+}
+
+void
+Entry::updateStaleTime()
+{
+  m_staleAt = time::steady_clock::now() + m_dataPacket->getFreshnessPeriod();
+}
+
+const ndn::ConstBufferPtr&
+Entry::getDigest() const
+{
+  if (!static_cast<bool>(m_digest))
+    {
+      const Block& block = m_dataPacket->wireEncode();
+      m_digest = ndn::crypto::sha256(block.wire(), block.size());
+    }
+
+  return m_digest;
+}
+
+void
+Entry::setIterator(int layer, const Entry::LayerIterators::mapped_type& layerIterator)
+{
+  m_layerIterators[layer] = layerIterator;
+}
+
+void
+Entry::removeIterator(int layer)
+{
+  m_layerIterators.erase(layer);
+}
+
+void
+Entry::printIterators() const
+{
+  for (LayerIterators::const_iterator it = m_layerIterators.begin();
+       it != m_layerIterators.end();
+       ++it)
+    {
+      NFD_LOG_TRACE("[" << it->first << "]" << " " << &(*it->second));
+    }
+}
+
+} // namespace cs
+} // namespace nfd
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
new file mode 100644
index 0000000..33f7d64
--- /dev/null
+++ b/daemon/table/cs-entry.hpp
@@ -0,0 +1,169 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ */
+
+#ifndef NFD_DAEMON_TABLE_CS_ENTRY_HPP
+#define NFD_DAEMON_TABLE_CS_ENTRY_HPP
+
+#include "common.hpp"
+#include <ndn-cpp-dev/util/crypto.hpp>
+
+namespace nfd {
+
+namespace cs {
+
+class Entry;
+
+/** \brief represents a CS entry
+ */
+class Entry : noncopyable
+{
+public:
+  typedef std::map<int, std::list<Entry*>::iterator > LayerIterators;
+
+  Entry();
+
+  /** \brief releases reference counts on shared objects
+   */
+  void
+  release();
+
+  /** \brief returns the name of the Data packet stored in the CS entry
+   *  \return{ NDN name }
+   */
+  const Name&
+  getName() const;
+
+  /** \brief Data packet is unsolicited if this particular NDN node
+   *  did not receive an Interest packet for it, or the Interest packet has already expired
+   *  \return{ True if the Data packet is unsolicited; otherwise False  }
+   */
+  bool
+  isUnsolicited() const;
+
+  /** \brief returns the absolute time when Data becomes expired
+   *  \return{ Time (resolution up to time::milliseconds) }
+   */
+  const time::steady_clock::TimePoint&
+  getStaleTime() const;
+
+  /** \brief returns the Data packet stored in the CS entry
+   */
+  const Data&
+  getData() const;
+
+  /** \brief changes the content of CS entry and recomputes digest
+   */
+  void
+  setData(const Data& data, bool isUnsolicited);
+
+  /** \brief changes the content of CS entry and modifies digest
+   */
+  void
+  setData(const Data& data, bool isUnsolicited, const ndn::ConstBufferPtr& digest);
+
+  /** \brief refreshes the time when Data becomes expired
+   *  according to the current absolute time.
+   */
+  void
+  updateStaleTime();
+
+  /** \brief returns the digest of the Data packet stored in the CS entry.
+   */
+  const ndn::ConstBufferPtr&
+  getDigest() const;
+
+  /** \brief saves the iterator pointing to the CS entry on a specific layer of skip list
+   */
+  void
+  setIterator(int layer, const LayerIterators::mapped_type& layerIterator);
+
+  /** \brief removes the iterator pointing to the CS entry on a specific layer of skip list
+   */
+  void
+  removeIterator(int layer);
+
+  /** \brief returns the table containing <layer, iterator> pairs.
+   */
+  const LayerIterators&
+  getIterators() const;
+
+private:
+  /** \brief prints <layer, iterator> pairs.
+   */
+  void
+  printIterators() const;
+
+private:
+  time::steady_clock::TimePoint m_staleAt;
+  shared_ptr<const Data> m_dataPacket;
+
+  bool m_isUnsolicited;
+  Name m_nameWithDigest;
+
+  mutable ndn::ConstBufferPtr m_digest;
+
+  LayerIterators m_layerIterators;
+};
+
+inline
+Entry::Entry()
+{
+}
+
+inline const Name&
+Entry::getName() const
+{
+  return m_nameWithDigest;
+}
+
+inline const Data&
+Entry::getData() const
+{
+  return *m_dataPacket;
+}
+
+inline bool
+Entry::isUnsolicited() const
+{
+  return m_isUnsolicited;
+}
+
+inline const time::steady_clock::TimePoint&
+Entry::getStaleTime() const
+{
+  return m_staleAt;
+}
+
+inline const Entry::LayerIterators&
+Entry::getIterators() const
+{
+  return m_layerIterators;
+}
+
+} // namespace cs
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
new file mode 100644
index 0000000..e5da3fa
--- /dev/null
+++ b/daemon/table/cs.cpp
@@ -0,0 +1,805 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ */
+
+#include "cs.hpp"
+#include "core/logger.hpp"
+#include <ndn-cpp-dev/util/crypto.hpp>
+#include "ndn-cpp-dev/security/signature-sha256-with-rsa.hpp"
+
+#define SKIPLIST_MAX_LAYERS 32
+#define SKIPLIST_PROBABILITY 25         // 25% (p = 1/4)
+
+NFD_LOG_INIT("ContentStore");
+
+namespace nfd {
+
+Cs::Cs(int nMaxPackets)
+  : m_nMaxPackets(nMaxPackets)
+  , m_nPackets(0)
+{
+  SkipListLayer* zeroLayer = new SkipListLayer();
+  m_skipList.push_back(zeroLayer);
+
+  for (size_t i = 0; i < m_nMaxPackets; i++)
+    m_freeCsEntries.push(new cs::Entry());
+}
+
+Cs::~Cs()
+{
+  // evict all items from CS
+  while (evictItem())
+    ;
+
+  BOOST_ASSERT(m_freeCsEntries.size() == m_nMaxPackets);
+
+  while (!m_freeCsEntries.empty())
+    {
+      delete m_freeCsEntries.front();
+      m_freeCsEntries.pop();
+    }
+}
+
+size_t
+Cs::size() const
+{
+  return m_nPackets; // size of the first layer in a skip list
+}
+
+void
+Cs::setLimit(size_t nMaxPackets)
+{
+  m_nMaxPackets = nMaxPackets;
+
+  while (isFull())
+    {
+      if (!evictItem())
+        break;
+    }
+}
+
+size_t
+Cs::getLimit() const
+{
+  return m_nMaxPackets;
+}
+
+//Reference: "Skip Lists: A Probabilistic Alternative to Balanced Trees" by W.Pugh
+std::pair<cs::Entry*, bool>
+Cs::insertToSkipList(const Data& data, bool isUnsolicited)
+{
+  NFD_LOG_TRACE("insertToSkipList() " << data.getName() << ", "
+                << "skipList size " << size());
+
+  BOOST_ASSERT(m_cleanupIndex.size() <= size());
+  BOOST_ASSERT(m_freeCsEntries.size() > 0);
+
+  // take entry for the memory pool
+  cs::Entry* entry = m_freeCsEntries.front();
+  m_freeCsEntries.pop();
+  m_nPackets++;
+  entry->setData(data, isUnsolicited);
+
+  bool insertInFront = false;
+  bool isIterated = false;
+  SkipList::reverse_iterator topLayer = m_skipList.rbegin();
+  SkipListLayer::iterator updateTable[SKIPLIST_MAX_LAYERS];
+  SkipListLayer::iterator head = (*topLayer)->begin();
+
+  if (!(*topLayer)->empty())
+    {
+      //start from the upper layer towards bottom
+      int layer = m_skipList.size() - 1;
+      for (SkipList::reverse_iterator rit = topLayer; rit != m_skipList.rend(); ++rit)
+        {
+          //if we didn't do any iterations on the higher layers, start from the begin() again
+          if (!isIterated)
+            head = (*rit)->begin();
+
+          updateTable[layer] = head;
+
+          if (head != (*rit)->end())
+            {
+              // it can happen when begin() contains the element in front of which we need to insert
+              if (!isIterated && ((*head)->getName() >= entry->getName()))
+                {
+                  --updateTable[layer];
+                  insertInFront = true;
+                }
+              else
+                {
+                  SkipListLayer::iterator it = head;
+
+                  while ((*it)->getName() < entry->getName())
+                    {
+                      head = it;
+                      updateTable[layer] = it;
+                      isIterated = true;
+
+                      ++it;
+                      if (it == (*rit)->end())
+                        break;
+                    }
+                }
+            }
+
+          if (layer > 0)
+            head = (*head)->getIterators().find(layer - 1)->second; // move HEAD to the lower layer
+
+          layer--;
+        }
+    }
+  else
+    {
+      updateTable[0] = (*topLayer)->begin(); //initialization
+    }
+
+  head = updateTable[0];
+  ++head; // look at the next slot to check if it contains a duplicate
+
+  bool isCsEmpty = (size() == 0);
+  bool isInBoundaries = (head != (*m_skipList.begin())->end());
+  bool isNameIdentical = false;
+  if (!isCsEmpty && isInBoundaries)
+    {
+      isNameIdentical = (*head)->getName() == entry->getName();
+    }
+
+  //check if this is a duplicate packet
+  if (isNameIdentical)
+    {
+      NFD_LOG_TRACE("Duplicate name (with digest)");
+
+      (*head)->setData(data, isUnsolicited, entry->getDigest()); //updates stale time
+
+      // new entry not needed, returning to the pool
+      entry->release();
+      m_freeCsEntries.push(entry);
+      m_nPackets--;
+
+      return std::make_pair(*head, false);
+    }
+
+  NFD_LOG_TRACE("Not a duplicate");
+
+  size_t randomLayer = pickRandomLayer();
+
+  while (m_skipList.size() < randomLayer + 1)
+    {
+      SkipListLayer* newLayer = new SkipListLayer();
+      m_skipList.push_back(newLayer);
+
+      updateTable[(m_skipList.size() - 1)] = newLayer->begin();
+    }
+
+  size_t layer = 0;
+  for (SkipList::iterator i = m_skipList.begin();
+       i != m_skipList.end() && layer <= randomLayer; ++i)
+    {
+      if (updateTable[layer] == (*i)->end() && !insertInFront)
+        {
+          (*i)->push_back(entry);
+          SkipListLayer::iterator last = (*i)->end();
+          --last;
+          entry->setIterator(layer, last);
+
+          NFD_LOG_TRACE("pushback " << &(*last));
+        }
+      else if (updateTable[layer] == (*i)->end() && insertInFront)
+        {
+          (*i)->push_front(entry);
+          entry->setIterator(layer, (*i)->begin());
+
+          NFD_LOG_TRACE("pushfront ");
+        }
+      else
+        {
+          NFD_LOG_TRACE("insertafter");
+          ++updateTable[layer]; // insert after
+          SkipListLayer::iterator position = (*i)->insert(updateTable[layer], entry);
+          entry->setIterator(layer, position); // save iterator where item was inserted
+        }
+      layer++;
+    }
+
+  return std::make_pair(entry, true);
+}
+
+bool
+Cs::insert(const Data& data, bool isUnsolicited)
+{
+  NFD_LOG_TRACE("insert() " << data.getName());
+
+  if (isFull())
+    {
+      evictItem();
+    }
+
+  //pointer and insertion status
+  std::pair<cs::Entry*, bool> entry = insertToSkipList(data, isUnsolicited);
+
+  //new entry
+  if (static_cast<bool>(entry.first) && (entry.second == true))
+    {
+      m_cleanupIndex.push_back(entry.first);
+      return true;
+    }
+
+  return false;
+}
+
+size_t
+Cs::pickRandomLayer() const
+{
+  int layer = -1;
+  int randomValue;
+
+  do
+    {
+      layer++;
+      randomValue = rand() % 100 + 1;
+    }
+  while ((randomValue < SKIPLIST_PROBABILITY) && (layer < SKIPLIST_MAX_LAYERS));
+
+  return static_cast<size_t>(layer);
+}
+
+bool
+Cs::isFull() const
+{
+  if (size() >= m_nMaxPackets) //size of the first layer vs. max size
+    return true;
+
+  return false;
+}
+
+bool
+Cs::eraseFromSkipList(cs::Entry* entry)
+{
+  NFD_LOG_TRACE("eraseFromSkipList() "  << entry->getName());
+  NFD_LOG_TRACE("SkipList size " << size());
+
+  bool isErased = false;
+
+  const std::map<int, std::list<cs::Entry*>::iterator>& iterators = entry->getIterators();
+
+  if (!iterators.empty())
+    {
+      int layer = 0;
+
+      for (SkipList::iterator it = m_skipList.begin(); it != m_skipList.end(); )
+        {
+          std::map<int, std::list<cs::Entry*>::iterator>::const_iterator i = iterators.find(layer);
+
+          if (i != iterators.end())
+            {
+              (*it)->erase(i->second);
+              entry->removeIterator(layer);
+              isErased = true;
+
+              //remove layers that do not contain any elements (starting from the second layer)
+              if ((layer != 0) && (*it)->empty())
+                {
+                  delete *it;
+                  it = m_skipList.erase(it);
+                }
+              else
+                ++it;
+
+              layer++;
+            }
+          else
+            break;
+      }
+    }
+
+  //delete entry;
+  if (isErased)
+  {
+    entry->release();
+    m_freeCsEntries.push(entry);
+    m_nPackets--;
+  }
+
+  return isErased;
+}
+
+bool
+Cs::evictItem()
+{
+  NFD_LOG_TRACE("evictItem()");
+
+  if (!m_cleanupIndex.get<unsolicited>().empty() &&
+      (*m_cleanupIndex.get<unsolicited>().begin())->isUnsolicited())
+  {
+    NFD_LOG_TRACE("Evict from unsolicited queue");
+
+    eraseFromSkipList(*m_cleanupIndex.get<unsolicited>().begin());
+    m_cleanupIndex.get<unsolicited>().erase(m_cleanupIndex.get<unsolicited>().begin());
+    return true;
+  }
+
+  if (!m_cleanupIndex.get<byStaleness>().empty() &&
+      (*m_cleanupIndex.get<byStaleness>().begin())->getStaleTime() < time::steady_clock::now())
+  {
+    NFD_LOG_TRACE("Evict from staleness queue");
+
+    eraseFromSkipList(*m_cleanupIndex.get<byStaleness>().begin());
+    m_cleanupIndex.get<byStaleness>().erase(m_cleanupIndex.get<byStaleness>().begin());
+    return true;
+  }
+
+  if (!m_cleanupIndex.get<byArrival>().empty())
+  {
+    NFD_LOG_TRACE("Evict from arrival queue");
+
+    eraseFromSkipList(*m_cleanupIndex.get<byArrival>().begin());
+    m_cleanupIndex.get<byArrival>().erase(m_cleanupIndex.get<byArrival>().begin());
+    return true;
+  }
+
+  return false;
+}
+
+const Data*
+Cs::find(const Interest& interest) const
+{
+  NFD_LOG_TRACE("find() " << interest.getName());
+
+  bool isIterated = false;
+  SkipList::const_reverse_iterator topLayer = m_skipList.rbegin();
+  SkipListLayer::iterator head = (*topLayer)->begin();
+
+  if (!(*topLayer)->empty())
+    {
+      //start from the upper layer towards bottom
+      int layer = m_skipList.size() - 1;
+      for (SkipList::const_reverse_iterator rit = topLayer; rit != m_skipList.rend(); ++rit)
+        {
+          //if we didn't do any iterations on the higher layers, start from the begin() again
+          if (!isIterated)
+            head = (*rit)->begin();
+
+          if (head != (*rit)->end())
+            {
+              // it happens when begin() contains the element we want to find
+              if (!isIterated && (interest.getName().isPrefixOf((*head)->getName())))
+                {
+                  if (layer > 0)
+                    {
+                      layer--;
+                      continue; // try lower layer
+                    }
+                  else
+                    {
+                      isIterated = true;
+                    }
+                }
+              else
+                {
+                  SkipListLayer::iterator it = head;
+
+                  while ((*it)->getName() < interest.getName())
+                    {
+                      NFD_LOG_TRACE((*it)->getName() << " < " << interest.getName());
+                      head = it;
+                      isIterated = true;
+
+                      ++it;
+                      if (it == (*rit)->end())
+                        break;
+                    }
+                }
+            }
+
+          if (layer > 0)
+            {
+              head = (*head)->getIterators().find(layer - 1)->second; // move HEAD to the lower layer
+            }
+          else //if we reached the first layer
+            {
+              if (isIterated)
+                return selectChild(interest, head);
+            }
+
+          layer--;
+        }
+    }
+
+  return 0;
+}
+
+const Data*
+Cs::selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) const
+{
+  BOOST_ASSERT(startingPoint != (*m_skipList.begin())->end());
+
+  if (startingPoint != (*m_skipList.begin())->begin())
+    {
+      BOOST_ASSERT((*startingPoint)->getName() < interest.getName());
+    }
+
+  NFD_LOG_TRACE("selectChild() " << interest.getChildSelector() << " "
+                << (*startingPoint)->getName());
+
+  bool hasLeftmostSelector = (interest.getChildSelector() <= 0);
+  bool hasRightmostSelector = !hasLeftmostSelector;
+
+  if (hasLeftmostSelector)
+    {
+      bool doesInterestContainDigest = recognizeInterestWithDigest(interest, *startingPoint);
+      bool isInPrefix = false;
+
+      if (doesInterestContainDigest)
+        {
+          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getName());
+        }
+      else
+        {
+          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getName());
+        }
+
+      if (isInPrefix)
+        {
+          if (doesComplyWithSelectors(interest, *startingPoint, doesInterestContainDigest))
+            {
+              return &(*startingPoint)->getData();
+            }
+        }
+    }
+
+  //iterate to the right
+  SkipListLayer::iterator rightmost = startingPoint;
+  if (startingPoint != (*m_skipList.begin())->end())
+    {
+      SkipListLayer::iterator rightmostCandidate = startingPoint;
+      Name currentChildPrefix("");
+
+      while (true)
+        {
+          ++rightmostCandidate;
+
+          bool isInBoundaries = (rightmostCandidate != (*m_skipList.begin())->end());
+          bool isInPrefix = false;
+          bool doesInterestContainDigest = false;
+          if (isInBoundaries)
+            {
+              doesInterestContainDigest = recognizeInterestWithDigest(interest,
+                                                                      *rightmostCandidate);
+
+              if (doesInterestContainDigest)
+                {
+                  isInPrefix = interest.getName().getPrefix(-1)
+                                 .isPrefixOf((*rightmostCandidate)->getName());
+                }
+              else
+                {
+                  isInPrefix = interest.getName().isPrefixOf((*rightmostCandidate)->getName());
+                }
+            }
+
+          if (isInPrefix)
+            {
+              if (doesComplyWithSelectors(interest, *rightmostCandidate, doesInterestContainDigest))
+                {
+                  if (hasLeftmostSelector)
+                    {
+                      return &(*rightmostCandidate)->getData();
+                    }
+
+                  if (hasRightmostSelector)
+                    {
+                      if (doesInterestContainDigest)
+                        {
+                          // get prefix which is one component longer than Interest name
+                          // (without digest)
+                          const Name& childPrefix = (*rightmostCandidate)->getName()
+                                                      .getPrefix(interest.getName().size());
+                          NFD_LOG_TRACE("Child prefix" << childPrefix);
+
+                          if (currentChildPrefix.empty() || (childPrefix != currentChildPrefix))
+                            {
+                              currentChildPrefix = childPrefix;
+                              rightmost = rightmostCandidate;
+                            }
+                        }
+                      else
+                        {
+                          // get prefix which is one component longer than Interest name
+                          const Name& childPrefix = (*rightmostCandidate)->getName()
+                                                      .getPrefix(interest.getName().size() + 1);
+                          NFD_LOG_TRACE("Child prefix" << childPrefix);
+
+                          if (currentChildPrefix.empty() || (childPrefix != currentChildPrefix))
+                            {
+                              currentChildPrefix = childPrefix;
+                              rightmost = rightmostCandidate;
+                            }
+                        }
+                    }
+                }
+            }
+          else
+            break;
+        }
+    }
+
+  if (rightmost != startingPoint)
+    {
+      return &(*rightmost)->getData();
+    }
+
+  if (hasRightmostSelector) // if rightmost was not found, try starting point
+    {
+      bool doesInterestContainDigest = recognizeInterestWithDigest(interest, *startingPoint);
+      bool isInPrefix = false;
+
+      if (doesInterestContainDigest)
+        {
+          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getName());
+        }
+      else
+        {
+          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getName());
+        }
+
+      if (isInPrefix)
+        {
+          if (doesComplyWithSelectors(interest, *startingPoint, doesInterestContainDigest))
+            {
+              return &(*startingPoint)->getData();
+            }
+        }
+    }
+
+  return 0;
+}
+
+bool
+Cs::doesComplyWithSelectors(const Interest& interest,
+                            cs::Entry* entry,
+                            bool doesInterestContainDigest) const
+{
+  NFD_LOG_TRACE("doesComplyWithSelectors()");
+
+  /// \todo The following detection is not correct
+  ///       1. If data name ends with 32-octet component doesn't mean that this component is digest
+  ///       2. Only min/max selectors (both 0) can be specified, all other selectors do not
+  ///          make sense for interests with digest (though not sure if we need to enforce this)
+
+  if (doesInterestContainDigest)
+    {
+      const ndn::name::Component& last = interest.getName().get(-1);
+      const ndn::ConstBufferPtr& digest = entry->getDigest();
+
+      BOOST_ASSERT(digest->size() == last.value_size());
+      BOOST_ASSERT(digest->size() == ndn::crypto::SHA256_DIGEST_SIZE);
+
+      if (std::memcmp(digest->buf(), last.value(), ndn::crypto::SHA256_DIGEST_SIZE) != 0)
+        {
+          NFD_LOG_TRACE("violates implicit digest");
+          return false;
+        }
+    }
+
+  if (!doesInterestContainDigest)
+    {
+      if (interest.getMinSuffixComponents() >= 0)
+        {
+          size_t minDataNameLength = interest.getName().size() + interest.getMinSuffixComponents();
+
+          bool isSatisfied = (minDataNameLength <= entry->getName().size());
+          if (!isSatisfied)
+            {
+              NFD_LOG_TRACE("violates minComponents");
+              return false;
+            }
+        }
+
+      if (interest.getMaxSuffixComponents() >= 0)
+        {
+          size_t maxDataNameLength = interest.getName().size() + interest.getMaxSuffixComponents();
+
+          bool isSatisfied = (maxDataNameLength >= entry->getName().size());
+          if (!isSatisfied)
+            {
+              NFD_LOG_TRACE("violates maxComponents");
+              return false;
+            }
+        }
+    }
+
+  if (interest.getMustBeFresh() && entry->getStaleTime() < time::steady_clock::now())
+    {
+      NFD_LOG_TRACE("violates mustBeFresh");
+      return false;
+    }
+
+  if (!interest.getPublisherPublicKeyLocator().empty())
+    {
+      if (entry->getData().getSignature().getType() == ndn::Signature::Sha256WithRsa)
+        {
+          ndn::SignatureSha256WithRsa rsaSignature(entry->getData().getSignature());
+          if (rsaSignature.getKeyLocator() != interest.getPublisherPublicKeyLocator())
+            {
+              NFD_LOG_TRACE("violates publisher key selector");
+              return false;
+            }
+        }
+      else
+        {
+          NFD_LOG_TRACE("violates publisher key selector");
+          return false;
+        }
+    }
+
+  if (doesInterestContainDigest)
+    {
+      const ndn::name::Component& lastComponent = entry->getName().get(-1);
+
+      if (!lastComponent.empty())
+        {
+          if (interest.getExclude().isExcluded(lastComponent))
+            {
+              NFD_LOG_TRACE("violates exclusion");
+              return false;
+            }
+        }
+    }
+  else
+    {
+      if (entry->getName().size() >= interest.getName().size() + 1)
+        {
+          const ndn::name::Component& nextComponent = entry->getName()
+                                                        .get(interest.getName().size());
+          if (!nextComponent.empty())
+            {
+              if (interest.getExclude().isExcluded(nextComponent))
+                {
+                  NFD_LOG_TRACE("violates exclusion");
+                  return false;
+                }
+            }
+        }
+    }
+
+  NFD_LOG_TRACE("complies");
+  return true;
+}
+
+bool
+Cs::recognizeInterestWithDigest(const Interest& interest, cs::Entry* entry) const
+{
+  // only when min selector is not specified or specified with value of 0
+  // and Interest's name length is exactly the length of the name of CS entry
+  if (interest.getMinSuffixComponents() <= 0 &&
+      interest.getName().size() == (entry->getName().size()))
+    {
+      const ndn::name::Component& last = interest.getName().get(-1);
+      if (last.value_size() == ndn::crypto::SHA256_DIGEST_SIZE)
+        {
+          NFD_LOG_TRACE("digest recognized");
+          return true;
+        }
+    }
+
+  return false;
+}
+
+void
+Cs::erase(const Name& exactName)
+{
+  NFD_LOG_TRACE("insert() " << exactName << ", "
+                << "skipList size " << size());
+
+  bool isIterated = false;
+  SkipListLayer::iterator updateTable[SKIPLIST_MAX_LAYERS];
+  SkipList::reverse_iterator topLayer = m_skipList.rbegin();
+  SkipListLayer::iterator head = (*topLayer)->begin();
+
+  if (!(*topLayer)->empty())
+    {
+      //start from the upper layer towards bottom
+      int layer = m_skipList.size() - 1;
+      for (SkipList::reverse_iterator rit = topLayer; rit != m_skipList.rend(); ++rit)
+        {
+          //if we didn't do any iterations on the higher layers, start from the begin() again
+          if (!isIterated)
+            head = (*rit)->begin();
+
+          updateTable[layer] = head;
+
+          if (head != (*rit)->end())
+            {
+              // it can happen when begin() contains the element we want to remove
+              if (!isIterated && ((*head)->getName() == exactName))
+                {
+                  eraseFromSkipList(*head);
+                  return;
+                }
+              else
+                {
+                  SkipListLayer::iterator it = head;
+
+                  while ((*it)->getName() < exactName)
+                    {
+                      head = it;
+                      updateTable[layer] = it;
+                      isIterated = true;
+
+                      ++it;
+                      if (it == (*rit)->end())
+                        break;
+                    }
+                }
+            }
+
+          if (layer > 0)
+            head = (*head)->getIterators().find(layer - 1)->second; // move HEAD to the lower layer
+
+          layer--;
+        }
+    }
+  else
+    {
+      return;
+    }
+
+  head = updateTable[0];
+  ++head; // look at the next slot to check if it contains the item we want to remove
+
+  bool isCsEmpty = (size() == 0);
+  bool isInBoundaries = (head != (*m_skipList.begin())->end());
+  bool isNameIdentical = false;
+  if (!isCsEmpty && isInBoundaries)
+    {
+      NFD_LOG_TRACE("Identical? " << (*head)->getName());
+      isNameIdentical = (*head)->getName() == exactName;
+    }
+
+  if (isNameIdentical)
+    {
+      NFD_LOG_TRACE("Found target " << (*head)->getName());
+      eraseFromSkipList(*head);
+    }
+}
+
+void
+Cs::printSkipList() const
+{
+  NFD_LOG_TRACE("print()");
+  //start from the upper layer towards bottom
+  int layer = m_skipList.size() - 1;
+  for (SkipList::const_reverse_iterator rit = m_skipList.rbegin(); rit != m_skipList.rend(); ++rit)
+    {
+      for (SkipListLayer::iterator it = (*rit)->begin(); it != (*rit)->end(); ++it)
+        {
+          NFD_LOG_TRACE("Layer " << layer << " " << (*it)->getName());
+        }
+      layer--;
+    }
+}
+
+} //namespace nfd
diff --git a/daemon/table/cs.hpp b/daemon/table/cs.hpp
new file mode 100644
index 0000000..5e3b79d
--- /dev/null
+++ b/daemon/table/cs.hpp
@@ -0,0 +1,227 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ */
+
+#ifndef NFD_DAEMON_TABLE_CS_HPP
+#define NFD_DAEMON_TABLE_CS_HPP
+
+#include "common.hpp"
+#include "cs-entry.hpp"
+
+#include <boost/multi_index/member.hpp>
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/sequenced_index.hpp>
+#include <boost/multi_index/identity.hpp>
+
+#include <queue>
+
+namespace nfd {
+
+typedef std::list<cs::Entry*> SkipListLayer;
+typedef std::list<SkipListLayer*> SkipList;
+
+class StalenessComparator
+{
+public:
+  bool
+  operator()(const cs::Entry* entry1, const cs::Entry* entry2) const
+  {
+    return entry1->getStaleTime() < entry2->getStaleTime();
+  }
+};
+
+class UnsolicitedComparator
+{
+public:
+  bool
+  operator()(const cs::Entry* entry1, const cs::Entry* entry2) const
+  {
+    return entry1->isUnsolicited();
+  }
+};
+
+// tags
+class unsolicited;
+class byStaleness;
+class byArrival;
+
+typedef boost::multi_index_container<
+  cs::Entry*,
+  boost::multi_index::indexed_by<
+
+    // by arrival (FIFO)
+    boost::multi_index::sequenced<
+      boost::multi_index::tag<byArrival>
+    >,
+
+    // index by staleness time
+    boost::multi_index::ordered_non_unique<
+      boost::multi_index::tag<byStaleness>,
+      boost::multi_index::identity<cs::Entry*>,
+      StalenessComparator
+    >,
+
+    // unsolicited Data is in the front
+    boost::multi_index::ordered_non_unique<
+      boost::multi_index::tag<unsolicited>,
+      boost::multi_index::identity<cs::Entry*>,
+      UnsolicitedComparator
+    >
+
+  >
+> CleanupIndex;
+
+/** \brief represents Content Store
+ */
+class Cs : noncopyable
+{
+public:
+  explicit
+  Cs(int nMaxPackets = 65536); // ~500MB with average packet size = 8KB
+
+  ~Cs();
+
+  /** \brief inserts a Data packet
+   *  This method does not consider the payload of the Data packet.
+   *
+   *  Packets are considered duplicate if the name matches.
+   *  The new Data packet with the identical name, but a different payload
+   *  is not placed in the Content Store
+   *  \return{ whether the Data is added }
+   */
+  bool
+  insert(const Data& data, bool isUnsolicited = false);
+
+  /** \brief finds the best match Data for an Interest
+   *  \return{ the best match, if any; otherwise 0 }
+   */
+  const Data*
+  find(const Interest& interest) const;
+
+  /** \brief deletes CS entry by the exact name
+   */
+  void
+  erase(const Name& exactName);
+
+  /** \brief sets maximum allowed size of Content Store (in packets)
+   */
+  void
+  setLimit(size_t nMaxPackets);
+
+  /** \brief returns maximum allowed size of Content Store (in packets)
+   *  \return{ number of packets that can be stored in Content Store }
+   */
+  size_t
+  getLimit() const;
+
+  /** \brief returns current size of Content Store measured in packets
+   *  \return{ number of packets located in Content Store }
+   */
+  size_t
+  size() const;
+
+protected:
+  /** \brief removes one Data packet from Content Store based on replacement policy
+   *  \return{ whether the Data was removed }
+   */
+  bool
+  evictItem();
+
+private:
+  /** \brief returns True if the Content Store is at its maximum capacity
+   *  \return{ True if Content Store is full; otherwise False}
+   */
+  bool
+  isFull() const;
+
+  /** \brief Computes the layer where new Content Store Entry is placed
+   *
+   *  Reference: "Skip Lists: A Probabilistic Alternative to Balanced Trees" by W.Pugh
+   *  \return{ returns random layer (number) in a skip list}
+   */
+  size_t
+  pickRandomLayer() const;
+
+  /** \brief Inserts a new Content Store Entry in a skip list
+   *  \return{ returns a pair containing a pointer to the CS Entry,
+   *  and a flag indicating if the entry was newly created (True) or refreshed (False) }
+   */
+  std::pair<cs::Entry*, bool>
+  insertToSkipList(const Data& data, bool isUnsolicited = false);
+
+  /** \brief Removes a specific CS Entry from all layers of a skip list
+   *  \return{ returns True if CS Entry was succesfully removed and False if CS Entry was not found}
+   */
+  bool
+  eraseFromSkipList(cs::Entry* entry);
+
+  /** \brief Prints contents of the skip list, starting from the top layer
+   */
+  void
+  printSkipList() const;
+
+  /** \brief Implements child selector (leftmost, rightmost, undeclared).
+   *  Operates on the first layer of a skip list.
+   *
+   *  startingPoint must be less than Interest Name.
+   *  startingPoint can be equal to Interest Name only when the item is in the begin() position.
+   *
+   *  Iterates toward greater Names, terminates when CS entry falls out of Interest prefix.
+   *  When childSelector = leftmost, returns first CS entry that satisfies other selectors.
+   *  When childSelector = rightmost, it goes till the end, and returns CS entry that satisfies
+   *  other selectors. Returned CS entry is the leftmost child of the rightmost child.
+   *  \return{ the best match, if any; otherwise 0 }
+   */
+  const Data*
+  selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) const;
+
+  /** \brief checks if Content Store entry satisfies Interest selectors (MinSuffixComponents,
+   *  MaxSuffixComponents, Implicit Digest, MustBeFresh)
+   *  \return{ true if satisfies all selectors; false otherwise }
+   */
+  bool
+  doesComplyWithSelectors(const Interest& interest,
+                          cs::Entry* entry,
+                          bool doesInterestContainDigest) const;
+
+  /** \brief interprets minSuffixComponent and name lengths to understand if Interest contains
+   *  implicit digest of the data
+   *  \return{ True if Interest name contains digest; False otherwise }
+   */
+  bool
+  recognizeInterestWithDigest(const Interest& interest, cs::Entry* entry) const;
+
+private:
+  SkipList m_skipList;
+  CleanupIndex m_cleanupIndex;
+  size_t m_nMaxPackets; // user defined maximum size of the Content Store in packets
+  size_t m_nPackets;    // current number of packets in Content Store
+  std::queue<cs::Entry*> m_freeCsEntries; // memory pool
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_CS_HPP
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
new file mode 100644
index 0000000..79111e2
--- /dev/null
+++ b/daemon/table/fib-entry.cpp
@@ -0,0 +1,91 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fib-entry.hpp"
+
+namespace nfd {
+namespace fib {
+
+Entry::Entry(const Name& prefix)
+  : m_prefix(prefix)
+{
+}
+
+static inline bool
+predicate_NextHop_eq_Face(const NextHop& nexthop, shared_ptr<Face> face)
+{
+  return nexthop.getFace() == face;
+}
+
+bool
+Entry::hasNextHop(shared_ptr<Face> face) const
+{
+  NextHopList::const_iterator it = std::find_if(m_nextHops.begin(), m_nextHops.end(),
+    bind(&predicate_NextHop_eq_Face, _1, face));
+  return it != m_nextHops.end();
+}
+
+void
+Entry::addNextHop(shared_ptr<Face> face, uint64_t cost)
+{
+  NextHopList::iterator it = std::find_if(m_nextHops.begin(), m_nextHops.end(),
+    bind(&predicate_NextHop_eq_Face, _1, face));
+  if (it == m_nextHops.end()) {
+    m_nextHops.push_back(fib::NextHop(face));
+    it = m_nextHops.end() - 1;
+  }
+  // now it refers to the NextHop for face
+
+  it->setCost(cost);
+
+  this->sortNextHops();
+}
+
+void
+Entry::removeNextHop(shared_ptr<Face> face)
+{
+  NextHopList::iterator it = std::find_if(m_nextHops.begin(), m_nextHops.end(),
+    bind(&predicate_NextHop_eq_Face, _1, face));
+  if (it == m_nextHops.end()) {
+    return;
+  }
+
+  m_nextHops.erase(it);
+}
+
+static inline bool
+compare_NextHop_cost(const NextHop& a, const NextHop& b)
+{
+  return a.getCost() < b.getCost();
+}
+
+void
+Entry::sortNextHops()
+{
+  std::sort(m_nextHops.begin(), m_nextHops.end(), &compare_NextHop_cost);
+}
+
+
+} // namespace fib
+} // namespace nfd
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
new file mode 100644
index 0000000..1d03426
--- /dev/null
+++ b/daemon/table/fib-entry.hpp
@@ -0,0 +1,114 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_FIB_ENTRY_HPP
+#define NFD_DAEMON_TABLE_FIB_ENTRY_HPP
+
+#include "fib-nexthop.hpp"
+
+namespace nfd {
+
+class NameTree;
+namespace name_tree {
+class Entry;
+}
+
+namespace fib {
+
+/** \class NextHopList
+ *  \brief represents a collection of nexthops
+ *  This type has these methods:
+ *    iterator<NextHop> begin()
+ *    iterator<NextHop> end()
+ *    size_t size()
+ */
+typedef std::vector<fib::NextHop> NextHopList;
+
+/** \class Entry
+ *  \brief represents a FIB entry
+ */
+class Entry : noncopyable
+{
+public:
+  explicit
+  Entry(const Name& prefix);
+
+  const Name&
+  getPrefix() const;
+
+  const NextHopList&
+  getNextHops() const;
+
+  /// whether this Entry has any nexthop
+  bool
+  hasNextHops() const;
+
+  bool
+  hasNextHop(shared_ptr<Face> face) const;
+
+  /// adds a nexthop
+  void
+  addNextHop(shared_ptr<Face> face, uint64_t cost);
+
+  /// removes a nexthop
+  void
+  removeNextHop(shared_ptr<Face> face);
+
+private:
+  /// sorts the nexthop list
+  void
+  sortNextHops();
+
+private:
+  Name m_prefix;
+  NextHopList m_nextHops;
+
+  shared_ptr<name_tree::Entry> m_nameTreeEntry;
+  friend class nfd::NameTree;
+  friend class nfd::name_tree::Entry;
+};
+
+
+inline const Name&
+Entry::getPrefix() const
+{
+  return m_prefix;
+}
+
+inline const NextHopList&
+Entry::getNextHops() const
+{
+  return m_nextHops;
+}
+
+inline bool
+Entry::hasNextHops() const
+{
+  return !m_nextHops.empty();
+}
+
+} // namespace fib
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_FIB_ENTRY_HPP
diff --git a/daemon/table/fib-nexthop.cpp b/daemon/table/fib-nexthop.cpp
new file mode 100644
index 0000000..7f480a8
--- /dev/null
+++ b/daemon/table/fib-nexthop.cpp
@@ -0,0 +1,59 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fib-nexthop.hpp"
+
+namespace nfd {
+namespace fib {
+
+NextHop::NextHop(shared_ptr<Face> face)
+  : m_face(face), m_cost(0)
+{
+}
+
+NextHop::NextHop(const NextHop& other)
+  : m_face(other.m_face), m_cost(other.m_cost)
+{
+}
+
+shared_ptr<Face>
+NextHop::getFace() const
+{
+  return m_face;
+}
+
+void
+NextHop::setCost(uint64_t cost)
+{
+  m_cost = cost;
+}
+
+uint64_t
+NextHop::getCost() const
+{
+  return m_cost;
+}
+
+} // namespace fib
+} // namespace nfd
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
new file mode 100644
index 0000000..691cf6b
--- /dev/null
+++ b/daemon/table/fib-nexthop.hpp
@@ -0,0 +1,62 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
+#define NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
+
+#include "common.hpp"
+#include "face/face.hpp"
+
+namespace nfd {
+namespace fib {
+
+/** \class NextHop
+ *  \brief represents a nexthop record in FIB entry
+ */
+class NextHop
+{
+public:
+  explicit
+  NextHop(shared_ptr<Face> face);
+
+  NextHop(const NextHop& other);
+
+  shared_ptr<Face>
+  getFace() const;
+
+  void
+  setCost(uint64_t cost);
+
+  uint64_t
+  getCost() const;
+
+private:
+  shared_ptr<Face> m_face;
+  uint64_t m_cost;
+};
+
+} // namespace fib
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
new file mode 100644
index 0000000..516de57
--- /dev/null
+++ b/daemon/table/fib.cpp
@@ -0,0 +1,157 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fib.hpp"
+#include "pit-entry.hpp"
+#include "measurements-entry.hpp"
+
+namespace nfd {
+
+const shared_ptr<fib::Entry> Fib::s_emptyEntry = make_shared<fib::Entry>(Name());
+
+Fib::Fib(NameTree& nameTree)
+  : m_nameTree(nameTree)
+  , m_nItems(0)
+{
+}
+
+Fib::~Fib()
+{
+}
+
+static inline bool
+predicate_NameTreeEntry_hasFibEntry(const name_tree::Entry& entry)
+{
+  return static_cast<bool>(entry.getFibEntry());
+}
+
+std::pair<shared_ptr<fib::Entry>, bool>
+Fib::insert(const Name& prefix)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(prefix);
+  shared_ptr<fib::Entry> entry = nameTreeEntry->getFibEntry();
+  if (static_cast<bool>(entry))
+    return std::make_pair(entry, false);
+  entry = make_shared<fib::Entry>(prefix);
+  nameTreeEntry->setFibEntry(entry);
+  ++m_nItems;
+  return std::make_pair(entry, true);
+}
+
+shared_ptr<fib::Entry>
+Fib::findLongestPrefixMatch(const Name& prefix) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry =
+    m_nameTree.findLongestPrefixMatch(prefix, &predicate_NameTreeEntry_hasFibEntry);
+  if (static_cast<bool>(nameTreeEntry)) {
+    return nameTreeEntry->getFibEntry();
+  }
+  return s_emptyEntry;
+}
+
+shared_ptr<fib::Entry>
+Fib::findLongestPrefixMatch(shared_ptr<name_tree::Entry> nameTreeEntry) const
+{
+  shared_ptr<fib::Entry> entry = nameTreeEntry->getFibEntry();
+  if (static_cast<bool>(entry))
+    return entry;
+  nameTreeEntry = m_nameTree.findLongestPrefixMatch(nameTreeEntry,
+                                                    &predicate_NameTreeEntry_hasFibEntry);
+  if (static_cast<bool>(nameTreeEntry)) {
+    return nameTreeEntry->getFibEntry();
+  }
+  return s_emptyEntry;
+}
+
+shared_ptr<fib::Entry>
+Fib::findLongestPrefixMatch(const pit::Entry& pitEntry) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(pitEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return findLongestPrefixMatch(nameTreeEntry);
+}
+
+shared_ptr<fib::Entry>
+Fib::findLongestPrefixMatch(const measurements::Entry& measurementsEntry) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(measurementsEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return findLongestPrefixMatch(nameTreeEntry);
+}
+
+shared_ptr<fib::Entry>
+Fib::findExactMatch(const Name& prefix) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
+  if (static_cast<bool>(nameTreeEntry))
+    return nameTreeEntry->getFibEntry();
+  return shared_ptr<fib::Entry>();
+}
+
+void
+Fib::erase(const Name& prefix)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
+  if (static_cast<bool>(nameTreeEntry))
+  {
+    nameTreeEntry->setFibEntry(shared_ptr<fib::Entry>());
+    --m_nItems;
+  }
+}
+
+void
+Fib::erase(const fib::Entry& entry)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(entry);
+  if (static_cast<bool>(nameTreeEntry))
+  {
+    nameTreeEntry->setFibEntry(shared_ptr<fib::Entry>());
+    --m_nItems;
+  }
+}
+
+void
+Fib::removeNextHopFromAllEntries(shared_ptr<Face> face)
+{
+  for (NameTree::const_iterator it = m_nameTree.fullEnumerate(
+       &predicate_NameTreeEntry_hasFibEntry); it != m_nameTree.end(); ++it) {
+    shared_ptr<fib::Entry> entry = it->getFibEntry();
+    entry->removeNextHop(face);
+    if (!entry->hasNextHops()) {
+      this->erase(*entry);
+    }
+  }
+}
+
+Fib::const_iterator
+Fib::begin() const
+{
+  return const_iterator(m_nameTree.fullEnumerate(&predicate_NameTreeEntry_hasFibEntry));
+}
+
+} // namespace nfd
diff --git a/daemon/table/fib.hpp b/daemon/table/fib.hpp
new file mode 100644
index 0000000..e5aaf15
--- /dev/null
+++ b/daemon/table/fib.hpp
@@ -0,0 +1,209 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_FIB_HPP
+#define NFD_DAEMON_TABLE_FIB_HPP
+
+#include "fib-entry.hpp"
+#include "name-tree.hpp"
+
+namespace nfd {
+
+namespace measurements {
+class Entry;
+}
+namespace pit {
+class Entry;
+}
+
+/** \class Fib
+ *  \brief represents the FIB
+ */
+class Fib : noncopyable
+{
+public:
+  class const_iterator;
+
+  explicit
+  Fib(NameTree& nameTree);
+
+  ~Fib();
+
+  /** \brief inserts a FIB entry for prefix
+   *  If an entry for exact same prefix exists, that entry is returned.
+   *  \return{ the entry, and true for new entry, false for existing entry }
+   */
+  std::pair<shared_ptr<fib::Entry>, bool>
+  insert(const Name& prefix);
+
+  /// performs a longest prefix match
+  shared_ptr<fib::Entry>
+  findLongestPrefixMatch(const Name& prefix) const;
+
+  /// performs a longest prefix match
+  shared_ptr<fib::Entry>
+  findLongestPrefixMatch(const pit::Entry& pitEntry) const;
+
+  /// performs a longest prefix match
+  shared_ptr<fib::Entry>
+  findLongestPrefixMatch(const measurements::Entry& measurementsEntry) const;
+
+  shared_ptr<fib::Entry>
+  findExactMatch(const Name& prefix) const;
+
+  void
+  erase(const Name& prefix);
+
+  void
+  erase(const fib::Entry& entry);
+
+  /** \brief removes the NextHop record for face in all entrites
+   *  This is usually invoked when face goes away.
+   *  Removing all NextHops in a FIB entry will not remove the FIB entry.
+   */
+  void
+  removeNextHopFromAllEntries(shared_ptr<Face> face);
+
+  size_t
+  size() const;
+
+  const_iterator
+  begin() const;
+
+  const_iterator
+  end() const;
+
+  class const_iterator : public std::iterator<std::forward_iterator_tag, fib::Entry>
+  {
+  public:
+    explicit
+    const_iterator(const NameTree::const_iterator& it);
+
+    ~const_iterator();
+
+    const fib::Entry&
+    operator*() const;
+
+    shared_ptr<fib::Entry>
+    operator->() const;
+
+    const_iterator&
+    operator++();
+
+    const_iterator
+    operator++(int);
+
+    bool
+    operator==(const const_iterator& other) const;
+
+    bool
+    operator!=(const const_iterator& other) const;
+
+  private:
+    NameTree::const_iterator m_nameTreeIterator;
+  };
+
+private:
+  shared_ptr<fib::Entry>
+  findLongestPrefixMatch(shared_ptr<name_tree::Entry> nameTreeEntry) const;
+
+private:
+  NameTree& m_nameTree;
+  size_t m_nItems;
+
+  /** \brief The empty FIB entry.
+   *
+   *  This entry has no nexthops.
+   *  It is returned by findLongestPrefixMatch if nothing is matched.
+   */
+  // Returning empty entry instead of nullptr makes forwarding and strategy implementation easier.
+  static const shared_ptr<fib::Entry> s_emptyEntry;
+};
+
+inline size_t
+Fib::size() const
+{
+  return m_nItems;
+}
+
+inline Fib::const_iterator
+Fib::end() const
+{
+  return const_iterator(m_nameTree.end());
+}
+
+inline
+Fib::const_iterator::const_iterator(const NameTree::const_iterator& it)
+  : m_nameTreeIterator(it)
+{
+}
+
+inline
+Fib::const_iterator::~const_iterator()
+{
+}
+
+inline
+Fib::const_iterator
+Fib::const_iterator::operator++(int)
+{
+  Fib::const_iterator temp(*this);
+  ++(*this);
+  return temp;
+}
+
+inline Fib::const_iterator&
+Fib::const_iterator::operator++()
+{
+  ++m_nameTreeIterator;
+  return *this;
+}
+
+inline const fib::Entry&
+Fib::const_iterator::operator*() const
+{
+  return *(m_nameTreeIterator->getFibEntry());
+}
+
+inline shared_ptr<fib::Entry>
+Fib::const_iterator::operator->() const
+{
+  return m_nameTreeIterator->getFibEntry();
+}
+
+inline bool
+Fib::const_iterator::operator==(const Fib::const_iterator& other) const
+{
+  return m_nameTreeIterator == other.m_nameTreeIterator;
+}
+
+inline bool
+Fib::const_iterator::operator!=(const Fib::const_iterator& other) const
+{
+  return m_nameTreeIterator != other.m_nameTreeIterator;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_FIB_HPP
diff --git a/daemon/table/measurements-accessor.cpp b/daemon/table/measurements-accessor.cpp
new file mode 100644
index 0000000..8ecb0fd
--- /dev/null
+++ b/daemon/table/measurements-accessor.cpp
@@ -0,0 +1,58 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "measurements-accessor.hpp"
+
+namespace nfd {
+
+using fw::Strategy;
+
+MeasurementsAccessor::MeasurementsAccessor(Measurements& measurements,
+                                           StrategyChoice& strategyChoice,
+                                           Strategy* strategy)
+  : m_measurements(measurements)
+  , m_strategyChoice(strategyChoice)
+  , m_strategy(strategy)
+{
+}
+
+MeasurementsAccessor::~MeasurementsAccessor()
+{
+}
+
+shared_ptr<measurements::Entry>
+MeasurementsAccessor::filter(const shared_ptr<measurements::Entry>& entry)
+{
+  if (!static_cast<bool>(entry)) {
+    return entry;
+  }
+
+  Strategy& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
+  if (&effectiveStrategy == m_strategy) {
+    return entry;
+  }
+  return shared_ptr<measurements::Entry>();
+}
+
+} // namespace nfd
diff --git a/daemon/table/measurements-accessor.hpp b/daemon/table/measurements-accessor.hpp
new file mode 100644
index 0000000..2db0ccb
--- /dev/null
+++ b/daemon/table/measurements-accessor.hpp
@@ -0,0 +1,119 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
+#define NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
+
+#include "measurements.hpp"
+#include "strategy-choice.hpp"
+
+namespace nfd {
+
+namespace fw {
+class Strategy;
+}
+
+/** \brief allows Strategy to access portion of Measurements table under its namespace
+ */
+class MeasurementsAccessor : noncopyable
+{
+public:
+  MeasurementsAccessor(Measurements& measurements, StrategyChoice& strategyChoice,
+                       fw::Strategy* strategy);
+
+  ~MeasurementsAccessor();
+
+  /// find or insert a Measurements entry for name
+  shared_ptr<measurements::Entry>
+  get(const Name& name);
+
+  /// find or insert a Measurements entry for fibEntry->getPrefix()
+  shared_ptr<measurements::Entry>
+  get(const fib::Entry& fibEntry);
+
+  /// find or insert a Measurements entry for pitEntry->getName()
+  shared_ptr<measurements::Entry>
+  get(const pit::Entry& pitEntry);
+
+  /** \brief find or insert a Measurements entry for child's parent
+   *
+   *  If child is the root entry, returns null.
+   */
+  shared_ptr<measurements::Entry>
+  getParent(shared_ptr<measurements::Entry> child);
+
+  /** \brief extend lifetime of an entry
+   *
+   *  The entry will be kept until at least now()+lifetime.
+   */
+  void
+  extendLifetime(measurements::Entry& entry, const time::nanoseconds& lifetime);
+
+private:
+  /** \brief perform access control to Measurements entry
+   *
+   *  \return entry if strategy has access to namespace, otherwise 0
+   */
+  shared_ptr<measurements::Entry>
+  filter(const shared_ptr<measurements::Entry>& entry);
+
+private:
+  Measurements& m_measurements;
+  StrategyChoice& m_strategyChoice;
+  fw::Strategy* m_strategy;
+};
+
+inline shared_ptr<measurements::Entry>
+MeasurementsAccessor::get(const Name& name)
+{
+  return this->filter(m_measurements.get(name));
+}
+
+inline shared_ptr<measurements::Entry>
+MeasurementsAccessor::get(const fib::Entry& fibEntry)
+{
+  return this->filter(m_measurements.get(fibEntry));
+}
+
+inline shared_ptr<measurements::Entry>
+MeasurementsAccessor::get(const pit::Entry& pitEntry)
+{
+  return this->filter(m_measurements.get(pitEntry));
+}
+
+inline shared_ptr<measurements::Entry>
+MeasurementsAccessor::getParent(shared_ptr<measurements::Entry> child)
+{
+  return this->filter(m_measurements.getParent(child));
+}
+
+inline void
+MeasurementsAccessor::extendLifetime(measurements::Entry& entry, const time::nanoseconds& lifetime)
+{
+  m_measurements.extendLifetime(entry, lifetime);
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
diff --git a/daemon/table/measurements-entry.cpp b/daemon/table/measurements-entry.cpp
new file mode 100644
index 0000000..6858399
--- /dev/null
+++ b/daemon/table/measurements-entry.cpp
@@ -0,0 +1,37 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "measurements-entry.hpp"
+
+namespace nfd {
+namespace measurements {
+
+Entry::Entry(const Name& name)
+  : m_name(name)
+  , m_expiry(time::steady_clock::TimePoint::min())
+{
+}
+
+} // namespace measurements
+} // namespace nfd
diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp
new file mode 100644
index 0000000..6593ee9
--- /dev/null
+++ b/daemon/table/measurements-entry.hpp
@@ -0,0 +1,78 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
+#define NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
+
+#include "common.hpp"
+#include "strategy-info-host.hpp"
+#include "core/scheduler.hpp"
+
+namespace nfd {
+
+class NameTree;
+
+namespace name_tree {
+class Entry;
+}
+
+class Measurements;
+
+namespace measurements {
+
+/** \class Entry
+ *  \brief represents a Measurements entry
+ */
+class Entry : public StrategyInfoHost, noncopyable
+{
+public:
+  explicit
+  Entry(const Name& name);
+
+  const Name&
+  getName() const;
+
+private:
+  Name m_name;
+
+private: // lifetime
+  time::steady_clock::TimePoint m_expiry;
+  EventId m_cleanup;
+  shared_ptr<name_tree::Entry> m_nameTreeEntry;
+
+  friend class nfd::NameTree;
+  friend class nfd::name_tree::Entry;
+  friend class nfd::Measurements;
+};
+
+inline const Name&
+Entry::getName() const
+{
+  return m_name;
+}
+
+} // namespace measurements
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
new file mode 100644
index 0000000..6c19d10
--- /dev/null
+++ b/daemon/table/measurements.cpp
@@ -0,0 +1,151 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "measurements.hpp"
+#include "name-tree.hpp"
+#include "pit-entry.hpp"
+#include "fib-entry.hpp"
+
+namespace nfd {
+
+const time::nanoseconds Measurements::s_defaultLifetime = time::seconds(4);
+
+Measurements::Measurements(NameTree& nameTree)
+  : m_nameTree(nameTree)
+  , m_nItems(0)
+{
+}
+
+Measurements::~Measurements()
+{
+}
+
+static inline bool
+predicate_NameTreeEntry_hasMeasurementsEntry(const name_tree::Entry& entry)
+{
+  return static_cast<bool>(entry.getMeasurementsEntry());
+}
+
+shared_ptr<measurements::Entry>
+Measurements::get(shared_ptr<name_tree::Entry> nameTreeEntry)
+{
+  shared_ptr<measurements::Entry> entry = nameTreeEntry->getMeasurementsEntry();
+  if (static_cast<bool>(entry))
+    return entry;
+  entry = make_shared<measurements::Entry>(nameTreeEntry->getPrefix());
+  nameTreeEntry->setMeasurementsEntry(entry);
+  m_nItems++;
+  return entry;
+}
+
+shared_ptr<measurements::Entry>
+Measurements::get(const Name& name)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(name);
+  return get(nameTreeEntry);
+}
+
+shared_ptr<measurements::Entry>
+Measurements::get(const fib::Entry& fibEntry)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(fibEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return get(nameTreeEntry);
+}
+
+shared_ptr<measurements::Entry>
+Measurements::get(const pit::Entry& pitEntry)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(pitEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return get(nameTreeEntry);
+}
+
+shared_ptr<measurements::Entry>
+Measurements::getParent(shared_ptr<measurements::Entry> child)
+{
+  BOOST_ASSERT(child);
+
+  if (child->getName().size() == 0) {
+    return shared_ptr<measurements::Entry>();
+  }
+
+  return this->get(child->getName().getPrefix(-1));
+}
+
+shared_ptr<measurements::Entry>
+Measurements::findLongestPrefixMatch(const Name& name) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry =
+    m_nameTree.findLongestPrefixMatch(name, &predicate_NameTreeEntry_hasMeasurementsEntry);
+  if (static_cast<bool>(nameTreeEntry)) {
+    return nameTreeEntry->getMeasurementsEntry();
+  }
+  return shared_ptr<measurements::Entry>();
+}
+
+shared_ptr<measurements::Entry>
+Measurements::findExactMatch(const Name& name) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(name);
+  if (static_cast<bool>(nameTreeEntry))
+    return nameTreeEntry->getMeasurementsEntry();
+  return shared_ptr<measurements::Entry>();
+}
+
+void
+Measurements::extendLifetime(measurements::Entry& entry, const time::nanoseconds& lifetime)
+{
+  shared_ptr<measurements::Entry> ret = this->findExactMatch(entry.getName());
+  if (static_cast<bool>(ret))
+  {
+    time::steady_clock::TimePoint expiry = time::steady_clock::now() + lifetime;
+    if (ret->m_expiry >= expiry) // has longer lifetime, not extending
+      return;
+    scheduler::cancel(entry.m_cleanup);
+    entry.m_expiry = expiry;
+    entry.m_cleanup = scheduler::schedule(lifetime,
+                         bind(&Measurements::cleanup, this, ret));
+  }
+}
+
+void
+Measurements::cleanup(shared_ptr<measurements::Entry> entry)
+{
+  BOOST_ASSERT(entry);
+
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(entry->getName());
+  if (static_cast<bool>(nameTreeEntry))
+  {
+    nameTreeEntry->setMeasurementsEntry(shared_ptr<measurements::Entry>());
+    m_nItems--;
+  }
+
+}
+
+} // namespace nfd
diff --git a/daemon/table/measurements.hpp b/daemon/table/measurements.hpp
new file mode 100644
index 0000000..4936d28
--- /dev/null
+++ b/daemon/table/measurements.hpp
@@ -0,0 +1,111 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_MEASUREMENTS_HPP
+#define NFD_DAEMON_TABLE_MEASUREMENTS_HPP
+
+#include "measurements-entry.hpp"
+#include "name-tree.hpp"
+
+namespace nfd {
+
+namespace fib {
+class Entry;
+}
+
+namespace pit {
+class Entry;
+}
+
+
+/** \class Measurement
+ *  \brief represents the Measurements table
+ */
+class Measurements : noncopyable
+{
+public:
+  explicit
+  Measurements(NameTree& nametree);
+
+  ~Measurements();
+
+  /// find or insert a Measurements entry for name
+  shared_ptr<measurements::Entry>
+  get(const Name& name);
+
+  /// find or insert a Measurements entry for fibEntry->getPrefix()
+  shared_ptr<measurements::Entry>
+  get(const fib::Entry& fibEntry);
+
+  /// find or insert a Measurements entry for pitEntry->getName()
+  shared_ptr<measurements::Entry>
+  get(const pit::Entry& pitEntry);
+
+  /** find or insert a Measurements entry for child's parent
+   *
+   *  If child is the root entry, returns null.
+   */
+  shared_ptr<measurements::Entry>
+  getParent(shared_ptr<measurements::Entry> child);
+
+  /// perform a longest prefix match
+  shared_ptr<measurements::Entry>
+  findLongestPrefixMatch(const Name& name) const;
+
+  /// perform an exact match
+  shared_ptr<measurements::Entry>
+  findExactMatch(const Name& name) const;
+
+  /** extend lifetime of an entry
+   *
+   *  The entry will be kept until at least now()+lifetime.
+   */
+  void
+  extendLifetime(measurements::Entry& entry, const time::nanoseconds& lifetime);
+
+  size_t
+  size() const;
+
+private:
+  void
+  cleanup(shared_ptr<measurements::Entry> entry);
+
+  shared_ptr<measurements::Entry>
+  get(shared_ptr<name_tree::Entry> nameTreeEntry);
+
+private:
+  NameTree& m_nameTree;
+  size_t m_nItems;
+  static const time::nanoseconds s_defaultLifetime;
+};
+
+inline size_t
+Measurements::size() const
+{
+  return m_nItems;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_MEASUREMENTS_HPP
diff --git a/daemon/table/name-tree-entry.cpp b/daemon/table/name-tree-entry.cpp
new file mode 100644
index 0000000..0e4d821
--- /dev/null
+++ b/daemon/table/name-tree-entry.cpp
@@ -0,0 +1,74 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+// Name Tree Entry (i.e., Name Prefix Entry)
+
+#include "name-tree-entry.hpp"
+
+namespace nfd {
+namespace name_tree {
+
+Node::Node()
+  : m_prev(0)
+  , m_next(0)
+{
+}
+
+Node::~Node()
+{
+  // erase the Name Tree Nodes that were created to
+  // resolve hash collisions
+  // So before erasing a single node, make sure its m_next == 0
+  // See eraseEntryIfEmpty in name-tree.cpp
+  if (m_next)
+    delete m_next;
+}
+
+Entry::Entry(const Name& name)
+  : m_hash(0)
+  , m_prefix(name)
+{
+}
+
+Entry::~Entry()
+{
+}
+
+void
+Entry::erasePitEntry(shared_ptr<pit::Entry> pitEntry)
+{
+  BOOST_ASSERT(static_cast<bool>(pitEntry));
+  BOOST_ASSERT(pitEntry->m_nameTreeEntry.get() == this);
+
+  std::vector<shared_ptr<pit::Entry> >::iterator it =
+    std::find(m_pitEntries.begin(), m_pitEntries.end(), pitEntry);
+  BOOST_ASSERT(it != m_pitEntries.end());
+
+  *it = m_pitEntries.back();
+  m_pitEntries.pop_back();
+  pitEntry->m_nameTreeEntry.reset();
+}
+
+} // namespace name_tree
+} // namespace nfd
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
new file mode 100644
index 0000000..48c9af7
--- /dev/null
+++ b/daemon/table/name-tree-entry.hpp
@@ -0,0 +1,290 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+// Name Tree Entry (i.e., Name Prefix Entry)
+
+#ifndef NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
+#define NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
+
+#include "common.hpp"
+#include "table/fib-entry.hpp"
+#include "table/pit-entry.hpp"
+#include "table/measurements-entry.hpp"
+#include "table/strategy-choice-entry.hpp"
+
+namespace nfd {
+
+class NameTree;
+
+namespace name_tree {
+
+// Forward declarations
+class Node;
+class Entry;
+
+/**
+ * \brief Name Tree Node Class
+ */
+class Node
+{
+public:
+  Node();
+
+  ~Node();
+
+public:
+  // variables are in public as this is just a data structure
+  shared_ptr<Entry> m_entry; // Name Tree Entry (i.e., Name Prefix Entry)
+  Node* m_prev; // Previous Name Tree Node (to resolve hash collision)
+  Node* m_next; // Next Name Tree Node (to resolve hash collision)
+};
+
+/**
+ * \brief Name Tree Entry Class
+ */
+class Entry : public enable_shared_from_this<Entry>, noncopyable
+{
+public:
+  explicit
+  Entry(const Name& prefix);
+
+  ~Entry();
+
+  const Name&
+  getPrefix() const;
+
+  void
+  setHash(size_t hash);
+
+  size_t
+  getHash() const;
+
+  void
+  setParent(shared_ptr<Entry> parent);
+
+  shared_ptr<Entry>
+  getParent() const;
+
+  std::vector<shared_ptr<Entry> >&
+  getChildren();
+
+  bool
+  hasChildren() const;
+
+  bool
+  isEmpty() const;
+
+  void
+  setFibEntry(shared_ptr<fib::Entry> fibEntry);
+
+  shared_ptr<fib::Entry>
+  getFibEntry() const;
+
+  void
+  insertPitEntry(shared_ptr<pit::Entry> pitEntry);
+
+  void
+  erasePitEntry(shared_ptr<pit::Entry> pitEntry);
+
+  bool
+  hasPitEntries() const;
+
+  const std::vector<shared_ptr<pit::Entry> >&
+  getPitEntries() const;
+
+  void
+  setMeasurementsEntry(shared_ptr<measurements::Entry> measurementsEntry);
+
+  shared_ptr<measurements::Entry>
+  getMeasurementsEntry() const;
+
+  void
+  setStrategyChoiceEntry(shared_ptr<strategy_choice::Entry> strategyChoiceEntry);
+
+  shared_ptr<strategy_choice::Entry>
+  getStrategyChoiceEntry() const;
+
+private:
+  // Benefits of storing m_hash
+  // 1. m_hash is compared before m_prefix is compared
+  // 2. fast hash table resize support
+  size_t m_hash;
+  Name m_prefix;
+  shared_ptr<Entry> m_parent;     // Pointing to the parent entry.
+  std::vector<shared_ptr<Entry> > m_children; // Children pointers.
+  shared_ptr<fib::Entry> m_fibEntry;
+  std::vector<shared_ptr<pit::Entry> > m_pitEntries;
+  shared_ptr<measurements::Entry> m_measurementsEntry;
+  shared_ptr<strategy_choice::Entry> m_strategyChoiceEntry;
+
+  // get the Name Tree Node that is associated with this Name Tree Entry
+  Node* m_node;
+
+  // Make private members accessible by Name Tree
+  friend class nfd::NameTree;
+};
+
+inline const Name&
+Entry::getPrefix() const
+{
+  return m_prefix;
+}
+
+inline size_t
+Entry::getHash() const
+{
+  return m_hash;
+}
+
+inline void
+Entry::setHash(size_t hash)
+{
+  m_hash = hash;
+}
+
+inline shared_ptr<Entry>
+Entry::getParent() const
+{
+  return m_parent;
+}
+
+inline void
+Entry::setParent(shared_ptr<Entry> parent)
+{
+  m_parent = parent;
+}
+
+inline std::vector<shared_ptr<name_tree::Entry> >&
+Entry::getChildren()
+{
+  return m_children;
+}
+
+inline bool
+Entry::hasChildren() const
+{
+  return !m_children.empty();
+}
+
+inline bool
+Entry::isEmpty() const
+{
+  return m_children.empty() &&
+         !static_cast<bool>(m_fibEntry) &&
+         m_pitEntries.empty() &&
+         !static_cast<bool>(m_measurementsEntry);
+}
+
+inline shared_ptr<fib::Entry>
+Entry::getFibEntry() const
+{
+  return m_fibEntry;
+}
+
+inline void
+Entry::setFibEntry(shared_ptr<fib::Entry> fibEntry)
+{
+  if (static_cast<bool>(fibEntry)) {
+    BOOST_ASSERT(!static_cast<bool>(fibEntry->m_nameTreeEntry));
+  }
+
+  if (static_cast<bool>(m_fibEntry)) {
+    m_fibEntry->m_nameTreeEntry.reset();
+  }
+  m_fibEntry = fibEntry;
+  if (static_cast<bool>(m_fibEntry)) {
+    m_fibEntry->m_nameTreeEntry = this->shared_from_this();
+  }
+}
+
+inline bool
+Entry::hasPitEntries() const
+{
+  return !m_pitEntries.empty();
+}
+
+inline const std::vector<shared_ptr<pit::Entry> >&
+Entry::getPitEntries() const
+{
+  return m_pitEntries;
+}
+
+inline void
+Entry::insertPitEntry(shared_ptr<pit::Entry> pitEntry)
+{
+  BOOST_ASSERT(static_cast<bool>(pitEntry));
+  BOOST_ASSERT(!static_cast<bool>(pitEntry->m_nameTreeEntry));
+
+  m_pitEntries.push_back(pitEntry);
+  pitEntry->m_nameTreeEntry = this->shared_from_this();
+}
+
+inline shared_ptr<measurements::Entry>
+Entry::getMeasurementsEntry() const
+{
+  return m_measurementsEntry;
+}
+
+inline void
+Entry::setMeasurementsEntry(shared_ptr<measurements::Entry> measurementsEntry)
+{
+  if (static_cast<bool>(measurementsEntry)) {
+    BOOST_ASSERT(!static_cast<bool>(measurementsEntry->m_nameTreeEntry));
+  }
+
+  if (static_cast<bool>(m_measurementsEntry)) {
+    m_measurementsEntry->m_nameTreeEntry.reset();
+  }
+  m_measurementsEntry = measurementsEntry;
+  if (static_cast<bool>(m_measurementsEntry)) {
+    m_measurementsEntry->m_nameTreeEntry = this->shared_from_this();
+  }
+}
+
+inline shared_ptr<strategy_choice::Entry>
+Entry::getStrategyChoiceEntry() const
+{
+  return m_strategyChoiceEntry;
+}
+
+inline void
+Entry::setStrategyChoiceEntry(shared_ptr<strategy_choice::Entry> strategyChoiceEntry)
+{
+  if (static_cast<bool>(strategyChoiceEntry)) {
+    BOOST_ASSERT(!static_cast<bool>(strategyChoiceEntry->m_nameTreeEntry));
+  }
+
+  if (static_cast<bool>(m_strategyChoiceEntry)) {
+    m_strategyChoiceEntry->m_nameTreeEntry.reset();
+  }
+  m_strategyChoiceEntry = strategyChoiceEntry;
+  if (static_cast<bool>(m_strategyChoiceEntry)) {
+    m_strategyChoiceEntry->m_nameTreeEntry = this->shared_from_this();
+  }
+}
+
+} // namespace name_tree
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
new file mode 100644
index 0000000..b42b240
--- /dev/null
+++ b/daemon/table/name-tree.cpp
@@ -0,0 +1,765 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+// Name Tree (Name Prefix Hash Table)
+
+#include "name-tree.hpp"
+#include "core/logger.hpp"
+#include "core/city-hash.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("NameTree");
+
+namespace name_tree {
+
+class Hash32
+{
+public:
+  static size_t
+  compute(const char* buffer, size_t length)
+  {
+    return static_cast<size_t>(CityHash32(buffer, length));
+  }
+};
+
+class Hash64
+{
+public:
+  static size_t
+  compute(const char* buffer, size_t length)
+  {
+    return static_cast<size_t>(CityHash64(buffer, length));
+  }
+};
+
+typedef boost::mpl::if_c<sizeof(size_t) >= 8, Hash64, Hash32>::type CityHash;
+
+// Interface of different hash functions
+size_t
+computeHash(const Name& prefix)
+{
+  prefix.wireEncode();  // guarantees prefix's wire buffer is not empty
+
+  size_t hashValue = 0;
+  size_t hashUpdate = 0;
+
+  for (Name::const_iterator it = prefix.begin(); it != prefix.end(); it++)
+    {
+      const char* wireFormat = reinterpret_cast<const char*>( it->wire() );
+      hashUpdate = CityHash::compute(wireFormat, it->size());
+      hashValue ^= hashUpdate;
+    }
+
+  return hashValue;
+}
+
+std::vector<size_t>
+computeHashSet(const Name& prefix)
+{
+  prefix.wireEncode();  // guarantees prefix's wire buffer is not empty
+
+  size_t hashValue = 0;
+  size_t hashUpdate = 0;
+
+  std::vector<size_t> hashValueSet;
+  hashValueSet.push_back(hashValue);
+
+  for (Name::const_iterator it = prefix.begin(); it != prefix.end(); it++)
+    {
+      const char* wireFormat = reinterpret_cast<const char*>( it->wire() );
+      hashUpdate = CityHash::compute(wireFormat, it->size());
+      hashValue ^= hashUpdate;
+      hashValueSet.push_back(hashValue);
+    }
+
+  return hashValueSet;
+}
+
+} // namespace name_tree
+
+NameTree::NameTree(size_t nBuckets)
+  : m_nItems(0)
+  , m_nBuckets(nBuckets)
+  , m_minNBuckets(nBuckets)
+  , m_enlargeLoadFactor(0.5)       // more than 50% buckets loaded
+  , m_enlargeFactor(2)       // double the hash table size
+  , m_shrinkLoadFactor(0.1) // less than 10% buckets loaded
+  , m_shrinkFactor(0.5)     // reduce the number of buckets by half
+  , m_endIterator(FULL_ENUMERATE_TYPE, *this, m_end)
+{
+  m_enlargeThreshold = static_cast<size_t>(m_enlargeLoadFactor *
+                                          static_cast<double>(m_nBuckets));
+
+  m_shrinkThreshold = static_cast<size_t>(m_shrinkLoadFactor *
+                                          static_cast<double>(m_nBuckets));
+
+  // array of node pointers
+  m_buckets = new name_tree::Node*[m_nBuckets];
+  // Initialize the pointer array
+  for (size_t i = 0; i < m_nBuckets; i++)
+    m_buckets[i] = 0;
+}
+
+NameTree::~NameTree()
+{
+  for (size_t i = 0; i < m_nBuckets; i++)
+    {
+      if (m_buckets[i] != 0) {
+        delete m_buckets[i];
+      }
+    }
+
+  delete [] m_buckets;
+}
+
+// insert() is a private function, and called by only lookup()
+std::pair<shared_ptr<name_tree::Entry>, bool>
+NameTree::insert(const Name& prefix)
+{
+  NFD_LOG_TRACE("insert " << prefix);
+
+  size_t hashValue = name_tree::computeHash(prefix);
+  size_t loc = hashValue % m_nBuckets;
+
+  NFD_LOG_TRACE("Name " << prefix << " hash value = " << hashValue << "  location = " << loc);
+
+  // Check if this Name has been stored
+  name_tree::Node* node = m_buckets[loc];
+  name_tree::Node* nodePrev = node;  // initialize nodePrev to node
+
+  for (node = m_buckets[loc]; node != 0; node = node->m_next)
+    {
+      if (static_cast<bool>(node->m_entry))
+        {
+          if (prefix == node->m_entry->m_prefix)
+            {
+              return std::make_pair(node->m_entry, false); // false: old entry
+            }
+        }
+      nodePrev = node;
+    }
+
+  NFD_LOG_TRACE("Did not find " << prefix << ", need to insert it to the table");
+
+  // If no bucket is empty occupied, we need to create a new node, and it is
+  // linked from nodePrev
+  node = new name_tree::Node();
+  node->m_prev = nodePrev;
+
+  if (nodePrev == 0)
+    {
+      m_buckets[loc] = node;
+    }
+  else
+    {
+      nodePrev->m_next = node;
+    }
+
+  // Create a new Entry
+  shared_ptr<name_tree::Entry> entry(make_shared<name_tree::Entry>(prefix));
+  entry->setHash(hashValue);
+  node->m_entry = entry; // link the Entry to its Node
+  entry->m_node = node; // link the node to Entry. Used in eraseEntryIfEmpty.
+
+  return std::make_pair(entry, true); // true: new entry
+}
+
+// Name Prefix Lookup. Create Name Tree Entry if not found
+shared_ptr<name_tree::Entry>
+NameTree::lookup(const Name& prefix)
+{
+  NFD_LOG_TRACE("lookup " << prefix);
+
+  shared_ptr<name_tree::Entry> entry;
+  shared_ptr<name_tree::Entry> parent;
+
+  for (size_t i = 0; i <= prefix.size(); i++)
+    {
+      Name temp = prefix.getPrefix(i);
+
+      // insert() will create the entry if it does not exist.
+      std::pair<shared_ptr<name_tree::Entry>, bool> ret = insert(temp);
+      entry = ret.first;
+
+      if (ret.second == true)
+        {
+          m_nItems++; // Increase the counter
+          entry->m_parent = parent;
+
+          if (static_cast<bool>(parent))
+            {
+              parent->m_children.push_back(entry);
+            }
+        }
+
+      if (m_nItems > m_enlargeThreshold)
+        {
+          resize(m_enlargeFactor * m_nBuckets);
+        }
+
+      parent = entry;
+    }
+  return entry;
+}
+
+// Exact Match
+shared_ptr<name_tree::Entry>
+NameTree::findExactMatch(const Name& prefix) const
+{
+  NFD_LOG_TRACE("findExactMatch " << prefix);
+
+  size_t hashValue = name_tree::computeHash(prefix);
+  size_t loc = hashValue % m_nBuckets;
+
+  NFD_LOG_TRACE("Name " << prefix << " hash value = " << hashValue <<
+                "  location = " << loc);
+
+  shared_ptr<name_tree::Entry> entry;
+  name_tree::Node* node = 0;
+
+  for (node = m_buckets[loc]; node != 0; node = node->m_next)
+    {
+      entry = node->m_entry;
+      if (static_cast<bool>(entry))
+        {
+          if (hashValue == entry->getHash() && prefix == entry->getPrefix())
+            {
+              return entry;
+            }
+        } // if entry
+    } // for node
+
+  // if not found, the default value of entry (null pointer) will be returned
+  entry.reset();
+  return entry;
+}
+
+// Longest Prefix Match
+shared_ptr<name_tree::Entry>
+NameTree::findLongestPrefixMatch(const Name& prefix, const name_tree::EntrySelector& entrySelector) const
+{
+  NFD_LOG_TRACE("findLongestPrefixMatch " << prefix);
+
+  shared_ptr<name_tree::Entry> entry;
+  std::vector<size_t> hashValueSet = name_tree::computeHashSet(prefix);
+
+  size_t hashValue = 0;
+  size_t loc = 0;
+
+  for (int i = static_cast<int>(prefix.size()); i >= 0; i--)
+    {
+      hashValue = hashValueSet[i];
+      loc = hashValue % m_nBuckets;
+
+      name_tree::Node* node = 0;
+      for (node = m_buckets[loc]; node != 0; node = node->m_next)
+        {
+          entry = node->m_entry;
+          if (static_cast<bool>(entry))
+            {
+              // isPrefixOf() is used to avoid making a copy of the name
+              if (hashValue == entry->getHash() &&
+                  entry->getPrefix().isPrefixOf(prefix) &&
+                  entrySelector(*entry))
+                {
+                  return entry;
+                }
+            } // if entry
+        } // for node
+    }
+
+  // if not found, the default value of entry (null pointer) will be returned
+  entry.reset();
+  return entry;
+}
+
+shared_ptr<name_tree::Entry>
+NameTree::findLongestPrefixMatch(shared_ptr<name_tree::Entry> entry,
+                                 const name_tree::EntrySelector& entrySelector) const
+{
+  while (static_cast<bool>(entry))
+    {
+      if (entrySelector(*entry))
+        return entry;
+      entry = entry->getParent();
+    }
+  return shared_ptr<name_tree::Entry>();
+}
+
+// return {false: this entry is not empty, true: this entry is empty and erased}
+bool
+NameTree::eraseEntryIfEmpty(shared_ptr<name_tree::Entry> entry)
+{
+  BOOST_ASSERT(static_cast<bool>(entry));
+
+  NFD_LOG_TRACE("eraseEntryIfEmpty " << entry->getPrefix());
+
+  // first check if this Entry can be erased
+  if (entry->isEmpty())
+    {
+      // update child-related info in the parent
+      shared_ptr<name_tree::Entry> parent = entry->getParent();
+
+      if (static_cast<bool>(parent))
+        {
+          std::vector<shared_ptr<name_tree::Entry> >& parentChildrenList =
+            parent->getChildren();
+
+          bool isFound = false;
+          size_t size = parentChildrenList.size();
+          for (size_t i = 0; i < size; i++)
+            {
+              if (parentChildrenList[i] == entry)
+                {
+                  parentChildrenList[i] = parentChildrenList[size - 1];
+                  parentChildrenList.pop_back();
+                  isFound = true;
+                  break;
+                }
+            }
+
+          BOOST_ASSERT(isFound == true);
+        }
+
+      // remove this Entry and its Name Tree Node
+      name_tree::Node* node = entry->m_node;
+      name_tree::Node* nodePrev = node->m_prev;
+
+      // configure the previous node
+      if (nodePrev != 0)
+        {
+          // link the previous node to the next node
+          nodePrev->m_next = node->m_next;
+        }
+      else
+        {
+          m_buckets[entry->getHash() % m_nBuckets] = node->m_next;
+        }
+
+      // link the previous node with the next node (skip the erased one)
+      if (node->m_next != 0)
+        {
+          node->m_next->m_prev = nodePrev;
+          node->m_next = 0;
+        }
+
+      BOOST_ASSERT(node->m_next == 0);
+
+      m_nItems--;
+      delete node;
+
+      if (static_cast<bool>(parent))
+        eraseEntryIfEmpty(parent);
+
+      size_t newNBuckets = static_cast<size_t>(m_shrinkFactor *
+                                     static_cast<double>(m_nBuckets));
+
+      if (newNBuckets >= m_minNBuckets && m_nItems < m_shrinkThreshold)
+        {
+          resize(newNBuckets);
+        }
+
+      return true;
+
+    } // if this entry is empty
+
+  return false; // if this entry is not empty
+}
+
+NameTree::const_iterator
+NameTree::fullEnumerate(const name_tree::EntrySelector& entrySelector) const
+{
+  NFD_LOG_TRACE("fullEnumerate");
+
+  // find the first eligible entry
+  for (size_t i = 0; i < m_nBuckets; i++)
+    {
+      for (name_tree::Node* node = m_buckets[i]; node != 0; node = node->m_next)
+        {
+          if (static_cast<bool>(node->m_entry) && entrySelector(*node->m_entry))
+            {
+              const_iterator it(FULL_ENUMERATE_TYPE, *this, node->m_entry, entrySelector);
+              return it;
+            }
+        }
+    }
+
+  // If none of the entry satisfies the requirements, then return the end() iterator.
+  return end();
+}
+
+NameTree::const_iterator
+NameTree::partialEnumerate(const Name& prefix,
+                           const name_tree::EntrySubTreeSelector& entrySubTreeSelector) const
+{
+  // the first step is to process the root node
+  shared_ptr<name_tree::Entry> entry = findExactMatch(prefix);
+  if (!static_cast<bool>(entry))
+    {
+      return end();
+    }
+
+  std::pair<bool, bool>result = entrySubTreeSelector(*entry);
+  const_iterator it(PARTIAL_ENUMERATE_TYPE,
+                    *this,
+                    entry,
+                    name_tree::AnyEntry(),
+                    entrySubTreeSelector);
+
+  it.m_shouldVisitChildren = (result.second && entry->hasChildren());
+
+  if (result.first)
+    {
+      // root node is acceptable
+      return it;
+    }
+  else
+    {
+      // let the ++ operator handle it
+      ++it;
+      return it;
+    }
+}
+
+NameTree::const_iterator
+NameTree::findAllMatches(const Name& prefix,
+                         const name_tree::EntrySelector& entrySelector) const
+{
+  NFD_LOG_TRACE("NameTree::findAllMatches" << prefix);
+
+  // As we are using Name Prefix Hash Table, and the current LPM() is
+  // implemented as starting from full name, and reduce the number of
+  // components by 1 each time, we could use it here.
+  // For trie-like design, it could be more efficient by walking down the
+  // trie from the root node.
+
+  shared_ptr<name_tree::Entry> entry = findLongestPrefixMatch(prefix, entrySelector);
+
+  if (static_cast<bool>(entry))
+    {
+      const_iterator it(FIND_ALL_MATCHES_TYPE, *this, entry, entrySelector);
+      return it;
+    }
+  // If none of the entry satisfies the requirements, then return the end() iterator.
+  return end();
+}
+
+// Hash Table Resize
+void
+NameTree::resize(size_t newNBuckets)
+{
+  NFD_LOG_TRACE("resize");
+
+  name_tree::Node** newBuckets = new name_tree::Node*[newNBuckets];
+  size_t count = 0;
+
+  // referenced ccnx hashtb.c hashtb_rehash()
+  name_tree::Node** pp = 0;
+  name_tree::Node* p = 0;
+  name_tree::Node* pre = 0;
+  name_tree::Node* q = 0; // record p->m_next
+  size_t i;
+  uint32_t h;
+  uint32_t b;
+
+  for (i = 0; i < newNBuckets; i++)
+    {
+      newBuckets[i] = 0;
+    }
+
+  for (i = 0; i < m_nBuckets; i++)
+    {
+      for (p = m_buckets[i]; p != 0; p = q)
+        {
+          count++;
+          q = p->m_next;
+          BOOST_ASSERT(static_cast<bool>(p->m_entry));
+          h = p->m_entry->m_hash;
+          b = h % newNBuckets;
+          pre = 0;
+          for (pp = &newBuckets[b]; *pp != 0; pp = &((*pp)->m_next))
+            {
+              pre = *pp;
+              continue;
+            }
+          p->m_prev = pre;
+          p->m_next = *pp; // Actually *pp always == 0 in this case
+          *pp = p;
+        }
+    }
+
+  BOOST_ASSERT(count == m_nItems);
+
+  name_tree::Node** oldBuckets = m_buckets;
+  m_buckets = newBuckets;
+  delete [] oldBuckets;
+
+  m_nBuckets = newNBuckets;
+
+  m_enlargeThreshold = static_cast<size_t>(m_enlargeLoadFactor *
+                                              static_cast<double>(m_nBuckets));
+  m_shrinkThreshold = static_cast<size_t>(m_shrinkLoadFactor *
+                                              static_cast<double>(m_nBuckets));
+}
+
+// For debugging
+void
+NameTree::dump(std::ostream& output) const
+{
+  NFD_LOG_TRACE("dump()");
+
+  name_tree::Node* node = 0;
+  shared_ptr<name_tree::Entry> entry;
+
+  using std::endl;
+
+  for (size_t i = 0; i < m_nBuckets; i++)
+    {
+      for (node = m_buckets[i]; node != 0; node = node->m_next)
+        {
+          entry = node->m_entry;
+
+          // if the Entry exist, dump its information
+          if (static_cast<bool>(entry))
+            {
+              output << "Bucket" << i << "\t" << entry->m_prefix.toUri() << endl;
+              output << "\t\tHash " << entry->m_hash << endl;
+
+              if (static_cast<bool>(entry->m_parent))
+                {
+                  output << "\t\tparent->" << entry->m_parent->m_prefix.toUri();
+                }
+              else
+                {
+                  output << "\t\tROOT";
+                }
+              output << endl;
+
+              if (entry->m_children.size() != 0)
+                {
+                  output << "\t\tchildren = " << entry->m_children.size() << endl;
+
+                  for (size_t j = 0; j < entry->m_children.size(); j++)
+                    {
+                      output << "\t\t\tChild " << j << " " <<
+                        entry->m_children[j]->getPrefix() << endl;
+                    }
+                }
+
+            } // if (static_cast<bool>(entry))
+
+        } // for node
+    } // for int i
+
+  output << "Bucket count = " << m_nBuckets << endl;
+  output << "Stored item = " << m_nItems << endl;
+  output << "--------------------------\n";
+}
+
+NameTree::const_iterator::const_iterator(NameTree::IteratorType type,
+                            const NameTree& nameTree,
+                            shared_ptr<name_tree::Entry> entry,
+                            const name_tree::EntrySelector& entrySelector,
+                            const name_tree::EntrySubTreeSelector& entrySubTreeSelector)
+  : m_nameTree(nameTree)
+  , m_entry(entry)
+  , m_subTreeRoot(entry)
+  , m_entrySelector(make_shared<name_tree::EntrySelector>(entrySelector))
+  , m_entrySubTreeSelector(make_shared<name_tree::EntrySubTreeSelector>(entrySubTreeSelector))
+  , m_type(type)
+  , m_shouldVisitChildren(true)
+{
+}
+
+// operator++()
+NameTree::const_iterator
+NameTree::const_iterator::operator++()
+{
+  NFD_LOG_TRACE("const_iterator::operator++()");
+
+  BOOST_ASSERT(m_entry != m_nameTree.m_end);
+
+  if (m_type == FULL_ENUMERATE_TYPE) // fullEnumerate
+    {
+      bool isFound = false;
+      // process the entries in the same bucket first
+      while (m_entry->m_node->m_next != 0)
+        {
+          m_entry = m_entry->m_node->m_next->m_entry;
+          if ((*m_entrySelector)(*m_entry))
+            {
+              isFound = true;
+              return *this;
+            }
+        }
+
+      // process other buckets
+
+      for (int newLocation = m_entry->m_hash % m_nameTree.m_nBuckets + 1;
+           newLocation < static_cast<int>(m_nameTree.m_nBuckets);
+           ++newLocation)
+        {
+          // process each bucket
+          name_tree::Node* node = m_nameTree.m_buckets[newLocation];
+          while (node != 0)
+            {
+              m_entry = node->m_entry;
+              if ((*m_entrySelector)(*m_entry))
+                {
+                  isFound = true;
+                  return *this;
+                }
+              node = node->m_next;
+            }
+        }
+      BOOST_ASSERT(isFound == false);
+      // Reach to the end()
+      m_entry = m_nameTree.m_end;
+      return *this;
+    }
+
+  if (m_type == PARTIAL_ENUMERATE_TYPE) // partialEnumerate
+    {
+      // We use pre-order traversal.
+      // if at the root, it could have already been accepted, or this
+      // iterator was just declared, and root doesn't satisfy the
+      // requirement
+      // The if() section handles this special case
+      // Essentially, we need to check root's fist child, and the rest will
+      // be the same as normal process
+      if (m_entry == m_subTreeRoot)
+        {
+          if (m_shouldVisitChildren)
+            {
+              m_entry = m_entry->getChildren()[0];
+              std::pair<bool, bool> result = ((*m_entrySubTreeSelector)(*m_entry));
+              m_shouldVisitChildren = (result.second && m_entry->hasChildren());
+              if(result.first)
+                {
+                  return *this;
+                }
+              else
+                {
+                  // the first child did not meet the requirement
+                  // the rest of the process can just fall through the while loop
+                  // as normal
+                }
+            }
+          else
+            {
+              // no children, should return end();
+              // just fall through
+            }
+        }
+
+      // The first thing to do is to visit its child, or go to find its possible
+      // siblings
+      while (m_entry != m_subTreeRoot)
+        {
+          if (m_shouldVisitChildren)
+            {
+              // If this subtree should be visited
+              m_entry = m_entry->getChildren()[0];
+              std::pair<bool, bool> result = ((*m_entrySubTreeSelector)(*m_entry));
+              m_shouldVisitChildren = (result.second && m_entry->hasChildren());
+              if (result.first) // if this node is acceptable
+                {
+                  return *this;
+                }
+              else
+                {
+                  // do nothing, as this node is essentially ignored
+                  // send this node to the while loop.
+                }
+            }
+          else
+            {
+              // Should try to find its sibling
+              shared_ptr<name_tree::Entry> parent = m_entry->getParent();
+
+              std::vector<shared_ptr<name_tree::Entry> >& parentChildrenList = parent->getChildren();
+              bool isFound = false;
+              size_t i = 0;
+              for (i = 0; i < parentChildrenList.size(); i++)
+                {
+                  if (parentChildrenList[i] == m_entry)
+                    {
+                      isFound = true;
+                      break;
+                    }
+                }
+
+              BOOST_ASSERT(isFound == true);
+              if (i < parentChildrenList.size() - 1) // m_entry not the last child
+                {
+                  m_entry = parentChildrenList[i + 1];
+                  std::pair<bool, bool> result = ((*m_entrySubTreeSelector)(*m_entry));
+                  m_shouldVisitChildren = (result.second && m_entry->hasChildren());
+                  if (result.first) // if this node is acceptable
+                    {
+                      return *this;
+                    }
+                  else
+                    {
+                      // do nothing, as this node is essentially ignored
+                      // send this node to the while loop.
+                    }
+                }
+              else
+                {
+                  // m_entry is the last child, no more sibling, should try to find parent's sibling
+                  m_shouldVisitChildren = false;
+                  m_entry = parent;
+                }
+            }
+        }
+
+      m_entry = m_nameTree.m_end;
+      return *this;
+    }
+
+  if (m_type == FIND_ALL_MATCHES_TYPE) // findAllMatches
+    {
+      // Assumption: at the beginning, m_entry was initialized with the first
+      // eligible Name Tree entry (i.e., has a PIT entry that can be satisfied
+      // by the Data packet)
+
+      while (static_cast<bool>(m_entry->getParent()))
+        {
+          m_entry = m_entry->getParent();
+          if ((*m_entrySelector)(*m_entry))
+            return *this;
+        }
+
+      // Reach to the end (Root)
+      m_entry = m_nameTree.m_end;
+      return *this;
+    }
+
+  BOOST_ASSERT(false); // unknown type
+  return *this;
+}
+
+} // namespace nfd
diff --git a/daemon/table/name-tree.hpp b/daemon/table/name-tree.hpp
new file mode 100644
index 0000000..2f404bf
--- /dev/null
+++ b/daemon/table/name-tree.hpp
@@ -0,0 +1,375 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+// Name Tree (Name Prefix Hash Table)
+
+#ifndef NFD_DAEMON_TABLE_NAME_TREE_HPP
+#define NFD_DAEMON_TABLE_NAME_TREE_HPP
+
+#include "common.hpp"
+#include "name-tree-entry.hpp"
+
+namespace nfd {
+namespace name_tree {
+
+/**
+ * \brief Compute the hash value of the given name prefix's WIRE FORMAT
+ */
+size_t
+computeHash(const Name& prefix);
+
+/**
+ * \brief Incrementally compute hash values
+ * \return Return a vector of hash values, starting from the root prefix
+ */
+std::vector<size_t>
+computeHashSet(const Name& prefix);
+
+/// a predicate to accept or reject an Entry in find operations
+typedef function<bool (const Entry& entry)> EntrySelector;
+
+/**
+ * \brief a predicate to accept or reject an Entry and its children
+ * \return .first indicates whether entry should be accepted;
+ *         .second indicates whether entry's children should be visited
+ */
+typedef function<std::pair<bool,bool> (const Entry& entry)> EntrySubTreeSelector;
+
+struct AnyEntry {
+  bool
+  operator()(const Entry& entry)
+  {
+    return true;
+  }
+};
+
+struct AnyEntrySubTree {
+  std::pair<bool, bool>
+  operator()(const Entry& entry)
+  {
+    return std::make_pair(true, true);
+  }
+};
+
+} // namespace name_tree
+
+/**
+ * \brief Class Name Tree
+ */
+class NameTree : noncopyable
+{
+public:
+  class const_iterator;
+
+  explicit
+  NameTree(size_t nBuckets = 1024);
+
+  ~NameTree();
+
+  /**
+   * \brief Get the number of occupied entries in the Name Tree
+   */
+  size_t
+  size() const;
+
+  /**
+   * \brief Get the number of buckets in the Name Tree (NPHT)
+   * \details The number of buckets is the one that used to create the hash
+   * table, i.e., m_nBuckets.
+   */
+  size_t
+  getNBuckets() const;
+
+  /**
+   * \brief Look for the Name Tree Entry that contains this name prefix.
+   * \details Starts from the shortest name prefix, and then increase the
+   * number of name components by one each time. All non-existing Name Tree
+   * Entries will be created.
+   * \param prefix The querying name prefix.
+   * \return The pointer to the Name Tree Entry that contains this full name
+   * prefix.
+   */
+  shared_ptr<name_tree::Entry>
+  lookup(const Name& prefix);
+
+  /**
+   * \brief Exact match lookup for the given name prefix.
+   * \return a null shared_ptr if this prefix is not found;
+   * otherwise return the Name Tree Entry address
+   */
+  shared_ptr<name_tree::Entry>
+  findExactMatch(const Name& prefix) const;
+
+  shared_ptr<name_tree::Entry>
+  findExactMatch(const fib::Entry& fibEntry) const;
+
+  /**
+   * \brief Erase a Name Tree Entry if this entry is empty.
+   * \details If a Name Tree Entry contains no Children, no FIB, no PIT, and
+   * no Measurements entries, then it can be erased. In addition, its parent entry
+   * will also be examined by following the parent pointer until all empty entries
+   * are erased.
+   * \param entry The pointer to the entry to be erased. The entry pointer should
+   * returned by the findExactMatch(), lookup(), or findLongestPrefixMatch() functions.
+   */
+  bool
+  eraseEntryIfEmpty(shared_ptr<name_tree::Entry> entry);
+
+  /**
+   * \brief Longest prefix matching for the given name
+   * \details Starts from the full name string, reduce the number of name component
+   * by one each time, until an Entry is found.
+   */
+  shared_ptr<name_tree::Entry>
+  findLongestPrefixMatch(const Name& prefix,
+                         const name_tree::EntrySelector& entrySelector =
+                         name_tree::AnyEntry()) const;
+
+  shared_ptr<name_tree::Entry>
+  findLongestPrefixMatch(shared_ptr<name_tree::Entry> entry,
+                         const name_tree::EntrySelector& entrySelector =
+                         name_tree::AnyEntry()) const;
+
+  /**
+   * \brief Resize the hash table size when its load factor reaches a threshold.
+   * \details As we are currently using a hand-written hash table implementation
+   * for the Name Tree, the hash table resize() function should be kept in the
+   * name-tree.hpp file.
+   * \param newNBuckets The number of buckets for the new hash table.
+   */
+  void
+  resize(size_t newNBuckets);
+
+  /**
+   * \brief Enumerate all the name prefixes stored in the Name Tree.
+   */
+  const_iterator
+  fullEnumerate(const name_tree::EntrySelector& entrySelector = name_tree::AnyEntry()) const;
+
+  /**
+   * \brief Enumerate all the name prefixes that satisfies the EntrySubTreeSelector.
+  */
+  const_iterator
+  partialEnumerate(const Name& prefix,
+                   const name_tree::EntrySubTreeSelector& entrySubTreeSelector =
+                         name_tree::AnyEntrySubTree()) const;
+
+  /**
+   * \brief Enumerate all the name prefixes that satisfy the prefix and entrySelector
+   */
+  const_iterator
+  findAllMatches(const Name& prefix,
+                 const name_tree::EntrySelector& entrySelector = name_tree::AnyEntry()) const;
+
+  /**
+   * \brief Dump all the information stored in the Name Tree for debugging.
+   */
+  void
+  dump(std::ostream& output) const;
+
+  shared_ptr<name_tree::Entry>
+  get(const fib::Entry& fibEntry) const;
+
+  shared_ptr<name_tree::Entry>
+  get(const pit::Entry& pitEntry) const;
+
+  shared_ptr<name_tree::Entry>
+  get(const measurements::Entry& measurementsEntry) const;
+
+  shared_ptr<name_tree::Entry>
+  get(const strategy_choice::Entry& strategeChoiceEntry) const;
+
+  const_iterator
+  begin() const;
+
+  const_iterator
+  end() const;
+
+  enum IteratorType
+  {
+    FULL_ENUMERATE_TYPE,
+    PARTIAL_ENUMERATE_TYPE,
+    FIND_ALL_MATCHES_TYPE
+  };
+
+  class const_iterator : public std::iterator<std::forward_iterator_tag, name_tree::Entry>
+  {
+  public:
+    friend class NameTree;
+
+    const_iterator(NameTree::IteratorType type,
+      const NameTree& nameTree,
+      shared_ptr<name_tree::Entry> entry,
+      const name_tree::EntrySelector& entrySelector = name_tree::AnyEntry(),
+      const name_tree::EntrySubTreeSelector& entrySubTreeSelector = name_tree::AnyEntrySubTree());
+
+    ~const_iterator();
+
+    const name_tree::Entry&
+    operator*() const;
+
+    shared_ptr<name_tree::Entry>
+    operator->() const;
+
+    const_iterator
+    operator++();
+
+    const_iterator
+    operator++(int);
+
+    bool
+    operator==(const const_iterator& other) const;
+
+    bool
+    operator!=(const const_iterator& other) const;
+
+  private:
+    const NameTree&                             m_nameTree;
+    shared_ptr<name_tree::Entry>                m_entry;
+    shared_ptr<name_tree::Entry>                m_subTreeRoot;
+    shared_ptr<name_tree::EntrySelector>        m_entrySelector;
+    shared_ptr<name_tree::EntrySubTreeSelector> m_entrySubTreeSelector;
+    NameTree::IteratorType                      m_type;
+    bool                                        m_shouldVisitChildren;
+  };
+
+private:
+  size_t                        m_nItems;  // Number of items being stored
+  size_t                        m_nBuckets; // Number of hash buckets
+  size_t                        m_minNBuckets; // Minimum number of hash buckets
+  double                        m_enlargeLoadFactor;
+  size_t                        m_enlargeThreshold;
+  int                           m_enlargeFactor;
+  double                        m_shrinkLoadFactor;
+  size_t                        m_shrinkThreshold;
+  double                        m_shrinkFactor;
+  name_tree::Node**             m_buckets; // Name Tree Buckets in the NPHT
+  shared_ptr<name_tree::Entry>  m_end;
+  const_iterator                m_endIterator;
+
+  /**
+   * \brief Create a Name Tree Entry if it does not exist, or return the existing
+   * Name Tree Entry address.
+   * \details Called by lookup() only.
+   * \return The first item is the Name Tree Entry address, the second item is
+   * a bool value indicates whether this is an old entry (false) or a new
+   * entry (true).
+   */
+  std::pair<shared_ptr<name_tree::Entry>, bool>
+  insert(const Name& prefix);
+};
+
+inline NameTree::const_iterator::~const_iterator()
+{
+}
+
+inline size_t
+NameTree::size() const
+{
+  return m_nItems;
+}
+
+inline size_t
+NameTree::getNBuckets() const
+{
+  return m_nBuckets;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::findExactMatch(const fib::Entry& fibEntry) const
+{
+  return fibEntry.m_nameTreeEntry;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::get(const fib::Entry& fibEntry) const
+{
+  return fibEntry.m_nameTreeEntry;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::get(const pit::Entry& pitEntry) const
+{
+  return pitEntry.m_nameTreeEntry;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::get(const measurements::Entry& measurementsEntry) const
+{
+  return measurementsEntry.m_nameTreeEntry;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::get(const strategy_choice::Entry& strategeChoiceEntry) const
+{
+  return strategeChoiceEntry.m_nameTreeEntry;
+}
+
+inline NameTree::const_iterator
+NameTree::begin() const
+{
+  return fullEnumerate();
+}
+
+inline NameTree::const_iterator
+NameTree::end() const
+{
+  return m_endIterator;
+}
+
+inline const name_tree::Entry&
+NameTree::const_iterator::operator*() const
+{
+  return *m_entry;
+}
+
+inline shared_ptr<name_tree::Entry>
+NameTree::const_iterator::operator->() const
+{
+  return m_entry;
+}
+
+inline NameTree::const_iterator
+NameTree::const_iterator::operator++(int)
+{
+  NameTree::const_iterator temp(*this);
+  ++(*this);
+  return temp;
+}
+
+inline bool
+NameTree::const_iterator::operator==(const NameTree::const_iterator& other) const
+{
+  return m_entry == other.m_entry;
+}
+
+inline bool
+NameTree::const_iterator::operator!=(const NameTree::const_iterator& other) const
+{
+  return m_entry != other.m_entry;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_NAME_TREE_HPP
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
new file mode 100644
index 0000000..e607dba
--- /dev/null
+++ b/daemon/table/pit-entry.cpp
@@ -0,0 +1,197 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "pit-entry.hpp"
+#include <algorithm>
+
+namespace nfd {
+namespace pit {
+
+const Name Entry::LOCALHOST_NAME("ndn:/localhost");
+const Name Entry::LOCALHOP_NAME("ndn:/localhop");
+
+Entry::Entry(const Interest& interest)
+  : m_interest(interest)
+{
+}
+
+const Name&
+Entry::getName() const
+{
+  return m_interest.getName();
+}
+
+const InRecordCollection&
+Entry::getInRecords() const
+{
+  return m_inRecords;
+}
+
+const OutRecordCollection&
+Entry::getOutRecords() const
+{
+  return m_outRecords;
+}
+
+static inline bool
+predicate_InRecord_isLocal(const InRecord& inRecord)
+{
+  return inRecord.getFace()->isLocal();
+}
+
+bool
+Entry::hasLocalInRecord() const
+{
+  InRecordCollection::const_iterator it = std::find_if(
+    m_inRecords.begin(), m_inRecords.end(), &predicate_InRecord_isLocal);
+  return it != m_inRecords.end();
+}
+
+static inline bool
+predicate_FaceRecord_Face(const FaceRecord& faceRecord, const Face* face)
+{
+  return faceRecord.getFace().get() == face;
+}
+
+static inline bool
+predicate_FaceRecord_ne_Face_and_unexpired(const FaceRecord& faceRecord,
+  const Face* face, const time::steady_clock::TimePoint& now)
+{
+  return faceRecord.getFace().get() != face && faceRecord.getExpiry() >= now;
+}
+
+bool
+Entry::canForwardTo(const Face& face) const
+{
+  OutRecordCollection::const_iterator outIt = std::find_if(
+    m_outRecords.begin(), m_outRecords.end(),
+    bind(&predicate_FaceRecord_Face, _1, &face));
+  bool hasUnexpiredOutRecord = outIt != m_outRecords.end() &&
+                               outIt->getExpiry() >= time::steady_clock::now();
+  if (hasUnexpiredOutRecord) {
+    return false;
+  }
+
+  InRecordCollection::const_iterator inIt = std::find_if(
+    m_inRecords.begin(), m_inRecords.end(),
+    bind(&predicate_FaceRecord_ne_Face_and_unexpired, _1, &face, time::steady_clock::now()));
+  bool hasUnexpiredOtherInRecord = inIt != m_inRecords.end();
+  if (!hasUnexpiredOtherInRecord) {
+    return false;
+  }
+
+  return !this->violatesScope(face);
+}
+
+bool
+Entry::violatesScope(const Face& face) const
+{
+  // /localhost scope
+  bool isViolatingLocalhost = !face.isLocal() &&
+                              LOCALHOST_NAME.isPrefixOf(this->getName());
+  if (isViolatingLocalhost) {
+    return true;
+  }
+
+  // /localhop scope
+  bool isViolatingLocalhop = !face.isLocal() &&
+                             LOCALHOP_NAME.isPrefixOf(this->getName()) &&
+                             !this->hasLocalInRecord();
+  if (isViolatingLocalhop) {
+    return true;
+  }
+
+  return false;
+}
+
+bool
+Entry::addNonce(uint32_t nonce)
+{
+  std::pair<std::set<uint32_t>::iterator, bool> insertResult =
+    m_nonces.insert(nonce);
+
+  return insertResult.second;
+}
+
+InRecordCollection::iterator
+Entry::insertOrUpdateInRecord(shared_ptr<Face> face, const Interest& interest)
+{
+  InRecordCollection::iterator it = std::find_if(m_inRecords.begin(),
+    m_inRecords.end(), bind(&predicate_FaceRecord_Face, _1, face.get()));
+  if (it == m_inRecords.end()) {
+    m_inRecords.push_front(InRecord(face));
+    it = m_inRecords.begin();
+  }
+
+  it->update(interest);
+  return it;
+}
+
+void
+Entry::deleteInRecords()
+{
+  m_inRecords.clear();
+}
+
+OutRecordCollection::iterator
+Entry::insertOrUpdateOutRecord(shared_ptr<Face> face, const Interest& interest)
+{
+  OutRecordCollection::iterator it = std::find_if(m_outRecords.begin(),
+    m_outRecords.end(), bind(&predicate_FaceRecord_Face, _1, face.get()));
+  if (it == m_outRecords.end()) {
+    m_outRecords.push_front(OutRecord(face));
+    it = m_outRecords.begin();
+  }
+
+  it->update(interest);
+  m_nonces.insert(interest.getNonce());
+  return it;
+}
+
+void
+Entry::deleteOutRecord(shared_ptr<Face> face)
+{
+  OutRecordCollection::iterator it = std::find_if(m_outRecords.begin(),
+    m_outRecords.end(), bind(&predicate_FaceRecord_Face, _1, face.get()));
+  if (it != m_outRecords.end()) {
+    m_outRecords.erase(it);
+  }
+}
+
+static inline bool
+predicate_FaceRecord_unexpired(const FaceRecord& faceRecord, const time::steady_clock::TimePoint& now)
+{
+  return faceRecord.getExpiry() >= now;
+}
+
+bool
+Entry::hasUnexpiredOutRecords() const
+{
+  OutRecordCollection::const_iterator it = std::find_if(m_outRecords.begin(),
+    m_outRecords.end(), bind(&predicate_FaceRecord_unexpired, _1, time::steady_clock::now()));
+  return it != m_outRecords.end();
+}
+
+} // namespace pit
+} // namespace nfd
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
new file mode 100644
index 0000000..c419f78
--- /dev/null
+++ b/daemon/table/pit-entry.hpp
@@ -0,0 +1,168 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_PIT_ENTRY_HPP
+#define NFD_DAEMON_TABLE_PIT_ENTRY_HPP
+
+#include "pit-in-record.hpp"
+#include "pit-out-record.hpp"
+#include "core/scheduler.hpp"
+
+namespace nfd {
+
+class NameTree;
+
+namespace name_tree {
+class Entry;
+}
+
+namespace pit {
+
+/** \class InRecordCollection
+ *  \brief represents an unordered collection of InRecords
+ */
+typedef std::list< InRecord>  InRecordCollection;
+
+/** \class OutRecordCollection
+ *  \brief represents an unordered collection of OutRecords
+ */
+typedef std::list<OutRecord> OutRecordCollection;
+
+/** \brief represents a PIT entry
+ */
+class Entry : public StrategyInfoHost, noncopyable
+{
+public:
+  explicit
+  Entry(const Interest& interest);
+
+  const Interest&
+  getInterest() const;
+
+  /** \return Interest Name
+   */
+  const Name&
+  getName() const;
+
+  const InRecordCollection&
+  getInRecords() const;
+
+  const OutRecordCollection&
+  getOutRecords() const;
+
+  /** \brief determines whether any InRecord is a local Face
+   *
+   *  \return true if any InRecord is a local Face,
+   *          false if all InRecords are non-local Faces
+   */
+  bool
+  hasLocalInRecord() const;
+
+  /** \brief decides whether Interest can be forwarded to face
+   *
+   *  \return true if OutRecord of this face does not exist or has expired,
+   *          and there is an InRecord not of this face,
+   *          and scope is not violated
+   */
+  bool
+  canForwardTo(const Face& face) const;
+
+  /** \brief decides whether forwarding Interest to face would violate scope
+   *
+   *  \return true if scope control would be violated
+   *  \note canForwardTo has more comprehensive checks (including scope control)
+   *        and should be used by most strategies. Outgoing Interest pipeline
+   *        should only check scope because some strategy (eg. vehicular) needs
+   *        to retransmit sooner than OutRecord expiry, or forward Interest
+   *        back to incoming face
+   */
+  bool
+  violatesScope(const Face& face) const;
+
+  /** \brief records a nonce
+   *
+   *  \return true if nonce is new; false if nonce is seen before
+   */
+  bool
+  addNonce(uint32_t nonce);
+
+  /** \brief inserts a InRecord for face, and updates it with interest
+   *
+   *  If InRecord for face exists, the existing one is updated.
+   *  This method does not add the Nonce as a seen Nonce.
+   *  \return an iterator to the InRecord
+   */
+  InRecordCollection::iterator
+  insertOrUpdateInRecord(shared_ptr<Face> face, const Interest& interest);
+
+  /// deletes all InRecords
+  void
+  deleteInRecords();
+
+  /** \brief inserts a OutRecord for face, and updates it with interest
+   *
+   *  If OutRecord for face exists, the existing one is updated.
+   *  \return an iterator to the OutRecord
+   */
+  OutRecordCollection::iterator
+  insertOrUpdateOutRecord(shared_ptr<Face> face, const Interest& interest);
+
+  /// deletes one OutRecord for face if exists
+  void
+  deleteOutRecord(shared_ptr<Face> face);
+
+  /** \return true if there is one or more unexpired OutRecords
+   */
+  bool
+  hasUnexpiredOutRecords() const;
+
+public:
+  EventId m_unsatisfyTimer;
+  EventId m_stragglerTimer;
+
+private:
+  std::set<uint32_t> m_nonces;
+  const Interest m_interest;
+  InRecordCollection m_inRecords;
+  OutRecordCollection m_outRecords;
+
+  static const Name LOCALHOST_NAME;
+  static const Name LOCALHOP_NAME;
+
+  shared_ptr<name_tree::Entry> m_nameTreeEntry;
+
+  friend class nfd::NameTree;
+  friend class nfd::name_tree::Entry;
+};
+
+inline const Interest&
+Entry::getInterest() const
+{
+  return m_interest;
+}
+
+} // namespace pit
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
new file mode 100644
index 0000000..2102baf
--- /dev/null
+++ b/daemon/table/pit-face-record.cpp
@@ -0,0 +1,62 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "pit-face-record.hpp"
+
+namespace nfd {
+namespace pit {
+
+FaceRecord::FaceRecord(shared_ptr<Face> face)
+  : m_face(face)
+  , m_lastNonce(0)
+  , m_lastRenewed(time::steady_clock::TimePoint::min())
+  , m_expiry(time::steady_clock::TimePoint::min())
+{
+}
+
+FaceRecord::FaceRecord(const FaceRecord& other)
+  : m_face(other.m_face)
+  , m_lastNonce(other.m_lastNonce)
+  , m_lastRenewed(other.m_lastRenewed)
+  , m_expiry(other.m_expiry)
+{
+}
+
+void
+FaceRecord::update(const Interest& interest)
+{
+  m_lastNonce = interest.getNonce();
+  m_lastRenewed = time::steady_clock::now();
+
+  static const time::milliseconds DEFAULT_INTEREST_LIFETIME = time::milliseconds(4000);
+  time::milliseconds lifetime = interest.getInterestLifetime();
+  if (lifetime < time::milliseconds::zero()) {
+    lifetime = DEFAULT_INTEREST_LIFETIME;
+  }
+  m_expiry = m_lastRenewed + time::milliseconds(lifetime);
+}
+
+
+} // namespace pit
+} // namespace nfd
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
new file mode 100644
index 0000000..a4cea26
--- /dev/null
+++ b/daemon/table/pit-face-record.hpp
@@ -0,0 +1,101 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
+#define NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
+
+#include "face/face.hpp"
+#include "strategy-info-host.hpp"
+
+namespace nfd {
+namespace pit {
+
+/** \class FaceRecord
+ *  \brief contains information about an Interest
+ *         on an incoming or outgoing face
+ *  \note This is an implementation detail to extract common functionality
+ *        of InRecord and OutRecord
+ */
+class FaceRecord : public StrategyInfoHost
+{
+public:
+  explicit
+  FaceRecord(shared_ptr<Face> face);
+
+  FaceRecord(const FaceRecord& other);
+
+  shared_ptr<Face>
+  getFace() const;
+
+  uint32_t
+  getLastNonce() const;
+
+  time::steady_clock::TimePoint
+  getLastRenewed() const;
+
+  /** \brief gives the time point this record expires
+   *  \return getLastRenewed() + InterestLifetime
+   */
+  time::steady_clock::TimePoint
+  getExpiry() const;
+
+  /// updates lastNonce, lastRenewed, expiry fields
+  void
+  update(const Interest& interest);
+
+private:
+  shared_ptr<Face> m_face;
+  uint32_t m_lastNonce;
+  time::steady_clock::TimePoint m_lastRenewed;
+  time::steady_clock::TimePoint m_expiry;
+};
+
+inline shared_ptr<Face>
+FaceRecord::getFace() const
+{
+  return m_face;
+}
+
+inline uint32_t
+FaceRecord::getLastNonce() const
+{
+  return m_lastNonce;
+}
+
+inline time::steady_clock::TimePoint
+FaceRecord::getLastRenewed() const
+{
+  return m_lastRenewed;
+}
+
+inline time::steady_clock::TimePoint
+FaceRecord::getExpiry() const
+{
+  return m_expiry;
+}
+
+} // namespace pit
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
diff --git a/daemon/table/pit-in-record.cpp b/daemon/table/pit-in-record.cpp
new file mode 100644
index 0000000..55df06b
--- /dev/null
+++ b/daemon/table/pit-in-record.cpp
@@ -0,0 +1,48 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "pit-in-record.hpp"
+
+namespace nfd {
+namespace pit {
+
+InRecord::InRecord(shared_ptr<Face> face)
+  : FaceRecord(face)
+{
+}
+
+InRecord::InRecord(const InRecord& other)
+  : FaceRecord(other)
+{
+}
+
+void
+InRecord::update(const Interest& interest)
+{
+  this->FaceRecord::update(interest);
+  m_interest = const_cast<Interest&>(interest).shared_from_this();
+}
+
+} // namespace pit
+} // namespace nfd
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
new file mode 100644
index 0000000..95b90ba
--- /dev/null
+++ b/daemon/table/pit-in-record.hpp
@@ -0,0 +1,64 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
+#define NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
+
+#include "pit-face-record.hpp"
+
+namespace nfd {
+namespace pit {
+
+/** \class InRecord
+ *  \brief contains information about an Interest from an incoming face
+ */
+class InRecord : public FaceRecord
+{
+public:
+  explicit
+  InRecord(shared_ptr<Face> face);
+
+  InRecord(const InRecord& other);
+
+  void
+  update(const Interest& interest);
+
+  const Interest&
+  getInterest() const;
+
+private:
+  shared_ptr<Interest> m_interest;
+};
+
+inline const Interest&
+InRecord::getInterest() const
+{
+  BOOST_ASSERT(static_cast<bool>(m_interest));
+  return *m_interest;
+}
+
+} // namespace pit
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
diff --git a/daemon/table/pit-out-record.cpp b/daemon/table/pit-out-record.cpp
new file mode 100644
index 0000000..2e74e9c
--- /dev/null
+++ b/daemon/table/pit-out-record.cpp
@@ -0,0 +1,41 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "pit-out-record.hpp"
+
+namespace nfd {
+namespace pit {
+
+OutRecord::OutRecord(shared_ptr<Face> face)
+  : FaceRecord(face)
+{
+}
+
+OutRecord::OutRecord(const OutRecord& other)
+  : FaceRecord(other)
+{
+}
+
+} // namespace pit
+} // namespace nfd
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
new file mode 100644
index 0000000..9b954e6
--- /dev/null
+++ b/daemon/table/pit-out-record.hpp
@@ -0,0 +1,48 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
+#define NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
+
+#include "pit-face-record.hpp"
+
+namespace nfd {
+namespace pit {
+
+/** \class OutRecord
+ *  \brief contains information about an Interest toward an outgoing face
+ */
+class OutRecord : public FaceRecord
+{
+public:
+  explicit
+  OutRecord(shared_ptr<Face> face);
+
+  OutRecord(const OutRecord& other);
+};
+
+} // namespace pit
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
new file mode 100644
index 0000000..9c2554a
--- /dev/null
+++ b/daemon/table/pit.cpp
@@ -0,0 +1,135 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "pit.hpp"
+
+namespace nfd {
+
+Pit::Pit(NameTree& nameTree)
+  : m_nameTree(nameTree)
+  , m_nItems(0)
+{
+}
+
+Pit::~Pit()
+{
+}
+
+static inline bool
+predicate_NameTreeEntry_hasPitEntry(const name_tree::Entry& entry)
+{
+  return entry.hasPitEntries();
+}
+
+static inline bool
+operator==(const Exclude& a, const Exclude& b)
+{
+  const Block& aBlock = a.wireEncode();
+  const Block& bBlock = b.wireEncode();
+  return aBlock.size() == bBlock.size() &&
+         0 == memcmp(aBlock.wire(), bBlock.wire(), aBlock.size());
+}
+
+static inline bool
+predicate_PitEntry_similar_Interest(shared_ptr<pit::Entry> entry,
+                                    const Interest& interest)
+{
+  const Interest& pi = entry->getInterest();
+  return pi.getName().equals(interest.getName()) &&
+         pi.getMinSuffixComponents() == interest.getMinSuffixComponents() &&
+         pi.getMaxSuffixComponents() == interest.getMaxSuffixComponents() &&
+         pi.getPublisherPublicKeyLocator() == interest.getPublisherPublicKeyLocator() &&
+         pi.getExclude() == interest.getExclude() &&
+         pi.getChildSelector() == interest.getChildSelector() &&
+         pi.getMustBeFresh() == interest.getMustBeFresh();
+}
+
+std::pair<shared_ptr<pit::Entry>, bool>
+Pit::insert(const Interest& interest)
+{
+  // - first lookup() the Interest Name in the NameTree, which will creates all
+  // the intermedia nodes, starting from the shortest prefix.
+  // - if it is guaranteed that this Interest already has a NameTree Entry, we
+  // could use findExactMatch() instead.
+  // - Alternatively, we could try to do findExactMatch() first, if not found,
+  // then do lookup().
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(interest.getName());
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  const std::vector<shared_ptr<pit::Entry> >& pitEntries = nameTreeEntry->getPitEntries();
+
+  // then check if this Interest is already in the PIT entries
+  std::vector<shared_ptr<pit::Entry> >::const_iterator it =
+    std::find_if(pitEntries.begin(), pitEntries.end(),
+                 bind(&predicate_PitEntry_similar_Interest, _1, boost::cref(interest)));
+
+  if (it != pitEntries.end())
+    {
+      return std::make_pair(*it, false);
+    }
+  else
+    {
+      shared_ptr<pit::Entry> entry = make_shared<pit::Entry>(interest);
+      nameTreeEntry->insertPitEntry(entry);
+
+      // Increase m_nItmes only if we create a new PIT Entry
+      m_nItems++;
+
+      return std::make_pair(entry, true);
+    }
+}
+
+shared_ptr<pit::DataMatchResult>
+Pit::findAllDataMatches(const Data& data) const
+{
+  shared_ptr<pit::DataMatchResult> result = make_shared<pit::DataMatchResult>();
+
+  for (NameTree::const_iterator it =
+       m_nameTree.findAllMatches(data.getName(), &predicate_NameTreeEntry_hasPitEntry);
+       it != m_nameTree.end(); it++)
+    {
+      const std::vector<shared_ptr<pit::Entry> >& pitEntries = it->getPitEntries();
+      for (size_t i = 0; i < pitEntries.size(); i++)
+        {
+          if (pitEntries[i]->getInterest().matchesData(data))
+            result->push_back(pitEntries[i]);
+        }
+    }
+
+  return result;
+}
+
+void
+Pit::erase(shared_ptr<pit::Entry> pitEntry)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(*pitEntry);
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  nameTreeEntry->erasePitEntry(pitEntry);
+  m_nameTree.eraseEntryIfEmpty(nameTreeEntry);
+
+  --m_nItems;
+}
+
+} // namespace nfd
diff --git a/daemon/table/pit.hpp b/daemon/table/pit.hpp
new file mode 100644
index 0000000..48a267b
--- /dev/null
+++ b/daemon/table/pit.hpp
@@ -0,0 +1,93 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_PIT_HPP
+#define NFD_DAEMON_TABLE_PIT_HPP
+
+#include "name-tree.hpp"
+#include "pit-entry.hpp"
+
+namespace nfd {
+namespace pit {
+
+/** \class DataMatchResult
+ *  \brief an unordered iterable of all PIT entries matching Data
+ *  This type shall support:
+ *    iterator<shared_ptr<pit::Entry>> begin()
+ *    iterator<shared_ptr<pit::Entry>> end()
+ */
+typedef std::vector<shared_ptr<pit::Entry> > DataMatchResult;
+
+} // namespace pit
+
+/** \class Pit
+ *  \brief represents the PIT
+ */
+class Pit : noncopyable
+{
+public:
+  explicit
+  Pit(NameTree& nameTree);
+
+  ~Pit();
+
+  /**
+   *  \brief Get the number of items stored in the PIT.
+   */
+  size_t
+  size() const;
+
+  /** \brief inserts a FIB entry for prefix
+   *  If an entry for exact same prefix exists, that entry is returned.
+   *  \return{ the entry, and true for new entry, false for existing entry }
+   */
+  std::pair<shared_ptr<pit::Entry>, bool>
+  insert(const Interest& interest);
+
+  /** \brief performs a Data match
+   *  \return{ an iterable of all PIT entries matching data }
+   */
+  shared_ptr<pit::DataMatchResult>
+  findAllDataMatches(const Data& data) const;
+
+  /**
+   *  \brief Erase a PIT Entry
+   */
+  void
+  erase(shared_ptr<pit::Entry> pitEntry);
+
+private:
+  NameTree& m_nameTree;
+  size_t m_nItems;
+};
+
+inline size_t
+Pit::size() const
+{
+  return m_nItems;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_PIT_HPP
diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
new file mode 100644
index 0000000..23c1b86
--- /dev/null
+++ b/daemon/table/strategy-choice-entry.cpp
@@ -0,0 +1,49 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "strategy-choice-entry.hpp"
+#include "core/logger.hpp"
+#include "fw/strategy.hpp"
+
+NFD_LOG_INIT("StrategyChoiceEntry");
+
+namespace nfd {
+namespace strategy_choice {
+
+Entry::Entry(const Name& prefix)
+  : m_prefix(prefix)
+{
+}
+
+void
+Entry::setStrategy(shared_ptr<fw::Strategy> strategy)
+{
+  BOOST_ASSERT(static_cast<bool>(strategy));
+  m_strategy = strategy;
+
+  NFD_LOG_INFO("Set strategy " << strategy->getName() << " for " << m_prefix << " prefix");
+}
+
+} // namespace strategy_choice
+} // namespace nfd
diff --git a/daemon/table/strategy-choice-entry.hpp b/daemon/table/strategy-choice-entry.hpp
new file mode 100644
index 0000000..4fe904e
--- /dev/null
+++ b/daemon/table/strategy-choice-entry.hpp
@@ -0,0 +1,84 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
+#define NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
+
+#include "common.hpp"
+
+namespace nfd {
+
+class NameTree;
+namespace name_tree {
+class Entry;
+}
+namespace fw {
+class Strategy;
+}
+
+namespace strategy_choice {
+
+/** \brief represents a Strategy Choice entry
+ */
+class Entry : noncopyable
+{
+public:
+  Entry(const Name& prefix);
+
+  const Name&
+  getPrefix() const;
+
+  fw::Strategy&
+  getStrategy() const;
+
+  void
+  setStrategy(shared_ptr<fw::Strategy> strategy);
+
+private:
+  Name m_prefix;
+  shared_ptr<fw::Strategy> m_strategy;
+
+  shared_ptr<name_tree::Entry> m_nameTreeEntry;
+  friend class nfd::NameTree;
+  friend class nfd::name_tree::Entry;
+};
+
+
+inline const Name&
+Entry::getPrefix() const
+{
+  return m_prefix;
+}
+
+inline fw::Strategy&
+Entry::getStrategy() const
+{
+  BOOST_ASSERT(static_cast<bool>(m_strategy));
+  return *m_strategy;
+}
+
+} // namespace strategy_choice
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
new file mode 100644
index 0000000..fff84c1
--- /dev/null
+++ b/daemon/table/strategy-choice.cpp
@@ -0,0 +1,273 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "strategy-choice.hpp"
+#include "core/logger.hpp"
+#include "fw/strategy.hpp"
+#include "pit-entry.hpp"
+#include "measurements-entry.hpp"
+
+namespace nfd {
+
+using strategy_choice::Entry;
+using fw::Strategy;
+
+NFD_LOG_INIT("StrategyChoice");
+
+StrategyChoice::StrategyChoice(NameTree& nameTree, shared_ptr<Strategy> defaultStrategy)
+  : m_nameTree(nameTree)
+{
+  this->setDefaultStrategy(defaultStrategy);
+}
+
+bool
+StrategyChoice::hasStrategy(const Name& strategyName) const
+{
+  return m_strategyInstances.count(strategyName) > 0;
+}
+
+bool
+StrategyChoice::install(shared_ptr<Strategy> strategy)
+{
+  BOOST_ASSERT(static_cast<bool>(strategy));
+  const Name& strategyName = strategy->getName();
+
+  if (this->hasStrategy(strategyName)) {
+    NFD_LOG_ERROR("install(" << strategyName << ") duplicate strategyName");
+    return false;
+  }
+
+  m_strategyInstances[strategyName] = strategy;
+  return true;
+}
+
+bool
+StrategyChoice::insert(const Name& prefix, const Name& strategyName)
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(prefix);
+  shared_ptr<Entry> entry = nameTreeEntry->getStrategyChoiceEntry();
+  shared_ptr<Strategy> oldStrategy;
+
+  if (static_cast<bool>(entry)) {
+    if (entry->getStrategy().getName() == strategyName) {
+      NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") not changing");
+      return true;
+    }
+    oldStrategy = entry->getStrategy().shared_from_this();
+    NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") "
+                  "changing from " << oldStrategy->getName());
+  }
+
+  shared_ptr<Strategy> strategy = this->getStrategy(strategyName);
+  if (!static_cast<bool>(strategy)) {
+    NFD_LOG_ERROR("insert(" << prefix << "," << strategyName << ") strategy not installed");
+    return false;
+  }
+
+  if (!static_cast<bool>(entry)) {
+    oldStrategy = this->findEffectiveStrategy(prefix).shared_from_this();
+    entry = make_shared<Entry>(prefix);
+    nameTreeEntry->setStrategyChoiceEntry(entry);
+    ++m_nItems;
+    NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") new entry");
+  }
+
+  this->changeStrategy(entry, oldStrategy, strategy);
+  return true;
+}
+
+void
+StrategyChoice::erase(const Name& prefix)
+{
+  BOOST_ASSERT(prefix.size() > 0);
+
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
+  if (!static_cast<bool>(nameTreeEntry)) {
+    return;
+  }
+
+  shared_ptr<Entry> entry = nameTreeEntry->getStrategyChoiceEntry();
+  if (!static_cast<bool>(entry)) {
+    return;
+  }
+
+  Strategy& oldStrategy = entry->getStrategy();
+
+  Strategy& parentStrategy = this->findEffectiveStrategy(prefix.getPrefix(-1));
+  this->changeStrategy(entry, oldStrategy.shared_from_this(), parentStrategy.shared_from_this());
+
+  nameTreeEntry->setStrategyChoiceEntry(shared_ptr<Entry>());
+  --m_nItems;
+}
+
+shared_ptr<const Name>
+StrategyChoice::get(const Name& prefix) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.findExactMatch(prefix);
+  if (!static_cast<bool>(nameTreeEntry)) {
+    return shared_ptr<const Name>();
+  }
+
+  shared_ptr<Entry> entry = nameTreeEntry->getStrategyChoiceEntry();
+  if (!static_cast<bool>(entry)) {
+    return shared_ptr<const Name>();
+  }
+
+  return entry->getStrategy().getName().shared_from_this();
+}
+
+static inline bool
+predicate_NameTreeEntry_hasStrategyChoiceEntry(const name_tree::Entry& entry)
+{
+  return static_cast<bool>(entry.getStrategyChoiceEntry());
+}
+
+Strategy&
+StrategyChoice::findEffectiveStrategy(const Name& prefix) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry =
+    m_nameTree.findLongestPrefixMatch(prefix, &predicate_NameTreeEntry_hasStrategyChoiceEntry);
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+  return nameTreeEntry->getStrategyChoiceEntry()->getStrategy();
+}
+
+Strategy&
+StrategyChoice::findEffectiveStrategy(shared_ptr<name_tree::Entry> nameTreeEntry) const
+{
+  shared_ptr<strategy_choice::Entry> entry = nameTreeEntry->getStrategyChoiceEntry();
+  if (static_cast<bool>(entry))
+    return entry->getStrategy();
+  nameTreeEntry = m_nameTree.findLongestPrefixMatch(nameTreeEntry,
+                               &predicate_NameTreeEntry_hasStrategyChoiceEntry);
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+  return nameTreeEntry->getStrategyChoiceEntry()->getStrategy();
+}
+
+Strategy&
+StrategyChoice::findEffectiveStrategy(const pit::Entry& pitEntry) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(pitEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return findEffectiveStrategy(nameTreeEntry);
+}
+
+Strategy&
+StrategyChoice::findEffectiveStrategy(const measurements::Entry& measurementsEntry) const
+{
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.get(measurementsEntry);
+
+  BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+
+  return findEffectiveStrategy(nameTreeEntry);
+}
+
+shared_ptr<fw::Strategy>
+StrategyChoice::getStrategy(const Name& strategyName)
+{
+  StrategyInstanceTable::iterator it = m_strategyInstances.find(strategyName);
+  return it != m_strategyInstances.end() ? it->second : shared_ptr<fw::Strategy>();
+}
+
+void
+StrategyChoice::setDefaultStrategy(shared_ptr<Strategy> strategy)
+{
+  this->install(strategy);
+
+  // don't use .insert here, because it will invoke findEffectiveStrategy
+  // which expects an existing root entry
+  shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.lookup(Name());
+  shared_ptr<Entry> entry = make_shared<Entry>(Name());
+  nameTreeEntry->setStrategyChoiceEntry(entry);
+  ++m_nItems;
+  NFD_LOG_INFO("Set default strategy " << strategy->getName());
+
+  entry->setStrategy(strategy);
+}
+
+/** \brief a predicate that decides whether StrategyInfo should be reset
+ *
+ *  StrategyInfo on a NameTree entry needs to be reset,
+ *  if its effective strategy is covered by the changing StrategyChoice entry.
+ */
+static inline std::pair<bool,bool>
+predicate_nameTreeEntry_needResetStrategyChoice(const name_tree::Entry& nameTreeEntry,
+                                            const name_tree::Entry& rootEntry)
+{
+  if (&nameTreeEntry == &rootEntry) {
+    return std::make_pair(true, true);
+  }
+  if (static_cast<bool>(nameTreeEntry.getStrategyChoiceEntry())) {
+    return std::make_pair(false, false);
+  }
+  return std::make_pair(true, true);
+}
+
+static inline void
+clearStrategyInfo_pitFaceRecord(const pit::FaceRecord& pitFaceRecord)
+{
+  const_cast<pit::FaceRecord&>(pitFaceRecord).clearStrategyInfo();
+}
+
+static inline void
+clearStrategyInfo_pitEntry(shared_ptr<pit::Entry> pitEntry)
+{
+  pitEntry->clearStrategyInfo();
+  std::for_each(pitEntry->getInRecords().begin(), pitEntry->getInRecords().end(),
+                &clearStrategyInfo_pitFaceRecord);
+  std::for_each(pitEntry->getOutRecords().begin(), pitEntry->getOutRecords().end(),
+                &clearStrategyInfo_pitFaceRecord);
+}
+
+static inline void
+clearStrategyInfo(const name_tree::Entry& nameTreeEntry)
+{
+  NFD_LOG_TRACE("clearStrategyInfo " << nameTreeEntry.getPrefix());
+
+  std::for_each(nameTreeEntry.getPitEntries().begin(), nameTreeEntry.getPitEntries().end(),
+                &clearStrategyInfo_pitEntry);
+  if (static_cast<bool>(nameTreeEntry.getMeasurementsEntry())) {
+    nameTreeEntry.getMeasurementsEntry()->clearStrategyInfo();
+  }
+}
+
+void
+StrategyChoice::changeStrategy(shared_ptr<strategy_choice::Entry> entry,
+                               shared_ptr<fw::Strategy> oldStrategy,
+                               shared_ptr<fw::Strategy> newStrategy)
+{
+  entry->setStrategy(newStrategy);
+  if (oldStrategy == newStrategy) {
+    return;
+  }
+
+  std::for_each(m_nameTree.partialEnumerate(entry->getPrefix(),
+                           bind(&predicate_nameTreeEntry_needResetStrategyChoice,
+                                _1, boost::cref(*m_nameTree.get(*entry)))),
+                m_nameTree.end(),
+                &clearStrategyInfo);
+}
+
+} // namespace nfd
diff --git a/daemon/table/strategy-choice.hpp b/daemon/table/strategy-choice.hpp
new file mode 100644
index 0000000..8ffe4d6
--- /dev/null
+++ b/daemon/table/strategy-choice.hpp
@@ -0,0 +1,119 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
+#define NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
+
+#include "strategy-choice-entry.hpp"
+#include "name-tree.hpp"
+
+namespace nfd {
+
+class StrategyChoice : noncopyable
+{
+public:
+  StrategyChoice(NameTree& nameTree, shared_ptr<fw::Strategy> defaultStrategy);
+
+public: // available Strategy types
+  /** \return true if strategy is installed
+   */
+  bool
+  hasStrategy(const Name& strategyName) const;
+
+  /** \brief install a strategy
+   *  \return true if installed; false if not installed due to duplicate strategyName
+   */
+  bool
+  install(shared_ptr<fw::Strategy> strategy);
+
+public: // Strategy Choice table
+  /** \brief set strategy of prefix to be strategyName
+   *  \param strategyName the strategy to be used, must be installed
+   *  \return true on success
+   */
+  bool
+  insert(const Name& prefix, const Name& strategyName);
+
+  /** \brief make prefix to inherit strategy from its parent
+   *
+   *  not allowed for root prefix (ndn:/)
+   */
+  void
+  erase(const Name& prefix);
+
+  /** \brief get strategy Name of prefix
+   *  \return strategyName at exact match, or nullptr
+   */
+  shared_ptr<const Name>
+  get(const Name& prefix) const;
+
+public: // effect strategy
+  /// get effective strategy for prefix
+  fw::Strategy&
+  findEffectiveStrategy(const Name& prefix) const;
+
+  /// get effective strategy for pitEntry
+  fw::Strategy&
+  findEffectiveStrategy(const pit::Entry& pitEntry) const;
+
+  /// get effective strategy for measurementsEntry
+  fw::Strategy&
+  findEffectiveStrategy(const measurements::Entry& measurementsEntry) const;
+
+  /// number of entries stored
+  size_t
+  size() const;
+
+private:
+  shared_ptr<fw::Strategy>
+  getStrategy(const Name& strategyName);
+
+  void
+  setDefaultStrategy(shared_ptr<fw::Strategy> strategy);
+
+  void
+  changeStrategy(shared_ptr<strategy_choice::Entry> entry,
+                 shared_ptr<fw::Strategy> oldStrategy,
+                 shared_ptr<fw::Strategy> newStrategy);
+
+  fw::Strategy&
+  findEffectiveStrategy(shared_ptr<name_tree::Entry> nameTreeEntry) const;
+
+private:
+  NameTree& m_nameTree;
+  size_t m_nItems;
+
+  typedef std::map<Name, shared_ptr<fw::Strategy> > StrategyInstanceTable;
+  StrategyInstanceTable m_strategyInstances;
+};
+
+inline size_t
+StrategyChoice::size() const
+{
+  return m_nItems;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_HPP
diff --git a/daemon/table/strategy-info-host.cpp b/daemon/table/strategy-info-host.cpp
new file mode 100644
index 0000000..9c46f1e
--- /dev/null
+++ b/daemon/table/strategy-info-host.cpp
@@ -0,0 +1,35 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "strategy-info-host.hpp"
+
+namespace nfd {
+
+void
+StrategyInfoHost::clearStrategyInfo()
+{
+  m_strategyInfo.reset();
+}
+
+} // namespace nfd
diff --git a/daemon/table/strategy-info-host.hpp b/daemon/table/strategy-info-host.hpp
new file mode 100644
index 0000000..dfe9341
--- /dev/null
+++ b/daemon/table/strategy-info-host.hpp
@@ -0,0 +1,102 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_TABLE_STRATEGY_INFO_HOST_HPP
+#define NFD_DAEMON_TABLE_STRATEGY_INFO_HOST_HPP
+
+#include "fw/strategy-info.hpp"
+
+namespace nfd {
+
+/** \class StrategyInfoHost
+ *  \brief base class for an entity onto which StrategyInfo may be placed
+ */
+class StrategyInfoHost
+{
+public:
+  template<typename T>
+  void
+  setStrategyInfo(shared_ptr<T> strategyInfo);
+
+  template<typename T>
+  shared_ptr<T>
+  getStrategyInfo();
+
+  template<typename T>
+  shared_ptr<T>
+  getOrCreateStrategyInfo();
+
+  template<typename T, typename T1>
+  shared_ptr<T>
+  getOrCreateStrategyInfo(T1& a1);
+
+  void
+  clearStrategyInfo();
+
+private:
+  shared_ptr<fw::StrategyInfo> m_strategyInfo;
+};
+
+
+template<typename T>
+void
+StrategyInfoHost::setStrategyInfo(shared_ptr<T> strategyInfo)
+{
+  m_strategyInfo = strategyInfo;
+}
+
+template<typename T>
+shared_ptr<T>
+StrategyInfoHost::getStrategyInfo()
+{
+  return static_pointer_cast<T, fw::StrategyInfo>(m_strategyInfo);
+}
+
+template<typename T>
+shared_ptr<T>
+StrategyInfoHost::getOrCreateStrategyInfo()
+{
+  shared_ptr<T> info = this->getStrategyInfo<T>();
+  if (!static_cast<bool>(info)) {
+    info = make_shared<T>();
+    this->setStrategyInfo(info);
+  }
+  return info;
+}
+
+template<typename T, typename T1>
+shared_ptr<T>
+StrategyInfoHost::getOrCreateStrategyInfo(T1& a1)
+{
+  shared_ptr<T> info = this->getStrategyInfo<T>();
+  if (!static_cast<bool>(info)) {
+    info = make_shared<T>(boost::ref(a1));
+    this->setStrategyInfo(info);
+  }
+  return info;
+}
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_TABLE_STRATEGY_INFO_HOST_HPP
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..11d8a52
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,241 @@
+# -*- coding: utf-8 -*-
+#
+# NFD - Named Data Networking Forwarding Daemon documentation build configuration file, created by
+# sphinx-quickstart on Sun Apr  6 19:58:22 2014.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+    'sphinx.ext.todo',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'NFD - Named Data Networking Forwarding Daemon'
+copyright = u'2014, Named Data Networking Project'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.1.0'
+# The full version, including alpha/beta/rc tags.
+release = '0.1.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+# html_theme = 'default'
+html_theme = 'named_data_theme'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ['./']
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+html_file_suffix = ".html"
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'nfd-docs'
+
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+  ('index', 'nfd-docs.tex', u'NFD - Named Data Networking Forwarding Daemon Documentation',
+   u'Named Data Networking Project', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('manpages/nfd', 'nfd', u'Named Data Networking Forwarding Daemon', None, 1),
+    ('manpages/ndn-autoconfig-server', 'ndn-autoconfig-server',
+        u'NFD Auto-configuration Server', None, 1),
+    ('manpages/ndn-autoconfig', 'ndn-autoconfig',
+        u'NFD Auto-configuration Client', None, 1),
+]
+
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
diff --git a/docs/doxygen.conf b/docs/doxygen.conf
new file mode 100644
index 0000000..a6a9a38
--- /dev/null
+++ b/docs/doxygen.conf
@@ -0,0 +1,2283 @@
+# Doxyfile 1.8.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = "NFD: Named Data Network Forwarding Daemon"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs/doxygen
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS         = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-
+# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,
+# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
+# Turkish, Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB  = YES
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES        = NO
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES       = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= NO
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES        = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS               = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC       = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT                  = core/ daemon/
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS        = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX     = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT            = ./
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER            = ../docs/named_data_theme/named_data_header.html
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER            = ../docs/named_data_theme/named_data_footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET        = ../docs/named_data_theme/static/named_data_doxygen.css
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET  =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES       = ../docs/named_data_theme/static/doxygen.css \
+                         ../docs/named_data_theme/static/base.css \
+                         ../docs/named_data_theme/static/foundation.css \
+                         ../docs/named_data_theme/static/bar-top.png
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE    = 0
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT    = 0
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA  = 91
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET        = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP      = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION           =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI           = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING     =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS     =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE       =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavours of web server based searching depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools. See
+# the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL       =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID     =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS  =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER           =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES      =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS         = YES
+
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE        = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES     = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT         = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all refrences to function-like macros that are alone on a line, have an
+# all uppercase name, and do not end with a semicolon. Such function macros are
+# typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have an unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS        = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT               = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS        = 0
+
+# When you want a differently looking font n the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK               = YES
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS     = YES
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH          = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT       = svg
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG        = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT        = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP            = YES
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..6bc1fff
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,9 @@
+NFD - Named Data Networking Forwarding Daemon's documentation
+=============================================================
+
+Contents:
+
+.. toctree::
+   release_notes
+   manpages
+   :maxdepth: 2
diff --git a/docs/manpages.rst b/docs/manpages.rst
new file mode 100644
index 0000000..da28853
--- /dev/null
+++ b/docs/manpages.rst
@@ -0,0 +1,7 @@
+NFD Manpages
+============
+
+.. toctree::
+   manpages/nfd
+   manpages/ndn-autoconfig
+   manpages/ndn-autoconfig-server
diff --git a/docs/manpages/ndn-autoconfig-server.rst b/docs/manpages/ndn-autoconfig-server.rst
new file mode 100644
index 0000000..923347b
--- /dev/null
+++ b/docs/manpages/ndn-autoconfig-server.rst
@@ -0,0 +1,19 @@
+ndn-autoconfig-server
+=====================
+
+Synopsis
+--------
+
+::
+
+    ndn-autoconfig-server [-h] Uri
+
+
+Description
+-----------
+
+::
+
+    -h print usage and exit
+
+    Uri - a FaceMgmt URI
diff --git a/docs/manpages/ndn-autoconfig.rst b/docs/manpages/ndn-autoconfig.rst
new file mode 100644
index 0000000..07233a5
--- /dev/null
+++ b/docs/manpages/ndn-autoconfig.rst
@@ -0,0 +1,104 @@
+ndn-autoconfig
+==============
+
+Synopsis
+--------
+
+::
+
+    ndn-autoconfig
+
+
+NDN hub discovery procedure
+---------------------------
+
+When an end host starts up, or detects a change in its network environment, it MAY use this procedure to discover a local or home NDN router, in order to gain connectivity to `the NDN research testbed <http://named-data.net/ndn-testbed/>`_.
+
+Overview
+^^^^^^^^
+
+This procedure contains three methods to discover a NDN router:
+
+1.  Look for a local NDN router by multicast.
+    This is useful in a home or small office network.
+
+2.  Look for a local NDN router by DNS query with default suffix.
+    This allows network administrator to configure a NDN router for a large enterprise network.
+
+3.  Connect to the home NDN router according to user certificate.
+    This ensures connectivity from anywhere.
+
+Stage 1: multicast discovery
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Request
++++++++
+
+The end host sends an Interest over a multicast face.
+
+Interest Name is ``/localhop/ndn-autoconf/hub``.
+
+Response
+++++++++
+
+A producer app on the HUB answer this Interest with a Data packet that contains a TLV-encoded `Uri` block.
+The value of this block is the URI for the HUB, preferrably a UDP tunnel.
+
+Stage 2: DNS query with default suffix
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Request
++++++++
+
+The end host sends a DNS query that is equivalent to this command::
+
+    dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv
+
+Response
+++++++++
+
+The DNS server should answer with an SRV record that contains the hostname and UDP port number of the NDN router.
+
+Stage 3: find home router
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This stage assumes that user has configured default certificate using `<http://ndncert.named-data.net/>`_ as described in `Certification Architecture <http://redmine.named-data.net/attachments/download/23/CertificationArchitecture.pptx>`_.
+
+Request
++++++++
+
+The end host loads the default user identity (eg. ``/ndn/edu/ucla/cs/afanasev``), and converts it to DNS format.
+
+The end host sends a DNS query for an SRV record of name ``_ndn._udp.`` + user identity in DNS format + ``_homehub._autoconf.named-data.net``. For example::
+
+    _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net
+
+Response
+++++++++
+
+The DNS server should answer with an SRV record that contains the hostname and UDP port number of the home NDN router of this user's site.
+
+Client procedure
+----------------
+
+Stage 1
+^^^^^^^
+
+Send a multicast discovery Interest.
+
+If this Interest is answered, connect to the HUB and terminate auto-discovery.
+
+Stage 2
+^^^^^^^
+
+Send a DNS query with default suffix.
+
+If this query is answered, connect to the HUB and terminate auto-discovery.
+
+Stage 3
+^^^^^^^
+
+* Load default user identity, and convert it to DNS format; if either fails, the auto-discovery fails.
+
+* Send a DNS query to find home HUB.
+  If this query is answered, connect to the home HUB and terminate auto-discovery. Otherwise, the auto-discovery fails.
diff --git a/docs/manpages/nfd.rst b/docs/manpages/nfd.rst
new file mode 100644
index 0000000..6ebef97
--- /dev/null
+++ b/docs/manpages/nfd.rst
@@ -0,0 +1,19 @@
+nfd
+===
+
+Synopsis
+--------
+
+::
+
+    nfd [options]
+
+
+Description
+-----------
+
+::
+
+    [--help]   - print this help message
+    [--modules] - list available logging modules
+    [--config /path/to/nfd.conf] - path to configuration file (default: /usr/local/etc/ndn/nfd.conf)
diff --git a/docs/named_data_theme/layout.html b/docs/named_data_theme/layout.html
new file mode 100644
index 0000000..0dc8b44
--- /dev/null
+++ b/docs/named_data_theme/layout.html
@@ -0,0 +1,90 @@
+{#
+    named_data_theme/layout.html
+    ~~~~~~~~~~~~~~~~~
+#}
+{% extends "basic/layout.html" %}
+
+{% block header %}
+    <!--headercontainer-->
+    <div id="header_container">
+
+        <!--header-->
+        <div class="row">
+             <div class="three columns">
+                  <div id="logo">
+                        <a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
+                  </div><!--logo end-->
+             </div>
+
+             <!--top menu-->
+             <div class="nine columns" id="menu_container" >
+               <h1><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></h1>
+             </div>
+        </div>
+    </div><!--header container end-->
+
+{% endblock %}
+
+{% block content %}
+    <div class="content-wrapper">
+      <div class="content">
+        <div class="document">
+          {%- block document %}
+            {{ super() }}
+          {%- endblock %}
+        </div>
+        <div class="sidebar">
+          {%- block sidebartoc %}
+          <h3>{{ _('Table Of Contents') }}</h3>
+          {{ toctree() }}
+          {%- endblock %}
+          {%- block sidebarsearch %}
+          <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
+          <form class="search" action="{{ pathto('search') }}" method="get">
+            <input type="text" name="q" />
+            <input type="submit" value="{{ _('Go') }}" />
+            <input type="hidden" name="check_keywords" value="yes" />
+            <input type="hidden" name="area" value="default" />
+          </form>
+          <p class="searchtip" style="font-size: 90%">
+            {{ _('Enter search terms or a module, class or function name.') }}
+          </p>
+          {%- endblock %}
+        </div>
+        <div class="clearer"></div>
+      </div>
+    </div>
+{% endblock %}
+
+{% block footer %}
+    <div id="footer-container">
+        <!--footer container-->
+        <div class="row">
+        </div><!-- footer container-->
+    </div>
+
+    <div id="footer-info">
+        <!--footer container-->
+        <div class="row">
+            <div class="twelve columns">
+
+                <div id="copyright">This research is partially supported by NSF (Award <a href="http://www.nsf.gov/awardsearch/showAward?AWD_ID=1040868" target="_blank>">CNS-1040868</a>)<br/><br/><a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US" target="_blank">Creative Commons Attribution 3.0 Unported License</a> except where noted.</div>
+
+            </div>
+        </div>
+    </div><!--footer info end-->
+
+    <script type="text/javascript">
+    var _gaq = _gaq || [];
+    _gaq.push(['_setAccount', 'UA-22320603-1']);
+    _gaq.push(['_trackPageview']);
+    (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+    })();
+    </script>
+{% endblock %}
+
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
diff --git a/docs/named_data_theme/named_data_footer.html b/docs/named_data_theme/named_data_footer.html
new file mode 100644
index 0000000..77fc327
--- /dev/null
+++ b/docs/named_data_theme/named_data_footer.html
@@ -0,0 +1,24 @@
+<!-- start footer part -->
+<!--BEGIN GENERATE_TREEVIEW-->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+  <ul>
+    $navpath
+    <li class="footer">$generatedby
+    <a href="http://www.doxygen.org/index.html">
+    <img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
+  </ul>
+</div>
+<!--END GENERATE_TREEVIEW-->
+<!--BEGIN !GENERATE_TREEVIEW-->
+<hr class="footer"/>
+<address class="footer"><small>
+$generatedby &#160;<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
+</a> $doxygenversion
+</small></address>
+<!--END !GENERATE_TREEVIEW-->
+
+<script type="text/javascript">
+</script>
+</body>
+</html>
diff --git a/docs/named_data_theme/named_data_header.html b/docs/named_data_theme/named_data_header.html
new file mode 100644
index 0000000..d9cb50b
--- /dev/null
+++ b/docs/named_data_theme/named_data_header.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath$jquery.js"></script>
+<script type="text/javascript" src="$relpath$dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+<link href="$relpath$named_data_doxygen.css" rel="stylesheet" type="text/css" />
+<link href="$relpath$favicon.ico" rel="shortcut icon" type="image/ico" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+
+<!--BEGIN TITLEAREA-->
+<!--headercontainer-->
+<div id="header_container">
+
+    <!--header-->
+    <div class="row">
+         <div class="three columns">
+              <div id="logo">
+                    <a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
+              </div><!--logo end-->
+         </div>
+
+         <!--top menu-->
+         <div class="nine columns" id="menu_container" >
+           <h1><a href="#">$projectname documentation</a></h1>
+         </div>
+    </div>
+</div><!--header container end-->
+<!--END TITLEAREA-->
+
+<!-- end header part -->
diff --git a/docs/named_data_theme/static/bar-top.png b/docs/named_data_theme/static/bar-top.png
new file mode 100644
index 0000000..07cafb6
--- /dev/null
+++ b/docs/named_data_theme/static/bar-top.png
Binary files differ
diff --git a/docs/named_data_theme/static/base.css b/docs/named_data_theme/static/base.css
new file mode 100644
index 0000000..164d1c1
--- /dev/null
+++ b/docs/named_data_theme/static/base.css
@@ -0,0 +1,71 @@
+* {
+  margin: 0px;
+  padding: 0px;
+}
+
+html { font-size: 62.5%; }
+
+body {
+  font-family: "Verdana", Arial, sans-serif;
+  background-color: #eeeeec;
+  color: #777;
+  border-top: 4px solid #fd7800;
+}
+
+body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
+
+.clearer {
+  clear: both;
+}
+
+.left {
+  float: left;
+}
+
+.right {
+  float: right;
+}
+
+.line-block {
+    display: block;
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+
+.line-block .line-block {
+    margin-top: 0;
+    margin-bottom: 0;
+    margin-left: 1.5em;
+}
+
+h1, h2, h3, h4 {
+  font-family: "Georgia", "Times New Roman", serif;
+  font-weight: normal;
+  color: #3465a4;
+  margin-bottom: .8em;
+}
+
+h1 {
+  color: #204a87;
+}
+
+h2 {
+  padding-bottom: .5em;
+  border-bottom: 1px solid #3465a4;
+}
+
+a.headerlink {
+  visibility: hidden;
+  color: #dddddd;
+  padding-left: .3em;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+  visibility: visible;
+}
diff --git a/docs/named_data_theme/static/base.css_t b/docs/named_data_theme/static/base.css_t
new file mode 100644
index 0000000..93fa4e1
--- /dev/null
+++ b/docs/named_data_theme/static/base.css_t
@@ -0,0 +1,455 @@
+* {
+  margin: 0px;
+  padding: 0px;
+}
+
+html { font-size: 62.5%; }
+
+body {
+  font-family: {{ theme_bodyfont }};
+  background-color: {{ theme_bgcolor }};
+  color: #777;
+  border-top: 4px solid #fd7800;
+}
+
+body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
+
+/* Page layout */
+
+div.header, div.content, div.footer {
+  width: {{ theme_pagewidth }};
+  margin-left: auto;
+  margin-right: auto;
+}
+
+div.header-wrapper {
+  background: {{ theme_headerbg }};
+  border-bottom: 3px solid #2e3436;
+}
+
+
+/* Default body styles */
+a {
+  color: {{ theme_linkcolor }};
+}
+
+div.bodywrapper a, div.footer a {
+  text-decoration: none;
+}
+
+.clearer {
+  clear: both;
+}
+
+.left {
+  float: left;
+}
+
+.right {
+  float: right;
+}
+
+.line-block {
+    display: block;
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+
+.line-block .line-block {
+    margin-top: 0;
+    margin-bottom: 0;
+    margin-left: 1.5em;
+}
+
+h1, h2, h3, h4 {
+  font-family: {{ theme_headerfont }};
+  font-weight: normal;
+  color: {{ theme_headercolor2 }};
+  margin-bottom: .8em;
+}
+
+h1 {
+  color: {{ theme_headercolor1 }};
+}
+
+h2 {
+  padding-bottom: .5em;
+  border-bottom: 1px solid {{ theme_headercolor2 }};
+}
+
+a.headerlink {
+  visibility: hidden;
+  color: #dddddd;
+  padding-left: .3em;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+  visibility: visible;
+}
+
+img {
+  border: 0;
+}
+
+div.admonition {
+  margin-top: 10px;
+  margin-bottom: 10px;
+  padding: 2px 7px 1px 7px;
+  border-left: 0.2em solid black;
+}
+
+p.admonition-title {
+  margin: 0px 10px 5px 0px;
+  font-weight: bold;
+}
+
+dt:target, .highlighted {
+  background-color: #fbe54e;
+}
+
+/* Header */
+
+div.header {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+div.header .headertitle {
+  font-family: {{ theme_headerfont }};
+  font-weight: normal;
+  font-size: 180%;
+  letter-spacing: .08em;
+  margin-bottom: .8em;
+}
+
+div.header .headertitle a {
+  color: white;
+}
+
+div.header div.rel {
+  margin-top: 1em;
+}
+
+div.header div.rel a {
+  color: {{ theme_headerlinkcolor }};
+  letter-spacing: .1em;
+  text-transform: uppercase;
+}
+
+p.logo {
+    float: right;
+}
+
+img.logo {
+    border: 0;
+}
+
+
+/* Content */
+div.content-wrapper {
+  background-color: white;
+  padding-top: 20px;
+  padding-bottom: 20px;
+}
+
+div.document {
+  width: {{ theme_documentwidth }};
+  float: left;
+}
+
+div.body {
+  padding-right: 2em;
+  text-align: {{ theme_textalign }};
+}
+
+div.document h1 {
+  line-height: 120%;
+}
+
+div.document ul {
+  margin: 1.5em;
+  list-style-type: square;
+}
+
+div.document dd {
+  margin-left: 1.2em;
+  margin-top: .4em;
+  margin-bottom: 1em;
+}
+
+div.document .section {
+  margin-top: 1.7em;
+}
+div.document .section:first-child {
+  margin-top: 0px;
+}
+
+div.document div.highlight {
+  padding: 3px;
+  background-color: #eeeeec;
+  border-top: 2px solid #dddddd;
+  border-bottom: 2px solid #dddddd;
+  margin-bottom: .8em;
+}
+
+div.document h2 {
+  margin-top: .7em;
+}
+
+div.document p {
+  margin-bottom: .5em;
+}
+
+div.document li.toctree-l1 {
+  margin-bottom: 1em;
+}
+
+div.document .descname {
+  font-weight: bold;
+}
+
+div.document .docutils.literal {
+  background-color: #eeeeec;
+  padding: 1px;
+}
+
+div.document .docutils.xref.literal {
+  background-color: transparent;
+  padding: 0px;
+}
+
+div.document blockquote {
+  margin: 1em;
+}
+
+div.document ol {
+  margin: 1.5em;
+}
+
+
+/* Sidebar */
+
+div.sidebar {
+  width: {{ theme_sidebarwidth }};
+  float: right;
+  font-size: .9em;
+}
+
+div.sidebar a, div.header a {
+  text-decoration: none;
+}
+
+div.sidebar a:hover, div.header a:hover {
+  text-decoration: none;
+}
+
+div.sidebar h3 {
+  color: #2e3436;
+  text-transform: uppercase;
+  font-size: 130%;
+  letter-spacing: .1em;
+}
+
+div.sidebar ul {
+  list-style-type: none;
+}
+
+div.sidebar li.toctree-l1 a {
+  display: block;
+  padding: 1px;
+  border: 1px solid #dddddd;
+  background-color: #eeeeec;
+  margin-bottom: .4em;
+  padding-left: 3px;
+  color: #2e3436;
+}
+
+div.sidebar li.toctree-l2 a {
+  background-color: transparent;
+  border: none;
+  margin-left: 1em;
+  border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l3 a {
+  background-color: transparent;
+  border: none;
+  margin-left: 2em;
+  border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l2:last-child a {
+  border-bottom: none;
+}
+
+div.sidebar li.toctree-l1.current a {
+  border-right: 5px solid {{ theme_headerlinkcolor }};
+}
+
+div.sidebar li.toctree-l1.current li.toctree-l2 a {
+  border-right: none;
+}
+
+div.sidebar input[type="text"] {
+  width: 170px;
+}
+
+div.sidebar input[type="submit"] {
+  width: 30px;
+}
+
+
+/* Footer */
+
+div.footer-wrapper {
+  background: {{ theme_footerbg }};
+  border-top: 4px solid #babdb6;
+  padding-top: 10px;
+  padding-bottom: 10px;
+  min-height: 80px;
+}
+
+div.footer, div.footer a {
+  color: #888a85;
+}
+
+div.footer .right {
+  text-align: right;
+}
+
+div.footer .left {
+  text-transform: uppercase;
+}
+
+
+/* Styles copied from basic theme */
+
+img.align-left, .figure.align-left, object.align-left {
+    clear: left;
+    float: left;
+    margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+    clear: right;
+    float: right;
+    margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+.align-left {
+    text-align: left;
+}
+
+.align-center {
+    text-align: center;
+}
+
+.align-right {
+    text-align: right;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+    margin: 10px 0 0 20px;
+    padding: 0;
+}
+
+ul.search li {
+    padding: 5px 0 5px 20px;
+    background-image: url(file.png);
+    background-repeat: no-repeat;
+    background-position: 0 7px;
+}
+
+ul.search li a {
+    font-weight: bold;
+}
+
+ul.search li div.context {
+    color: #888;
+    margin: 2px 0 0 30px;
+    text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+    font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+    width: 90%;
+}
+
+table.contentstable p.biglink {
+    line-height: 150%;
+}
+
+a.biglink {
+    font-size: 1.3em;
+}
+
+span.linkdescr {
+    font-style: italic;
+    padding-top: 5px;
+    font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+    text-align: left;
+    vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+    height: 10px;
+}
+
+table.indextable tr.cap {
+    margin-top: 10px;
+    background-color: #f2f2f2;
+}
+
+img.toggler {
+    margin-right: 3px;
+    margin-top: 3px;
+    cursor: pointer;
+}
+
+/* -- viewcode extension ---------------------------------------------------- */
+
+.viewcode-link {
+    float: right;
+}
+
+.viewcode-back {
+    float: right;
+    font-family:: {{ theme_bodyfont }};
+}
+
+div.viewcode-block:target {
+    margin: -1px -3px;
+    padding: 0 3px;
+    background-color: #f4debf;
+    border-top: 1px solid #ac9;
+    border-bottom: 1px solid #ac9;
+}
diff --git a/docs/named_data_theme/static/bc_s.png b/docs/named_data_theme/static/bc_s.png
new file mode 100644
index 0000000..eebf862
--- /dev/null
+++ b/docs/named_data_theme/static/bc_s.png
Binary files differ
diff --git a/docs/named_data_theme/static/default.css_t b/docs/named_data_theme/static/default.css_t
new file mode 100644
index 0000000..b582768
--- /dev/null
+++ b/docs/named_data_theme/static/default.css_t
@@ -0,0 +1,14 @@
+@import url("agogo.css");
+
+pre {
+    padding: 10px;
+    background-color: #fafafa;
+    color: #222;
+    line-height: 1.2em;
+    border: 2px solid #C6C9CB;
+    font-size: 1.1em;
+    /* margin: 1.5em 0 1.5em 0; */
+    margin: 0;
+    border-right-style: none;
+    border-left-style: none;
+}
diff --git a/docs/named_data_theme/static/doxygen.css b/docs/named_data_theme/static/doxygen.css
new file mode 100644
index 0000000..e5c796e
--- /dev/null
+++ b/docs/named_data_theme/static/doxygen.css
@@ -0,0 +1,1157 @@
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+	font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+	font-size: 13px;
+	line-height: 1.3;
+}
+
+/* @group Heading Levels */
+
+h1 {
+	font-size: 150%;
+}
+
+.title {
+	font-size: 150%;
+	font-weight: bold;
+	margin: 10px 2px;
+}
+
+h2 {
+	font-size: 120%;
+}
+
+h3 {
+	font-size: 100%;
+}
+
+h1, h2, h3, h4, h5, h6 {
+	-webkit-transition: text-shadow 0.5s linear;
+	-moz-transition: text-shadow 0.5s linear;
+	-ms-transition: text-shadow 0.5s linear;
+	-o-transition: text-shadow 0.5s linear;
+	transition: text-shadow 0.5s linear;
+	margin-right: 15px;
+}
+
+h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow {
+	text-shadow: 0 0 15px cyan;
+}
+
+dt {
+	font-weight: bold;
+}
+
+div.multicol {
+	-moz-column-gap: 1em;
+	-webkit-column-gap: 1em;
+	-moz-column-count: 3;
+	-webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+	margin-top: 2px;
+}
+
+p.endli {
+	margin-bottom: 0px;
+}
+
+p.enddd {
+	margin-bottom: 4px;
+}
+
+p.endtd {
+	margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+	font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+	background-color: #EFEFEF;
+	border: 1px solid #B5B5B5;
+	text-align: center;
+}
+
+div.qindex, div.navpath {
+	width: 100%;
+	line-height: 140%;
+}
+
+div.navtab {
+	margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+	color: #585858;
+	font-weight: normal;
+	text-decoration: none;
+}
+
+/*.contents a:visited {
+	color: #686868;
+}*/
+
+a:hover {
+	text-decoration: underline;
+}
+
+a.qindex {
+	font-weight: bold;
+}
+
+a.qindexHL {
+	font-weight: bold;
+	background-color: #B0B0B0;
+	color: #ffffff;
+	border: 1px double #9F9F9F;
+}
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+	font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code, a.code:visited {
+	color: #4665A2;
+}
+
+a.codeRef, a.codeRef:visited {
+	color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+	margin-left: -1cm;
+}
+
+pre.fragment {
+        border: 1px solid #C4CFE5;
+        background-color: #FBFCFD;
+        padding: 4px 6px;
+        margin: 4px 8px 4px 2px;
+        overflow: auto;
+        word-wrap: break-word;
+        font-size:  9pt;
+        line-height: 125%;
+        font-family: monospace, fixed;
+        font-size: 105%;
+}
+
+div.fragment {
+        padding: 4px;
+        margin: 4px;
+	background-color: #FCFCFC;
+	border: 1px solid #D0D0D0;
+}
+
+div.line {
+	font-family: monospace, fixed;
+        font-size: 13px;
+	min-height: 13px;
+	line-height: 1.0;
+	text-wrap: unrestricted;
+	white-space: -moz-pre-wrap; /* Moz */
+	white-space: -pre-wrap;     /* Opera 4-6 */
+	white-space: -o-pre-wrap;   /* Opera 7 */
+	white-space: pre-wrap;      /* CSS3  */
+	word-wrap: break-word;      /* IE 5.5+ */
+	text-indent: -53px;
+	padding-left: 53px;
+	padding-bottom: 0px;
+	margin: 0px;
+	-webkit-transition-property: background-color, box-shadow;
+	-webkit-transition-duration: 0.5s;
+	-moz-transition-property: background-color, box-shadow;
+	-moz-transition-duration: 0.5s;
+	-ms-transition-property: background-color, box-shadow;
+	-ms-transition-duration: 0.5s;
+	-o-transition-property: background-color, box-shadow;
+	-o-transition-duration: 0.5s;
+	transition-property: background-color, box-shadow;
+	transition-duration: 0.5s;
+}
+
+div.line.glow {
+	background-color: cyan;
+	box-shadow: 0 0 10px cyan;
+}
+
+
+span.lineno {
+	padding-right: 4px;
+	text-align: right;
+	border-right: 2px solid #0F0;
+	background-color: #E8E8E8;
+        white-space: pre;
+}
+span.lineno a {
+	background-color: #D8D8D8;
+}
+
+span.lineno a:hover {
+	background-color: #C8C8C8;
+}
+
+div.ah {
+	background-color: black;
+	font-weight: bold;
+	color: #ffffff;
+	margin-bottom: 3px;
+	margin-top: 3px;
+	padding: 0.2em;
+	border: solid thin #333;
+	border-radius: 0.5em;
+	-webkit-border-radius: .5em;
+	-moz-border-radius: .5em;
+	box-shadow: 2px 2px 3px #999;
+	-webkit-box-shadow: 2px 2px 3px #999;
+	-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+	background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+	margin-left: 16px;
+	margin-top: 12px;
+	font-weight: bold;
+}
+
+div.groupText {
+	margin-left: 16px;
+	font-style: italic;
+}
+
+body {
+	background-color: white;
+	color: black;
+        margin: 0;
+}
+
+div.contents {
+	margin-top: 10px;
+	margin-left: 12px;
+	margin-right: 8px;
+}
+
+td.indexkey {
+	background-color: #EFEFEF;
+	font-weight: bold;
+	border: 1px solid #D0D0D0;
+	margin: 2px 0px 2px 0;
+	padding: 2px 10px;
+        white-space: nowrap;
+        vertical-align: top;
+}
+
+td.indexvalue {
+	background-color: #EFEFEF;
+	border: 1px solid #D0D0D0;
+	padding: 2px 10px;
+	margin: 2px 0px;
+}
+
+tr.memlist {
+	background-color: #F1F1F1;
+}
+
+p.formulaDsp {
+	text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+	vertical-align: middle;
+}
+
+div.center {
+	text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
+}
+
+div.center img {
+	border: 0px;
+}
+
+address.footer {
+	text-align: right;
+	padding-right: 12px;
+}
+
+img.footer {
+	border: 0px;
+	vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+	color: #008000
+}
+
+span.keywordtype {
+	color: #604020
+}
+
+span.keywordflow {
+	color: #e08000
+}
+
+span.comment {
+	color: #800000
+}
+
+span.preprocessor {
+	color: #806020
+}
+
+span.stringliteral {
+	color: #002080
+}
+
+span.charliteral {
+	color: #008080
+}
+
+span.vhdldigit {
+	color: #ff00ff
+}
+
+span.vhdlchar {
+	color: #000000
+}
+
+span.vhdlkeyword {
+	color: #700070
+}
+
+span.vhdllogic {
+	color: #ff0000
+}
+
+blockquote {
+        background-color: #F8F8F8;
+        border-left: 2px solid #B0B0B0;
+        margin: 0 24px 0 4px;
+        padding: 0 12px 0 16px;
+}
+
+/* @end */
+
+/*
+.search {
+	color: #003399;
+	font-weight: bold;
+}
+
+form.search {
+	margin-bottom: 0px;
+	margin-top: 0px;
+}
+
+input.search {
+	font-size: 75%;
+	color: #000080;
+	font-weight: normal;
+	background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+	font-size: 75%;
+}
+
+.dirtab {
+	padding: 4px;
+	border-collapse: collapse;
+	border: 1px solid #B5B5B5;
+}
+
+th.dirtab {
+	background: #EFEFEF;
+	font-weight: bold;
+}
+
+hr {
+	height: 0px;
+	border: none;
+	border-top: 1px solid #6E6E6E;
+}
+
+hr.footer {
+	height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+	border-spacing: 0px;
+	padding: 0px;
+}
+
+.memberdecls td {
+	-webkit-transition-property: background-color, box-shadow;
+	-webkit-transition-duration: 0.5s;
+	-moz-transition-property: background-color, box-shadow;
+	-moz-transition-duration: 0.5s;
+	-ms-transition-property: background-color, box-shadow;
+	-ms-transition-duration: 0.5s;
+	-o-transition-property: background-color, box-shadow;
+	-o-transition-duration: 0.5s;
+	transition-property: background-color, box-shadow;
+	transition-duration: 0.5s;
+}
+
+.memberdecls td.glow {
+	background-color: cyan;
+	box-shadow: 0 0 15px cyan;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+	background-color: #FAFAFA;
+	border: none;
+	margin: 4px;
+	padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+	padding: 0px 8px 4px 8px;
+	color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+	border-top: 1px solid #D0D0D0;
+}
+
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
+}
+
+.memItemRight {
+	width: 100%;
+}
+
+.memTemplParams {
+	color: #686868;
+        white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+	font-size: 80%;
+	color: #686868;
+	font-weight: normal;
+	margin-left: 9px;
+}
+
+.memnav {
+	background-color: #EFEFEF;
+	border: 1px solid #B5B5B5;
+	text-align: center;
+	margin: 2px;
+	margin-right: 15px;
+	padding: 2px;
+}
+
+.mempage {
+	width: 100%;
+}
+
+.memitem {
+	padding: 0;
+	margin-bottom: 10px;
+	margin-right: 5px;
+        -webkit-transition: box-shadow 0.5s linear;
+        -moz-transition: box-shadow 0.5s linear;
+        -ms-transition: box-shadow 0.5s linear;
+        -o-transition: box-shadow 0.5s linear;
+        transition: box-shadow 0.5s linear;
+        display: table !important;
+        width: 100%;
+}
+
+.memitem.glow {
+         box-shadow: 0 0 15px cyan;
+}
+
+.memname {
+        font-weight: bold;
+        margin-left: 6px;
+}
+
+.memname td {
+	vertical-align: bottom;
+}
+
+.memproto, dl.reflist dt {
+        border-top: 1px solid #B9B9B9;
+        border-left: 1px solid #B9B9B9;
+        border-right: 1px solid #B9B9B9;
+        padding: 6px 0px 6px 0px;
+        color: #323232;
+        font-weight: bold;
+        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E8E8E8;
+        /* opera specific markup */
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        border-top-right-radius: 4px;
+        border-top-left-radius: 4px;
+        /* firefox specific markup */
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        -moz-border-radius-topright: 4px;
+        -moz-border-radius-topleft: 4px;
+        /* webkit specific markup */
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        -webkit-border-top-right-radius: 4px;
+        -webkit-border-top-left-radius: 4px;
+
+}
+
+.memdoc, dl.reflist dd {
+        border-bottom: 1px solid #B9B9B9;
+        border-left: 1px solid #B9B9B9;
+        border-right: 1px solid #B9B9B9;
+        padding: 6px 10px 2px 10px;
+        background-color: #FCFCFC;
+        border-top-width: 0;
+        background-image:url('nav_g.png');
+        background-repeat:repeat-x;
+        background-color: #FFFFFF;
+        /* opera specific markup */
+        border-bottom-left-radius: 4px;
+        border-bottom-right-radius: 4px;
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        /* firefox specific markup */
+        -moz-border-radius-bottomleft: 4px;
+        -moz-border-radius-bottomright: 4px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        /* webkit specific markup */
+        -webkit-border-bottom-left-radius: 4px;
+        -webkit-border-bottom-right-radius: 4px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+dl.reflist dt {
+        padding: 5px;
+}
+
+dl.reflist dd {
+        margin: 0px 0px 10px 0px;
+        padding: 5px;
+}
+
+.paramkey {
+	text-align: right;
+}
+
+.paramtype {
+	white-space: nowrap;
+}
+
+.paramname {
+	color: #602020;
+	white-space: nowrap;
+}
+.paramname em {
+	font-style: normal;
+}
+.paramname code {
+        line-height: 14px;
+}
+
+.params, .retval, .exception, .tparams {
+        margin-left: 0px;
+        padding-left: 0px;
+}
+
+.params .paramname, .retval .paramname {
+        font-weight: bold;
+        vertical-align: top;
+}
+
+.params .paramtype {
+        font-style: italic;
+        vertical-align: top;
+}
+
+.params .paramdir {
+        font-family: "courier new",courier,monospace;
+        vertical-align: top;
+}
+
+table.mlabels {
+	border-spacing: 0px;
+}
+
+td.mlabels-left {
+	width: 100%;
+	padding: 0px;
+}
+
+td.mlabels-right {
+	vertical-align: bottom;
+	padding: 0px;
+	white-space: nowrap;
+}
+
+span.mlabels {
+        margin-left: 8px;
+}
+
+span.mlabel {
+        background-color: #8F8F8F;
+        border-top:1px solid #787878;
+        border-left:1px solid #787878;
+        border-right:1px solid #D0D0D0;
+        border-bottom:1px solid #D0D0D0;
+	text-shadow: none;
+        color: white;
+        margin-right: 4px;
+        padding: 2px 3px;
+        border-radius: 3px;
+        font-size: 7pt;
+	white-space: nowrap;
+}
+
+
+
+/* @end */
+
+/* these are for tree view when not used as main index */
+
+div.directory {
+        margin: 10px 0px;
+        border-top: 1px solid #A8B8D9;
+        border-bottom: 1px solid #A8B8D9;
+        width: 100%;
+}
+
+.directory table {
+        border-collapse:collapse;
+        width: 100%;
+}
+
+.directory td {
+        margin: 0px;
+        padding: 0px;
+	vertical-align: top;
+}
+
+.directory td.entry {
+        width: 20%;
+        white-space: nowrap;
+        padding-right: 6px;
+}
+
+.directory td.entry a {
+        outline:none;
+}
+
+.directory td.entry a img {
+        border: none;
+}
+
+.directory td.desc {
+        width: 80%;
+        padding-left: 6px;
+	padding-right: 6px;
+	border-left: 1px solid rgba(0,0,0,0.05);
+}
+
+.directory tr.even {
+	padding-left: 6px;
+	background-color: #F8F8F8;
+}
+
+.directory img {
+	vertical-align: -30%;
+}
+
+.directory .levels {
+        white-space: nowrap;
+        width: 100%;
+        text-align: right;
+        font-size: 9pt;
+}
+
+.directory .levels span {
+        cursor: pointer;
+        padding-left: 2px;
+        padding-right: 2px;
+	color: #585858;
+}
+
+div.dynheader {
+        margin-top: 8px;
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+address {
+	font-style: normal;
+	color: #3A3A3A;
+}
+
+table.doxtable {
+	border-collapse:collapse;
+        margin-top: 4px;
+        margin-bottom: 4px;
+}
+
+table.doxtable td, table.doxtable th {
+	border: 1px solid #3F3F3F;
+	padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+	background-color: #4F4F4F;
+	color: #FFFFFF;
+	font-size: 110%;
+	padding-bottom: 4px;
+	padding-top: 5px;
+}
+
+table.fieldtable {
+        width: 100%;
+        margin-bottom: 10px;
+        border: 1px solid #B9B9B9;
+        border-spacing: 0px;
+        -moz-border-radius: 4px;
+        -webkit-border-radius: 4px;
+        border-radius: 4px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+        -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+}
+
+.fieldtable td, .fieldtable th {
+        padding: 3px 7px 2px;
+}
+
+.fieldtable td.fieldtype, .fieldtable td.fieldname {
+        white-space: nowrap;
+        border-right: 1px solid #B9B9B9;
+        border-bottom: 1px solid #B9B9B9;
+        vertical-align: top;
+}
+
+.fieldtable td.fielddoc {
+        border-bottom: 1px solid #B9B9B9;
+        width: 100%;
+}
+
+.fieldtable tr:last-child td {
+        border-bottom: none;
+}
+
+.fieldtable th {
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E8E8E8;
+        font-size: 90%;
+        color: #323232;
+        padding-bottom: 4px;
+        padding-top: 5px;
+        text-align:left;
+        -moz-border-radius-topleft: 4px;
+        -moz-border-radius-topright: 4px;
+        -webkit-border-top-left-radius: 4px;
+        -webkit-border-top-right-radius: 4px;
+        border-top-left-radius: 4px;
+        border-top-right-radius: 4px;
+        border-bottom: 1px solid #B9B9B9;
+}
+
+
+.tabsearch {
+	top: 0px;
+	left: 10px;
+	height: 36px;
+	background-image: url('tab_b.png');
+	z-index: 101;
+	overflow: hidden;
+	font-size: 13px;
+}
+
+.navpath ul
+{
+	font-size: 11px;
+	background-image:url('tab_b.png');
+	background-repeat:repeat-x;
+	height:30px;
+	line-height:30px;
+	color:#A2A2A2;
+	border:solid 1px #CECECE;
+	overflow:hidden;
+	margin:0px;
+	padding:0px;
+}
+
+.navpath li
+{
+	list-style-type:none;
+	float:left;
+	padding-left:10px;
+	padding-right:15px;
+	background-image:url('bc_s.png');
+	background-repeat:no-repeat;
+	background-position:right;
+	color:#4D4D4D;
+}
+
+.navpath li.navelem a
+{
+	height:32px;
+	display:block;
+	text-decoration: none;
+	outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+	color:#888888;
+}
+
+.navpath li.footer
+{
+        list-style-type:none;
+        float:right;
+        padding-left:10px;
+        padding-right:15px;
+        background-image:none;
+        background-repeat:no-repeat;
+        background-position:right;
+        color:#4D4D4D;
+        font-size: 8pt;
+}
+
+
+div.summary
+{
+	float: right;
+	font-size: 8pt;
+	padding-right: 5px;
+	width: 50%;
+	text-align: right;
+}
+
+div.summary a
+{
+	white-space: nowrap;
+}
+
+div.ingroups
+{
+	font-size: 8pt;
+	width: 50%;
+	text-align: left;
+}
+
+div.ingroups a
+{
+	white-space: nowrap;
+}
+
+div.header
+{
+        background-image:url('nav_h.png');
+        background-repeat:repeat-x;
+	background-color: #FAFAFA;
+	margin:  0px;
+	border-bottom: 1px solid #D0D0D0;
+}
+
+div.headertitle
+{
+	padding: 5px 5px 5px 7px;
+}
+
+dl
+{
+        padding: 0 0 0 10px;
+}
+
+/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
+dl.section
+{
+	margin-left: 0px;
+	padding-left: 0px;
+}
+
+dl.note
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #D0C000;
+}
+
+dl.warning, dl.attention
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #00D000;
+}
+
+dl.deprecated
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #505050;
+}
+
+dl.todo
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border:4px solid;
+        border-color: #00C0E0;
+}
+
+dl.test
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #3030E0;
+}
+
+dl.bug
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #C08050;
+}
+
+dl.section dd {
+	margin-bottom: 6px;
+}
+
+
+#projectlogo
+{
+	text-align: center;
+	vertical-align: bottom;
+	border-collapse: separate;
+}
+
+#projectlogo img
+{
+	border: 0px none;
+}
+
+#projectname
+{
+	font: 300% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 2px 0px;
+}
+
+#projectbrief
+{
+	font: 120% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#projectnumber
+{
+	font: 50% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#titlearea
+{
+	padding: 0px;
+	margin: 0px;
+	width: 100%;
+	border-bottom: 1px solid #787878;
+}
+
+.image
+{
+        text-align: center;
+}
+
+.dotgraph
+{
+        text-align: center;
+}
+
+.mscgraph
+{
+        text-align: center;
+}
+
+.caption
+{
+	font-weight: bold;
+}
+
+div.zoom
+{
+	border: 1px solid #A6A6A6;
+}
+
+dl.citelist {
+        margin-bottom:50px;
+}
+
+dl.citelist dt {
+        color:#484848;
+        float:left;
+        font-weight:bold;
+        margin-right:10px;
+        padding:5px;
+}
+
+dl.citelist dd {
+        margin:2px 0;
+        padding:5px 0;
+}
+
+div.toc {
+        padding: 14px 25px;
+        background-color: #F6F6F6;
+        border: 1px solid #DFDFDF;
+        border-radius: 7px 7px 7px 7px;
+        float: right;
+        height: auto;
+        margin: 0 20px 10px 10px;
+        width: 200px;
+}
+
+div.toc li {
+        background: url("bdwn.png") no-repeat scroll 0 5px transparent;
+        font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
+        margin-top: 5px;
+        padding-left: 10px;
+        padding-top: 2px;
+}
+
+div.toc h3 {
+        font: bold 12px/1.2 Arial,FreeSans,sans-serif;
+	color: #686868;
+        border-bottom: 0 none;
+        margin: 0;
+}
+
+div.toc ul {
+        list-style: none outside none;
+        border: medium none;
+        padding: 0px;
+}
+
+div.toc li.level1 {
+        margin-left: 0px;
+}
+
+div.toc li.level2 {
+        margin-left: 15px;
+}
+
+div.toc li.level3 {
+        margin-left: 30px;
+}
+
+div.toc li.level4 {
+        margin-left: 45px;
+}
+
+.inherit_header {
+        font-weight: bold;
+        color: gray;
+        cursor: pointer;
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+.inherit_header td {
+        padding: 6px 0px 2px 5px;
+}
+
+.inherit {
+        display: none;
+}
+
+tr.heading h2 {
+        margin-top: 12px;
+        margin-bottom: 4px;
+}
+
+@media print
+{
+  #top { display: none; }
+  #side-nav { display: none; }
+  #nav-path { display: none; }
+  body { overflow:visible; }
+  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
+  .summary { display: none; }
+  .memitem { page-break-inside: avoid; }
+  #doc-content
+  {
+    margin-left:0 !important;
+    height:auto !important;
+    width:auto !important;
+    overflow:inherit;
+    display:inline;
+  }
+}
diff --git a/docs/named_data_theme/static/foundation.css b/docs/named_data_theme/static/foundation.css
new file mode 100644
index 0000000..91ad40c
--- /dev/null
+++ b/docs/named_data_theme/static/foundation.css
@@ -0,0 +1,788 @@
+.c-1, .c-2, .c-3, .c-4, .c-5, .c-6, .c-7, .c-8, .c-9, .c-10, .c-11, .c-12 { float: left; }
+
+.c-1, .c-2, .c-3, .c-4, .c-5, .c-6, .c-7, .c-8, .c-9, .c-10, .c-11, .c-12 { position: relative; min-height: 1px; padding: 0 15px; }
+
+.c-1 { width: 8.33333%; }
+
+.c-2 { width: 16.66667%; }
+
+.c-3 { width: 25%; }
+
+.c-4 { width: 33.33333%; }
+
+.c-5 { width: 41.66667%; }
+
+.c-6 { width: 50%; }
+
+.c-7 { width: 58.33333%; }
+
+.c-8 { width: 66.66667%; }
+
+.c-9 { width: 75%; }
+
+.c-10 { width: 83.33333%; }
+
+.c-11 { width: 91.66667%; }
+
+.c-12 { width: 100%; }
+
+/* Requires: normalize.css */
+/* Global Reset & Standards ---------------------- */
+* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
+
+html { font-size: 62.5%; }
+
+body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
+
+/* Links ---------------------- */
+a { color: #fd7800; text-decoration: none; line-height: inherit; }
+
+a:hover { color: #2795b6; }
+
+a:focus { color: #fd7800; outline: none; }
+
+p a, p a:visited { line-height: inherit; }
+
+/* Misc ---------------------- */
+.left { float: left; }
+@media only screen and (max-width: 767px) { .left { float: none; } }
+
+.right { float: right; }
+@media only screen and (max-width: 767px) { .right { float: none; } }
+
+.text-left { text-align: left; }
+
+.text-right { text-align: right; }
+
+.text-center { text-align: center; }
+
+.hide { display: none; }
+
+.highlight { background: #ffff99; }
+
+#googlemap img, object, embed { max-width: none; }
+
+#map_canvas embed { max-width: none; }
+
+#map_canvas img { max-width: none; }
+
+#map_canvas object { max-width: none; }
+
+/* Reset for strange margins by default on <figure> elements */
+figure { margin: 0; }
+
+/* Base Type Styles Using Modular Scale ---------------------- */
+body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, p, blockquote, th, td { margin: 0; padding: 0; font-size: 14px; direction: ltr; }
+
+p { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-size: 14px; line-height: 1.6; margin-bottom: 17px; }
+p.lead { font-size: 17.5px; line-height: 1.6; margin-bottom: 17px; }
+
+aside p { font-size: 13px; line-height: 1.35; font-style: italic; }
+
+h1, h2, h3, h4, h5, h6 { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: bold; color: #222222; text-rendering: optimizeLegibility; line-height: 1.0; margin-bottom: 14px; margin-top: 14px; }
+h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #6f6f6f; line-height: 0; }
+
+h1 { font-size: 24px; }
+
+h2 { font-size: 18px; }
+
+h3 { font-size: 14px; }
+
+h4 { font-size: 12px; }
+
+h5 { font-weight: bold; font-size: 12px; }
+
+h6 { font-style: italic; font-size: 12px; }
+
+hr { border: solid #c6c6c6; border-width: 1px 0 0; clear: both; margin: 22px 0 21px; height: 0; }
+
+.subheader { line-height: 1.3; color: #6f6f6f; font-weight: 300; margin-bottom: 17px; }
+
+em, i { font-style: italic; line-height: inherit; }
+
+strong, b { font-weight: bold; line-height: inherit; }
+
+small { font-size: 60%; line-height: inherit; }
+
+code { font-weight: bold; background: #ffff99; }
+
+/* Lists ---------------------- */
+ul, ol { font-size: 14px; line-height: 1.6; margin-bottom: 17px; list-style-position: inside; }
+
+ul li ul, ul li ol { margin-left: 20px; margin-bottom: 0; }
+ul.square, ul.circle, ul.disc { margin-left: 17px; }
+ul.square { list-style-type: square; }
+ul.square li ul { list-style: inherit; }
+ul.circle { list-style-type: circle; }
+ul.circle li ul { list-style: inherit; }
+ul.disc { list-style-type: disc; }
+ul.disc li ul { list-style: inherit; }
+ul.no-bullet { list-style: none; }
+ul.large li { line-height: 21px; }
+
+ol li ul, ol li ol { margin-left: 20px; margin-bottom: 0; }
+
+/* Blockquotes ---------------------- */
+blockquote, blockquote p { line-height: 1.5; color: #6f6f6f; }
+
+blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }
+blockquote cite { display: block; font-size: 13px; color: #555555; }
+blockquote cite:before { content: "\2014 \0020"; }
+blockquote cite a, blockquote cite a:visited { color: #555555; }
+
+abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px solid #ddd; cursor: help; }
+
+abbr { text-transform: none; }
+
+/* Print styles.  Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
+*/
+.print-only { display: none !important; }
+
+@media print { * { background: transparent !important; color: black !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; -ms-filter: none !important; }
+  /* Black prints faster: h5bp.com/s */
+  a, a:visited { text-decoration: underline; }
+  a[href]:after { content: " (" attr(href) ")"; }
+  abbr[title]:after { content: " (" attr(title) ")"; }
+  .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
+  /* Don't show links for images, or javascript/internal links */
+  pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
+  thead { display: table-header-group; }
+  /* h5bp.com/t */
+  tr, img { page-break-inside: avoid; }
+  img { max-width: 100% !important; }
+  @page { margin: 0.5cm; }
+  p, h2, h3 { orphans: 3; widows: 3; }
+  h2, h3 { page-break-after: avoid; }
+  .hide-on-print { display: none !important; }
+  .print-only { display: block !important; } }
+/* Requires globals.css */
+/* Standard Forms ---------------------- */
+form { margin: 0 0 19.41641px; }
+
+.row form .row { margin: 0 -6px; }
+.row form .row .column, .row form .row .columns { padding: 0 6px; }
+.row form .row.collapse { margin: 0; }
+.row form .row.collapse .column, .row form .row.collapse .columns { padding: 0; }
+
+label { font-size: 14px; color: #4d4d4d; cursor: pointer; display: block; font-weight: 500; margin-bottom: 3px; }
+label.right { float: none; text-align: right; }
+label.inline { line-height: 32px; margin: 0 0 12px 0; }
+
+@media only screen and (max-width: 767px) { label.right { text-align: left; } }
+.prefix, .postfix { display: block; position: relative; z-index: 2; text-align: center; width: 100%; padding-top: 0; padding-bottom: 0; height: 32px; line-height: 31px; }
+
+a.button.prefix, a.button.postfix { padding-left: 0; padding-right: 0; text-align: center; }
+
+span.prefix, span.postfix { background: #f2f2f2; border: 1px solid #cccccc; }
+
+.prefix { left: 2px; -moz-border-radius-topleft: 2px; -webkit-border-top-left-radius: 2px; border-top-left-radius: 2px; -moz-border-radius-bottomleft: 2px; -webkit-border-bottom-left-radius: 2px; border-bottom-left-radius: 2px; overflow: hidden; }
+
+.postfix { right: 2px; -moz-border-radius-topright: 2px; -webkit-border-top-right-radius: 2px; border-top-right-radius: 2px; -moz-border-radius-bottomright: 2px; -webkit-border-bottom-right-radius: 2px; border-bottom-right-radius: 2px; }
+
+input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], textarea { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; border: 1px solid #cccccc; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.75); display: block; font-size: 14px; margin: 0 0 12px 0; padding: 6px; height: 32px; width: 100%; -webkit-transition: all 0.15s linear; -moz-transition: all 0.15s linear; -o-transition: all 0.15s linear; transition: all 0.15s linear; }
+input[type="text"].oversize, input[type="password"].oversize, input[type="date"].oversize, input[type="datetime"].oversize, input[type="email"].oversize, input[type="number"].oversize, input[type="search"].oversize, input[type="tel"].oversize, input[type="time"].oversize, input[type="url"].oversize, textarea.oversize { font-size: 17px; padding: 4px 6px; }
+input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="url"]:focus, textarea:focus { background: #fafafa; outline: none !important; border-color: #b3b3b3; }
+input[type="text"][disabled], input[type="password"][disabled], input[type="date"][disabled], input[type="datetime"][disabled], input[type="email"][disabled], input[type="number"][disabled], input[type="search"][disabled], input[type="tel"][disabled], input[type="time"][disabled], input[type="url"][disabled], textarea[disabled] { background-color: #ddd; }
+
+textarea { height: auto; }
+
+select { width: 100%; }
+
+/* Fieldsets */
+fieldset { border: solid 1px #ddd; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; padding: 12px 12px 0; margin: 18px 0; }
+fieldset legend { font-weight: bold; background: white; padding: 0 3px; margin: 0; margin-left: -3px; }
+
+/* Errors */
+.error input, input.error, .error textarea, textarea.error { border-color: #c60f13; background-color: rgba(198, 15, 19, 0.1); }
+
+.error label, label.error { color: #c60f13; }
+
+.error small, small.error { display: block; padding: 6px 4px; margin-top: -13px; margin-bottom: 12px; background: #c60f13; color: #fff; font-size: 12px; font-size: 1.2rem; font-weight: bold; -moz-border-radius-bottomleft: 2px; -webkit-border-bottom-left-radius: 2px; border-bottom-left-radius: 2px; -moz-border-radius-bottomright: 2px; -webkit-border-bottom-right-radius: 2px; border-bottom-right-radius: 2px; }
+
+@media only screen and (max-width: 767px) { input[type="text"].one, input[type="password"].one, input[type="date"].one, input[type="datetime"].one, input[type="email"].one, input[type="number"].one, input[type="search"].one, input[type="tel"].one, input[type="time"].one, input[type="url"].one, textarea.one, .row textarea.one { width: 100% !important; }
+  input[type="text"].two, .row input[type="text"].two, input[type="password"].two, .row input[type="password"].two, input[type="date"].two, .row input[type="date"].two, input[type="datetime"].two, .row input[type="datetime"].two, input[type="email"].two, .row input[type="email"].two, input[type="number"].two, .row input[type="number"].two, input[type="search"].two, .row input[type="search"].two, input[type="tel"].two, .row input[type="tel"].two, input[type="time"].two, .row input[type="time"].two, input[type="url"].two, .row input[type="url"].two, textarea.two, .row textarea.two { width: 100% !important; }
+  input[type="text"].three, .row input[type="text"].three, input[type="password"].three, .row input[type="password"].three, input[type="date"].three, .row input[type="date"].three, input[type="datetime"].three, .row input[type="datetime"].three, input[type="email"].three, .row input[type="email"].three, input[type="number"].three, .row input[type="number"].three, input[type="search"].three, .row input[type="search"].three, input[type="tel"].three, .row input[type="tel"].three, input[type="time"].three, .row input[type="time"].three, input[type="url"].three, .row input[type="url"].three, textarea.three, .row textarea.three { width: 100% !important; }
+  input[type="text"].four, .row input[type="text"].four, input[type="password"].four, .row input[type="password"].four, input[type="date"].four, .row input[type="date"].four, input[type="datetime"].four, .row input[type="datetime"].four, input[type="email"].four, .row input[type="email"].four, input[type="number"].four, .row input[type="number"].four, input[type="search"].four, .row input[type="search"].four, input[type="tel"].four, .row input[type="tel"].four, input[type="time"].four, .row input[type="time"].four, input[type="url"].four, .row input[type="url"].four, textarea.four, .row textarea.four { width: 100% !important; }
+  input[type="text"].five, .row input[type="text"].five, input[type="password"].five, .row input[type="password"].five, input[type="date"].five, .row input[type="date"].five, input[type="datetime"].five, .row input[type="datetime"].five, input[type="email"].five, .row input[type="email"].five, input[type="number"].five, .row input[type="number"].five, input[type="search"].five, .row input[type="search"].five, input[type="tel"].five, .row input[type="tel"].five, input[type="time"].five, .row input[type="time"].five, input[type="url"].five, .row input[type="url"].five, textarea.five, .row textarea.five { width: 100% !important; }
+  input[type="text"].six, .row input[type="text"].six, input[type="password"].six, .row input[type="password"].six, input[type="date"].six, .row input[type="date"].six, input[type="datetime"].six, .row input[type="datetime"].six, input[type="email"].six, .row input[type="email"].six, input[type="number"].six, .row input[type="number"].six, input[type="search"].six, .row input[type="search"].six, input[type="tel"].six, .row input[type="tel"].six, input[type="time"].six, .row input[type="time"].six, input[type="url"].six, .row input[type="url"].six, textarea.six, .row textarea.six { width: 100% !important; }
+  input[type="text"].seven, .row input[type="text"].seven, input[type="password"].seven, .row input[type="password"].seven, input[type="date"].seven, .row input[type="date"].seven, input[type="datetime"].seven, .row input[type="datetime"].seven, input[type="email"].seven, .row input[type="email"].seven, input[type="number"].seven, .row input[type="number"].seven, input[type="search"].seven, .row input[type="search"].seven, input[type="tel"].seven, .row input[type="tel"].seven, input[type="time"].seven, .row input[type="time"].seven, input[type="url"].seven, .row input[type="url"].seven, textarea.seven, .row textarea.seven { width: 100% !important; }
+  input[type="text"].eight, .row input[type="text"].eight, input[type="password"].eight, .row input[type="password"].eight, input[type="date"].eight, .row input[type="date"].eight, input[type="datetime"].eight, .row input[type="datetime"].eight, input[type="email"].eight, .row input[type="email"].eight, input[type="number"].eight, .row input[type="number"].eight, input[type="search"].eight, .row input[type="search"].eight, input[type="tel"].eight, .row input[type="tel"].eight, input[type="time"].eight, .row input[type="time"].eight, input[type="url"].eight, .row input[type="url"].eight, textarea.eight, .row textarea.eight { width: 100% !important; }
+  input[type="text"].nine, .row input[type="text"].nine, input[type="password"].nine, .row input[type="password"].nine, input[type="date"].nine, .row input[type="date"].nine, input[type="datetime"].nine, .row input[type="datetime"].nine, input[type="email"].nine, .row input[type="email"].nine, input[type="number"].nine, .row input[type="number"].nine, input[type="search"].nine, .row input[type="search"].nine, input[type="tel"].nine, .row input[type="tel"].nine, input[type="time"].nine, .row input[type="time"].nine, input[type="url"].nine, .row input[type="url"].nine, textarea.nine, .row textarea.nine { width: 100% !important; }
+  input[type="text"].ten, .row input[type="text"].ten, input[type="password"].ten, .row input[type="password"].ten, input[type="date"].ten, .row input[type="date"].ten, input[type="datetime"].ten, .row input[type="datetime"].ten, input[type="email"].ten, .row input[type="email"].ten, input[type="number"].ten, .row input[type="number"].ten, input[type="search"].ten, .row input[type="search"].ten, input[type="tel"].ten, .row input[type="tel"].ten, input[type="time"].ten, .row input[type="time"].ten, input[type="url"].ten, .row input[type="url"].ten, textarea.ten, .row textarea.ten { width: 100% !important; }
+  input[type="text"].eleven, .row input[type="text"].eleven, input[type="password"].eleven, .row input[type="password"].eleven, input[type="date"].eleven, .row input[type="date"].eleven, input[type="datetime"].eleven, .row input[type="datetime"].eleven, input[type="email"].eleven, .row input[type="email"].eleven, input[type="number"].eleven, .row input[type="number"].eleven, input[type="search"].eleven, .row input[type="search"].eleven, input[type="tel"].eleven, .row input[type="tel"].eleven, input[type="time"].eleven, .row input[type="time"].eleven, input[type="url"].eleven, .row input[type="url"].eleven, textarea.eleven, .row textarea.eleven { width: 100% !important; }
+  input[type="text"].twelve, .row input[type="text"].twelve, input[type="password"].twelve, .row input[type="password"].twelve, input[type="date"].twelve, .row input[type="date"].twelve, input[type="datetime"].twelve, .row input[type="datetime"].twelve, input[type="email"].twelve, .row input[type="email"].twelve, input[type="number"].twelve, .row input[type="number"].twelve, input[type="search"].twelve, .row input[type="search"].twelve, input[type="tel"].twelve, .row input[type="tel"].twelve, input[type="time"].twelve, .row input[type="time"].twelve, input[type="url"].twelve, .row input[type="url"].twelve, textarea.twelve, .row textarea.twelve { width: 100% !important; } }
+/* Custom Forms ---------------------- */
+form.custom { /* Custom input, disabled */ }
+form.custom span.custom { display: inline-block; width: 16px; height: 16px; position: relative; top: 2px; border: solid 1px #ccc; background: #fff; }
+form.custom span.custom.radio { -webkit-border-radius: 100px; -moz-border-radius: 100px; -ms-border-radius: 100px; -o-border-radius: 100px; border-radius: 100px; }
+form.custom span.custom.checkbox:before { content: ""; display: block; line-height: 0.8; height: 14px; width: 14px; text-align: center; position: absolute; top: 0; left: 0; font-size: 14px; color: #fff; }
+form.custom span.custom.radio.checked:before { content: ""; display: block; width: 8px; height: 8px; -webkit-border-radius: 100px; -moz-border-radius: 100px; -ms-border-radius: 100px; -o-border-radius: 100px; border-radius: 100px; background: #222; position: relative; top: 3px; left: 3px; }
+form.custom span.custom.checkbox.checked:before { content: "\00d7"; color: #222; }
+form.custom div.custom.dropdown { display: block; position: relative; width: auto; height: 28px; margin-bottom: 9px; margin-top: 2px; }
+form.custom div.custom.dropdown a.current { display: block; width: auto; line-height: 26px; min-height: 28px; padding: 0; padding-left: 6px; padding-right: 38px; border: solid 1px #ddd; color: #141414; background-color: #fff; white-space: nowrap; }
+form.custom div.custom.dropdown a.selector { position: absolute; width: 27px; height: 28px; display: block; right: 0; top: 0; border: solid 1px #ddd; }
+form.custom div.custom.dropdown a.selector:after { content: ""; display: block; content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: #aaaaaa transparent transparent transparent; position: absolute; left: 50%; top: 50%; margin-top: -2px; margin-left: -5px; }
+form.custom div.custom.dropdown:hover a.selector:after, form.custom div.custom.dropdown.open a.selector:after { content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: #222222 transparent transparent transparent; }
+form.custom div.custom.dropdown.open ul { display: block; z-index: 10; }
+form.custom div.custom.dropdown.small { width: 134px !important; }
+form.custom div.custom.dropdown.medium { width: 254px !important; }
+form.custom div.custom.dropdown.large { width: 434px !important; }
+form.custom div.custom.dropdown.expand { width: 100% !important; }
+form.custom div.custom.dropdown.open.small ul { width: 134px !important; }
+form.custom div.custom.dropdown.open.medium ul { width: 254px !important; }
+form.custom div.custom.dropdown.open.large ul { width: 434px !important; }
+form.custom div.custom.dropdown.open.expand ul { width: 100% !important; }
+form.custom div.custom.dropdown ul { position: absolute; width: auto; display: none; margin: 0; left: 0; top: 27px; margin: 0; padding: 0; background: #fff; background: rgba(255, 255, 255, 0.95); border: solid 1px #cccccc; }
+form.custom div.custom.dropdown ul li { color: #555; font-size: 13px; cursor: pointer; padding: 3px; padding-left: 6px; padding-right: 38px; min-height: 18px; line-height: 18px; margin: 0; white-space: nowrap; list-style: none; }
+form.custom div.custom.dropdown ul li.selected { background: #cdebf5; color: #000; }
+form.custom div.custom.dropdown ul li.selected:after { content: "\2013"; position: absolute; right: 10px; }
+form.custom div.custom.dropdown ul li:hover { background-color: #e3f4f9; color: #222; }
+form.custom div.custom.dropdown ul li:hover:after { content: "\2013"; position: absolute; right: 10px; color: #8ed3e7; }
+form.custom div.custom.dropdown ul li.selected:hover { background: #cdebf5; cursor: default; color: #000; }
+form.custom div.custom.dropdown ul li.selected:hover:after { color: #000; }
+form.custom div.custom.dropdown ul.show { display: block; }
+form.custom .custom.disabled { background-color: #ddd; }
+
+/* Correct FF custom dropdown height */
+@-moz-document url-prefix() { form.custom div.custom.dropdown a.selector { height: 30px; } }
+
+.lt-ie9 form.custom div.custom.dropdown a.selector { height: 30px; }
+
+/* The Grid ---------------------- */
+.row { width: 1000px; max-width: 100%; min-width: 768px; margin: 0 auto; }
+.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
+.row.collapse .column, .row.collapse .columns { padding: 0; }
+.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
+.row .row.collapse { margin: 0; }
+
+.column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
+.column.centered, .columns.centered { float: none; margin: 0 auto; }
+
+[class*="column"] + [class*="column"]:last-child { float: right; }
+
+[class*="column"] + [class*="column"].end { float: left; }
+
+.one, .row .one { width: 8.33333%; }
+
+.two, .row .two { width: 16.66667%; }
+
+.three, .row .three { width: 25%; }
+
+.four, .row .four { width: 33.33333%; }
+
+.five, .row .five { width: 41.66667%; }
+
+.six, .row .six { width: 50%; }
+
+.seven, .row .seven { width: 58.33333%; }
+
+.eight, .row .eight { width: 66.66667%; }
+
+.nine, .row .nine { width: 75%; }
+
+.ten, .row .ten { width: 83.33333%; }
+
+.eleven, .row .eleven { width: 91.66667%; }
+
+.twelve, .row .twelve { width: 100%; }
+
+.row .offset-by-one { margin-left: 8.33333%; }
+
+.row .offset-by-two { margin-left: 16.66667%; }
+
+.row .offset-by-three { margin-left: 25%; }
+
+.row .offset-by-four { margin-left: 33.33333%; }
+
+.row .offset-by-five { margin-left: 41.66667%; }
+
+.row .offset-by-six { margin-left: 50%; }
+
+.row .offset-by-seven { margin-left: 58.33333%; }
+
+.row .offset-by-eight { margin-left: 66.66667%; }
+
+.row .offset-by-nine { margin-left: 75%; }
+
+.row .offset-by-ten { margin-left: 83.33333%; }
+
+.push-two { left: 16.66667%; }
+
+.pull-two { right: 16.66667%; }
+
+.push-three { left: 25%; }
+
+.pull-three { right: 25%; }
+
+.push-four { left: 33.33333%; }
+
+.pull-four { right: 33.33333%; }
+
+.push-five { left: 41.66667%; }
+
+.pull-five { right: 41.66667%; }
+
+.push-six { left: 50%; }
+
+.pull-six { right: 50%; }
+
+.push-seven { left: 58.33333%; }
+
+.pull-seven { right: 58.33333%; }
+
+.push-eight { left: 66.66667%; }
+
+.pull-eight { right: 66.66667%; }
+
+.push-nine { left: 75%; }
+
+.pull-nine { right: 75%; }
+
+.push-ten { left: 83.33333%; }
+
+.pull-ten { right: 83.33333%; }
+
+img, object, embed { max-width: 100%; height: auto; }
+
+object, embed { height: 100%; }
+
+img { -ms-interpolation-mode: bicubic; }
+
+#map_canvas img, .map_canvas img { max-width: none!important; }
+
+/* Nicolas Gallagher's micro clearfix */
+.row { *zoom: 1; }
+.row:before, .row:after { content: ""; display: table; }
+.row:after { clear: both; }
+
+/* Mobile Grid and Overrides ---------------------- */
+@media only screen and (max-width: 767px) { body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
+  .row { width: auto; min-width: 0; margin-left: 0; margin-right: 0; }
+  .column, .columns { width: auto !important; float: none; }
+  .column:last-child, .columns:last-child { float: none; }
+  [class*="column"] + [class*="column"]:last-child { float: none; }
+  .column:before, .columns:before, .column:after, .columns:after { content: ""; display: table; }
+  .column:after, .columns:after { clear: both; }
+  .offset-by-one, .offset-by-two, .offset-by-three, .offset-by-four, .offset-by-five, .offset-by-six, .offset-by-seven, .offset-by-eight, .offset-by-nine, .offset-by-ten { margin-left: 0 !important; }
+  .push-two, .push-three, .push-four, .push-five, .push-six, .push-seven, .push-eight, .push-nine, .push-ten { left: auto; }
+  .pull-two, .pull-three, .pull-four, .pull-five, .pull-six, .pull-seven, .pull-eight, .pull-nine, .pull-ten { right: auto; }
+  /* Mobile 4-column Grid */
+  .row .mobile-one { width: 25% !important; float: left; padding: 0 15px; }
+  .row .mobile-one:last-child { float: right; }
+  .row.collapse .mobile-one { padding: 0; }
+  .row .mobile-two { width: 50% !important; float: left; padding: 0 15px; }
+  .row .mobile-two:last-child { float: right; }
+  .row.collapse .mobile-two { padding: 0; }
+  .row .mobile-three { width: 75% !important; float: left; padding: 0 15px; }
+  .row .mobile-three:last-child { float: right; }
+  .row.collapse .mobile-three { padding: 0; }
+  .row .mobile-four { width: 100% !important; float: left; padding: 0 15px; }
+  .row .mobile-four:last-child { float: right; }
+  .row.collapse .mobile-four { padding: 0; }
+  .push-one-mobile { left: 25%; }
+  .pull-one-mobile { right: 25%; }
+  .push-two-mobile { left: 50%; }
+  .pull-two-mobile { right: 50%; }
+  .push-three-mobile { left: 75%; }
+  .pull-three-mobile { right: 75%; } }
+/* Block Grids ---------------------- */
+/* These are 2-up, 3-up, 4-up and 5-up ULs, suited
+for repeating blocks of content. Add 'mobile' to
+them to switch them just like the layout grid
+(one item per line) on phones
+
+For IE7/8 compatibility block-grid items need to be
+the same height. You can optionally uncomment the
+lines below to support arbitrary height, but know
+that IE7/8 do not support :nth-child.
+-------------------------------------------------- */
+.block-grid { display: block; overflow: hidden; padding: 0; }
+.block-grid > li { display: block; height: auto; float: left; }
+.block-grid.one-up { margin: 0; }
+.block-grid.one-up > li { width: 100%; padding: 0 0 15px; }
+.block-grid.two-up { margin: 0 -15px; }
+.block-grid.two-up > li { width: 50%; padding: 0 15px 15px; }
+.block-grid.two-up > li:nth-child(2n+1) { clear: both; }
+.block-grid.three-up { margin: 0 -12px; }
+.block-grid.three-up > li { width: 33.33%; padding: 0 12px 12px; }
+.block-grid.three-up > li:nth-child(3n+1) { clear: both; }
+.block-grid.four-up { margin: 0 -10px; }
+.block-grid.four-up > li { width: 25%; padding: 0 10px 10px; }
+.block-grid.four-up > li:nth-child(4n+1) { clear: both; }
+.block-grid.five-up { margin: 0 -8px; }
+.block-grid.five-up > li { width: 20%; padding: 0 8px 8px; }
+.block-grid.five-up > li:nth-child(5n+1) { clear: both; }
+
+/* Mobile Block Grids */
+@media only screen and (max-width: 767px) { .block-grid.mobile > li { float: none; width: 100%; margin-left: 0; }
+  .block-grid > li { clear: none !important; }
+  .block-grid.mobile-two-up > li { width: 50%; }
+  .block-grid.mobile-two-up > li:nth-child(2n+1) { clear: both; }
+  .block-grid.mobile-three-up > li { width: 33.33%; }
+  .block-grid.mobile-three-up > li:nth-child(3n+1) { clear: both !important; }
+  .block-grid.mobile-four-up > li { width: 25%; }
+  .block-grid.mobile-four-up > li:nth-child(4n+1) { clear: both; }
+  .block-grid.mobile-five-up > li:nth-child(5n+1) { clear: both; } }
+/* Requires globals.css */
+/* Normal Buttons ---------------------- */
+.button { width: auto; background: #fd7800; border: 1px solid #ce6200; -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; color: white; cursor: pointer; display: inline-block; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; line-height: 1; margin: 0; outline: none; padding: 10px 20px 11px; position: relative; text-align: center; text-decoration: none; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; /* Hovers */ /* Sizes */ /* Colors */ /* Radii */ /* Layout */ /* Disabled ---------- */ }
+.button:hover { color: white; background-color: #ce6200; }
+.button:active { -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; }
+.button:focus { -webkit-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; color: white; }
+.button.large { font-size: 17px; padding: 15px 30px 16px; }
+.button.medium { font-size: 14px; }
+.button.small { font-size: 11px; padding: 7px 14px 8px; }
+.button.tiny { font-size: 10px; padding: 5px 10px 6px; }
+.button.expand { width: 100%; text-align: center; }
+.button.primary { background-color: #fd7800; border: 1px solid #1e728c; }
+.button.primary:hover { background-color: #2284a1; }
+.button.primary:focus { -webkit-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
+.button.success { background-color: #5da423; border: 1px solid #396516; }
+.button.success:hover { background-color: #457a1a; }
+.button.success:focus { -webkit-box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
+.button.alert { background-color: #c60f13; border: 1px solid #7f0a0c; }
+.button.alert:hover { background-color: #970b0e; }
+.button.alert:focus { -webkit-box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
+.button.secondary { background-color: #e9e9e9; color: #1d1d1d; border: 1px solid #c3c3c3; }
+.button.secondary:hover { background-color: #d0d0d0; }
+.button.secondary:focus { -webkit-box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
+.button.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
+.button.round { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
+.button.full-width { width: 100%; text-align: center; padding-left: 0px !important; padding-right: 0px !important; }
+.button.left-align { text-align: left; text-indent: 12px; }
+.button.disabled, .button[disabled] { opacity: 0.6; cursor: default; background: #fd7800; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
+.button.disabled :hover, .button[disabled] :hover { background: #fd7800; }
+.button.disabled.success, .button[disabled].success { background-color: #5da423; }
+.button.disabled.success:hover, .button[disabled].success:hover { background-color: #5da423; }
+.button.disabled.alert, .button[disabled].alert { background-color: #c60f13; }
+.button.disabled.alert:hover, .button[disabled].alert:hover { background-color: #c60f13; }
+.button.disabled.secondary, .button[disabled].secondary { background-color: #e9e9e9; }
+.button.disabled.secondary:hover, .button[disabled].secondary:hover { background-color: #e9e9e9; }
+
+/* Don't use native buttons on iOS */
+input[type=submit].button, button.button { -webkit-appearance: none; }
+
+@media only screen and (max-width: 767px) { .button { display: block; }
+  button.button, input[type="submit"].button { width: 100%; padding-left: 0; padding-right: 0; } }
+/* Correct FF button padding */
+@-moz-document url-prefix() { button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner, input[type="file"] > input[type="button"]::-moz-focus-inner { border: none; padding: 0; }
+  input[type="submit"].tiny.button { padding: 3px 10px 4px; }
+  input[type="submit"].small.button { padding: 5px 14px 6px; }
+  input[type="submit"].button, input[type=submit].medium.button { padding: 8px 20px 9px; }
+  input[type="submit"].large.button { padding: 13px 30px 14px; } }
+
+/* Buttons with Dropdowns ---------------------- */
+.button.dropdown { position: relative; padding-right: 44px; /* Sizes */ /* Triangles */ /* Flyout List */ /* Split Dropdown Buttons */ }
+.button.dropdown.large { padding-right: 60px; }
+.button.dropdown.small { padding-right: 28px; }
+.button.dropdown.tiny { padding-right: 20px; }
+.button.dropdown:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: white transparent transparent transparent; position: absolute; top: 50%; right: 20px; margin-top: -2px; }
+.button.dropdown.large:after { content: ""; display: block; width: 0; height: 0; border: solid 7px; border-color: white transparent transparent transparent; margin-top: -3px; right: 30px; }
+.button.dropdown.small:after { content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: white transparent transparent transparent; margin-top: -2px; right: 14px; }
+.button.dropdown.tiny:after { content: ""; display: block; width: 0; height: 0; border: solid 4px; border-color: white transparent transparent transparent; margin-top: -1px; right: 10px; }
+.button.dropdown > ul { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; display: none; position: absolute; left: -1px; background: #fff; background: rgba(255, 255, 255, 0.95); list-style: none; margin: 0; padding: 0; border: 1px solid #cccccc; border-top: none; min-width: 100%; z-index: 40; }
+.button.dropdown > ul li { width: 100%; cursor: pointer; padding: 0; min-height: 18px; line-height: 18px; margin: 0; white-space: nowrap; list-style: none; }
+.button.dropdown > ul li a { display: block; color: #555; font-size: 13px; font-weight: normal; padding: 6px 14px; text-align: left; }
+.button.dropdown > ul li:hover { background-color: #e3f4f9; color: #222; }
+.button.dropdown > ul li.divider { min-height: 0; padding: 0; height: 1px; margin: 4px 0; background: #ededed; }
+.button.dropdown.up > ul { border-top: 1px solid #cccccc; border-bottom: none; }
+.button.dropdown ul.no-hover.show-dropdown { display: block !important; }
+.button.dropdown:hover > ul.no-hover { display: none; }
+.button.dropdown.split { padding: 0; position: relative; /* Sizes */ /* Triangle Spans */ /* Colors */ }
+.button.dropdown.split:after { display: none; }
+.button.dropdown.split:hover { background-color: #fd7800; }
+.button.dropdown.split.alert:hover { background-color: #c60f13; }
+.button.dropdown.split.success:hover { background-color: #5da423; }
+.button.dropdown.split.secondary:hover { background-color: #e9e9e9; }
+.button.dropdown.split > a { color: white; display: block; padding: 10px 50px 11px 20px; padding-left: 20px; padding-right: 50px; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; }
+.button.dropdown.split > a:hover { background-color: #2284a1; }
+.button.dropdown.split.large > a { padding: 15px 75px 16px 30px; padding-left: 30px; padding-right: 75px; }
+.button.dropdown.split.small > a { padding: 7px 35px 8px 14px; padding-left: 14px; padding-right: 35px; }
+.button.dropdown.split.tiny > a { padding: 5px 25px 6px 10px; padding-left: 10px; padding-right: 25px; }
+.button.dropdown.split > span { background-color: #fd7800; position: absolute; right: 0; top: 0; height: 100%; width: 30px; border-left: 1px solid #1e728c; -webkit-box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; }
+.button.dropdown.split > span:hover { background-color: #2284a1; }
+.button.dropdown.split > span:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: white transparent transparent transparent; position: absolute; top: 50%; left: 50%; margin-left: -6px; margin-top: -2px; }
+.button.dropdown.split.secondary > span:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: #1d1d1d transparent transparent transparent; }
+.button.dropdown.split.large span { width: 45px; }
+.button.dropdown.split.small span { width: 21px; }
+.button.dropdown.split.tiny span { width: 15px; }
+.button.dropdown.split.large span:after { content: ""; display: block; width: 0; height: 0; border: solid 7px; border-color: white transparent transparent transparent; margin-top: -3px; margin-left: -7px; }
+.button.dropdown.split.small span:after { content: ""; display: block; width: 0; height: 0; border: solid 4px; border-color: white transparent transparent transparent; margin-top: -1px; margin-left: -4px; }
+.button.dropdown.split.tiny span:after { content: ""; display: block; width: 0; height: 0; border: solid 3px; border-color: white transparent transparent transparent; margin-top: -1px; margin-left: -3px; }
+.button.dropdown.split.alert > span { background-color: #c60f13; border-left-color: #7f0a0c; }
+.button.dropdown.split.success > span { background-color: #5da423; border-left-color: #396516; }
+.button.dropdown.split.secondary > span { background-color: #e9e9e9; border-left-color: #c3c3c3; }
+.button.dropdown.split.secondary > a { color: #1d1d1d; }
+.button.dropdown.split.alert > a:hover, .button.dropdown.split.alert > span:hover { background-color: #970b0e; }
+.button.dropdown.split.success > a:hover, .button.dropdown.split.success > span:hover { background-color: #457a1a; }
+.button.dropdown.split.secondary > a:hover, .button.dropdown.split.secondary > span:hover { background-color: #d0d0d0; }
+
+/* Button Groups ---------------------- */
+ul.button-group { list-style: none; padding: 0; margin: 0 0 12px; *zoom: 1; }
+ul.button-group:before, ul.button-group:after { content: ""; display: table; }
+ul.button-group:after { clear: both; }
+ul.button-group li { padding: 0; margin: 0 0 0 -1px; float: left; }
+ul.button-group li:first-child { margin-left: 0; }
+ul.button-group.radius li a.button, ul.button-group.radius li a.button.radius, ul.button-group.radius li a.button-rounded { -webkit-border-radius: 0px; -moz-border-radius: 0px; -ms-border-radius: 0px; -o-border-radius: 0px; border-radius: 0px; }
+ul.button-group.radius li:first-child a.button, ul.button-group.radius li:first-child a.button.radius { -moz-border-radius-left3px: 5px; -webkit-border-left-3px-radius: 5px; border-left-3px-radius: 5px; }
+ul.button-group.radius li:first-child a.button.rounded { -moz-border-radius-left1000px: 5px; -webkit-border-left-1000px-radius: 5px; border-left-1000px-radius: 5px; }
+ul.button-group.radius li:last-child a.button, ul.button-group.radius li:last-child a.button.radius { -moz-border-radius-right3px: 5px; -webkit-border-right-3px-radius: 5px; border-right-3px-radius: 5px; }
+ul.button-group.radius li:last-child a.button.rounded { -moz-border-radius-right1000px: 5px; -webkit-border-right-1000px-radius: 5px; border-right-1000px-radius: 5px; }
+ul.button-group.even a.button { width: 100%; }
+ul.button-group.even.two-up li { width: 50%; }
+ul.button-group.even.three-up li { width: 33.3%; }
+ul.button-group.even.three-up li:first-child { width: 33.4%; }
+ul.button-group.even.four-up li { width: 25%; }
+ul.button-group.even.five-up li { width: 20%; }
+
+@media only screen and (max-width: 767px) { .button-group button.button, .button-group input[type="submit"].button { width: auto; padding: 10px 20px 11px; }
+  .button-group button.button.large, .button-group input[type="submit"].button.large { padding: 15px 30px 16px; }
+  .button-group button.button.medium, .button-group input[type="submit"].button.medium { padding: 10px 20px 11px; }
+  .button-group button.button.small, .button-group input[type="submit"].button.small { padding: 7px 14px 8px; }
+  .button-group button.button.tiny, .button-group input[type="submit"].button.tiny { padding: 5px 10px 6px; }
+  .button-group.even button.button, .button-group.even input[type="submit"].button { width: 100%; padding-left: 0; padding-right: 0; } }
+div.button-bar { overflow: hidden; }
+div.button-bar ul.button-group { float: left; margin-right: 8px; }
+div.button-bar ul.button-group:last-child { margin-left: 0; }
+
+/* CSS for jQuery Reveal Plugin Maintained for Foundation. foundation.zurb.com Free to use under the MIT license. http://www.opensource.org/licenses/mit-license.php */
+/* Reveal Modals ---------------------- */
+.reveal-modal-bg { position: fixed; height: 100%; width: 100%; background: #000; background: rgba(0, 0, 0, 0.45); z-index: 40; display: none; top: 0; left: 0; }
+
+.reveal-modal { background: white; visibility: hidden; display: none; top: 100px; left: 50%; margin-left: -260px; width: 520px; position: absolute; z-index: 41; padding: 30px; -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); }
+.reveal-modal *:first-child { margin-top: 0; }
+.reveal-modal *:last-child { margin-bottom: 0; }
+.reveal-modal .close-reveal-modal { font-size: 22px; font-size: 2.2rem; line-height: .5; position: absolute; top: 8px; right: 11px; color: #aaa; text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6); font-weight: bold; cursor: pointer; }
+.reveal-modal.small { width: 30%; margin-left: -15%; }
+.reveal-modal.medium { width: 40%; margin-left: -20%; }
+.reveal-modal.large { width: 60%; margin-left: -30%; }
+.reveal-modal.xlarge { width: 70%; margin-left: -35%; }
+.reveal-modal.expand { width: 90%; margin-left: -45%; }
+.reveal-modal .row { min-width: 0; margin-bottom: 10px; }
+
+/* Mobile */
+@media only screen and (max-width: 767px) { .reveal-modal-bg { position: absolute; }
+  .reveal-modal, .reveal-modal.small, .reveal-modal.medium, .reveal-modal.large, .reveal-modal.xlarge { width: 80%; top: 15px; left: 50%; margin-left: -40%; padding: 20px; height: auto; } }
+  /* NOTES Close button entity is &#215;
+ Example markup <div id="myModal" class="reveal-modal"> <h2>Awesome. I have it.</h2> <p class="lead">Your couch.  I it's mine.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam. </p> <a class="close-reveal-modal">&#215;</a> </div> */
+/* Requires -globals.css -app.js */
+/* Tabs ---------------------- */
+dl.tabs { border-bottom: solid 1px #e6e6e6; display: block; height: 40px; padding: 0; margin-bottom: 20px; }
+dl.tabs.contained { margin-bottom: 0; }
+dl.tabs dt { color: #b3b3b3; cursor: default; display: block; float: left; font-size: 12px; height: 40px; line-height: 40px; padding: 0; padding-right: 9px; padding-left: 20px; width: auto; text-transform: uppercase; }
+dl.tabs dt:first-child { padding: 0; padding-right: 9px; }
+dl.tabs dd { display: block; float: left; padding: 0; margin: 0; }
+dl.tabs dd a { color: #6f6f6f; display: block; font-size: 14px; height: 40px; line-height: 40px; padding: 0px 23.8px; }
+dl.tabs dd a:focus { font-weight: bold; color: #fd7800; }
+dl.tabs dd.active { border-top: 3px solid #fd7800; margin-top: -3px; }
+dl.tabs dd.active a { cursor: default; color: #3c3c3c; background: #fff; border-left: 1px solid #e6e6e6; border-right: 1px solid #e6e6e6; font-weight: bold; }
+dl.tabs dd:first-child { margin-left: 0; }
+dl.tabs.vertical { height: auto; border-bottom: 1px solid #e6e6e6; }
+dl.tabs.vertical dt, dl.tabs.vertical dd { float: none; height: auto; }
+dl.tabs.vertical dd { border-left: 3px solid #cccccc; }
+dl.tabs.vertical dd a { background: #f2f2f2; border: none; border: 1px solid #e6e6e6; border-width: 1px 1px 0 0; color: #555; display: block; font-size: 14px; height: auto; line-height: 1; padding: 15px 20px; -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
+dl.tabs.vertical dd.active { margin-top: 0; border-top: 1px solid #4d4d4d; border-left: 4px solid #1a1a1a; }
+dl.tabs.vertical dd.active a { background: #4d4d4d; border: none; color: #fff; height: auto; margin: 0; position: static; top: 0; -webkit-box-shadow: 0 0 0; -moz-box-shadow: 0 0 0; box-shadow: 0 0 0; }
+dl.tabs.vertical dd:first-child a.active { margin: 0; }
+dl.tabs.pill { border-bottom: none; margin-bottom: 10px; }
+dl.tabs.pill dd { margin-right: 10px; }
+dl.tabs.pill dd:last-child { margin-right: 0; }
+dl.tabs.pill dd a { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; background: #e6e6e6; height: 26px; line-height: 26px; color: #666; }
+dl.tabs.pill dd.active { border: none; margin-top: 0; }
+dl.tabs.pill dd.active a { background-color: #fd7800; border: none; color: #fff; }
+dl.tabs.pill.contained { border-bottom: solid 1px #eee; margin-bottom: 0; }
+dl.tabs.pill.two-up dd, dl.tabs.pill.three-up dd, dl.tabs.pill.four-up dd, dl.tabs.pill.five-up dd { margin-right: 0; }
+dl.tabs.two-up dt a, dl.tabs.two-up dd a, dl.tabs.three-up dt a, dl.tabs.three-up dd a, dl.tabs.four-up dt a, dl.tabs.four-up dd a, dl.tabs.five-up dt a, dl.tabs.five-up dd a { padding: 0 17px; text-align: center; overflow: hidden; }
+dl.tabs.two-up dt, dl.tabs.two-up dd { width: 50%; }
+dl.tabs.three-up dt, dl.tabs.three-up dd { width: 33.33%; }
+dl.tabs.four-up dt, dl.tabs.four-up dd { width: 25%; }
+dl.tabs.five-up dt, dl.tabs.five-up dd { width: 20%; }
+
+ul.tabs-content { display: block; margin: 0 0 20px; padding: 0; }
+ul.tabs-content > li { display: none; }
+ul.tabs-content > li.active { display: block; }
+ul.tabs-content.contained { padding: 0; }
+ul.tabs-content.contained > li { border: solid 0 #e6e6e6; border-width: 0 1px 1px 1px; padding: 20px; }
+ul.tabs-content.contained.vertical > li { border-width: 1px 1px 1px 1px; }
+
+.no-js ul.tabs-content > li { display: block; }
+
+@media only screen and (max-width: 767px) { dl.tabs.mobile { width: auto; margin: 20px -20px 40px; height: auto; }
+  dl.tabs.mobile dt, dl.tabs.mobile dd { float: none; height: auto; }
+  dl.tabs.mobile dd a { display: block; width: auto; height: auto; padding: 18px 20px; line-height: 1; border: solid 0 #ccc; border-width: 1px 0 0; margin: 0; color: #555; background: #eee; font-size: 15px; font-size: 1.5rem; }
+  dl.tabs.mobile dd a.active { height: auto; margin: 0; border-width: 1px 0 0; }
+  .tabs.mobile { border-bottom: solid 1px #ccc; height: auto; }
+  .tabs.mobile dd a { padding: 18px 20px; border: none; border-left: none; border-right: none; border-top: 1px solid #ccc; background: #fff; }
+  .tabs.mobile dd a.active { border: none; background: #fd7800; color: #fff; margin: 0; position: static; top: 0; height: auto; }
+  .tabs.mobile dd:first-child a.active { margin: 0; }
+  dl.contained.mobile { margin-bottom: 0; }
+  dl.contained.tabs.mobile dd a { padding: 18px 20px; }
+  dl.tabs.mobile + ul.contained { margin-left: -20px; margin-right: -20px; border-width: 0 0 1px 0; } }
+/* Requires: globals.css */
+/* Table of Contents
+
+:: Visibility
+:: Alerts
+:: Labels
+:: Tooltips
+:: Panels
+:: Accordion
+:: Side Nav
+:: Sub Nav
+:: Pagination
+:: Breadcrumbs
+:: Lists
+:: Link Lists
+:: Keystroke Chars
+:: Image Thumbnails
+:: Video
+:: Tables
+:: Microformats
+:: Progress Bars
+
+*/
+/* Visibility Classes ---------------------- */
+/* Standard (large) display targeting */
+.show-for-small, .show-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .show-for-xlarge { display: none !important; }
+
+.hide-for-xlarge, .show-for-large, .show-for-large-up, .hide-for-small, .hide-for-medium, .hide-for-medium-down { display: block !important; }
+
+/* Very large display targeting */
+@media only screen and (min-width: 1441px) { .hide-for-small, .hide-for-medium, .hide-for-medium-down, .hide-for-large, .show-for-large-up, .show-for-xlarge { display: block !important; }
+  .show-for-small, .show-for-medium, .show-for-medium-down, .show-for-large, .hide-for-large-up, .hide-for-xlarge { display: none !important; } }
+/* Medium display targeting */
+@media only screen and (max-width: 1279px) and (min-width: 768px) { .hide-for-small, .show-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .hide-for-xlarge { display: block !important; }
+  .show-for-small, .hide-for-medium, .hide-for-medium-down, .show-for-large, .show-for-large-up, .show-for-xlarge { display: none !important; } }
+/* Small display targeting */
+@media only screen and (max-width: 767px) { .show-for-small, .hide-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .hide-for-xlarge { display: block !important; }
+  .hide-for-small, .show-for-medium, .hide-for-medium-down, .show-for-large, .show-for-large-up, .show-for-xlarge { display: none !important; } }
+/* Orientation targeting */
+.show-for-landscape, .hide-for-portrait { display: block !important; }
+
+.hide-for-landscape, .show-for-portrait { display: none !important; }
+
+@media screen and (orientation: landscape) { .show-for-landscape, .hide-for-portrait { display: block !important; }
+  .hide-for-landscape, .show-for-portrait { display: none !important; } }
+@media screen and (orientation: portrait) { .show-for-portrait, .hide-for-landscape { display: block !important; }
+  .hide-for-portrait, .show-for-landscape { display: none !important; } }
+/* Touch-enabled device targeting */
+.show-for-touch { display: none !important; }
+
+.hide-for-touch { display: block !important; }
+
+.touch .show-for-touch { display: block !important; }
+
+.touch .hide-for-touch { display: none !important; }
+
+/* Specific overrides for elements that require something other than display: block */
+table.show-for-xlarge, table.show-for-large, table.hide-for-small, table.hide-for-medium { display: table !important; }
+
+@media only screen and (max-width: 1279px) and (min-width: 768px) { .touch table.hide-for-xlarge, .touch table.hide-for-large, .touch table.hide-for-small, .touch table.show-for-medium { display: table !important; } }
+@media only screen and (max-width: 767px) { table.hide-for-xlarge, table.hide-for-large, table.hide-for-medium, table.show-for-small { display: table !important; } }
+/* Alerts ---------------------- */
+div.alert-box { display: block; padding: 6px 7px 7px; font-weight: bold; font-size: 14px; color: white; background-color: #fd7800; border: 1px solid rgba(0, 0, 0, 0.1); margin-bottom: 12px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); position: relative; }
+div.alert-box.success { background-color: #5da423; color: #fff; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); }
+div.alert-box.alert { background-color: #c60f13; color: #fff; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); }
+div.alert-box.secondary { background-color: #e9e9e9; color: #505050; text-shadow: 0 1px rgba(255, 255, 255, 0.3); }
+div.alert-box a.close { color: #333; position: absolute; right: 4px; top: -1px; font-size: 17px; opacity: 0.2; padding: 4px; }
+div.alert-box a.close:hover, div.alert-box a.close:focus { opacity: 0.4; }
+
+/* Labels ---------------------- */
+
+
+/* Tooltips ---------------------- */
+.has-tip { border-bottom: dotted 1px #cccccc; cursor: help; font-weight: bold; color: #333333; }
+.has-tip:hover { border-bottom: dotted 1px #196177; color: #fd7800; }
+.has-tip.tip-left, .has-tip.tip-right { float: none !important; }
+
+.tooltip { display: none; background: black; background: rgba(0, 0, 0, 0.85); position: absolute; color: white; font-weight: bold; font-size: 12px; font-size: 1.2rem; padding: 5px; z-index: 999; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; line-height: normal; }
+.tooltip > .nub { display: block; width: 0; height: 0; border: solid 5px; border-color: transparent transparent black transparent; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent; position: absolute; top: -10px; left: 10px; }
+.tooltip.tip-override > .nub { border-color: transparent transparent black transparent !important; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent !important; top: -10px !important; }
+.tooltip.tip-top > .nub { border-color: black transparent transparent transparent; border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent; top: auto; bottom: -10px; }
+.tooltip.tip-left, .tooltip.tip-right { float: none !important; }
+.tooltip.tip-left > .nub { border-color: transparent transparent transparent black; border-color: transparent transparent transparent rgba(0, 0, 0, 0.85); right: -10px; left: auto; }
+.tooltip.tip-right > .nub { border-color: transparent black transparent transparent; border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent; right: auto; left: -10px; }
+.tooltip.noradius { -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
+.tooltip.opened { color: #fd7800 !important; border-bottom: dotted 1px #196177 !important; }
+
+.tap-to-close { display: block; font-size: 10px; font-size: 1rem; color: #888888; font-weight: normal; }
+
+@media only screen and (max-width: 767px) { .tooltip { font-size: 14px; font-size: 1.4rem; line-height: 1.4; padding: 7px 10px 9px 10px; }
+  .tooltip > .nub, .tooltip.top > .nub, .tooltip.left > .nub, .tooltip.right > .nub { border-color: transparent transparent black transparent; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent; top: -12px; left: 10px; } }
+/* Panels ---------------------- */
+.panel { background: #f2f2f2; border: solid 1px #e6e6e6; margin: 0 0 22px 0; padding: 20px; }
+.panel > :first-child { margin-top: 0; }
+.panel > :last-child { margin-bottom: 0; }
+.panel.callout { background: #fd7800; color: #fff; border-color: #2284a1; -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); -moz-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); }
+.panel.callout a { color: #fff; }
+.panel.callout .button { background: white; border: none; color: #fd7800; text-shadow: none; }
+.panel.callout .button:hover { background: rgba(255, 255, 255, 0.8); }
+.panel.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
+
+/* Accordion ---------------------- */
+ul.accordion { margin: 0 0 22px 0; border-bottom: 1px solid #e9e9e9; }
+ul.accordion > li { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e9e9e9; }
+ul.accordion > li .title { cursor: pointer; background: #f6f6f6; padding: 15px; margin: 0; position: relative; border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; -webkit-transition: 0.15s background linear; -moz-transition: 0.15s background linear; -o-transition: 0.15s background linear; transition: 0.15s background linear; }
+ul.accordion > li .title h1, ul.accordion > li .title h2, ul.accordion > li .title h3, ul.accordion > li .title h4, ul.accordion > li .title h5 { margin: 0; }
+ul.accordion > li .title:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: transparent #9d9d9d transparent transparent; position: absolute; right: 15px; top: 21px; }
+ul.accordion > li .content { display: none; padding: 15px; }
+ul.accordion > li.active { border-top: 3px solid #fd7800; }
+ul.accordion > li.active .title { background: white; padding-top: 13px; }
+ul.accordion > li.active .title:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: #9d9d9d transparent transparent transparent; }
+ul.accordion > li.active .content { background: white; display: block; border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; }
+
+/* Side Nav ---------------------- */
+ul.side-nav { display: block; list-style: none; margin: 0; padding: 17px 0; }
+ul.side-nav li { display: block; list-style: none; margin: 0 0 7px 0; }
+ul.side-nav li a { display: block; }
+ul.side-nav li.active a { color: #4d4d4d; font-weight: bold; }
+ul.side-nav li.divider { border-top: 1px solid #e6e6e6; height: 0; padding: 0; }
+
+/* Sub Navs http://www.zurb.com/article/292/how-to-create-simple-and-effective-sub-na ---------------------- */
+dl.sub-nav { display: block; width: auto; overflow: hidden; margin: -4px 0 18px; margin-right: 0; margin-left: -9px; padding-top: 4px; }
+dl.sub-nav dt, dl.sub-nav dd { float: left; display: inline; margin-left: 9px; margin-bottom: 10px; }
+dl.sub-nav dt { color: #999; font-weight: normal; }
+dl.sub-nav dd a { text-decoration: none; -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
+dl.sub-nav dd.active a { font-weight: bold; background: #fd7800; color: #fff; padding: 3px 9px; cursor: default; }
+
+/* Pagination ---------------------- */
+ul.pagination { display: block; height: 24px; margin-left: -5px; }
+ul.pagination li { float: left; display: block; height: 24px; color: #999; font-size: 14px; margin-left: 5px; }
+ul.pagination li a { display: block; padding: 1px 7px 1px; color: #555; }
+ul.pagination li:hover a, ul.pagination li a:focus { background: #e6e6e6; }
+ul.pagination li.unavailable a { cursor: default; color: #999; }
+ul.pagination li.unavailable:hover a, ul.pagination li.unavailable a:focus { background: transparent; }
+ul.pagination li.current a { background: #fd7800; color: white; font-weight: bold; cursor: default; }
+ul.pagination li.current a:hover { background: #fd7800; }
+
+/* Breadcrums ---------------------- */
+ul.breadcrumbs { display: block; background: #f6f6f6; padding: 6px 10px 7px; border: 1px solid #e9e9e9; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; overflow: hidden; }
+ul.breadcrumbs li { margin: 0; padding: 0 12px 0 0; float: left; list-style: none; }
+ul.breadcrumbs li a, ul.breadcrumbs li span { text-transform: uppercase; font-size: 11px; font-size: 1.1rem; padding-left: 12px; }
+ul.breadcrumbs li:first-child a, ul.breadcrumbs li:first-child span { padding-left: 0; }
+ul.breadcrumbs li:before { content: "/"; color: #aaa; }
+ul.breadcrumbs li:first-child:before { content: " "; }
+ul.breadcrumbs li.current a { cursor: default; color: #333; }
+ul.breadcrumbs li:hover a, ul.breadcrumbs li a:focus { text-decoration: underline; }
+ul.breadcrumbs li.current:hover a, ul.breadcrumbs li.current a:focus { text-decoration: none; }
+ul.breadcrumbs li.unavailable a { color: #999; }
+ul.breadcrumbs li.unavailable:hover a, ul.breadcrumbs li.unavailable a:focus { text-decoration: none; color: #999; cursor: default; }
+
+/* Link List */
+ul.link-list { margin: 0 0 17px -22px; padding: 0; list-style: none; overflow: hidden; }
+ul.link-list li { list-style: none; float: left; margin-left: 22px; display: block; }
+ul.link-list li a { display: block; }
+
+/* Keytroke Characters ---------------------- */
+.keystroke, kbd { font-family: "Consolas", "Menlo", "Courier", monospace; font-size: 13px; padding: 2px 4px 0px; margin: 0; background: #ededed; border: solid 1px #dbdbdb; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
+
+/* Image Thumbnails ---------------------- */
+.th { display: block; }
+.th img { display: block; border: solid 4px #fff; -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; -webkit-transition-property: border, box-shadow; -moz-transition-property: border, box-shadow; -o-transition-property: border, box-shadow; transition-property: border, box-shadow; -webkit-transition-duration: 300ms; -moz-transition-duration: 300ms; -o-transition-duration: 300ms; transition-duration: 300ms; }
+.th:hover img { -webkit-box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); -moz-box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); }
+
+/* Video - Mad props to http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ ---------------------- */
+.flex-video { position: relative; padding-top: 25px; padding-bottom: 67.5%; height: 0; margin-bottom: 16px; overflow: hidden; }
+.flex-video.widescreen { padding-bottom: 57.25%; }
+.flex-video.vimeo { padding-top: 0; }
+.flex-video iframe, .flex-video object, .flex-video embed, .flex-video video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
diff --git a/docs/named_data_theme/static/named_data_doxygen.css b/docs/named_data_theme/static/named_data_doxygen.css
new file mode 100644
index 0000000..02bcbf6
--- /dev/null
+++ b/docs/named_data_theme/static/named_data_doxygen.css
@@ -0,0 +1,776 @@
+@import url("base.css");
+
+@import url("foundation.css");
+
+table {
+      border: 0;
+}
+
+pre {
+    padding: 10px;
+    background-color: #fafafa;
+    color: #222;
+    line-height: 1.0em;
+    border: 2px solid #C6C9CB;
+    font-size: 0.9em;
+    /* margin: 1.5em 0 1.5em 0; */
+    margin: 0;
+    border-right-style: none;
+    border-left-style: none;
+}
+
+/* General */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+a:link {
+    text-decoration: none;
+}
+a:visited {
+    text-decoration: none;
+}
+a:active,
+a:hover {
+    text-decoration: none;
+}
+
+h1,h2,h3,h4,h5,h6 {
+    color: #000;
+    margin-bottom: 18px;
+}
+
+h1 { font-weight: normal; font-size: 24px; line-height: 24px;  }
+h2 { font-weight: normal; font-size: 18px; line-height: 18px;  }
+h3 { font-weight: bold;   font-size: 18px; line-height: 18px; }
+h4 { font-weight: normal; font-size: 18px; line-height: 178px; }
+
+hr {
+    background-color: #c6c6c6;
+    border:0;
+    height: 1px;
+    margin-bottom: 18px;
+    clear:both;
+}
+
+div.hr {
+  height: 1px;
+  background: #c6c6c6;
+}
+
+div.hr2 {
+  height: 1px;
+  background: #c6c6c6;
+}
+
+div.hr hr, div.hr2 hr {
+  display: none;
+}
+
+p {
+    padding: 0 0 0.5em;
+    line-height:1.6em;
+}
+ul {
+    list-style: square;
+    margin: 0 0 18px 0;
+}
+ol {
+    list-style: decimal;
+    margin: 0 0 18px 1.5em;
+}
+ol ol {
+    list-style:upper-alpha;
+}
+ol ol ol {
+    list-style:lower-roman;
+}
+ol ol ol ol {
+    list-style:lower-alpha;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+    margin-bottom:0;
+}
+dl {
+    margin:0 0 24px 0;
+}
+dt {
+    font-weight: bold;
+}
+dd {
+    margin-bottom: 18px;
+}
+strong {
+    font-weight: bold;
+    color: #000;
+}
+cite,
+em,
+i {
+    font-style: italic;
+    border: none;
+}
+big {
+    font-size: 131.25%;
+}
+ins {
+    background: #FFFFCC;
+    border: none;
+    color: #333;
+}
+del {
+    text-decoration: line-through;
+    color: #555;
+}
+blockquote {
+    font-style: italic;
+    padding: 0 3em;
+}
+blockquote cite,
+blockquote em,
+blockquote i {
+    font-style: normal;
+}
+pre {
+    background: #f7f7f7;
+    color: #222;
+    padding: 1.5em;
+}
+abbr,
+acronym {
+    border-bottom: 1px solid #666;
+    cursor: help;
+}
+ins {
+    text-decoration: none;
+}
+sup,
+sub {
+    height: 0;
+    line-height: 1;
+    vertical-align: baseline;
+    position: relative;
+    font-size: 10px;
+}
+sup {
+    bottom: 1ex;
+}
+sub {
+    top: .5ex;
+}
+
+p,
+ul,
+ol,
+dd,
+hr {
+    margin-bottom:10px;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+    margin-bottom:0;
+}
+pre,
+kbd,
+tt,
+var {
+}
+code {
+    font-size: 13px;
+}
+strong,
+b,
+dt,
+th {
+    color: #000;
+}
+
+
+/* main_container */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#wrapper {
+    padding: 0px 0px;
+    margin-top: 20px;
+}
+
+/* header*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#search-header{
+    margin-top:15px;
+    padding-bottom:13px;
+}
+
+#search-header #search{
+    background: #222;
+
+}
+
+#search-header #search #s{
+    background: #222;
+    font-size:12px;
+    color: #aaa;
+}
+
+#header_container{
+    padding-bottom: 25px;
+    padding-top: 0px;
+    background: #fff;
+}
+
+#header {
+
+}
+
+#header2 {
+
+}
+
+#content_container{
+    padding-top: 15px;
+}
+
+#left-col {
+    padding: 10px 20px;
+    padding-left: 0px;
+    background: #fff;
+
+}
+
+
+/*footer*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+
+#footer {
+    padding: 5px 20px;
+    background: #ddd;
+}
+
+#footer-container{
+    padding: 5px 20px;
+    background: #303030;
+    border-top: 8px solid #000;
+    font-size:11px;
+}
+
+#footer-info {
+    color:#ccc;
+    text-align:left;
+    background: #1b1b1b;
+    padding: 20px 0;
+}
+
+
+#footer-info a{
+    text-decoration:none;
+    color: #fff;
+}
+
+#footer-info a:hover{
+    color: #ebebeb;
+}
+
+#copyright{float: left;}
+
+.scroll-top {
+    text-align:right;
+}
+
+#footer-widget{
+    padding: 8px 0px 8px 0px;
+    color:#6f6f6f;
+}
+
+#footer-widget #search {
+    width:120px;
+    height:28px;
+    background: #222;
+    margin-left: 0px;
+    position: relative;
+    border: 1px solid #666;
+}
+
+#footer-widget #search #s {
+    width:110px;
+    height:23px;
+    border:0px;
+    margin-left:7px;
+    margin-right:10px;
+    margin-top:3px;
+    color:#fff;
+    display: inline;
+    background: #222;
+    float: left;
+}
+
+#footer-widget #calendar_wrap {
+    padding: 8px 0px;
+}
+
+#footer-widget #wp-calendar td{
+    padding:2px;
+}
+
+
+#footer-widget .textwidget {
+    padding: 5px 0px;
+    line-height: 23px;
+}
+
+
+#footer-widget .widget_tag_cloud a{
+    text-decoration: none;
+    margin: 5px;
+    line-height: 24px;
+    margin-left: 0px;
+    color: #6f6f6f;
+}
+
+#footer-widget .widget_tag_cloud a:hover{
+    color: #fff;
+}
+
+#footer-widget .widget-container ul li a    {
+    color:#fd7800;
+}
+
+#footer-widget .widget-container ul li a:hover    {
+    color: #ccc;
+}
+
+#footer-widget .widget-container h3 {
+    color: #a5a5a5;
+    text-transform: uppercase;
+    margin-bottom: 0px;
+    padding-top: 10px;
+    padding-left: 0px;
+    font-size: 25px;
+    padding-bottom: 8px;
+    font-weight: bold;
+}
+
+#footer-widget .widget-container ul li {
+    padding: 5px 0px;
+    background: none;
+    }
+
+#footer-widget ul {
+    margin-left: 0px;
+    }
+
+#footer-bar1 {
+    padding-right: 40px;
+}
+#footer-bar2 {
+    padding-right: 40px;
+}
+#footer-bar3 {
+}
+#footer-bar4 {
+}
+
+span#follow-box{
+    position: absolute;
+    right: 100px;
+}
+
+span#follow-box img{
+    margin: 0 2px;
+}
+
+/*logo*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#logo {
+    margin: 0px 0px 0px 0px;
+}
+
+#logo2 {
+    margin: 0px 0px 0px 0px;
+}
+
+#logo img{
+    border: none;
+}
+
+#logo2{
+    text-decoration: none;
+    font-size: 42px;
+    letter-spacing: -1pt;
+    font-weight: bold;
+    font-family:arial, "Times New Roman", Times, serif;
+    text-align: left;
+    line-height: 57px;
+    padding-left: 0px;
+}
+
+#logo2 a, #slogan{
+    color: #fd7800;
+}
+
+#slogan{
+    text-align: left;
+    padding-left: 0px;
+}
+
+/*search*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#search {
+    width:180px;
+    height:28px;
+    border: 1px solid #ccc;
+    margin-left: 10px;
+    position: relative;
+}
+
+#sidebar #search {
+    margin-top: 20px;
+}
+
+#search #searchsubmit {
+    background:url(images/go-btn.png) no-repeat top right;
+    width:28px;
+    height:28px;
+    border:0px;
+    position:absolute;
+    right: -35px;
+}
+
+#search #s {
+    width:170px;
+    height:23px;
+    border:0px;
+    margin-left:7px;
+    margin-right:10px;
+    margin-top:3px;
+    color:#000;
+    display: inline;
+    float: left;
+}
+
+/*menu bar*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#menu_container{
+    padding-top: 0px;
+}
+
+
+/*responsive menu*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+/* default style */
+.selectnav { display: none; }
+
+/* small screen */
+@media screen and (max-width: 600px) {
+  .js #nav { display: none; }
+   .js #nav2 { display: none; }
+  .js .selectnav { display: block; }
+}
+
+
+/*welcome*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+#welcome_container h1{
+    margin-top: 0px;
+}
+
+/*homepage boxes*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#box_container{
+    padding-top: 35px;
+    padding-bottom: 15px;
+}
+
+.box-head {
+    float: left;
+    padding-bottom: 20px;
+}
+
+.box-head img{
+
+}
+
+.title-head{
+    padding-top:2px;
+}
+
+.title-box{
+    color: #333;
+    line-height: 15px;
+    text-transform: uppercase;
+}
+
+.title-box h1 {
+    font-size: 18px;
+    margin-bottom: 3px;
+}
+
+.box-content {
+    float: left;
+    padding-top: 10px;
+    line-height: 20px;
+}
+
+
+/* POST */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+
+.post {
+    overflow: hidden;
+
+}
+
+.post-shadow{
+    background: url("images/post_shadow.png") no-repeat bottom;
+    height: 9px;
+    margin-bottom: 25px;
+}
+
+.post ol{
+    margin-left: 20px;
+}
+
+.post ul {
+    margin-left: 15px;
+}
+.post-entry ul { margin: 0 0 10px 10px; }
+.post-entry ul li {
+    display: block;
+    margin: 5px 0;
+    padding: 0 0 0 20px;
+    /*background: url(images/bullet.png) no-repeat 0 7px;*/
+}
+
+.post-entry ol {
+    list-style: decimal;
+    margin: 0 0 18px 1.6em;
+}
+.post-entry ol li {
+    list-style: decimal;
+ }
+
+.post-entry {
+    padding-bottom: 10px;
+    padding-top: 10px;
+    overflow: hidden;
+
+}
+
+.post-head {
+    margin-bottom: 5px;
+    padding-top: 15px;
+}
+
+.post-head h1 a, .post-head h1 {
+    text-decoration:none;
+    color:#000;
+    margin: 0px;
+    font-size: 27px;
+}
+
+.post-head h1 a:hover {
+    color:#777;
+}
+
+
+.post-head-notfound h1, .post-head-404 h1, .post-head-archive h1, .post-head-search h1 {
+    margin-bottom: 10px;
+    font-weight:normal;
+    text-decoration:none;
+    color:#000;
+    font-size: 27px;
+}
+
+.post-thumb img {
+    border: 0px solid #ebebeb;
+}
+
+.post-entry img{
+    margin-bottom: 10px;
+    height:auto;
+    max-width:100% !important;
+}
+
+.meta-data{
+    line-height: 16px;
+    padding: 6px 3px;
+    margin-bottom: 3px;
+    font-size: 11px;
+    border-bottom: 1px solid #e9e9e9;
+}
+
+.meta-data a{
+    color: #fd7800;
+}
+
+.meta-data a:hover{
+    color: #777;
+}
+
+.read-more {
+color: #000;
+    background: #fff;
+      padding: 4px 8px;
+      border-radius: 3px;
+      display: inline-block;
+      font-size: 11px;
+      font-weight: bold;
+      text-decoration: none;
+      text-transform: capitalize;
+      cursor: pointer;
+      margin-top: 20px;
+}
+
+.read-more:hover{
+    background: #fff;
+    color: #666;
+}
+
+.clear {
+    clear:both;
+}
+
+.sticky {
+
+}
+
+/* content */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+#content_container table {
+    border: 1px solid #e7e7e7;
+    margin: 0 -1px 24px 0;
+    text-align: left;
+    width: 100%;
+
+}
+#content_container tr th,
+#content_container thead th {
+    color: #888;
+    font-size: 12px;
+    font-weight: bold;
+    line-height: 18px;
+    padding: 9px 10px;
+}
+#content_container tr td {
+
+    padding: 6px 10px;
+}
+#content_container tr.odd td {
+    background: #f2f7fc;
+}
+
+/*--navigation--*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+.navigation {
+    float: left;
+    width: 100%;
+    margin: 20px 0;
+}
+
+
+.navigation .alignleft a {
+    float: left;
+}
+
+.navigation .alignright a {
+    float: right;
+}
+
+#nav-single {
+    overflow:hidden;
+    margin-top:20px;
+    margin-bottom:10px;
+}
+.nav-previous {
+    float: left;
+    width: 50%;
+}
+.nav-next {
+    float: right;
+    text-align: right;
+    width: 50%;
+}
+
+/*--sub head and breadcrumbs--*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#subhead_container{
+    padding: 7px 0px;
+}
+
+#subhead h1{
+    color: #000;
+    padding-top: 10px;
+    padding-left: 0px;
+    font-size: 30px;
+}
+
+#breadcrumbs {
+    padding-left: 25px;
+    margin-bottom: 15px;
+    color: #9e9e9e;
+    margin:0 auto;
+    width: 964px;
+    font-size: 10px;
+}
+
+#breadcrumbs a{
+    text-decoration: none;
+    color: #9e9e9e;
+}
+
+/*Alignments */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+.alignleft,
+img.alignleft {
+    display: inline;
+    float: left;
+    margin-right: 22px;
+    margin-top: 9px;
+}
+
+.alignright,
+img.alignright {
+    display: inline;
+    float: right;
+    margin-left: 22px;
+    margin-top: 8px;
+}
+.aligncenter,
+img.aligncenter {
+    clear: both;
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.alignleft,
+.alignright,
+.aligncenter,
+img.alignleft,
+img.alignright,
+img.aligncenter
+{
+    margin-bottom: 10px;
+}
+
+
+a img.aligncenter {
+    display:block;
+    margin-left:auto;
+    margin-right:auto;
+}
+
+img { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; }
diff --git a/docs/named_data_theme/static/named_data_style.css_t b/docs/named_data_theme/static/named_data_style.css_t
new file mode 100644
index 0000000..0d00020
--- /dev/null
+++ b/docs/named_data_theme/static/named_data_style.css_t
@@ -0,0 +1,805 @@
+@import url("base.css");
+
+@import url("foundation.css");
+
+table {
+      border: 0;
+}
+
+pre {
+    padding: 10px;
+    background-color: #fafafa;
+    color: #222;
+    line-height: 1.0em;
+    border: 2px solid #C6C9CB;
+    font-size: 0.9em;
+    /* margin: 1.5em 0 1.5em 0; */
+    margin: 0;
+    border-right-style: none;
+    border-left-style: none;
+}
+
+/* General */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+a:link {
+    text-decoration: none;
+}
+a:visited {
+    text-decoration: none;
+}
+a:active,
+a:hover {
+    text-decoration: none;
+}
+
+h1,h2,h3,h4,h5,h6 {
+    color: #000;
+    margin-bottom: 18px;
+}
+
+h1 { font-weight: normal; font-size: 24px; }
+h2 { font-weight: normal; font-size: 18px; }
+h3 { font-weight: bold;   font-size: 18px; }
+h4 { font-weight: normal; font-size: 18px; }
+
+hr {
+    background-color: #c6c6c6;
+    border:0;
+    height: 1px;
+    margin-bottom: 18px;
+    clear:both;
+}
+
+div.hr {
+  height: 1px;
+  background: #c6c6c6;
+}
+
+div.hr2 {
+  height: 1px;
+  background: #c6c6c6;
+}
+
+div.hr hr, div.hr2 hr {
+  display: none;
+}
+
+p {
+    padding: 0 0 0.5em;
+    line-height:1.6em;
+}
+ul {
+    list-style: square;
+    margin: 0 0 18px 0;
+}
+ol {
+    list-style: decimal;
+    margin: 0 0 18px 1.5em;
+}
+ol ol {
+    list-style:upper-alpha;
+}
+ol ol ol {
+    list-style:lower-roman;
+}
+ol ol ol ol {
+    list-style:lower-alpha;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+    margin-bottom:0;
+}
+dl {
+    margin:0 0 24px 0;
+}
+dt {
+    font-weight: bold;
+}
+dd {
+    margin-bottom: 18px;
+}
+strong {
+    font-weight: bold;
+    color: #000;
+}
+cite,
+em,
+i {
+    font-style: italic;
+    border: none;
+}
+big {
+    font-size: 131.25%;
+}
+ins {
+    background: #FFFFCC;
+    border: none;
+    color: #333;
+}
+del {
+    text-decoration: line-through;
+    color: #555;
+}
+blockquote {
+    font-style: italic;
+    padding: 0 3em;
+}
+blockquote cite,
+blockquote em,
+blockquote i {
+    font-style: normal;
+}
+pre {
+    background: #f7f7f7;
+    color: #222;
+    padding: 1.5em;
+}
+abbr,
+acronym {
+    border-bottom: 1px solid #666;
+    cursor: help;
+}
+ins {
+    text-decoration: none;
+}
+sup,
+sub {
+    height: 0;
+    line-height: 1;
+    vertical-align: baseline;
+    position: relative;
+    font-size: 10px;
+}
+sup {
+    bottom: 1ex;
+}
+sub {
+    top: .5ex;
+}
+
+p,
+ul,
+ol,
+dd,
+hr {
+    margin-bottom:10px;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+    margin-bottom:0;
+}
+pre,
+kbd,
+tt,
+var {
+}
+code {
+    font-size: 13px;
+}
+strong,
+b,
+dt,
+th {
+    color: #000;
+}
+
+
+/* main_container */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#wrapper {
+    padding: 0px 0px;
+    margin-top: 20px;
+}
+
+/* header*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#search-header{
+    margin-top:15px;
+    padding-bottom:13px;
+}
+
+#search-header #search{
+    background: #222;
+
+}
+
+#search-header #search #s{
+    background: #222;
+    font-size:12px;
+    color: #aaa;
+}
+
+#header_container{
+    padding-bottom: 25px;
+    padding-top: 0px;
+    background: #fff;
+}
+
+#header {
+
+}
+
+#header2 {
+
+}
+
+#content_container{
+    padding-top: 15px;
+}
+
+#left-col {
+    padding: 10px 20px;
+    padding-left: 0px;
+    background: #fff;
+
+}
+
+
+/*footer*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+
+#footer {
+    padding: 5px 20px;
+    background: #ddd;
+}
+
+#footer-container{
+    padding: 5px 20px;
+    background: #303030;
+    border-top: 8px solid #000;
+    font-size:11px;
+}
+
+#footer-info {
+    color:#ccc;
+    text-align:left;
+    background: #1b1b1b;
+    padding: 20px 0;
+}
+
+
+#footer-info a{
+    text-decoration:none;
+    color: #fff;
+}
+
+#footer-info a:hover{
+    color: #ebebeb;
+}
+
+#copyright{float: left;}
+
+.scroll-top {
+    text-align:right;
+}
+
+#footer-widget{
+    padding: 8px 0px 8px 0px;
+    color:#6f6f6f;
+}
+
+#footer-widget #search {
+    width:120px;
+    height:28px;
+    background: #222;
+    margin-left: 0px;
+    position: relative;
+    border: 1px solid #666;
+}
+
+#footer-widget #search #s {
+    width:110px;
+    height:23px;
+    border:0px;
+    margin-left:7px;
+    margin-right:10px;
+    margin-top:3px;
+    color:#fff;
+    display: inline;
+    background: #222;
+    float: left;
+}
+
+#footer-widget #calendar_wrap {
+    padding: 8px 0px;
+}
+
+#footer-widget #wp-calendar td{
+    padding:2px;
+}
+
+
+#footer-widget .textwidget {
+    padding: 5px 0px;
+    line-height: 23px;
+}
+
+
+#footer-widget .widget_tag_cloud a{
+    text-decoration: none;
+    margin: 5px;
+    line-height: 24px;
+    margin-left: 0px;
+    color: #6f6f6f;
+}
+
+#footer-widget .widget_tag_cloud a:hover{
+    color: #fff;
+}
+
+#footer-widget .widget-container ul li a    {
+    color:#fd7800;
+}
+
+#footer-widget .widget-container ul li a:hover    {
+    color: #ccc;
+}
+
+#footer-widget .widget-container h3 {
+    color: #a5a5a5;
+    text-transform: uppercase;
+    margin-bottom: 0px;
+    padding-top: 10px;
+    padding-left: 0px;
+    font-size: 25px;
+    padding-bottom: 8px;
+    font-weight: bold;
+}
+
+#footer-widget .widget-container ul li {
+    padding: 5px 0px;
+    background: none;
+    }
+
+#footer-widget ul {
+    margin-left: 0px;
+    }
+
+#footer-bar1 {
+    padding-right: 40px;
+}
+#footer-bar2 {
+    padding-right: 40px;
+}
+#footer-bar3 {
+}
+#footer-bar4 {
+}
+
+span#follow-box{
+    position: absolute;
+    right: 100px;
+}
+
+span#follow-box img{
+    margin: 0 2px;
+}
+
+/*logo*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#logo {
+    margin: 0px 0px 0px 0px;
+}
+
+#logo2 {
+    margin: 0px 0px 0px 0px;
+}
+
+#logo img{
+    border: none;
+}
+
+#logo2{
+    text-decoration: none;
+    font-size: 42px;
+    letter-spacing: -1pt;
+    font-weight: bold;
+    font-family:arial, "Times New Roman", Times, serif;
+    text-align: left;
+    line-height: 57px;
+    padding-left: 0px;
+}
+
+#logo2 a, #slogan{
+    color: #fd7800;
+}
+
+#slogan{
+    text-align: left;
+    padding-left: 0px;
+}
+
+/*search*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#search {
+    width:180px;
+    height:28px;
+    border: 1px solid #ccc;
+    margin-left: 10px;
+    position: relative;
+}
+
+#sidebar #search {
+    margin-top: 20px;
+}
+
+#search #searchsubmit {
+    background:url(images/go-btn.png) no-repeat top right;
+    width:28px;
+    height:28px;
+    border:0px;
+    position:absolute;
+    right: -35px;
+}
+
+#search #s {
+    width:170px;
+    height:23px;
+    border:0px;
+    margin-left:7px;
+    margin-right:10px;
+    margin-top:3px;
+    color:#000;
+    display: inline;
+    float: left;
+}
+
+/*menu bar*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#menu_container{
+    padding-top: 0px;
+}
+
+
+/*responsive menu*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+/* default style */
+.selectnav { display: none; }
+
+/* small screen */
+@media screen and (max-width: 600px) {
+  .js #nav { display: none; }
+   .js #nav2 { display: none; }
+  .js .selectnav { display: block; }
+}
+
+
+/*welcome*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+#welcome_container h1{
+    margin-top: 0px;
+}
+
+/*homepage boxes*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#box_container{
+    padding-top: 35px;
+    padding-bottom: 15px;
+}
+
+.box-head {
+    float: left;
+    padding-bottom: 20px;
+}
+
+.box-head img{
+
+}
+
+.title-head{
+    padding-top:2px;
+}
+
+.title-box{
+    color: #333;
+    line-height: 15px;
+    text-transform: uppercase;
+}
+
+.title-box h1 {
+    font-size: 18px;
+    margin-bottom: 3px;
+}
+
+.box-content {
+    float: left;
+    padding-top: 10px;
+    line-height: 20px;
+}
+
+
+/* POST */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+
+.post {
+    overflow: hidden;
+
+}
+
+.post-shadow{
+    background: url("images/post_shadow.png") no-repeat bottom;
+    height: 9px;
+    margin-bottom: 25px;
+}
+
+.post ol{
+    margin-left: 20px;
+}
+
+.post ul {
+    margin-left: 15px;
+}
+.post-entry ul { margin: 0 0 10px 10px; }
+.post-entry ul li {
+    display: block;
+    margin: 5px 0;
+    padding: 0 0 0 20px;
+    /*background: url(images/bullet.png) no-repeat 0 7px;*/
+}
+
+.post-entry ol {
+    list-style: decimal;
+    margin: 0 0 18px 1.6em;
+}
+.post-entry ol li {
+    list-style: decimal;
+ }
+
+.post-entry {
+    padding-bottom: 10px;
+    padding-top: 10px;
+    overflow: hidden;
+
+}
+
+.post-head {
+    margin-bottom: 5px;
+    padding-top: 15px;
+}
+
+.post-head h1 a, .post-head h1 {
+    text-decoration:none;
+    color:#000;
+    margin: 0px;
+    font-size: 27px;
+}
+
+.post-head h1 a:hover {
+    color:#777;
+}
+
+
+.post-head-notfound h1, .post-head-404 h1, .post-head-archive h1, .post-head-search h1 {
+    margin-bottom: 10px;
+    font-weight:normal;
+    text-decoration:none;
+    color:#000;
+    font-size: 27px;
+}
+
+.post-thumb img {
+    border: 0px solid #ebebeb;
+}
+
+.post-entry img{
+    margin-bottom: 10px;
+    height:auto;
+      max-width:100% !important;
+}
+
+.meta-data{
+    line-height: 16px;
+    padding: 6px 3px;
+    margin-bottom: 3px;
+    font-size: 11px;
+    border-bottom: 1px solid #e9e9e9;
+}
+
+.meta-data a{
+    color: #fd7800;
+}
+
+.meta-data a:hover{
+    color: #777;
+}
+
+.read-more {
+color: #000;
+    background: #fff;
+      padding: 4px 8px;
+      border-radius: 3px;
+      display: inline-block;
+      font-size: 11px;
+      font-weight: bold;
+      text-decoration: none;
+      text-transform: capitalize;
+      cursor: pointer;
+      margin-top: 20px;
+}
+
+.read-more:hover{
+    background: #fff;
+    color: #666;
+}
+
+.clear {
+    clear:both;
+}
+
+.sticky {
+
+}
+
+/* content */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+#content_container table {
+    border: 1px solid #e7e7e7;
+    margin: 0 -1px 24px 0;
+    text-align: left;
+    width: 100%;
+
+}
+#content_container tr th,
+#content_container thead th {
+    color: #888;
+    font-size: 12px;
+    font-weight: bold;
+    line-height: 18px;
+    padding: 9px 10px;
+}
+#content_container tr td {
+
+    padding: 6px 10px;
+}
+#content_container tr.odd td {
+    background: #f2f7fc;
+}
+
+/* sidebar*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#sidebar {
+    padding:0px 20px 20px 0px;
+}
+
+#sidebar ul  {
+    list-style: none;
+}
+
+#sidebar { word-wrap: break-word;}
+
+
+/*--navigation--*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+.navigation {
+    float: left;
+    width: 100%;
+    margin: 20px 0;
+}
+
+
+.navigation .alignleft a {
+    float: left;
+}
+
+.navigation .alignright a {
+    float: right;
+}
+
+#nav-single {
+    overflow:hidden;
+    margin-top:20px;
+    margin-bottom:10px;
+}
+.nav-previous {
+    float: left;
+    width: 50%;
+}
+.nav-next {
+    float: right;
+    text-align: right;
+    width: 50%;
+}
+
+/*--slider--*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#slider_container {
+    background: #fff;
+}
+
+.flex-caption{
+background: #232323;
+color: #fff;
+padding: 7px;
+}
+
+.flexslider p{
+    margin: 0px;
+}
+
+/*--sub head and breadcrumbs--*/
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+#subhead_container{
+    padding: 7px 0px;
+}
+
+#subhead h1{
+    color: #000;
+    padding-top: 10px;
+    padding-left: 0px;
+    font-size: 30px;
+}
+
+#breadcrumbs {
+    padding-left: 25px;
+    margin-bottom: 15px;
+    color: #9e9e9e;
+    margin:0 auto;
+    width: 964px;
+    font-size: 10px;
+}
+
+#breadcrumbs a{
+    text-decoration: none;
+    color: #9e9e9e;
+}
+
+/*Alignments */
+/*////////////////////////////////////////////////////////////////////////////////////////////*/
+
+.alignleft,
+img.alignleft {
+    display: inline;
+    float: left;
+    margin-right: 22px;
+    margin-top: 9px;
+}
+
+.alignright,
+img.alignright {
+    display: inline;
+    float: right;
+    margin-left: 22px;
+    margin-top: 8px;
+}
+.aligncenter,
+img.aligncenter {
+    clear: both;
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.alignleft,
+.alignright,
+.aligncenter,
+img.alignleft,
+img.alignright,
+img.aligncenter
+{
+    margin-bottom: 10px;
+}
+
+
+a img.aligncenter {
+    display:block;
+    margin-left:auto;
+    margin-right:auto;
+}
diff --git a/docs/named_data_theme/static/nav_f.png b/docs/named_data_theme/static/nav_f.png
new file mode 100644
index 0000000..f09ac2f
--- /dev/null
+++ b/docs/named_data_theme/static/nav_f.png
Binary files differ
diff --git a/docs/named_data_theme/static/tab_b.png b/docs/named_data_theme/static/tab_b.png
new file mode 100644
index 0000000..801fb4e
--- /dev/null
+++ b/docs/named_data_theme/static/tab_b.png
Binary files differ
diff --git a/docs/named_data_theme/theme.conf b/docs/named_data_theme/theme.conf
new file mode 100644
index 0000000..1dab97e
--- /dev/null
+++ b/docs/named_data_theme/theme.conf
@@ -0,0 +1,12 @@
+[theme]
+inherit = agogo
+stylesheet = named_data_style.css
+# pygments_style = sphinx
+
+theme_bodyfont = "normal 12px Verdana, sans-serif"
+theme_bgcolor = "#ccc"
+
+[options]
+
+stickysidebar = true
+collapsiblesidebar = true
diff --git a/docs/release_notes.rst b/docs/release_notes.rst
new file mode 100644
index 0000000..6cc8005
--- /dev/null
+++ b/docs/release_notes.rst
@@ -0,0 +1,2 @@
+Release Notes
+=============
diff --git a/nfd.conf.sample.in b/nfd.conf.sample.in
new file mode 100644
index 0000000..22aae5a
--- /dev/null
+++ b/nfd.conf.sample.in
@@ -0,0 +1,157 @@
+; The general section contains settings of nfd process.
+; general
+; {
+; }
+
+log
+{
+  ; default_level specifies the logging level for modules
+  ; that are not explicitly named. All debugging levels
+  ; listed above the selected value are enabled.
+  ;
+  ; Valid values:
+  ;
+  ;  NONE ; no messages
+  ;  ERROR ; error messages
+  ;  WARN ; warning messages
+  ;  INFO ; informational messages (default)
+  ;  DEBUG ; debugging messages
+  ;  TRACE ; trace messages (most verbose)
+  ;  ALL ; all messages
+
+  default_level INFO
+
+  ; You may override default_level by assigning a logging level
+  ; to the desired module name. Module names can be found in two ways:
+  ;
+  ; Run:
+  ;   nfd --modules
+  ;
+  ; Or look for NFD_LOG_INIT(<module name>) statements in .cpp files
+  ;
+  ; Example module-level settings:
+  ;
+  ; FibManager DEBUG
+  ; Forwarder INFO
+}
+
+; The face_system section defines what faces and channels are created.
+face_system
+{
+  ; The unix section contains settings of UNIX stream faces and channels.
+  unix
+  {
+    listen yes ; set to 'no' to disable UNIX stream listener, default 'yes'
+    path /var/run/nfd.sock ; UNIX stream listener path
+  }
+
+  ; The tcp section contains settings of TCP faces and channels.
+  tcp
+  {
+    listen yes ; set to 'no' to disable TCP listener, default 'yes'
+    port 6363 ; TCP listener port number
+    enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
+    enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
+  }
+
+  ; The udp section contains settings of UDP faces and channels.
+  ; UDP channel is always listening; delete udp section to disable UDP
+  udp
+  {
+    port 6363 ; UDP unicast port number
+    enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
+    enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
+    idle_timeout 600 ; idle time (seconds) before closing a UDP unicast face
+    keep_alive_interval 25; interval (seconds) between keep-alive refreshes
+
+    ; UDP multicast settings
+    ; NFD creates one UDP multicast face per NIC
+
+    mcast yes ; set to 'no' to disable UDP multicast, default 'yes'
+    mcast_port 56363 ; UDP multicast port number
+    mcast_group 224.0.23.170 ; UDP multicast group (IPv4 only)
+  }
+
+  ; The ether section contains settings of Ethernet faces and channels.
+  ; These settings will NOT work without root or setting the appropriate
+  ; permissions:
+  ;
+  ;    sudo setcap cap_net_raw,cap_net_admin=eip /full/path/nfd
+  ;
+  ; You may need to install a package to use setcap:
+  ;
+  ; **Ubuntu:**
+  ;
+  ;    sudo apt-get install libcap2-bin
+  ;
+  ; **Mac OS X:**
+  ;
+  ;    curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
+  ;    tar zxvf ChmodBPF.tar.gz
+  ;    open ChmodBPF/Install\ ChmodBPF.app
+  ;
+  ; or manually:
+  ;
+  ;    sudo chgrp admin /dev/bpf*
+  ;    sudo chmod g+rw /dev/bpf*
+
+  @IF_HAVE_LIBPCAP@ether
+  @IF_HAVE_LIBPCAP@{
+  @IF_HAVE_LIBPCAP@  ; Ethernet multicast settings
+  @IF_HAVE_LIBPCAP@  ; NFD creates one Ethernet multicast face per NIC
+  @IF_HAVE_LIBPCAP@
+  @IF_HAVE_LIBPCAP@  mcast yes ; set to 'no' to disable Ethernet multicast, default 'yes'
+  @IF_HAVE_LIBPCAP@  mcast_group 01:00:5E:00:17:AA ; Ethernet multicast group
+  @IF_HAVE_LIBPCAP@}
+}
+
+; The authorizations section grants privileges to authorized keys.
+authorizations
+{
+  ; An authorize section grants privileges to a NDN certificate.
+  authorize
+  {
+    ; If you do not already have NDN certificate, you can generate
+    ; one with the following commands.
+    ;
+    ; 1. Generate and install a self-signed identity certificate:
+    ;
+    ;      ndnsec-keygen /`whoami` | ndnsec-install-cert -
+    ;
+    ; Note that the argument to ndnsec-key will be the identity name of the
+    ; new key (in this case, /your-username). Identities are hierarchical NDN
+    ; names and may have multiple components (e.g. `/ndn/ucla/edu/alice`).
+    ; You may create additional keys and identities as you see fit.
+    ;
+    ; 2. Dump the NDN certificate to a file:
+    ;
+    ;      sudo mkdir -p @SYSCONFDIR@/ndn/keys/
+    ;      ndnsec-cert-dump -i /`whoami` >  default.ndncert
+    ;      sudo mv default.ndncert @SYSCONFDIR@/ndn/keys/default.ndncert
+    ;
+    ; The "certfile" field below specifies the default key directory for
+    ; your machine. You may move your newly created key to the location it
+    ; specifies or path.
+
+    certfile keys/default.ndncert ; NDN identity certificate file
+    privileges ; set of privileges granted to this identity
+    {
+      faces
+      fib
+      strategy-choice
+    }
+  }
+
+  ; You may have multiple authorize sections that specify additional
+  ; certificates and their privileges.
+
+  ; authorize
+  ; {
+  ;   certfile keys/this_cert_does_not_exist.ndncert
+  ;   authorize
+  ;   privileges
+  ;   {
+  ;     faces
+  ;   }
+  ; }
+}
diff --git a/rib/.gitignore b/rib/.gitignore
new file mode 100644
index 0000000..d26fa7d
--- /dev/null
+++ b/rib/.gitignore
@@ -0,0 +1,5 @@
+.DS*
+.waf-1*
+.lock*
+**/*.pyc
+build/
diff --git a/rib/.waf-tools/boost.py b/rib/.waf-tools/boost.py
new file mode 100644
index 0000000..ffcfbae
--- /dev/null
+++ b/rib/.waf-tools/boost.py
@@ -0,0 +1,376 @@
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# partially based on boost.py written by Gernot Vormayr
+# written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008
+# modified by Bjoern Michaelsen, 2008
+# modified by Luca Fossati, 2008
+# rewritten for waf 1.5.1, Thomas Nagy, 2008
+# rewritten for waf 1.6.2, Sylvain Rouquette, 2011
+
+'''
+
+This is an extra tool, not bundled with the default waf binary.
+To add the boost tool to the waf file:
+$ ./waf-light --tools=compat15,boost
+	or, if you have waf >= 1.6.2
+$ ./waf update --files=boost
+
+When using this tool, the wscript will look like:
+
+	def options(opt):
+		opt.load('compiler_cxx boost')
+
+	def configure(conf):
+		conf.load('compiler_cxx boost')
+		conf.check_boost(lib='system filesystem')
+
+	def build(bld):
+		bld(source='main.cpp', target='app', use='BOOST')
+
+Options are generated, in order to specify the location of boost includes/libraries.
+The `check_boost` configuration function allows to specify the used boost libraries.
+It can also provide default arguments to the --boost-static and --boost-mt command-line arguments.
+Everything will be packaged together in a BOOST component that you can use.
+
+When using MSVC, a lot of compilation flags need to match your BOOST build configuration:
+ - you may have to add /EHsc to your CXXFLAGS or define boost::throw_exception if BOOST_NO_EXCEPTIONS is defined.
+   Errors: C4530
+ - boost libraries will try to be smart and use the (pretty but often not useful) auto-linking feature of MSVC
+   So before calling `conf.check_boost` you might want to disabling by adding:
+       conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
+   Errors:
+ - boost might also be compiled with /MT, which links the runtime statically.
+   If you have problems with redefined symbols,
+		self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
+		self.env['CXXFLAGS_%s' % var] += ['/MD', '/EHsc']
+Passing `--boost-linkage_autodetect` might help ensuring having a correct linkage in some basic cases.
+
+'''
+
+import sys
+import re
+from waflib import Utils, Logs, Errors
+from waflib.Configure import conf
+
+BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib', '/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu', '/usr/local/ndn/lib']
+BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include', '/usr/local/ndn/include']
+BOOST_VERSION_FILE = 'boost/version.hpp'
+BOOST_VERSION_CODE = '''
+#include <iostream>
+#include <boost/version.hpp>
+int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
+'''
+
+# toolsets from {boost_dir}/tools/build/v2/tools/common.jam
+PLATFORM = Utils.unversioned_sys_platform()
+detect_intel = lambda env: (PLATFORM == 'win32') and 'iw' or 'il'
+detect_clang = lambda env: (PLATFORM == 'darwin') and 'clang-darwin' or 'clang'
+detect_mingw = lambda env: (re.search('MinGW', env.CXX[0])) and 'mgw' or 'gcc'
+BOOST_TOOLSETS = {
+	'borland':  'bcb',
+	'clang':	detect_clang,
+	'como':	 'como',
+	'cw':	   'cw',
+	'darwin':   'xgcc',
+	'edg':	  'edg',
+	'g++':	  detect_mingw,
+	'gcc':	  detect_mingw,
+	'icpc':	 detect_intel,
+	'intel':	detect_intel,
+	'kcc':	  'kcc',
+	'kylix':	'bck',
+	'mipspro':  'mp',
+	'mingw':	'mgw',
+	'msvc':	 'vc',
+	'qcc':	  'qcc',
+	'sun':	  'sw',
+	'sunc++':   'sw',
+	'tru64cxx': 'tru',
+	'vacpp':	'xlc'
+}
+
+
+def options(opt):
+	opt = opt.add_option_group('Boost Options')
+
+	opt.add_option('--boost-includes', type='string',
+				   default='', dest='boost_includes',
+				   help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_47_0/stage/include''')
+	opt.add_option('--boost-libs', type='string',
+				   default='', dest='boost_libs',
+				   help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_47_0/stage/lib''')
+	opt.add_option('--boost-static', action='store_true',
+				   default=False, dest='boost_static',
+				   help='link with static boost libraries (.lib/.a)')
+	opt.add_option('--boost-mt', action='store_true',
+				   default=False, dest='boost_mt',
+				   help='select multi-threaded libraries')
+	opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
+				   help='''select libraries with tags (dgsyp, d for debug), see doc Boost, Getting Started, chapter 6.1''')
+	opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
+				   help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
+	opt.add_option('--boost-toolset', type='string',
+				   default='', dest='boost_toolset',
+				   help='force a toolset e.g. msvc, vc90, gcc, mingw, mgw45 (default: auto)')
+	py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
+	opt.add_option('--boost-python', type='string',
+				   default=py_version, dest='boost_python',
+				   help='select the lib python with this version (default: %s)' % py_version)
+
+
+@conf
+def __boost_get_version_file(self, d):
+	dnode = self.root.find_dir(d)
+	if dnode:
+		return dnode.find_node(BOOST_VERSION_FILE)
+	return None
+
+@conf
+def boost_get_version(self, d):
+	"""silently retrieve the boost version number"""
+	node = self.__boost_get_version_file(d)
+	if node:
+		try:
+			txt = node.read()
+		except (OSError, IOError):
+			Logs.error("Could not read the file %r" % node.abspath())
+		else:
+			re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
+			m1 = re_but1.search(txt)
+
+			re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+"(.*)"', re.M)
+			m2 = re_but2.search(txt)
+
+			if m1 and m2:
+				return (m1.group(1), m2.group(1))
+
+	return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
+
+@conf
+def boost_get_includes(self, *k, **kw):
+	includes = k and k[0] or kw.get('includes', None)
+	if includes and self.__boost_get_version_file(includes):
+		return includes
+	for d in Utils.to_list(self.environ.get('INCLUDE', '')) + BOOST_INCLUDES:
+		if self.__boost_get_version_file(d):
+			return d
+	if includes:
+		self.end_msg('headers not found in %s' % includes)
+		self.fatal('The configuration failed')
+	else:
+		self.end_msg('headers not found, please provide a --boost-includes argument (see help)')
+		self.fatal('The configuration failed')
+
+
+@conf
+def boost_get_toolset(self, cc):
+	toolset = cc
+	if not cc:
+		build_platform = Utils.unversioned_sys_platform()
+		if build_platform in BOOST_TOOLSETS:
+			cc = build_platform
+		else:
+			cc = self.env.CXX_NAME
+	if cc in BOOST_TOOLSETS:
+		toolset = BOOST_TOOLSETS[cc]
+	return isinstance(toolset, str) and toolset or toolset(self.env)
+
+
+@conf
+def __boost_get_libs_path(self, *k, **kw):
+	''' return the lib path and all the files in it '''
+	if 'files' in kw:
+		return self.root.find_dir('.'), Utils.to_list(kw['files'])
+	libs = k and k[0] or kw.get('libs', None)
+	if libs:
+		path = self.root.find_dir(libs)
+		files = path.ant_glob('*boost_*')
+	if not libs or not files:
+		for d in Utils.to_list(self.environ.get('LIB', [])) + BOOST_LIBS:
+			path = self.root.find_dir(d)
+			if path:
+				files = path.ant_glob('*boost_*')
+				if files:
+					break
+			path = self.root.find_dir(d + '64')
+			if path:
+				files = path.ant_glob('*boost_*')
+				if files:
+					break
+	if not path:
+		if libs:
+			self.end_msg('libs not found in %s' % libs)
+			self.fatal('The configuration failed')
+		else:
+			self.end_msg('libs not found, please provide a --boost-libs argument (see help)')
+			self.fatal('The configuration failed')
+
+	self.to_log('Found the boost path in %r with the libraries:' % path)
+	for x in files:
+		self.to_log('    %r' % x)
+	return path, files
+
+@conf
+def boost_get_libs(self, *k, **kw):
+	'''
+	return the lib path and the required libs
+	according to the parameters
+	'''
+	path, files = self.__boost_get_libs_path(**kw)
+	t = []
+	if kw.get('mt', False):
+		t.append('mt')
+	if kw.get('abi', None):
+		t.append(kw['abi'])
+	tags = t and '(-%s)+' % '-'.join(t) or ''
+	toolset = self.boost_get_toolset(kw.get('toolset', ''))
+	toolset_pat = '(-%s[0-9]{0,3})+' % toolset
+	version = '(-%s)+' % self.env.BOOST_VERSION
+
+	def find_lib(re_lib, files):
+		for file in files:
+			if re_lib.search(file.name):
+				self.to_log('Found boost lib %s' % file)
+				return file
+		return None
+
+	def format_lib_name(name):
+		if name.startswith('lib') and self.env.CC_NAME != 'msvc':
+			name = name[3:]
+		return name[:name.rfind('.')]
+
+	libs = []
+	for lib in Utils.to_list(k and k[0] or kw.get('lib', None)):
+		py = (lib == 'python') and '(-py%s)+' % kw['python'] or ''
+		# Trying libraries, from most strict match to least one
+		for pattern in ['boost_%s%s%s%s%s' % (lib, toolset_pat, tags, py, version),
+						'boost_%s%s%s%s' % (lib, tags, py, version),
+						'boost_%s%s%s' % (lib, tags, version),
+						# Give up trying to find the right version
+						'boost_%s%s%s%s' % (lib, toolset_pat, tags, py),
+						'boost_%s%s%s' % (lib, tags, py),
+						'boost_%s%s' % (lib, tags)]:
+			self.to_log('Trying pattern %s' % pattern)
+			file = find_lib(re.compile(pattern), files)
+			if file:
+				libs.append(format_lib_name(file.name))
+				break
+		else:
+			self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
+			self.fatal('The configuration failed')
+
+	return path.abspath(), libs
+
+
+@conf
+def check_boost(self, *k, **kw):
+	"""
+	Initialize boost libraries to be used.
+
+	Keywords: you can pass the same parameters as with the command line (without "--boost-").
+	Note that the command line has the priority, and should preferably be used.
+	"""
+	if not self.env['CXX']:
+		self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
+
+	params = {'lib': k and k[0] or kw.get('lib', None)}
+	for key, value in self.options.__dict__.items():
+		if not key.startswith('boost_'):
+			continue
+		key = key[len('boost_'):]
+		params[key] = value and value or kw.get(key, '')
+
+	var = kw.get('uselib_store', 'BOOST')
+
+	self.start_msg('Checking boost includes')
+	self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
+	versions = self.boost_get_version(inc)
+	self.env.BOOST_VERSION = versions[0]
+	self.env.BOOST_VERSION_NUMBER = int(versions[1])
+	self.end_msg("%d.%d.%d" % (int(versions[1]) / 100000,
+				   int(versions[1]) / 100 % 1000,
+				   int(versions[1]) % 100))
+	if Logs.verbose:
+		Logs.pprint('CYAN', '	path : %s' % self.env['INCLUDES_%s' % var])
+
+	if not params['lib']:
+		return
+	self.start_msg('Checking boost libs')
+	suffix = params.get('static', None) and 'ST' or ''
+	path, libs = self.boost_get_libs(**params)
+	self.env['%sLIBPATH_%s' % (suffix, var)] = [path]
+	self.env['%sLIB_%s' % (suffix, var)] = libs
+	self.end_msg('ok')
+	if Logs.verbose:
+		Logs.pprint('CYAN', '	path : %s' % path)
+		Logs.pprint('CYAN', '	libs : %s' % libs)
+
+
+	def try_link():
+		if 'system' in params['lib']:
+			self.check_cxx(
+			 fragment="\n".join([
+			  '#include <boost/system/error_code.hpp>',
+			  'int main() { boost::system::error_code c; }',
+			 ]),
+			 use=var,
+			 execute=False,
+			)
+		if 'thread' in params['lib']:
+			self.check_cxx(
+			 fragment="\n".join([
+			  '#include <boost/thread.hpp>',
+			  'int main() { boost::thread t; }',
+			 ]),
+			 use=var,
+			 execute=False,
+			)
+
+	if params.get('linkage_autodetect', False):
+		self.start_msg("Attempting to detect boost linkage flags")
+		toolset = self.boost_get_toolset(kw.get('toolset', ''))
+		if toolset in ['vc']:
+			# disable auto-linking feature, causing error LNK1181
+			# because the code wants to be linked against
+			self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
+
+			# if no dlls are present, we guess the .lib files are not stubs
+			has_dlls = False
+			for x in Utils.listdir(path):
+				if x.endswith(self.env.cxxshlib_PATTERN % ''):
+					has_dlls = True
+					break
+			if not has_dlls:
+				self.env['STLIBPATH_%s' % var] = [path]
+				self.env['STLIB_%s' % var] = libs
+				del self.env['LIB_%s' % var]
+				del self.env['LIBPATH_%s' % var]
+
+			# we attempt to play with some known-to-work CXXFLAGS combinations
+			for cxxflags in (['/MD', '/EHsc'], []):
+				self.env.stash()
+				self.env["CXXFLAGS_%s" % var] += cxxflags
+				try:
+					try_link()
+					self.end_msg("ok: winning cxxflags combination: %s" % (self.env["CXXFLAGS_%s" % var]))
+					e = None
+					break
+				except Errors.ConfigurationError as exc:
+					self.env.revert()
+					e = exc
+
+			if e is not None:
+				self.end_msg("Could not auto-detect boost linking flags combination, you may report it to boost.py author", ex=e)
+				self.fatal('The configuration failed')
+		else:
+			self.end_msg("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain")
+			self.fatal('The configuration failed')
+	else:
+		self.start_msg('Checking for boost linkage')
+		try:
+			try_link()
+		except Errors.ConfigurationError as e:
+			self.end_msg("Could not link against boost libraries using supplied options")
+			self.fatal('The configuration failed')
+		self.end_msg('ok')
diff --git a/rib/.waf-tools/coverage.py b/rib/.waf-tools/coverage.py
new file mode 100644
index 0000000..eac7608
--- /dev/null
+++ b/rib/.waf-tools/coverage.py
@@ -0,0 +1,20 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+from waflib import TaskGen
+
+def options(opt):
+    opt.add_option('--with-coverage',action='store_true',default=False,dest='with_coverage',
+                   help='''Set compiler flags for gcc to enable code coverage information''')
+
+def configure(conf):
+    if conf.options.with_coverage:
+        conf.check_cxx(cxxflags=['-fprofile-arcs', '-ftest-coverage', '-fPIC'],
+                       linkflags=['-fprofile-arcs'], uselib_store='GCOV', mandatory=True)
+
+@TaskGen.feature('cxx','cc')
+@TaskGen.after('process_source')
+def add_coverage(self):
+    if getattr(self, 'use', ''):
+        self.use += ' GCOV'
+    else:
+        self.use = 'GCOV'
diff --git a/rib/.waf-tools/doxygen.py b/rib/.waf-tools/doxygen.py
new file mode 100644
index 0000000..aebb511
--- /dev/null
+++ b/rib/.waf-tools/doxygen.py
@@ -0,0 +1,204 @@
+#! /usr/bin/env python
+# encoding: UTF-8
+# Thomas Nagy 2008-2010 (ita)
+
+"""
+
+Doxygen support
+
+Variables passed to bld():
+* doxyfile -- the Doxyfile to use
+
+When using this tool, the wscript will look like:
+
+	def options(opt):
+		opt.load('doxygen')
+
+	def configure(conf):
+		conf.load('doxygen')
+		# check conf.env.DOXYGEN, if it is mandatory
+
+	def build(bld):
+		if bld.env.DOXYGEN:
+			bld(features="doxygen", doxyfile='Doxyfile', ...)
+"""
+
+from fnmatch import fnmatchcase
+import os, os.path, re, stat
+from waflib import Task, Utils, Node, Logs, Errors
+from waflib.TaskGen import feature
+
+DOXY_STR = '"${DOXYGEN}" - '
+DOXY_FMTS = 'html latex man rft xml'.split()
+DOXY_FILE_PATTERNS = '*.' + ' *.'.join('''
+c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx hpp h++ idl odl cs php php3
+inc m mm py f90c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx
+'''.split())
+
+re_rl = re.compile('\\\\\r*\n', re.MULTILINE)
+re_nl = re.compile('\r*\n', re.M)
+def parse_doxy(txt):
+	tbl = {}
+	txt   = re_rl.sub('', txt)
+	lines = re_nl.split(txt)
+	for x in lines:
+		x = x.strip()
+		if not x or x.startswith('#') or x.find('=') < 0:
+			continue
+		if x.find('+=') >= 0:
+			tmp = x.split('+=')
+			key = tmp[0].strip()
+			if key in tbl:
+				tbl[key] += ' ' + '+='.join(tmp[1:]).strip()
+			else:
+				tbl[key] = '+='.join(tmp[1:]).strip()
+		else:
+			tmp = x.split('=')
+			tbl[tmp[0].strip()] = '='.join(tmp[1:]).strip()
+	return tbl
+
+class doxygen(Task.Task):
+	vars  = ['DOXYGEN', 'DOXYFLAGS']
+	color = 'BLUE'
+
+	def runnable_status(self):
+		'''
+		self.pars are populated in runnable_status - because this function is being
+		run *before* both self.pars "consumers" - scan() and run()
+
+		set output_dir (node) for the output
+		'''
+
+		for x in self.run_after:
+			if not x.hasrun:
+				return Task.ASK_LATER
+
+		if not getattr(self, 'pars', None):
+			txt = self.inputs[0].read()
+			self.pars = parse_doxy(txt)
+			if not self.pars.get('OUTPUT_DIRECTORY'):
+				self.pars['OUTPUT_DIRECTORY'] = self.inputs[0].parent.get_bld().abspath()
+
+			# Override with any parameters passed to the task generator
+			if getattr(self.generator, 'pars', None):
+				for k, v in self.generator.pars.iteritems():
+					self.pars[k] = v
+
+			self.doxy_inputs = getattr(self, 'doxy_inputs', [])
+			if not self.pars.get('INPUT'):
+				self.doxy_inputs.append(self.inputs[0].parent)
+			else:
+				for i in self.pars.get('INPUT').split():
+					if os.path.isabs(i):
+						node = self.generator.bld.root.find_node(i)
+					else:
+						node = self.generator.path.find_node(i)
+					if not node:
+						self.generator.bld.fatal('Could not find the doxygen input %r' % i)
+					self.doxy_inputs.append(node)
+
+		if not getattr(self, 'output_dir', None):
+			bld = self.generator.bld
+			# First try to find an absolute path, then find or declare a relative path
+			self.output_dir = bld.root.find_dir(self.pars['OUTPUT_DIRECTORY'])
+			if not self.output_dir:
+				self.output_dir = bld.path.find_or_declare(self.pars['OUTPUT_DIRECTORY'])
+
+		self.signature()
+		return Task.Task.runnable_status(self)
+
+	def scan(self):
+		exclude_patterns = self.pars.get('EXCLUDE_PATTERNS','').split()
+		file_patterns = self.pars.get('FILE_PATTERNS','').split()
+		if not file_patterns:
+			file_patterns = DOXY_FILE_PATTERNS
+		if self.pars.get('RECURSIVE') == 'YES':
+			file_patterns = ["**/%s" % pattern for pattern in file_patterns]
+		nodes = []
+		names = []
+		for node in self.doxy_inputs:
+			if os.path.isdir(node.abspath()):
+				for m in node.ant_glob(incl=file_patterns, excl=exclude_patterns):
+					nodes.append(m)
+			else:
+				nodes.append(node)
+		return (nodes, names)
+
+	def run(self):
+		dct = self.pars.copy()
+		dct['INPUT'] = ' '.join(['"%s"' % x.abspath() for x in self.doxy_inputs])
+		code = '\n'.join(['%s = %s' % (x, dct[x]) for x in self.pars])
+		code = code.encode() # for python 3
+		#fmt = DOXY_STR % (self.inputs[0].parent.abspath())
+		cmd = Utils.subst_vars(DOXY_STR, self.env)
+		env = self.env.env or None
+		proc = Utils.subprocess.Popen(cmd, shell=True, stdin=Utils.subprocess.PIPE, env=env, cwd=self.generator.bld.path.get_bld().abspath())
+		proc.communicate(code)
+		return proc.returncode
+
+	def post_run(self):
+		nodes = self.output_dir.ant_glob('**/*', quiet=True)
+		for x in nodes:
+			x.sig = Utils.h_file(x.abspath())
+		self.outputs += nodes
+		return Task.Task.post_run(self)
+
+class tar(Task.Task):
+	"quick tar creation"
+	run_str = '${TAR} ${TAROPTS} ${TGT} ${SRC}'
+	color   = 'RED'
+	after   = ['doxygen']
+	def runnable_status(self):
+		for x in getattr(self, 'input_tasks', []):
+			if not x.hasrun:
+				return Task.ASK_LATER
+
+		if not getattr(self, 'tar_done_adding', None):
+			# execute this only once
+			self.tar_done_adding = True
+			for x in getattr(self, 'input_tasks', []):
+				self.set_inputs(x.outputs)
+			if not self.inputs:
+				return Task.SKIP_ME
+		return Task.Task.runnable_status(self)
+
+	def __str__(self):
+		tgt_str = ' '.join([a.nice_path(self.env) for a in self.outputs])
+		return '%s: %s\n' % (self.__class__.__name__, tgt_str)
+
+@feature('doxygen')
+def process_doxy(self):
+	if not getattr(self, 'doxyfile', None):
+		self.generator.bld.fatal('no doxyfile??')
+
+	node = self.doxyfile
+	if not isinstance(node, Node.Node):
+		node = self.path.find_resource(node)
+	if not node:
+		raise ValueError('doxygen file not found')
+
+	# the task instance
+	dsk = self.create_task('doxygen', node)
+
+	if getattr(self, 'doxy_tar', None):
+		tsk = self.create_task('tar')
+		tsk.input_tasks = [dsk]
+		tsk.set_outputs(self.path.find_or_declare(self.doxy_tar))
+		if self.doxy_tar.endswith('bz2'):
+			tsk.env['TAROPTS'] = ['cjf']
+		elif self.doxy_tar.endswith('gz'):
+			tsk.env['TAROPTS'] = ['czf']
+		else:
+			tsk.env['TAROPTS'] = ['cf']
+
+def configure(conf):
+	'''
+	Check if doxygen and tar commands are present in the system
+
+	If the commands are present, then conf.env.DOXYGEN and conf.env.TAR
+	variables will be set. Detection can be controlled by setting DOXYGEN and
+	TAR environmental variables.
+	'''
+
+	conf.find_program('doxygen', var='DOXYGEN', mandatory=False)
+	conf.find_program('tar', var='TAR', mandatory=False)
diff --git a/.waf-tools/flags.py b/rib/.waf-tools/flags.py
similarity index 100%
rename from .waf-tools/flags.py
rename to rib/.waf-tools/flags.py
diff --git a/rib/INSTALL.md b/rib/INSTALL.md
new file mode 100644
index 0000000..868a8d1
--- /dev/null
+++ b/rib/INSTALL.md
@@ -0,0 +1,16 @@
+## Prerequisites
+
+* Boost libraries >= 1.48
+* [NDN-CPP-dev library](https://github.com/named-data/ndn-cpp-dev)
+* `pkg-config`
+
+## Build
+
+The following commands should be used to build NRD:
+
+    ./waf configure
+    ./waf
+
+If NRD needs to be installed
+
+    sudo ./waf install
diff --git a/rib/README.md b/rib/README.md
new file mode 100644
index 0000000..fbbe11a
--- /dev/null
+++ b/rib/README.md
@@ -0,0 +1,67 @@
+NRD (NDN Routing Daemon)
+========================
+NRD works in parallel with NFD and provides services for prefix registration.
+
+For installation details please see INSTALL.md.
+
+## Default Paths
+
+This README uses `SYSCONFDIR` when referring to the default locations of
+various configuration files.  By default, `SYSCONFDIR` is set to
+`/usr/local/etc`.  If you override just `PREFIX`, then `SYSCONFDIR` will
+default to `PREFIX/etc`.
+
+You may override `SYSCONFDIR` and/or `PREFIX` by specifying their
+corresponding options during configuration:
+
+    ./waf configure --prefix <path/for/prefix> --sysconfdir <some/other/path>
+
+## Running and Configuring NRD
+
+NRD's runtime settings may be modified via configuration file.  After
+installation, a working sample configuration is provided at
+`SYSCONFDIR/ndn/nrd.conf.sample`. At startup, NRD will attempt to
+read the default configuration file from following location:
+`SYSCONFDIR/ndn/nrd.conf`.
+
+You may also specify an alternative configuration file location
+by running NRD with:
+
+    nrd --config </path/to/nrd.conf>
+
+Currently, nrd.conf contains only a security section, which is well documented
+in the sample configuration file.
+
+## Starting experiments
+
+1. Build, install and setup NFD by following the directions provided in
+README.md in NFD root folder.
+
+2. Create certificates by following the instructions in NFD's README.md
+
+3. Build and install NRD by following the directions in INSTALL.md
+
+4. Create nrd.conf file. You can simply copy the provided sample file in
+`SYSCONFDIR/ndn/nrd.conf`.
+
+5. Setup the trust-anchors in nrd.conf. Ideally, the prefix registration
+Interest should be signed by application/user key, and this application/user
+key should be used as trust-anchor. However, currently the default certificate
+is used to sign the registration Interests. Therefore, for initial testing the
+default certificate should be set as the trust-anchor. For doing so, the default
+certificate should be copied in the same folder where the nrd.conf is.
+Secondly, the trust-anchor should point to the copied certificate in nrd.conf.
+To know the id of default certificate you can use:
+
+    ~$ ndnsec-get-default
+
+6. Start NFD (assuming the NFD's conf file exist in `SYSCONFDIR/ndn/nfd.conf`):
+
+    ~$ nfd
+
+7. Start NRD (assuming the conf file exist in `SYSCONFDIR/ndn/nrd.conf`):
+
+    ~$ nrd
+
+8. Try to connect any application to NFD. For example, producer application that is provided
+ndn-cpp-dev examples.
diff --git a/nrd.conf.sample b/rib/nrd.conf.sample
similarity index 100%
rename from nrd.conf.sample
rename to rib/nrd.conf.sample
diff --git a/src/common.hpp b/rib/src/common.hpp
similarity index 100%
rename from src/common.hpp
rename to rib/src/common.hpp
diff --git a/src/face-monitor.cpp b/rib/src/face-monitor.cpp
similarity index 99%
rename from src/face-monitor.cpp
rename to rib/src/face-monitor.cpp
index f4143a9..f434523 100644
--- a/src/face-monitor.cpp
+++ b/rib/src/face-monitor.cpp
@@ -147,4 +147,3 @@
 }
 
 }//namespace ndn
-
diff --git a/src/face-monitor.hpp b/rib/src/face-monitor.hpp
similarity index 100%
rename from src/face-monitor.hpp
rename to rib/src/face-monitor.hpp
diff --git a/src/main.cpp b/rib/src/main.cpp
similarity index 100%
rename from src/main.cpp
rename to rib/src/main.cpp
diff --git a/src/nrd-config.cpp b/rib/src/nrd-config.cpp
similarity index 100%
rename from src/nrd-config.cpp
rename to rib/src/nrd-config.cpp
diff --git a/src/nrd-config.hpp b/rib/src/nrd-config.hpp
similarity index 100%
rename from src/nrd-config.hpp
rename to rib/src/nrd-config.hpp
diff --git a/src/nrd.cpp b/rib/src/nrd.cpp
similarity index 100%
rename from src/nrd.cpp
rename to rib/src/nrd.cpp
diff --git a/src/nrd.hpp b/rib/src/nrd.hpp
similarity index 100%
rename from src/nrd.hpp
rename to rib/src/nrd.hpp
diff --git a/src/rib.cpp b/rib/src/rib.cpp
similarity index 100%
rename from src/rib.cpp
rename to rib/src/rib.cpp
diff --git a/src/rib.hpp b/rib/src/rib.hpp
similarity index 100%
rename from src/rib.hpp
rename to rib/src/rib.hpp
diff --git a/rib/tests/main.cpp b/rib/tests/main.cpp
new file mode 100644
index 0000000..a7e827d
--- /dev/null
+++ b/rib/tests/main.cpp
@@ -0,0 +1,10 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#define BOOST_TEST_MAIN 1
+#define BOOST_TEST_DYN_LINK 1
+
+#include <boost/test/unit_test.hpp>
diff --git a/tests/test-rib.cpp b/rib/tests/test-rib.cpp
similarity index 100%
rename from tests/test-rib.cpp
rename to rib/tests/test-rib.cpp
diff --git a/rib/waf b/rib/waf
new file mode 100755
index 0000000..78a44f3
--- /dev/null
+++ b/rib/waf
Binary files differ
diff --git a/rib/wscript b/rib/wscript
new file mode 100644
index 0000000..1a7f82a
--- /dev/null
+++ b/rib/wscript
@@ -0,0 +1,71 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+from waflib import Logs
+
+def options(opt):
+    opt.load('compiler_cxx gnu_dirs')
+    opt.load('flags boost doxygen coverage', tooldir=['.waf-tools'])
+
+    nrdopt = opt.add_option_group('NRD Options')
+    nrdopt.add_option('--debug', action='store_true', default=False,
+                      dest='debug',
+                      help='''Compile library debugging mode without all optimizations (-O0)''')
+    nrdopt.add_option('--with-tests', action='store_true',
+                      default=False, dest='with_tests', help='''Build unit tests''')
+
+def configure(conf):
+    conf.load("compiler_cxx gnu_dirs boost flags")
+
+    conf.check_cfg(package='libndn-cpp-dev', args=['--cflags', '--libs'],
+                   uselib_store='NDN_CPP', mandatory=True)
+
+    boost_libs = 'system'
+    if conf.options.with_tests:
+        conf.env['WITH_TESTS'] = 1
+        conf.define('WITH_TESTS', 1);
+        boost_libs += ' unit_test_framework'
+
+    conf.check_boost(lib=boost_libs)
+    if conf.env.BOOST_VERSION_NUMBER < 104800:
+        Logs.error("Minimum required boost version is 1.48")
+        Logs.error("Please upgrade your distribution or install custom boost libraries" +
+                   " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
+        return
+
+    # conf.load('coverage')
+
+    # try:
+    #     conf.load('doxygen')
+    # except:
+    #     pass
+
+    conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nrd.conf' % conf.env['SYSCONFDIR'])
+    conf.write_config_header('src/config.hpp')
+
+def build (bld):
+    bld(
+        features='cxx',
+        name='nrd-objects',
+        source=bld.path.ant_glob('src/*.cpp',
+                                 excl='src/main.cpp'),
+        use='NDN_CPP BOOST',
+        )
+
+    bld.program(
+        target='nrd',
+        source='src/main.cpp',
+        use='nrd-objects'
+        )
+
+    # Unit tests
+    if bld.env['WITH_TESTS']:
+        unit_tests = bld.program(
+            target='unit-tests',
+            features='cxx cxxprogram',
+            source=bld.path.ant_glob(['tests/**/*.cpp']),
+            use='nrd-objects',
+            includes=['.', 'src'],
+            install_prefix=None,
+            )
+
+    bld.install_files('${SYSCONFDIR}/ndn', 'nrd.conf.sample')
diff --git a/tests/core/config-file.cpp b/tests/core/config-file.cpp
new file mode 100644
index 0000000..bb75b77
--- /dev/null
+++ b/tests/core/config-file.cpp
@@ -0,0 +1,367 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/config-file.hpp"
+
+#include "tests/test-common.hpp"
+
+#include <fstream>
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("ConfigFileTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtConfigFile, BaseFixture)
+
+// a
+// {
+//    akey "avalue"
+// }
+// b
+// {
+//   bkey "bvalue"
+// }
+
+const std::string CONFIG =
+"a\n"
+"{\n"
+"        akey \"avalue\"\n"
+"}\n"
+"b\n"
+"{\n"
+"        bkey \"bvalue\"\n"
+"}\n";
+
+
+// a
+// {
+//    akey "avalue"
+// }
+// b
+//
+//   bkey "bvalue"
+// }
+
+const std::string MALFORMED_CONFIG =
+"a\n"
+"{\n"
+"        akey \"avalue\"\n"
+"}\n"
+"b\n"
+"\n"
+"        bkey \"bvalue\"\n"
+"}\n";
+
+// counts of the respective section counts in config_example.info
+
+const int CONFIG_N_A_SECTIONS = 1;
+const int CONFIG_N_B_SECTIONS = 1;
+
+class DummySubscriber
+{
+public:
+
+  DummySubscriber(ConfigFile& config,
+                  int nASections,
+                  int nBSections,
+                  bool expectDryRun)
+    : m_nASections(nASections),
+      m_nBSections(nBSections),
+      m_nRemainingACallbacks(nASections),
+      m_nRemainingBCallbacks(nBSections),
+      m_expectDryRun(expectDryRun)
+  {
+
+  }
+
+  void
+  onA(const ConfigSection& section, bool isDryRun)
+  {
+    // NFD_LOG_DEBUG("a");
+    BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
+    --m_nRemainingACallbacks;
+  }
+
+
+  void
+  onB(const ConfigSection& section, bool isDryRun)
+  {
+    // NFD_LOG_DEBUG("b");
+    BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
+    --m_nRemainingBCallbacks;
+  }
+
+  bool
+  allCallbacksFired() const
+  {
+    return m_nRemainingACallbacks == 0 &&
+      m_nRemainingBCallbacks == 0;
+  }
+
+  bool
+  noCallbacksFired() const
+  {
+    return m_nRemainingACallbacks == m_nASections &&
+      m_nRemainingBCallbacks == m_nBSections;
+  }
+
+  virtual
+  ~DummySubscriber()
+  {
+
+  }
+
+private:
+  int m_nASections;
+  int m_nBSections;
+  int m_nRemainingACallbacks;
+  int m_nRemainingBCallbacks;
+  bool m_expectDryRun;
+};
+
+class DummyAllSubscriber : public DummySubscriber
+{
+public:
+  DummyAllSubscriber(ConfigFile& config, bool expectDryRun=false)
+    : DummySubscriber(config,
+                      CONFIG_N_A_SECTIONS,
+                      CONFIG_N_B_SECTIONS,
+                      expectDryRun)
+  {
+    config.addSectionHandler("a", bind(&DummySubscriber::onA, this, _1, _2));
+    config.addSectionHandler("b", bind(&DummySubscriber::onB, this, _1, _2));
+  }
+
+  virtual
+  ~DummyAllSubscriber()
+  {
+
+  }
+};
+
+class DummyOneSubscriber : public DummySubscriber
+{
+public:
+  DummyOneSubscriber(ConfigFile& config,
+                     const std::string& sectionName,
+                     bool expectDryRun=false)
+    : DummySubscriber(config,
+                      (sectionName == "a"),
+                      (sectionName == "b"),
+                      expectDryRun)
+  {
+    if (sectionName == "a")
+      {
+        config.addSectionHandler(sectionName, bind(&DummySubscriber::onA, this, _1, _2));
+      }
+    else if (sectionName == "b")
+      {
+        config.addSectionHandler(sectionName, bind(&DummySubscriber::onB, this, _1, _2));
+      }
+    else
+      {
+        BOOST_FAIL("Test setup error: "
+                   << "Unexpected section name "
+                   <<"\"" << sectionName << "\"");
+      }
+
+  }
+
+  virtual
+  ~DummyOneSubscriber()
+  {
+
+  }
+};
+
+class DummyNoSubscriber : public DummySubscriber
+{
+public:
+  DummyNoSubscriber(ConfigFile& config, bool expectDryRun)
+    : DummySubscriber(config, 0, 0, expectDryRun)
+  {
+
+  }
+
+  virtual
+  ~DummyNoSubscriber()
+  {
+
+  }
+};
+
+BOOST_AUTO_TEST_CASE(OnConfigStream)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+  std::ifstream input;
+
+  input.open("tests/core/config_example.info");
+  BOOST_REQUIRE(input.is_open());
+
+  file.parse(input, false, "config_example.info");
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStreamEmptyStream)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  std::ifstream input;
+
+  BOOST_CHECK_THROW(file.parse(input, false, "unknown"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+
+BOOST_AUTO_TEST_CASE(OnConfigString)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringEmpty)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse(std::string(), false, "dummy-config"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringMalformed)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse(MALFORMED_CONFIG, false, "dummy-config"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+
+  file.parse(CONFIG, true, "dummy-config");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilename)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  file.parse("tests/core/config_example.info", false);
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameNoFile)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse("i_made_this_up.info", false), ConfigFile::Error);
+
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameMalformed)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse("tests/core/config_malformed.info", false), ConfigFile::Error);
+
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStreamDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+  std::ifstream input;
+
+  input.open("tests/core/config_example.info");
+  BOOST_REQUIRE(input.is_open());
+
+  file.parse(input, true, "tests/core/config_example.info");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+
+  input.close();
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+
+  file.parse("tests/core/config_example.info", true);
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigReplaceSubscriber)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub1(file);
+  DummyAllSubscriber sub2(file);
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(sub1.noCallbacksFired());
+  BOOST_CHECK(sub2.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigUncoveredSections)
+{
+  ConfigFile file;
+
+  BOOST_CHECK_THROW(file.parse(CONFIG, false, "dummy-config"), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigCoveredByPartialSubscribers)
+{
+  ConfigFile file;
+  DummyOneSubscriber subA(file, "a");
+  DummyOneSubscriber subB(file, "b");
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(subA.allCallbacksFired());
+  BOOST_CHECK(subB.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/config_example.info b/tests/core/config_example.info
new file mode 100644
index 0000000..d61691f
--- /dev/null
+++ b/tests/core/config_example.info
@@ -0,0 +1,9 @@
+a
+{
+        akey "avalue"
+}
+
+b
+{
+        bkey "bvalue"
+}
\ No newline at end of file
diff --git a/tests/core/config_malformed.info b/tests/core/config_malformed.info
new file mode 100644
index 0000000..d3a1f9e
--- /dev/null
+++ b/tests/core/config_malformed.info
@@ -0,0 +1,9 @@
+a
+{
+        akey "avalue"
+}
+
+b
+
+        bkey "bvalue"
+}
\ No newline at end of file
diff --git a/tests/core/ethernet.cpp b/tests/core/ethernet.cpp
new file mode 100644
index 0000000..157f574
--- /dev/null
+++ b/tests/core/ethernet.cpp
@@ -0,0 +1,89 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/ethernet.hpp"
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceEthernetAddress, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Checks)
+{
+  BOOST_CHECK(ethernet::Address().isNull());
+  BOOST_CHECK(ethernet::getBroadcastAddress().isBroadcast());
+  BOOST_CHECK(ethernet::getDefaultMulticastAddress().isMulticast());
+}
+
+BOOST_AUTO_TEST_CASE(ToString)
+{
+  BOOST_CHECK_EQUAL(ethernet::Address().toString('-'),
+                    "00-00-00-00-00-00");
+  BOOST_CHECK_EQUAL(ethernet::getBroadcastAddress().toString(),
+                    "ff:ff:ff:ff:ff:ff");
+  BOOST_CHECK_EQUAL(ethernet::Address(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB).toString('-'),
+                    "01-23-45-67-89-ab");
+  BOOST_CHECK_EQUAL(ethernet::Address(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB).toString(),
+                    "01:23:45:67:89:ab");
+}
+
+BOOST_AUTO_TEST_CASE(FromString)
+{
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("0:0:0:0:0:0"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("ff-ff-ff-ff-ff-ff"),
+                    ethernet::getBroadcastAddress());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("de:ad:be:ef:1:2"),
+                    ethernet::Address(0xde, 0xad, 0xbe, 0xef, 0x01, 0x02));
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("DE:AD:BE:EF:1:2"),
+                    ethernet::Address(0xde, 0xad, 0xbe, 0xef, 0x01, 0x02));
+
+  // malformed inputs
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01.23.45.67.89.ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45 :67:89:ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67:89::1"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01-23-45-67-89"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67:89:ab:cd"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67-89-ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("qw-er-ty-12-34-56"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("this-is-not-an-ethernet-address"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("foobar"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString(""),
+                    ethernet::Address());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/event-emitter.cpp b/tests/core/event-emitter.cpp
new file mode 100644
index 0000000..b03f71d
--- /dev/null
+++ b/tests/core/event-emitter.cpp
@@ -0,0 +1,251 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/event-emitter.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(UtilEventEmitter, BaseFixture)
+
+class EventEmitterTester : noncopyable
+{
+public:
+  EventEmitterTester();
+
+  int m_hit;
+  int m_a1;
+  int m_a2;
+  int m_a3;
+  int m_a4;
+
+  void
+  clear();
+
+  void
+  f0();
+
+  void
+  f1(int a1);
+
+  void
+  f2(int a1, int a2);
+
+  void
+  f3(int a1, int a2, int a3);
+
+  void
+  f4(int a1, int a2, int a3, int a4);
+};
+
+EventEmitterTester::EventEmitterTester()
+{
+  this->clear();
+}
+
+void
+EventEmitterTester::clear()
+{
+  m_hit = 0;
+  m_a1 = 0;
+  m_a2 = 0;
+  m_a3 = 0;
+  m_a4 = 0;
+}
+
+void
+EventEmitterTester::f0()
+{
+  ++m_hit;
+}
+
+void
+EventEmitterTester::f1(int a1)
+{
+  ++m_hit;
+  m_a1 = a1;
+}
+
+void
+EventEmitterTester::f2(int a1, int a2)
+{
+  ++m_hit;
+  m_a1 = a1;
+  m_a2 = a2;
+}
+
+void
+EventEmitterTester::f3(int a1, int a2, int a3)
+{
+  ++m_hit;
+  m_a1 = a1;
+  m_a2 = a2;
+  m_a3 = a3;
+}
+
+void
+EventEmitterTester::f4(int a1, int a2, int a3, int a4)
+{
+  ++m_hit;
+  m_a1 = a1;
+  m_a2 = a2;
+  m_a3 = a3;
+  m_a4 = a4;
+}
+
+static int g_EventEmitterTest_RefObject_copyCount;
+
+class EventEmitterTest_RefObject
+{
+public:
+  EventEmitterTest_RefObject() {}
+
+  EventEmitterTest_RefObject(const EventEmitterTest_RefObject& other);
+};
+
+EventEmitterTest_RefObject::EventEmitterTest_RefObject(const EventEmitterTest_RefObject& other)
+{
+  ++g_EventEmitterTest_RefObject_copyCount;
+}
+
+void
+EventEmitterTest_RefObject_byVal(EventEmitterTest_RefObject a1) {}
+
+void
+EventEmitterTest_RefObject_byRef(const EventEmitterTest_RefObject& a1) {}
+
+
+BOOST_AUTO_TEST_CASE(ZeroListener)
+{
+  EventEmitter<> ee;
+  BOOST_CHECK_NO_THROW(ee());
+}
+
+BOOST_AUTO_TEST_CASE(TwoListeners)
+{
+  EventEmitterTester eet1;
+  EventEmitterTester eet2;
+  EventEmitter<> ee;
+  ee += bind(&EventEmitterTester::f0, &eet1);
+  ee += bind(&EventEmitterTester::f0, &eet2);
+  ee();
+
+  BOOST_CHECK_EQUAL(eet1.m_hit, 1);
+  BOOST_CHECK_EQUAL(eet2.m_hit, 1);
+}
+
+BOOST_AUTO_TEST_CASE(ZeroArgument)
+{
+  EventEmitterTester eet;
+  EventEmitter<> ee;
+  ee += bind(&EventEmitterTester::f0, &eet);
+  ee();
+
+  BOOST_CHECK_EQUAL(eet.m_hit, 1);
+}
+
+BOOST_AUTO_TEST_CASE(OneArgument)
+{
+  EventEmitterTester eet;
+  EventEmitter<int> ee;
+  ee += bind(&EventEmitterTester::f1, &eet, _1);
+  ee(11);
+
+  BOOST_CHECK_EQUAL(eet.m_hit, 1);
+  BOOST_CHECK_EQUAL(eet.m_a1, 11);
+}
+
+BOOST_AUTO_TEST_CASE(TwoArguments)
+{
+  EventEmitterTester eet;
+  EventEmitter<int,int> ee;
+  ee += bind(&EventEmitterTester::f2, &eet, _1, _2);
+  ee(21, 22);
+
+  BOOST_CHECK_EQUAL(eet.m_hit, 1);
+  BOOST_CHECK_EQUAL(eet.m_a1, 21);
+  BOOST_CHECK_EQUAL(eet.m_a2, 22);
+}
+
+BOOST_AUTO_TEST_CASE(ThreeArguments)
+{
+  EventEmitterTester eet;
+  EventEmitter<int,int,int> ee;
+  ee += bind(&EventEmitterTester::f3, &eet, _1, _2, _3);
+  ee(31, 32, 33);
+
+  BOOST_CHECK_EQUAL(eet.m_hit, 1);
+  BOOST_CHECK_EQUAL(eet.m_a1, 31);
+  BOOST_CHECK_EQUAL(eet.m_a2, 32);
+  BOOST_CHECK_EQUAL(eet.m_a3, 33);
+}
+
+BOOST_AUTO_TEST_CASE(FourArguments)
+{
+  EventEmitterTester eet;
+  EventEmitter<int,int,int,int> ee;
+  ee += bind(&EventEmitterTester::f4, &eet, _1, _2, _3, _4);
+  ee(41, 42, 43, 44);
+
+  BOOST_CHECK_EQUAL(eet.m_hit, 1);
+  BOOST_CHECK_EQUAL(eet.m_a1, 41);
+  BOOST_CHECK_EQUAL(eet.m_a2, 42);
+  BOOST_CHECK_EQUAL(eet.m_a3, 43);
+  BOOST_CHECK_EQUAL(eet.m_a4, 44);
+}
+
+// EventEmitter passes arguments by reference,
+// but it also allows a handler that accept arguments by value
+BOOST_AUTO_TEST_CASE(HandlerByVal)
+{
+  EventEmitterTest_RefObject refObject;
+  g_EventEmitterTest_RefObject_copyCount = 0;
+
+  EventEmitter<EventEmitterTest_RefObject> ee;
+  ee += &EventEmitterTest_RefObject_byVal;
+  ee(refObject);
+
+  BOOST_CHECK_EQUAL(g_EventEmitterTest_RefObject_copyCount, 1);
+}
+
+// EventEmitter passes arguments by reference, and no copying
+// is necessary when handler accepts arguments by reference
+BOOST_AUTO_TEST_CASE(HandlerByRef)
+{
+  EventEmitterTest_RefObject refObject;
+  g_EventEmitterTest_RefObject_copyCount = 0;
+
+  EventEmitter<EventEmitterTest_RefObject> ee;
+  ee += &EventEmitterTest_RefObject_byRef;
+  ee(refObject);
+
+  BOOST_CHECK_EQUAL(g_EventEmitterTest_RefObject_copyCount, 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/face-uri.cpp b/tests/core/face-uri.cpp
new file mode 100644
index 0000000..0e54f04
--- /dev/null
+++ b/tests/core/face-uri.cpp
@@ -0,0 +1,192 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/face-uri.hpp"
+#ifdef HAVE_LIBPCAP
+#include "core/ethernet.hpp"
+#endif // HAVE_LIBPCAP
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreFaceUri, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Internal)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("internal://"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "internal");
+  BOOST_CHECK_EQUAL(uri.getHost(), "");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK_EQUAL(uri.parse("internal:"), false);
+  BOOST_CHECK_EQUAL(uri.parse("internal:/"), false);
+}
+
+BOOST_AUTO_TEST_CASE(Udp)
+{
+  BOOST_CHECK_NO_THROW(FaceUri("udp://hostname:6363"));
+  BOOST_CHECK_THROW(FaceUri("udp//hostname:6363"), FaceUri::Error);
+  BOOST_CHECK_THROW(FaceUri("udp://hostname:port"), FaceUri::Error);
+
+  FaceUri uri;
+  BOOST_CHECK_EQUAL(uri.parse("udp//hostname:6363"), false);
+
+  BOOST_CHECK(uri.parse("udp://hostname:80"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "udp");
+  BOOST_CHECK_EQUAL(uri.getHost(), "hostname");
+  BOOST_CHECK_EQUAL(uri.getPort(), "80");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK(uri.parse("udp4://192.0.2.1:20"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "udp4");
+  BOOST_CHECK_EQUAL(uri.getHost(), "192.0.2.1");
+  BOOST_CHECK_EQUAL(uri.getPort(), "20");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK(uri.parse("udp6://[2001:db8:3f9:0::1]:6363"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
+  BOOST_CHECK_EQUAL(uri.getHost(), "2001:db8:3f9:0::1");
+  BOOST_CHECK_EQUAL(uri.getPort(), "6363");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK(uri.parse("udp6://[2001:db8:3f9:0:3025:ccc5:eeeb:86d3]:6363"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
+  BOOST_CHECK_EQUAL(uri.getHost(), "2001:db8:3f9:0:3025:ccc5:eeeb:86d3");
+  BOOST_CHECK_EQUAL(uri.getPort(), "6363");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK_EQUAL(uri.parse("udp6://[2001:db8:3f9:0:3025:ccc5:eeeb:86dg]:6363"), false);
+
+  using namespace boost::asio;
+  ip::udp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
+  BOOST_REQUIRE_NO_THROW(FaceUri(endpoint4));
+  BOOST_CHECK_EQUAL(FaceUri(endpoint4).toString(), "udp4://192.0.2.1:7777");
+
+  ip::udp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
+  BOOST_REQUIRE_NO_THROW(FaceUri(endpoint6));
+  BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "udp6://[2001:db8::1]:7777");
+}
+
+BOOST_AUTO_TEST_CASE(Tcp)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("tcp://random.host.name"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "tcp");
+  BOOST_CHECK_EQUAL(uri.getHost(), "random.host.name");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK_EQUAL(uri.parse("tcp://192.0.2.1:"), false);
+  BOOST_CHECK_EQUAL(uri.parse("tcp://[::zzzz]"), false);
+
+  using namespace boost::asio;
+  ip::tcp::endpoint endpoint4(ip::address_v4::from_string("192.0.2.1"), 7777);
+  BOOST_REQUIRE_NO_THROW(FaceUri(endpoint4));
+  BOOST_CHECK_EQUAL(FaceUri(endpoint4).toString(), "tcp4://192.0.2.1:7777");
+
+  ip::tcp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
+  BOOST_REQUIRE_NO_THROW(FaceUri(endpoint6));
+  BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "tcp6://[2001:db8::1]:7777");
+}
+
+BOOST_AUTO_TEST_CASE(Unix)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("unix:///var/run/example.sock"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "unix");
+  BOOST_CHECK_EQUAL(uri.getHost(), "");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "/var/run/example.sock");
+
+  //BOOST_CHECK_EQUAL(uri.parse("unix://var/run/example.sock"), false);
+  // This is not a valid unix:/ URI, but the parse would treat "var" as host
+
+#ifdef HAVE_UNIX_SOCKETS
+  using namespace boost::asio;
+  local::stream_protocol::endpoint endpoint("/var/run/example.sock");
+  BOOST_REQUIRE_NO_THROW(FaceUri(endpoint));
+  BOOST_CHECK_EQUAL(FaceUri(endpoint).toString(), "unix:///var/run/example.sock");
+#endif // HAVE_UNIX_SOCKETS
+}
+
+BOOST_AUTO_TEST_CASE(Fd)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("fd://6"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "fd");
+  BOOST_CHECK_EQUAL(uri.getHost(), "6");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  int fd = 21;
+  BOOST_REQUIRE_NO_THROW(FaceUri::fromFd(fd));
+  BOOST_CHECK_EQUAL(FaceUri::fromFd(fd).toString(), "fd://21");
+}
+
+BOOST_AUTO_TEST_CASE(Ether)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("ether://08:00:27:01:dd:01"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "ether");
+  BOOST_CHECK_EQUAL(uri.getHost(), "08:00:27:01:dd:01");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  BOOST_CHECK_EQUAL(uri.parse("ether://08:00:27:zz:dd:01"), false);
+
+#ifdef HAVE_LIBPCAP
+  ethernet::Address address = ethernet::Address::fromString("33:33:01:01:01:01");
+  BOOST_REQUIRE_NO_THROW(FaceUri(address));
+  BOOST_CHECK_EQUAL(FaceUri(address).toString(), "ether://33:33:01:01:01:01");
+#endif // HAVE_LIBPCAP
+}
+
+BOOST_AUTO_TEST_CASE(Dev)
+{
+  FaceUri uri;
+
+  BOOST_CHECK(uri.parse("dev://eth0"));
+  BOOST_CHECK_EQUAL(uri.getScheme(), "dev");
+  BOOST_CHECK_EQUAL(uri.getHost(), "eth0");
+  BOOST_CHECK_EQUAL(uri.getPort(), "");
+  BOOST_CHECK_EQUAL(uri.getPath(), "");
+
+  std::string ifname = "en1";
+  BOOST_REQUIRE_NO_THROW(FaceUri::fromDev(ifname));
+  BOOST_CHECK_EQUAL(FaceUri::fromDev(ifname).toString(), "dev://en1");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/logger.cpp b/tests/core/logger.cpp
new file mode 100644
index 0000000..5a85d45
--- /dev/null
+++ b/tests/core/logger.cpp
@@ -0,0 +1,817 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/logger.hpp"
+
+#include "tests/test-common.hpp"
+
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/classification.hpp>
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreLogger, BaseFixture)
+
+class LoggerFixture : protected BaseFixture
+{
+public:
+  LoggerFixture()
+    : m_savedBuf(std::clog.rdbuf())
+    , m_savedLevel(LoggerFactory::getInstance().getDefaultLevel())
+  {
+    std::clog.rdbuf(m_buffer.rdbuf());
+  }
+
+  ~LoggerFixture()
+  {
+    std::clog.rdbuf(m_savedBuf);
+    LoggerFactory::getInstance().setDefaultLevel(m_savedLevel);
+  }
+
+  std::stringstream m_buffer;
+  std::streambuf* m_savedBuf;
+  LogLevel m_savedLevel;
+
+};
+
+BOOST_FIXTURE_TEST_CASE(Basic, LoggerFixture)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  NFD_LOG_INIT("BasicTests");
+  g_logger.setLogLevel(LOG_ALL);
+
+  const string EXPECTED[] =
+    {
+      "TRACE:",   "[BasicTests]", "trace-message-JHGFDSR^1\n",
+      "DEBUG:",   "[BasicTests]", "debug-message-IGg2474fdksd-fo-151617\n",
+      "WARNING:", "[BasicTests]", "warning-message-XXXhdhd111x\n",
+      "INFO:",    "[BasicTests]", "info-message-Jjxjshj13\n",
+      "ERROR:",   "[BasicTests]", "error-message-!#$&^%$#@\n",
+      "FATAL:",   "[BasicTests]", "fatal-message-JJSjaamcng\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  NFD_LOG_TRACE("trace-message-JHGFDSR^1");
+  NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
+  NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
+  NFD_LOG_INFO("info-message-Jjxjshj13");
+  NFD_LOG_ERROR("error-message-!#$&^%$#@");
+  NFD_LOG_FATAL("fatal-message-JJSjaamcng");
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // std::cout << components.size() << " for " << moduleName  << std::endl;
+  // for (size_t i = 0; i < components.size(); ++i)
+  //   {
+  //     std::cout << "-> " << components[i] << std::endl;
+  //   }
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+
+}
+
+
+BOOST_FIXTURE_TEST_CASE(ConfigureFactory, LoggerFixture)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  NFD_LOG_INIT("ConfigureFactoryTests");
+
+  const string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  default_level INFO\n"
+    "}\n";
+
+  LoggerFactory::getInstance().setDefaultLevel(LOG_ALL);
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  config.parse(LOG_CONFIG, false, "LOG_CONFIG");
+
+  BOOST_REQUIRE_EQUAL(LoggerFactory::getInstance().getDefaultLevel(), LOG_INFO);
+
+  const std::string EXPECTED[] =
+    {
+      "WARNING:", "[ConfigureFactoryTests]", "warning-message-XXXhdhd111x\n",
+      "INFO:",    "[ConfigureFactoryTests]", "info-message-Jjxjshj13\n",
+      "ERROR:",   "[ConfigureFactoryTests]", "error-message-!#$&^%$#@\n",
+      "FATAL:",   "[ConfigureFactoryTests]", "fatal-message-JJSjaamcng\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  NFD_LOG_TRACE("trace-message-JHGFDSR^1");
+  NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
+  NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
+  NFD_LOG_INFO("info-message-Jjxjshj13");
+  NFD_LOG_ERROR("error-message-!#$&^%$#@");
+  NFD_LOG_FATAL("fatal-message-JJSjaamcng");
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // std::cout << components.size() << " for " << moduleName  << std::endl;
+  // for (size_t i = 0; i < components.size(); ++i)
+  //   {
+  //     std::cout << "-> " << components[i] << std::endl;
+  //   }
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 4 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+BOOST_FIXTURE_TEST_CASE(TestNumberLevel, LoggerFixture)
+{
+  const std::string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  default_level 2\n" // equivalent of WARN
+    "}\n";
+
+  LoggerFactory::getInstance().setDefaultLevel(LOG_ALL);
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  config.parse(LOG_CONFIG, false, "LOG_CONFIG");
+
+  BOOST_REQUIRE_EQUAL(LoggerFactory::getInstance().getDefaultLevel(), LOG_WARN);
+}
+
+static void
+testModuleBPrint()
+{
+  NFD_LOG_INIT("TestModuleB");
+  NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
+}
+
+BOOST_FIXTURE_TEST_CASE(LimitModules, LoggerFixture)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  NFD_LOG_INIT("TestModuleA");
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  const std::string EXPECTED[] =
+    {
+      "WARNING:", "[TestModuleA]", "warning-message-XXXhdhd111x\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
+
+  const std::string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  default_level WARN\n"
+    "}\n";
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  config.parse(LOG_CONFIG, false, "LOG_CONFIG");
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  // this should print
+  NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 << "x");
+
+  // this should not because it's level is < WARN
+  testModuleBPrint();
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 1 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+BOOST_FIXTURE_TEST_CASE(ExplicitlySetModule, LoggerFixture)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  NFD_LOG_INIT("TestModuleA");
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  const std::string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  default_level WARN\n"
+    "  TestModuleB DEBUG\n"
+    "}\n";
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  config.parse(LOG_CONFIG, false, "LOG_CONFIG");
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+ // this should print
+  NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 << "x");
+
+  // this too because its level is explicitly set to DEBUG
+  testModuleBPrint();
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const std::string EXPECTED[] =
+    {
+      "WARNING:", "[TestModuleA]", "warning-message-XXXhdhd111x\n",
+      "DEBUG:",   "[TestModuleB]", "debug-message-IGg2474fdksd-fo-151617\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // for (size_t i = 0; i < components.size(); ++i)
+  //   {
+  //     std::cout << "-> " << components[i] << std::endl;
+  //   }
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 2 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+static bool
+checkError(const LoggerFactory::Error& error, const std::string& expected)
+{
+  return error.what() == expected;
+}
+
+BOOST_FIXTURE_TEST_CASE(UnknownLevelString, LoggerFixture)
+{
+  const std::string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  default_level TestMadeUpLevel\n"
+    "}\n";
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  BOOST_REQUIRE_EXCEPTION(config.parse(LOG_CONFIG, false, "LOG_CONFIG"),
+                          LoggerFactory::Error,
+                          bind(&checkError,
+                               _1,
+                               "Unsupported logging level \"TestMadeUpLevel\""));
+}
+
+BOOST_FIXTURE_TEST_CASE(UnknownOption, LoggerFixture)
+{
+  const std::string LOG_CONFIG =
+    "log\n"
+    "{\n"
+    "  TestMadeUpOption\n"
+    "}\n";
+
+  ConfigFile config;
+  LoggerFactory::getInstance().setConfigFile(config);
+
+  BOOST_REQUIRE_EXCEPTION(config.parse(LOG_CONFIG, false, "LOG_CONFIG"),
+                          LoggerFactory::Error,
+                          bind(&checkError,
+                               _1,
+                               "No logging level found for option \"TestMadeUpOption\""));
+}
+
+class InClassLogger : public LoggerFixture
+{
+public:
+
+  InClassLogger()
+  {
+    g_logger.setLogLevel(LOG_ALL);
+  }
+
+  void
+  writeLogs()
+  {
+    NFD_LOG_TRACE("trace-message-JHGFDSR^1");
+    NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
+    NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
+    NFD_LOG_INFO("info-message-Jjxjshj13");
+    NFD_LOG_ERROR("error-message-!#$&^%$#@");
+    NFD_LOG_FATAL("fatal-message-JJSjaamcng");
+  }
+
+private:
+  NFD_LOG_INCLASS_DECLARE();
+};
+
+NFD_LOG_INCLASS_DEFINE(InClassLogger, "InClassLogger");
+
+BOOST_FIXTURE_TEST_CASE(InClass, InClassLogger)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  writeLogs();
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string EXPECTED[] =
+    {
+      "TRACE:",   "[InClassLogger]", "trace-message-JHGFDSR^1\n",
+      "DEBUG:",   "[InClassLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
+      "WARNING:", "[InClassLogger]", "warning-message-XXXhdhd111x\n",
+      "INFO:",    "[InClassLogger]", "info-message-Jjxjshj13\n",
+      "ERROR:",   "[InClassLogger]", "error-message-!#$&^%$#@\n",
+      "FATAL:",   "[InClassLogger]", "fatal-message-JJSjaamcng\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+
+template<class T>
+class InClassTemplateLogger : public LoggerFixture
+{
+public:
+  InClassTemplateLogger()
+  {
+    g_logger.setLogLevel(LOG_ALL);
+  }
+
+  void
+  writeLogs()
+  {
+    NFD_LOG_TRACE("trace-message-JHGFDSR^1");
+    NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
+    NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
+    NFD_LOG_INFO("info-message-Jjxjshj13");
+    NFD_LOG_ERROR("error-message-!#$&^%$#@");
+    NFD_LOG_FATAL("fatal-message-JJSjaamcng");
+  }
+
+private:
+  NFD_LOG_INCLASS_DECLARE();
+};
+
+NFD_LOG_INCLASS_TEMPLATE_DEFINE(InClassTemplateLogger, "GenericInClassTemplateLogger");
+NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(InClassTemplateLogger, int, "IntInClassLogger");
+
+BOOST_FIXTURE_TEST_CASE(GenericInTemplatedClass, InClassTemplateLogger<bool>)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  writeLogs();
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string EXPECTED[] =
+    {
+      "TRACE:",   "[GenericInClassTemplateLogger]", "trace-message-JHGFDSR^1\n",
+      "DEBUG:",   "[GenericInClassTemplateLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
+      "WARNING:", "[GenericInClassTemplateLogger]", "warning-message-XXXhdhd111x\n",
+      "INFO:",    "[GenericInClassTemplateLogger]", "info-message-Jjxjshj13\n",
+      "ERROR:",   "[GenericInClassTemplateLogger]", "error-message-!#$&^%$#@\n",
+      "FATAL:",   "[GenericInClassTemplateLogger]", "fatal-message-JJSjaamcng\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+
+BOOST_FIXTURE_TEST_CASE(SpecializedInTemplatedClass, InClassTemplateLogger<int>)
+{
+  using namespace ndn::time;
+  using std::string;
+
+  const ndn::time::microseconds::rep ONE_SECOND = 1000000;
+
+  microseconds::rep before =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  writeLogs();
+
+  microseconds::rep after =
+    duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
+
+  const string EXPECTED[] =
+    {
+      "TRACE:",   "[IntInClassLogger]", "trace-message-JHGFDSR^1\n",
+      "DEBUG:",   "[IntInClassLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
+      "WARNING:", "[IntInClassLogger]", "warning-message-XXXhdhd111x\n",
+      "INFO:",    "[IntInClassLogger]", "info-message-Jjxjshj13\n",
+      "ERROR:",   "[IntInClassLogger]", "error-message-!#$&^%$#@\n",
+      "FATAL:",   "[IntInClassLogger]", "fatal-message-JJSjaamcng\n",
+    };
+
+  const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
+
+  const string buffer = m_buffer.str();
+
+  std::vector<string> components;
+  boost::split(components, buffer, boost::is_any_of(" ,\n"));
+
+  // expected + number of timestamps (one per log statement) + trailing newline of last statement
+  BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
+
+  std::vector<std::string>::const_iterator componentIter = components.begin();
+  for (size_t i = 0; i < N_EXPECTED; ++i)
+    {
+      // timestamp LOG_LEVEL: [ModuleName] message\n
+
+      const string& timestamp = *componentIter;
+      // std::cout << "timestamp = " << timestamp << std::endl;
+      ++componentIter;
+
+      size_t timeDelimiterPosition = timestamp.find(".");
+
+      BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
+
+      string secondsString = timestamp.substr(0, timeDelimiterPosition);
+      string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
+
+      microseconds::rep extractedTime =
+        ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
+        boost::lexical_cast<microseconds::rep>(usecondsString);
+
+      // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
+
+      BOOST_REQUIRE(before <= extractedTime);
+      BOOST_REQUIRE(extractedTime <= after);
+
+      // LOG_LEVEL:
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      // [ModuleName]
+      BOOST_REQUIRE_EQUAL(*componentIter, EXPECTED[i]);
+      ++componentIter;
+      ++i;
+
+      const string& message = *componentIter;
+
+      // std::cout << "message = " << message << std::endl;
+
+      // add back the newline that we split on
+      BOOST_REQUIRE_EQUAL(message + "\n", EXPECTED[i]);
+      ++componentIter;
+    }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/map-value-iterator.cpp b/tests/core/map-value-iterator.cpp
new file mode 100644
index 0000000..8a46da6
--- /dev/null
+++ b/tests/core/map-value-iterator.cpp
@@ -0,0 +1,57 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/map-value-iterator.hpp"
+#include <boost/concept_check.hpp>
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreMapValueIterator, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Basic)
+{
+  typedef std::map<char, int> CharIntMap;
+  typedef MapValueIterator<CharIntMap> CharIntMapValueIterator;
+  BOOST_CONCEPT_ASSERT((boost::ForwardIterator<CharIntMapValueIterator>));
+
+  CharIntMap map;
+  map['a'] = 1918;
+  map['b'] = 2675;
+  map['c'] = 7783;
+  map['d'] = 2053;
+
+  CharIntMapValueIterator begin(map.begin());
+  CharIntMapValueIterator end  (map.end  ());
+
+  int expected[] = { 1918, 2675, 7783, 2053 };
+  BOOST_CHECK_EQUAL_COLLECTIONS(begin, end, expected, expected + 4);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/network-interface.cpp b/tests/core/network-interface.cpp
new file mode 100644
index 0000000..2fb9c0b
--- /dev/null
+++ b/tests/core/network-interface.cpp
@@ -0,0 +1,57 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/network-interface.hpp"
+#include "tests/test-common.hpp"
+
+#include <boost/foreach.hpp>
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreNetworkInterface, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(ListNetworkInterfaces)
+{
+  std::list< shared_ptr<NetworkInterfaceInfo> > netifs;
+  BOOST_CHECK_NO_THROW(netifs = listNetworkInterfaces());
+
+  BOOST_FOREACH(shared_ptr<NetworkInterfaceInfo> netif, netifs)
+  {
+    BOOST_TEST_MESSAGE(netif->index << ": " << netif->name);
+    BOOST_TEST_MESSAGE("\tether " << netif->etherAddress);
+    BOOST_FOREACH(boost::asio::ip::address_v4 address, netif->ipv4Addresses)
+      BOOST_TEST_MESSAGE("\tinet  " << address);
+    BOOST_FOREACH(boost::asio::ip::address_v6 address, netif->ipv6Addresses)
+      BOOST_TEST_MESSAGE("\tinet6 " << address);
+    BOOST_TEST_MESSAGE("\tloopback  : " << netif->isLoopback());
+    BOOST_TEST_MESSAGE("\tmulticast : " << netif->isMulticastCapable());
+    BOOST_TEST_MESSAGE("\tup        : " << netif->isUp());
+  }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/resolver.cpp b/tests/core/resolver.cpp
new file mode 100644
index 0000000..18d35b7
--- /dev/null
+++ b/tests/core/resolver.cpp
@@ -0,0 +1,246 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/resolver.hpp"
+#include "core/logger.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("tests.CoreResolver");
+
+using boost::asio::ip::address_v4;
+using boost::asio::ip::address_v6;
+using boost::asio::ip::tcp;
+using boost::asio::ip::udp;
+
+BOOST_FIXTURE_TEST_SUITE(CoreResolver, BaseFixture)
+
+template<class Protocol>
+class ResolverFixture : protected BaseFixture
+{
+public:
+  ResolverFixture()
+    : m_nFailures(0)
+    , m_nSuccesses(0)
+  {
+  }
+
+  void
+  onSuccess(const typename Protocol::endpoint& resolvedEndpoint,
+            const typename Protocol::endpoint& expectedEndpoint,
+            bool isValid, bool wantCheckAddress = false)
+  {
+    NFD_LOG_DEBUG("Resolved to: " << resolvedEndpoint);
+    ++m_nSuccesses;
+
+    if (!isValid)
+      {
+        BOOST_FAIL("Resolved to " + boost::lexical_cast<std::string>(resolvedEndpoint)
+                   + ", but it should have failed");
+      }
+
+    BOOST_CHECK_EQUAL(resolvedEndpoint.port(), expectedEndpoint.port());
+
+    BOOST_CHECK_EQUAL(resolvedEndpoint.address().is_v4(), expectedEndpoint.address().is_v4());
+
+    // checking address is not deterministic and should be enabled only
+    // if only one IP address will be returned by resolution
+    if (wantCheckAddress)
+      {
+        BOOST_CHECK_EQUAL(resolvedEndpoint.address(), expectedEndpoint.address());
+      }
+  }
+
+  void
+  onFailure(bool isValid)
+  {
+    ++m_nFailures;
+
+    if (!isValid)
+      BOOST_FAIL("Resolution should not have failed");
+
+    BOOST_CHECK_MESSAGE(true, "Resolution failed as expected");
+  }
+
+
+  uint32_t m_nFailures;
+  uint32_t m_nSuccesses;
+};
+
+BOOST_FIXTURE_TEST_CASE(Tcp, ResolverFixture<tcp>)
+{
+  TcpResolver::asyncResolve("www.named-data.net", "6363",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v4(), 6363), true, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false));
+
+  TcpResolver::asyncResolve("www.named-data.net", "notport",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v4(), 0), false, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, true)); // should fail
+
+
+  TcpResolver::asyncResolve("nothost.nothost.nothost.arpa", "6363",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v4(), 6363), false, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, true)); // should fail
+
+  TcpResolver::asyncResolve("www.google.com", "80",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v4(), 80), true, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false),
+                            resolver::Ipv4Address()); // request IPv4 address
+
+  TcpResolver::asyncResolve("www.google.com", "80",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false),
+                            resolver::Ipv6Address()); // request IPv6 address
+
+  TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false));
+
+  TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false),
+                            resolver::Ipv6Address());
+
+  TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v6(), 80), false, false),
+                            bind(&ResolverFixture<tcp>::onFailure, this, true), // should fail
+                            resolver::Ipv4Address());
+
+  TcpResolver::asyncResolve("192.0.2.1", "80",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v4::from_string("192.0.2.1"), 80), true, true),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false));
+
+  TcpResolver::asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3", "80",
+                            bind(&ResolverFixture<tcp>::onSuccess, this, _1,
+                                 tcp::endpoint(address_v6::
+                                               from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3"),
+                                               80), true, true),
+                            bind(&ResolverFixture<tcp>::onFailure, this, false));
+
+  g_io.run();
+
+  BOOST_CHECK_EQUAL(m_nFailures, 3);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 7);
+}
+
+BOOST_AUTO_TEST_CASE(SyncTcp)
+{
+  tcp::endpoint endpoint;
+  BOOST_CHECK_NO_THROW(endpoint = TcpResolver::syncResolve("www.named-data.net", "6363"));
+  NFD_LOG_DEBUG("Resolved to: " << endpoint);
+  BOOST_CHECK_EQUAL(endpoint.address().is_v4(), true);
+  BOOST_CHECK_EQUAL(endpoint.port(), 6363);
+}
+
+BOOST_FIXTURE_TEST_CASE(Udp, ResolverFixture<udp>)
+{
+  UdpResolver::asyncResolve("www.named-data.net", "6363",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v4(), 6363), true, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, false));
+
+  UdpResolver::asyncResolve("www.named-data.net", "notport",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v4(), 0), false, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, true)); // should fail
+
+
+  UdpResolver::asyncResolve("nothost.nothost.nothost.arpa", "6363",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v4(), 6363), false, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, true)); // should fail
+
+  UdpResolver::asyncResolve("www.google.com", "80",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v4(), 80), true, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, false),
+                            resolver::Ipv4Address()); // request IPv4 address
+
+  UdpResolver::asyncResolve("www.google.com", "80",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, false),
+                            resolver::Ipv6Address()); // request IPv6 address
+
+  UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, false));
+
+  UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v6(), 80), true, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, false),
+                            resolver::Ipv6Address());
+
+  UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v6(), 80), false, false),
+                            bind(&ResolverFixture<udp>::onFailure, this, true), // should fail
+                            resolver::Ipv4Address());
+
+  UdpResolver::asyncResolve("192.0.2.1", "80",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v4::from_string("192.0.2.1"), 80), true, true),
+                            bind(&ResolverFixture<udp>::onFailure, this, false));
+
+  UdpResolver::asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3", "80",
+                            bind(&ResolverFixture<udp>::onSuccess, this, _1,
+                                 udp::endpoint(address_v6::
+                                               from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3"),
+                                               80), true, true),
+                            bind(&ResolverFixture<udp>::onFailure, this, false));
+
+  g_io.run();
+
+  BOOST_CHECK_EQUAL(m_nFailures, 3);
+  BOOST_CHECK_EQUAL(m_nSuccesses, 7);
+}
+
+BOOST_AUTO_TEST_CASE(SyncUdp)
+{
+  udp::endpoint endpoint;
+  BOOST_CHECK_NO_THROW(endpoint = UdpResolver::syncResolve("www.named-data.net", "6363"));
+  NFD_LOG_DEBUG("Resolved to: " << endpoint);
+  BOOST_CHECK_EQUAL(endpoint.address().is_v4(), true);
+  BOOST_CHECK_EQUAL(endpoint.port(), 6363);
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/scheduler.cpp b/tests/core/scheduler.cpp
new file mode 100644
index 0000000..e30a41e
--- /dev/null
+++ b/tests/core/scheduler.cpp
@@ -0,0 +1,117 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "core/scheduler.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreScheduler, BaseFixture)
+
+class SchedulerFixture : protected BaseFixture
+{
+public:
+  SchedulerFixture()
+    : count1(0)
+    , count2(0)
+    , count3(0)
+  {
+  }
+
+  void
+  event1()
+  {
+    BOOST_CHECK_EQUAL(count3, 1);
+    ++count1;
+  }
+
+  void
+  event2()
+  {
+    ++count2;
+  }
+
+  void
+  event3()
+  {
+    BOOST_CHECK_EQUAL(count1, 0);
+    ++count3;
+  }
+
+  int count1;
+  int count2;
+  int count3;
+};
+
+BOOST_FIXTURE_TEST_CASE(Events, SchedulerFixture)
+{
+  scheduler::schedule(time::milliseconds(500), bind(&SchedulerFixture::event1, this));
+
+  EventId i = scheduler::schedule(time::seconds(1), bind(&SchedulerFixture::event2, this));
+  scheduler::cancel(i);
+
+  scheduler::schedule(time::milliseconds(250), bind(&SchedulerFixture::event3, this));
+
+  i = scheduler::schedule(time::milliseconds(50), bind(&SchedulerFixture::event2, this));
+  scheduler::cancel(i);
+
+  g_io.run();
+
+  BOOST_CHECK_EQUAL(count1, 1);
+  BOOST_CHECK_EQUAL(count2, 0);
+  BOOST_CHECK_EQUAL(count3, 1);
+}
+
+BOOST_AUTO_TEST_CASE(CancelEmptyEvent)
+{
+  EventId i;
+  scheduler::cancel(i);
+}
+
+class SelfCancelFixture : protected BaseFixture
+{
+public:
+  void
+  cancelSelf()
+  {
+    scheduler::cancel(m_selfEventId);
+  }
+
+  EventId m_selfEventId;
+};
+
+BOOST_FIXTURE_TEST_CASE(SelfCancel, SelfCancelFixture)
+{
+  m_selfEventId = scheduler::schedule(time::milliseconds(100),
+                                      bind(&SelfCancelFixture::cancelSelf, this));
+
+  BOOST_REQUIRE_NO_THROW(g_io.run());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/version.cpp b/tests/core/version.cpp
new file mode 100644
index 0000000..669a866
--- /dev/null
+++ b/tests/core/version.cpp
@@ -0,0 +1,60 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "version.hpp"
+#include "core/logger.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreVersion, BaseFixture)
+
+NFD_LOG_INIT("VersionTest");
+
+BOOST_AUTO_TEST_CASE(Version)
+{
+  NFD_LOG_INFO("NFD_VERSION " << NFD_VERSION);
+
+  BOOST_CHECK_EQUAL(NFD_VERSION, NFD_VERSION_MAJOR * 1000000 +
+                                 NFD_VERSION_MINOR * 1000 +
+                                 NFD_VERSION_PATCH);
+}
+
+BOOST_AUTO_TEST_CASE(VersionString)
+{
+  NFD_LOG_INFO("NFD_VERSION_STRING " << NFD_VERSION_STRING);
+
+  BOOST_STATIC_ASSERT(NFD_VERSION_MAJOR < 1000);
+  char buf[12];
+  snprintf(buf, sizeof(buf), "%d.%d.%d", NFD_VERSION_MAJOR, NFD_VERSION_MINOR, NFD_VERSION_PATCH);
+
+  BOOST_CHECK_EQUAL(std::string(NFD_VERSION_STRING), std::string(buf));
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
new file mode 100644
index 0000000..7039286
--- /dev/null
+++ b/tests/daemon/face/dummy-face.hpp
@@ -0,0 +1,93 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_FACE_DUMMY_FACE_HPP
+#define NFD_TESTS_NFD_FACE_DUMMY_FACE_HPP
+
+#include "face/face.hpp"
+#include "face/local-face.hpp"
+
+namespace nfd {
+namespace tests {
+
+/** \class DummyFace
+ *  \brief a Face for unit testing
+ */
+template<class FaceBase>
+class DummyFaceImpl : public FaceBase
+{
+public:
+  DummyFaceImpl()
+    : FaceBase(FaceUri("dummy://"), FaceUri("dummy://"))
+  {
+  }
+
+  virtual void
+  sendInterest(const Interest& interest)
+  {
+    this->onSendInterest(interest);
+    m_sentInterests.push_back(interest);
+    this->afterSend();
+  }
+
+  virtual void
+  sendData(const Data& data)
+  {
+    this->onSendData(data);
+    m_sentDatas.push_back(data);
+    this->afterSend();
+  }
+
+  virtual void
+  close()
+  {
+    this->onFail("close");
+  }
+
+  void
+  receiveInterest(const Interest& interest)
+  {
+    this->onReceiveInterest(interest);
+  }
+
+  void
+  receiveData(const Data& data)
+  {
+    this->onReceiveData(data);
+  }
+
+  EventEmitter<> afterSend;
+
+public:
+  std::vector<Interest> m_sentInterests;
+  std::vector<Data> m_sentDatas;
+};
+
+typedef DummyFaceImpl<Face> DummyFace;
+typedef DummyFaceImpl<LocalFace> DummyLocalFace;
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_FACE_DUMMY_FACE_HPP
diff --git a/tests/daemon/face/ethernet.cpp b/tests/daemon/face/ethernet.cpp
new file mode 100644
index 0000000..d27fda4
--- /dev/null
+++ b/tests/daemon/face/ethernet.cpp
@@ -0,0 +1,162 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/ethernet-factory.hpp"
+#include "core/network-interface.hpp"
+#include "tests/test-common.hpp"
+
+#include <ndn-cpp-dev/security/key-chain.hpp>
+#include <pcap/pcap.h>
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceEthernet, BaseFixture)
+
+class InterfacesFixture : protected BaseFixture
+{
+protected:
+  InterfacesFixture()
+  {
+    std::list< shared_ptr<NetworkInterfaceInfo> > ifs = listNetworkInterfaces();
+    for (std::list< shared_ptr<NetworkInterfaceInfo> >::const_iterator i = ifs.begin();
+         i != ifs.end();
+         ++i)
+      {
+        if (!(*i)->isLoopback() && (*i)->isUp())
+          {
+            pcap_t* p = pcap_create((*i)->name.c_str(), 0);
+            if (!p)
+              continue;
+
+            if (pcap_activate(p) == 0)
+              m_interfaces.push_back(*i);
+
+            pcap_close(p);
+          }
+      }
+  }
+
+protected:
+  std::list< shared_ptr<NetworkInterfaceInfo> > m_interfaces;
+};
+
+
+BOOST_FIXTURE_TEST_CASE(MulticastFacesMap, InterfacesFixture)
+{
+  EthernetFactory factory;
+
+  if (m_interfaces.empty())
+    {
+      BOOST_WARN_MESSAGE(false, "No interfaces available, cannot perform MulticastFacesMap test");
+      return;
+    }
+
+  shared_ptr<EthernetFace> face1;
+  BOOST_REQUIRE_NO_THROW(face1 = factory.createMulticastFace(m_interfaces.front(),
+                                                             ethernet::getBroadcastAddress()));
+  shared_ptr<EthernetFace> face1bis;
+  BOOST_REQUIRE_NO_THROW(face1bis = factory.createMulticastFace(m_interfaces.front(),
+                                                                ethernet::getBroadcastAddress()));
+  BOOST_CHECK_EQUAL(face1, face1bis);
+
+  if (m_interfaces.size() > 1)
+    {
+      shared_ptr<EthernetFace> face2;
+      BOOST_REQUIRE_NO_THROW(face2 = factory.createMulticastFace(m_interfaces.back(),
+                                                                 ethernet::getBroadcastAddress()));
+      BOOST_CHECK_NE(face1, face2);
+    }
+  else
+    {
+      BOOST_WARN_MESSAGE(false, "Cannot test second EthernetFace creation, "
+                         "only one interface available");
+    }
+
+  shared_ptr<EthernetFace> face3;
+  BOOST_REQUIRE_NO_THROW(face3 = factory.createMulticastFace(m_interfaces.front(),
+                                                             ethernet::getDefaultMulticastAddress()));
+  BOOST_CHECK_NE(face1, face3);
+}
+
+BOOST_FIXTURE_TEST_CASE(SendPacket, InterfacesFixture)
+{
+  EthernetFactory factory;
+
+  if (m_interfaces.empty())
+    {
+      BOOST_WARN_MESSAGE(false, "No interfaces available for pcap, cannot perform SendPacket test");
+      return;
+    }
+
+  shared_ptr<EthernetFace> face = factory.createMulticastFace(m_interfaces.front(),
+                                                              ethernet::getDefaultMulticastAddress());
+
+  BOOST_REQUIRE(static_cast<bool>(face));
+
+  BOOST_CHECK(!face->isOnDemand());
+  BOOST_CHECK_EQUAL(face->isLocal(), false);
+  BOOST_CHECK_EQUAL(face->getRemoteUri().toString(),
+                    "ether://" + ethernet::getDefaultMulticastAddress().toString());
+  BOOST_CHECK_EQUAL(face->getLocalUri().toString(),
+                    "dev://" + m_interfaces.front()->name);
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  BOOST_CHECK_NO_THROW(face->sendInterest(interest1));
+  BOOST_CHECK_NO_THROW(face->sendData    (data1    ));
+  BOOST_CHECK_NO_THROW(face->sendInterest(interest2));
+  BOOST_CHECK_NO_THROW(face->sendData    (data2    ));
+
+//  m_ioRemaining = 4;
+//  m_ioService.run();
+//  m_ioService.reset();
+
+//  BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
+//  BOOST_REQUIRE_EQUAL(m_face1_receivedDatas    .size(), 1);
+//  BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
+//  BOOST_REQUIRE_EQUAL(m_face2_receivedDatas    .size(), 1);
+
+//  BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
+//  BOOST_CHECK_EQUAL(m_face1_receivedDatas    [0].getName(), data2.getName());
+//  BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
+//  BOOST_CHECK_EQUAL(m_face2_receivedDatas    [0].getName(), data1.getName());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/face.cpp b/tests/daemon/face/face.cpp
new file mode 100644
index 0000000..46c0345
--- /dev/null
+++ b/tests/daemon/face/face.cpp
@@ -0,0 +1,74 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/face.hpp"
+#include "face/local-face.hpp"
+#include "dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceFace, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Description)
+{
+  DummyFace face;
+  face.setDescription("3pFsKrvWr");
+  BOOST_CHECK_EQUAL(face.getDescription(), "3pFsKrvWr");
+}
+
+BOOST_AUTO_TEST_CASE(LocalControlHeaderEnabled)
+{
+  DummyLocalFace face;
+
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false);
+
+  face.setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID, true);
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), true);
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID), true);
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(
+                         LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID), false);
+
+  face.setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID, false);
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false);
+  BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(
+                         LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID), false);
+}
+
+BOOST_AUTO_TEST_CASE(Counters)
+{
+  DummyFace face;
+  const FaceCounters& counters = face.getCounters();
+  BOOST_CHECK_EQUAL(counters.getNInInterests() , 0);
+  BOOST_CHECK_EQUAL(counters.getNInDatas()     , 0);
+  BOOST_CHECK_EQUAL(counters.getNOutInterests(), 0);
+  BOOST_CHECK_EQUAL(counters.getNOutDatas()    , 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/ndnlp.cpp b/tests/daemon/face/ndnlp.cpp
new file mode 100644
index 0000000..f5ba8e1
--- /dev/null
+++ b/tests/daemon/face/ndnlp.cpp
@@ -0,0 +1,232 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/ndnlp-sequence-generator.hpp"
+#include "face/ndnlp-slicer.hpp"
+#include "face/ndnlp-partial-message-store.hpp"
+
+#include "tests/test-common.hpp"
+
+#include <boost/scoped_array.hpp>
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceNdnlp, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(SequenceBlock)
+{
+  ndnlp::SequenceBlock sb(0x8000, 2);
+  BOOST_CHECK_EQUAL(sb.count(), 2);
+  BOOST_CHECK_EQUAL(sb[0], 0x8000);
+  BOOST_CHECK_EQUAL(sb[1], 0x8001);
+  BOOST_CHECK_THROW(sb[2], std::out_of_range);
+}
+
+// sequence number can safely wrap around
+BOOST_AUTO_TEST_CASE(SequenceBlockWrap)
+{
+  ndnlp::SequenceBlock sb(std::numeric_limits<uint64_t>::max(), 2);
+  BOOST_CHECK_EQUAL(sb[0], std::numeric_limits<uint64_t>::max());
+  BOOST_CHECK_EQUAL(sb[1], std::numeric_limits<uint64_t>::min());
+  BOOST_CHECK_EQUAL(sb[1] - sb[0], 1);
+}
+
+BOOST_AUTO_TEST_CASE(SequenceGenerator)
+{
+  ndnlp::SequenceGenerator seqgen;
+
+  ndnlp::SequenceBlock sb1 = seqgen.nextBlock(2);
+  BOOST_CHECK_EQUAL(sb1.count(), 2);
+
+  ndnlp::SequenceBlock sb2 = seqgen.nextBlock(1);
+  BOOST_CHECK_NE(sb1[0], sb2[0]);
+  BOOST_CHECK_NE(sb1[1], sb2[0]);
+}
+
+// slice a Block to one NDNLP packet
+BOOST_AUTO_TEST_CASE(Slice1)
+{
+  uint8_t blockValue[60];
+  memset(blockValue, 0xcc, sizeof(blockValue));
+  Block block = ndn::dataBlock(0x01, blockValue, sizeof(blockValue));
+
+  ndnlp::Slicer slicer(9000);
+  ndnlp::PacketArray pa = slicer.slice(block);
+
+  BOOST_REQUIRE_EQUAL(pa->size(), 1);
+
+  const Block& pkt = pa->at(0);
+  BOOST_CHECK_EQUAL(pkt.type(), static_cast<uint32_t>(tlv::NdnlpData));
+  pkt.parse();
+
+  const Block::element_container& elements = pkt.elements();
+  BOOST_REQUIRE_EQUAL(elements.size(), 2);
+
+  const Block& sequenceElement = elements[0];
+  BOOST_CHECK_EQUAL(sequenceElement.type(), static_cast<uint32_t>(tlv::NdnlpSequence));
+  BOOST_REQUIRE_EQUAL(sequenceElement.value_size(), sizeof(uint64_t));
+
+  const Block& payloadElement = elements[1];
+  BOOST_CHECK_EQUAL(payloadElement.type(), static_cast<uint32_t>(tlv::NdnlpPayload));
+  size_t payloadSize = payloadElement.value_size();
+  BOOST_CHECK_EQUAL(payloadSize, block.size());
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(payloadElement.value_begin(), payloadElement.value_end(),
+                                block.begin(),                block.end());
+}
+
+// slice a Block to four NDNLP packets
+BOOST_AUTO_TEST_CASE(Slice4)
+{
+  uint8_t blockValue[5050];
+  memset(blockValue, 0xcc, sizeof(blockValue));
+  Block block = ndn::dataBlock(0x01, blockValue, sizeof(blockValue));
+
+  ndnlp::Slicer slicer(1500);
+  ndnlp::PacketArray pa = slicer.slice(block);
+
+  BOOST_REQUIRE_EQUAL(pa->size(), 4);
+
+  uint64_t seq0 = 0xdddd;
+
+  size_t totalPayloadSize = 0;
+
+  for (size_t i = 0; i < 4; ++i) {
+    const Block& pkt = pa->at(i);
+    BOOST_CHECK_EQUAL(pkt.type(), static_cast<uint32_t>(tlv::NdnlpData));
+    pkt.parse();
+
+    const Block::element_container& elements = pkt.elements();
+    BOOST_REQUIRE_EQUAL(elements.size(), 4);
+
+    const Block& sequenceElement = elements[0];
+    BOOST_CHECK_EQUAL(sequenceElement.type(), static_cast<uint32_t>(tlv::NdnlpSequence));
+    BOOST_REQUIRE_EQUAL(sequenceElement.value_size(), sizeof(uint64_t));
+    uint64_t seq = be64toh(*reinterpret_cast<const uint64_t*>(
+                             &*sequenceElement.value_begin()));
+    if (i == 0) {
+      seq0 = seq;
+    }
+    BOOST_CHECK_EQUAL(seq, seq0 + i);
+
+    const Block& fragIndexElement = elements[1];
+    BOOST_CHECK_EQUAL(fragIndexElement.type(), static_cast<uint32_t>(tlv::NdnlpFragIndex));
+    uint64_t fragIndex = ndn::readNonNegativeInteger(fragIndexElement);
+    BOOST_CHECK_EQUAL(fragIndex, i);
+
+    const Block& fragCountElement = elements[2];
+    BOOST_CHECK_EQUAL(fragCountElement.type(), static_cast<uint32_t>(tlv::NdnlpFragCount));
+    uint64_t fragCount = ndn::readNonNegativeInteger(fragCountElement);
+    BOOST_CHECK_EQUAL(fragCount, 4);
+
+    const Block& payloadElement = elements[3];
+    BOOST_CHECK_EQUAL(payloadElement.type(), static_cast<uint32_t>(tlv::NdnlpPayload));
+    size_t payloadSize = payloadElement.value_size();
+    totalPayloadSize += payloadSize;
+  }
+
+  BOOST_CHECK_EQUAL(totalPayloadSize, block.size());
+}
+
+class ReassembleFixture : protected BaseFixture
+{
+protected:
+  ReassembleFixture()
+    : m_slicer(1500)
+  {
+    m_partialMessageStore.onReceive +=
+      // push_back in C++11 has 2 overloads, and specific version needs to be selected
+      bind(static_cast<void (std::vector<Block>::*)(const Block&)>(&std::vector<Block>::push_back),
+           &m_received, _1);
+  }
+
+  Block
+  makeBlock(size_t valueLength)
+  {
+    boost::scoped_array<uint8_t> blockValue(new uint8_t[valueLength]);
+    memset(blockValue.get(), 0xcc, valueLength);
+    return ndn::dataBlock(0x01, blockValue.get(), valueLength);
+  }
+
+protected:
+  ndnlp::Slicer m_slicer;
+  ndnlp::PartialMessageStore m_partialMessageStore;
+
+  // received network layer packets
+  std::vector<Block> m_received;
+};
+
+// reassemble one NDNLP packets into one Block
+BOOST_FIXTURE_TEST_CASE(Reassemble1, ReassembleFixture)
+{
+  Block block = makeBlock(60);
+  ndnlp::PacketArray pa = m_slicer.slice(block);
+  BOOST_REQUIRE_EQUAL(pa->size(), 1);
+
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa->at(0));
+
+  BOOST_REQUIRE_EQUAL(m_received.size(), 1);
+  BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(0).begin(), m_received.at(0).end(),
+                                block.begin(),            block.end());
+}
+
+// reassemble four and two NDNLP packets into two Blocks
+BOOST_FIXTURE_TEST_CASE(Reassemble4and2, ReassembleFixture)
+{
+  Block block = makeBlock(5050);
+  ndnlp::PacketArray pa = m_slicer.slice(block);
+  BOOST_REQUIRE_EQUAL(pa->size(), 4);
+
+  Block block2 = makeBlock(2000);
+  ndnlp::PacketArray pa2 = m_slicer.slice(block2);
+  BOOST_REQUIRE_EQUAL(pa2->size(), 2);
+
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa->at(0));
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa->at(1));
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa2->at(1));
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa->at(1));
+  BOOST_CHECK_EQUAL(m_received.size(), 0);
+  m_partialMessageStore.receiveNdnlpData(pa2->at(0));
+  BOOST_CHECK_EQUAL(m_received.size(), 1);
+  m_partialMessageStore.receiveNdnlpData(pa->at(3));
+  BOOST_CHECK_EQUAL(m_received.size(), 1);
+  m_partialMessageStore.receiveNdnlpData(pa->at(2));
+
+  BOOST_REQUIRE_EQUAL(m_received.size(), 2);
+  BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(1).begin(), m_received.at(1).end(),
+                                block.begin(),            block.end());
+  BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(0).begin(), m_received.at(0).end(),
+                                block2.begin(),           block2.end());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/tcp.cpp b/tests/daemon/face/tcp.cpp
new file mode 100644
index 0000000..07e6ec5
--- /dev/null
+++ b/tests/daemon/face/tcp.cpp
@@ -0,0 +1,440 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/tcp-factory.hpp"
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+#include "tests/test-common.hpp"
+#include "tests/limited-io.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceTcp, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(ChannelMap)
+{
+  TcpFactory factory;
+
+  shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<TcpChannel> channel1a = factory.createChannel("127.0.0.1", "20070");
+  BOOST_CHECK_EQUAL(channel1, channel1a);
+  BOOST_CHECK_EQUAL(channel1->getUri().toString(), "tcp4://127.0.0.1:20070");
+
+  shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+  BOOST_CHECK_NE(channel1, channel2);
+
+  shared_ptr<TcpChannel> channel3 = factory.createChannel("::1", "20071");
+  BOOST_CHECK_NE(channel2, channel3);
+  BOOST_CHECK_EQUAL(channel3->getUri().toString(), "tcp6://[::1]:20071");
+}
+
+class EndToEndFixture : protected BaseFixture
+{
+public:
+  void
+  channel1_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face1));
+    face1 = newFace;
+    face1->onReceiveInterest +=
+      bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
+    face1->onReceiveData +=
+      bind(&EndToEndFixture::face1_onReceiveData, this, _1);
+    face1->onFail +=
+      bind(&EndToEndFixture::face1_onFail, this);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel1_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveInterest(const Interest& interest)
+  {
+    face1_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveData(const Data& data)
+  {
+    face1_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onFail()
+  {
+    face1.reset();
+    limitedIo.afterOp();
+  }
+
+  void
+  channel2_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face2));
+    face2 = newFace;
+    face2->onReceiveInterest +=
+      bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+    face2->onReceiveData +=
+      bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+    face2->onFail +=
+      bind(&EndToEndFixture::face2_onFail, this);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel2_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveInterest(const Interest& interest)
+  {
+    face2_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveData(const Data& data)
+  {
+    face2_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onFail()
+  {
+    face2.reset();
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    faces.push_back(newFace);
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  checkFaceList(size_t shouldBe)
+  {
+    BOOST_CHECK_EQUAL(faces.size(), shouldBe);
+  }
+
+public:
+  LimitedIo limitedIo;
+
+  shared_ptr<Face> face1;
+  std::vector<Interest> face1_receivedInterests;
+  std::vector<Data> face1_receivedDatas;
+  shared_ptr<Face> face2;
+  std::vector<Interest> face2_receivedInterests;
+  std::vector<Data> face2_receivedDatas;
+
+  std::list< shared_ptr<Face> > faces;
+};
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
+{
+  TcpFactory factory1;
+
+  shared_ptr<TcpChannel> channel1 = factory1.createChannel("127.0.0.1", "20070");
+  factory1.createChannel("127.0.0.1", "20071");
+
+  BOOST_CHECK_EQUAL(channel1->isListening(), false);
+
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  BOOST_CHECK_EQUAL(channel1->isListening(), true);
+
+  TcpFactory factory2;
+
+  shared_ptr<TcpChannel> channel2 = factory2.createChannel("127.0.0.2", "20070");
+  factory2.createChannel("127.0.0.2", "20071");
+
+  factory2.createFace(FaceUri("tcp://127.0.0.1:20070"),
+                      bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                      bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_REQUIRE(static_cast<bool>(face2));
+
+  BOOST_CHECK(face1->isOnDemand());
+  BOOST_CHECK(!face2->isOnDemand());
+
+  BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp4://127.0.0.1:20070");
+  BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp4://127.0.0.1:20070");
+  // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
+
+  BOOST_CHECK_EQUAL(face1->isLocal(), true);
+  BOOST_CHECK_EQUAL(face2->isLocal(), true);
+
+  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
+
+  // integrated tests needs to check that TcpFace for non-loopback fails these tests...
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot send or receive Interest/Data packets");
+
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+
+  const FaceCounters& counters1 = face1->getCounters();
+  BOOST_CHECK_EQUAL(counters1.getNInInterests() , 1);
+  BOOST_CHECK_EQUAL(counters1.getNInDatas()     , 3);
+  BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
+  BOOST_CHECK_EQUAL(counters1.getNOutDatas()    , 1);
+
+  const FaceCounters& counters2 = face2->getCounters();
+  BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
+  BOOST_CHECK_EQUAL(counters2.getNInDatas()     , 1);
+  BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 1);
+  BOOST_CHECK_EQUAL(counters2.getNOutDatas()    , 3);
+}
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd6, EndToEndFixture)
+{
+  TcpFactory factory1;
+
+  shared_ptr<TcpChannel> channel1 = factory1.createChannel("::1", "20070");
+  shared_ptr<TcpChannel> channel2 = factory1.createChannel("::1", "20071");
+
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  TcpFactory factory2;
+
+  factory2.createChannel("::2", "20070");
+
+  factory2.createFace(FaceUri("tcp://[::1]:20070"),
+                      bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                      bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_REQUIRE(static_cast<bool>(face2));
+
+  BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp6://[::1]:20070");
+  BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp6://[::1]:20070");
+  // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
+
+  BOOST_CHECK_EQUAL(face1->isLocal(), true);
+  BOOST_CHECK_EQUAL(face2->isLocal(), true);
+
+  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
+
+  // integrated tests needs to check that TcpFace for non-loopback fails these tests...
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot send or receive Interest/Data packets");
+
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+}
+
+BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
+{
+  TcpFactory factory;
+
+  shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+
+  channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+
+  channel2->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
+                    time::seconds(4)); // very short timeout
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot connect or cannot accept connection");
+
+
+  BOOST_CHECK_EQUAL(faces.size(), 2);
+
+  shared_ptr<TcpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
+  channel3->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
+                    time::seconds(4)); // very short timeout
+
+
+  shared_ptr<TcpChannel> channel4 = factory.createChannel("127.0.0.1", "20073");
+
+  BOOST_CHECK_NE(channel3, channel4);
+
+  scheduler::schedule(time::seconds(1),
+      bind(&TcpChannel::connect, channel4, "127.0.0.1", "20070",
+          // does not work without static_cast
+           static_cast<TcpChannel::FaceCreatedCallback>(
+               bind(&EndToEndFixture::channel_onFaceCreated, this, _1)),
+           static_cast<TcpChannel::ConnectFailedCallback>(
+               bind(&EndToEndFixture::channel_onConnectFailed, this, _1)),
+           time::seconds(4)));
+
+  scheduler::schedule(time::milliseconds(500),
+                      bind(&EndToEndFixture::checkFaceList, this, 4));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(4,// 2 connects and 2 accepts
+                      time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot connect or cannot accept multiple connections");
+
+  BOOST_CHECK_EQUAL(faces.size(), 6);
+}
+
+
+BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
+{
+  TcpFactory factory;
+
+  shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  channel2->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel2_onConnectFailed, this, _1),
+                    time::seconds(4)); // very short timeout
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "TcpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_CHECK_EQUAL(channel1->size(), 1);
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_CHECK(static_cast<bool>(face2));
+
+  // Face::close must be invoked during io run to be counted as an op
+  scheduler::schedule(time::milliseconds(100), bind(&Face::close, face1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
+                      "FaceClosing error: cannot properly close faces");
+
+  // both faces should get closed
+  BOOST_CHECK(!static_cast<bool>(face1));
+  BOOST_CHECK(!static_cast<bool>(face2));
+
+  BOOST_CHECK_EQUAL(channel1->size(), 0);
+  BOOST_CHECK_EQUAL(channel2->size(), 0);
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/udp.cpp b/tests/daemon/face/udp.cpp
new file mode 100644
index 0000000..2dfca3a
--- /dev/null
+++ b/tests/daemon/face/udp.cpp
@@ -0,0 +1,915 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/udp-factory.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/limited-io.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceUdp, BaseFixture)
+
+class FactoryErrorCheck : protected BaseFixture
+{
+public:
+  bool isTheSameMulticastEndpoint(const UdpFactory::Error& e) {
+    return strcmp(e.what(),
+                  "Cannot create the requested UDP unicast channel, local "
+                  "endpoint is already allocated for a UDP multicast face") == 0;
+  }
+
+  bool isNotMulticastAddress(const UdpFactory::Error& e) {
+    return strcmp(e.what(),
+                  "Cannot create the requested UDP multicast face, "
+                  "the multicast group given as input is not a multicast address") == 0;
+  }
+
+  bool isTheSameUnicastEndpoint(const UdpFactory::Error& e) {
+    return strcmp(e.what(),
+                  "Cannot create the requested UDP multicast face, local "
+                  "endpoint is already allocated for a UDP unicast channel") == 0;
+  }
+
+  bool isLocalEndpointOnDifferentGroup(const UdpFactory::Error& e) {
+    return strcmp(e.what(),
+                  "Cannot create the requested UDP multicast face, local "
+                  "endpoint is already allocated for a UDP multicast face "
+                  "on a different multicast group") == 0;
+  }
+};
+
+BOOST_FIXTURE_TEST_CASE(ChannelMapUdp, FactoryErrorCheck)
+{
+  using boost::asio::ip::udp;
+
+  UdpFactory factory = UdpFactory();
+
+  //to instantiate multicast face on a specific ip address, change interfaceIp
+  std::string interfaceIp = "0.0.0.0";
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<UdpChannel> channel1a = factory.createChannel("127.0.0.1", "20070");
+  BOOST_CHECK_EQUAL(channel1, channel1a);
+  BOOST_CHECK_EQUAL(channel1->getUri().toString(), "udp4://127.0.0.1:20070");
+
+  shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+  BOOST_CHECK_NE(channel1, channel2);
+
+  shared_ptr<UdpChannel> channel3 = factory.createChannel(interfaceIp, "20070");
+
+  shared_ptr<UdpChannel> channel4 = factory.createChannel("::1", "20071");
+  BOOST_CHECK_NE(channel2, channel4);
+  BOOST_CHECK_EQUAL(channel4->getUri().toString(), "udp6://[::1]:20071");
+
+  //same endpoint of a unicast channel
+  BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
+                                                    "224.0.0.1",
+                                                    "20070"),
+                        UdpFactory::Error,
+                        isTheSameUnicastEndpoint);
+
+
+  shared_ptr<MulticastUdpFace> multicastFace1 = factory.createMulticastFace(interfaceIp,
+                                                                            "224.0.0.1",
+                                                                            "20072");
+  shared_ptr<MulticastUdpFace> multicastFace1a = factory.createMulticastFace(interfaceIp,
+                                                                            "224.0.0.1",
+                                                                            "20072");
+  BOOST_CHECK_EQUAL(multicastFace1, multicastFace1a);
+
+
+  //same endpoint of a multicast face
+  BOOST_CHECK_EXCEPTION(factory.createChannel(interfaceIp, "20072"),
+                        UdpFactory::Error,
+                        isTheSameMulticastEndpoint);
+
+  //same multicast endpoint, different group
+  BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
+                                                    "224.0.0.42",
+                                                    "20072"),
+                        UdpFactory::Error,
+                        isLocalEndpointOnDifferentGroup);
+
+  BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
+                                                    "192.168.10.15",
+                                                    "20025"),
+                        UdpFactory::Error,
+                        isNotMulticastAddress);
+
+
+//  //Test commented because it required to be run in a machine that can resolve ipv6 query
+//  shared_ptr<UdpChannel> channel1v6 = factory.createChannel(//"::1",
+//                                                     "fe80::5e96:9dff:fe7d:9c8d%en1",
+//                                                     //"fe80::aa54:b2ff:fe08:27b8%wlan0",
+//                                                     "20070");
+//
+//  //the creation of multicastFace2 works properly. It has been disable because it needs an IP address of
+//  //an available network interface (different from the first one used)
+//  shared_ptr<MulticastUdpFace> multicastFace2 = factory.createMulticastFace("192.168.1.17",
+//                                                                            "224.0.0.1",
+//                                                                            "20073");
+//  BOOST_CHECK_NE(multicastFace1, multicastFace2);
+//
+//
+//  //ipv6 - work in progress
+//  shared_ptr<MulticastUdpFace> multicastFace3 = factory.createMulticastFace("fe80::5e96:9dff:fe7d:9c8d%en1",
+//                                                                            "FF01:0:0:0:0:0:0:2",
+//                                                                            "20073");
+//
+//  shared_ptr<MulticastUdpFace> multicastFace4 = factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
+//                                                                            "FF01:0:0:0:0:0:0:2",
+//                                                                            "20073");
+//
+//  BOOST_CHECK_EQUAL(multicastFace3, multicastFace4);
+//
+//  shared_ptr<MulticastUdpFace> multicastFace5 = factory.createMulticastFace("::1",
+//                                                                            "FF01:0:0:0:0:0:0:2",
+//                                                                            "20073");
+//
+//  BOOST_CHECK_NE(multicastFace3, multicastFace5);
+//
+//  //same local ipv6 endpoint for a different multicast group
+//  BOOST_CHECK_THROW(factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
+//                                                "FE01:0:0:0:0:0:0:2",
+//                                                "20073"),
+//                    UdpFactory::Error);
+//
+//  //same local ipv6 (expect for th port number) endpoint for a different multicast group
+//  BOOST_CHECK_THROW(factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
+//                                                "FE01:0:0:0:0:0:0:2",
+//                                                "20075"),
+//                    UdpFactory::Error);
+//
+//  BOOST_CHECK_THROW(factory.createMulticastFace("fa80::20a:9dff:fef6:12ff",
+//                                                "FE12:0:0:0:0:0:0:2",
+//                                                "20075"),
+//                    UdpFactory::Error);
+//
+//  //not a multicast ipv6
+//  BOOST_CHECK_THROW(factory.createMulticastFace("fa80::20a:9dff:fef6:12ff",
+//                                                "A112:0:0:0:0:0:0:2",
+//                                                "20075"),
+//                    UdpFactory::Error);
+}
+
+class EndToEndFixture : protected BaseFixture
+{
+public:
+  void
+  channel1_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face1));
+    channel1_onFaceCreatedNoCheck(newFace);
+  }
+
+  void
+  channel1_onFaceCreatedNoCheck(const shared_ptr<Face>& newFace)
+  {
+    face1 = newFace;
+    face1->onReceiveInterest +=
+      bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
+    face1->onReceiveData +=
+      bind(&EndToEndFixture::face1_onReceiveData, this, _1);
+    face1->onFail +=
+      bind(&EndToEndFixture::face1_onFail, this);
+    BOOST_CHECK_MESSAGE(true, "channel 1 face created");
+
+    faces.push_back(face1);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel1_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveInterest(const Interest& interest)
+  {
+    face1_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveData(const Data& data)
+  {
+    face1_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onFail()
+  {
+    face1.reset();
+    limitedIo.afterOp();
+  }
+
+  void
+  channel2_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face2));
+    face2 = newFace;
+    face2->onReceiveInterest +=
+      bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+    face2->onReceiveData +=
+      bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+    face2->onFail +=
+      bind(&EndToEndFixture::face2_onFail, this);
+
+    faces.push_back(face2);
+
+    BOOST_CHECK_MESSAGE(true, "channel 2 face created");
+    limitedIo.afterOp();
+  }
+
+  void
+  channel2_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveInterest(const Interest& interest)
+  {
+    face2_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveData(const Data& data)
+  {
+    face2_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onFail()
+  {
+    face2.reset();
+    limitedIo.afterOp();
+  }
+
+  void
+  channel3_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face1));
+    face3 = newFace;
+    faces.push_back(newFace);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    faces.push_back(newFace);
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onConnectFailedOk(const std::string& reason)
+  {
+    //it's ok, it was supposed to fail
+    limitedIo.afterOp();
+  }
+
+  void
+  checkFaceList(size_t shouldBe)
+  {
+    BOOST_CHECK_EQUAL(faces.size(), shouldBe);
+  }
+
+public:
+  LimitedIo limitedIo;
+
+  shared_ptr<Face> face1;
+  std::vector<Interest> face1_receivedInterests;
+  std::vector<Data> face1_receivedDatas;
+  shared_ptr<Face> face2;
+  std::vector<Interest> face2_receivedInterests;
+  std::vector<Data> face2_receivedDatas;
+  shared_ptr<Face> face3;
+
+  std::list< shared_ptr<Face> > faces;
+};
+
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
+{
+  UdpFactory factory;
+
+  factory.createChannel("127.0.0.1", "20071");
+
+  factory.createFace(FaceUri("udp4://127.0.0.1:20070"),
+                     bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                     bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face2));
+  BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp4://127.0.0.1:20070");
+  BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp4://127.0.0.1:20071");
+  BOOST_CHECK_EQUAL(face2->isLocal(), false);
+  // face1 is not created yet
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+  Interest interest3("ndn:/QWiIhjgkj5sL");
+  Data     data3    ("ndn:/XNBV794f");
+  data3.setContent(0, 0);
+
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0),
+                                        0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+  data3.setSignature(fakeSignature);
+
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(5,//4 send + 1 listen return
+                      time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp4://127.0.0.1:20071");
+  BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp4://127.0.0.1:20070");
+  BOOST_CHECK_EQUAL(face1->isLocal(), false);
+
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+
+
+
+  //checking if the connection accepting mechanism works properly.
+
+  face2->sendData    (data3    );
+  face2->sendInterest(interest3);
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 4);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [3].getName(), data3.getName());
+
+  const FaceCounters& counters1 = face1->getCounters();
+  BOOST_CHECK_EQUAL(counters1.getNInInterests() , 2);
+  BOOST_CHECK_EQUAL(counters1.getNInDatas()     , 4);
+  BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
+  BOOST_CHECK_EQUAL(counters1.getNOutDatas()    , 1);
+
+  const FaceCounters& counters2 = face2->getCounters();
+  BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
+  BOOST_CHECK_EQUAL(counters2.getNInDatas()     , 1);
+  BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 2);
+  BOOST_CHECK_EQUAL(counters2.getNOutDatas()    , 4);
+}
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd6, EndToEndFixture)
+{
+  UdpFactory factory;
+
+  factory.createChannel("::1", "20071");
+
+  factory.createFace(FaceUri("udp://[::1]:20070"),
+                     bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                     bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face2));
+  BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp6://[::1]:20070");
+  BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp6://[::1]:20071");
+  BOOST_CHECK_EQUAL(face2->isLocal(), false);
+  // face1 is not created yet
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+  Interest interest3("ndn:/QWiIhjgkj5sL");
+  Data     data3    ("ndn:/XNBV794f");
+  data3.setContent(0, 0);
+
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0),
+                                        0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+  data3.setSignature(fakeSignature);
+
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(3,//2 send + 1 listen return
+                      time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp6://[::1]:20071");
+  BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp6://[::1]:20070");
+  BOOST_CHECK_EQUAL(face1->isLocal(), false);
+
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+
+
+
+  //checking if the connection accepting mechanism works properly.
+
+  face2->sendData    (data3    );
+  face2->sendInterest(interest3);
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 2);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [1].getName(), data3.getName());
+}
+
+BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
+{
+  Interest interest1("ndn:/TpnzGvW9R");
+  Interest interest2("ndn:/QWiIMfj5sL");
+
+  UdpFactory factory;
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+
+  channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+
+  channel2->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_CHECK_EQUAL(faces.size(), 1);
+
+  shared_ptr<UdpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
+  channel3->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel3_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+
+  shared_ptr<UdpChannel> channel4 = factory.createChannel("127.0.0.1", "20073");
+
+  BOOST_CHECK_NE(channel3, channel4);
+
+  scheduler::schedule(time::milliseconds(500),
+           bind(&UdpChannel::connect, channel4, "127.0.0.1", "20070",
+                // does not work without static_cast
+                static_cast<UdpChannel::FaceCreatedCallback>(
+                    bind(&EndToEndFixture::channel_onFaceCreated, this, _1)),
+                static_cast<UdpChannel::ConnectFailedCallback>(
+                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1))));
+
+  scheduler::schedule(time::milliseconds(400), bind(&EndToEndFixture::checkFaceList, this, 2));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2,// 2 connects
+                      time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept multiple connections");
+
+  BOOST_CHECK_EQUAL(faces.size(), 3);
+
+
+  face2->sendInterest(interest1);
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_CHECK_EQUAL(faces.size(), 4);
+
+  face3->sendInterest(interest2);
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
+  BOOST_CHECK_EQUAL(faces.size(), 5);
+  BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,     this, _1),
+                                     bind(&EndToEndFixture::channel_onConnectFailedOk, this, _1)),
+                    UdpChannel::Error);
+}
+
+//Test commented because it required to be run in a machine that can resolve ipv6 query
+//BOOST_FIXTURE_TEST_CASE(EndToEndIpv6, EndToEndFixture)
+//{
+//  UdpFactory factory = UdpFactory();
+//  Scheduler scheduler(g_io); // to limit the amount of time the test may take
+//
+//  EventId abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                              "UdpChannel error: cannot connect or cannot accept connection"));
+//
+//  limitedIoRemaining = 1;
+//
+//  shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
+//  shared_ptr<UdpChannel> channel2 = factory.createChannel("::1", "20071");
+//
+//  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+//                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+//
+//  channel2->connect("::1", "20070",
+//                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+//                    bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_REQUIRE(static_cast<bool>(face2));
+//
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot send or receive Interest/Data packets"));
+//
+//  Interest interest1("ndn:/TpnzGvW9R");
+//  Data     data1    ("ndn:/KfczhUqVix");
+//  data1.setContent(0, 0);
+//  Interest interest2("ndn:/QWiIMfj5sL");
+//  Data     data2    ("ndn:/XNBV796f");
+//  data2.setContent(0, 0);
+//  Interest interest3("ndn:/QWiIhjgkj5sL");
+//  Data     data3    ("ndn:/XNBV794f");
+//  data3.setContent(0, 0);
+//
+//  ndn::SignatureSha256WithRsa fakeSignature;
+//  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+//
+//  // set fake signature on data1 and data2
+//  data1.setSignature(fakeSignature);
+//  data2.setSignature(fakeSignature);
+//  data3.setSignature(fakeSignature);
+//
+//  face2->sendInterest(interest2);
+//  face2->sendData    (data2    );
+//
+//  limitedIoRemaining = 3; //2 send + 1 listen return
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_REQUIRE(static_cast<bool>(face1));
+//
+//  face1->sendInterest(interest1);
+//  face1->sendData    (data1    );
+//
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot send or receive Interest/Data packets"));
+//  limitedIoRemaining = 2;
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+//  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 1);
+//  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+//  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+//
+//  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+//  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+//  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+//  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+//
+//  //checking if the connection accepting mechanism works properly.
+//
+//  face2->sendData    (data3    );
+//  face2->sendInterest(interest3);
+//
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot send or receive Interest/Data packets"));
+//  limitedIoRemaining = 2;
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
+//  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 2);
+//
+//  BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
+//  BOOST_CHECK_EQUAL(face1_receivedDatas    [1].getName(), data3.getName());
+//
+//}
+
+
+//Test commented because it required to be run in a machine that can resolve ipv6 query
+//BOOST_FIXTURE_TEST_CASE(MultipleAcceptsIpv6, EndToEndFixture)
+//{
+//  Interest interest1("ndn:/TpnzGvW9R");
+//  Interest interest2("ndn:/QWiIMfj5sL");
+//  Interest interest3("ndn:/QWiIhjgkj5sL");
+//
+//  UdpFactory factory = UdpFactory();
+//  Scheduler scheduler(g_io); // to limit the amount of time the test may take
+//
+//  EventId abortEvent =
+//  scheduler.scheduleEvent(time::seconds(4),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot connect or cannot accept connection"));
+//
+//  shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
+//  shared_ptr<UdpChannel> channel2 = factory.createChannel("::1", "20071");
+//
+//  channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
+//                   bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+//
+//  channel2->connect("::1", "20070",
+//                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+//                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+//
+//  limitedIoRemaining = 1;
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_CHECK_EQUAL(faces.size(), 1);
+//
+//  shared_ptr<UdpChannel> channel3 = factory.createChannel("::1", "20072");
+//  channel3->connect("::1", "20070",
+//                    bind(&EndToEndFixture::channel3_onFaceCreated, this, _1),
+//                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+//
+//  shared_ptr<UdpChannel> channel4 = factory.createChannel("::1", "20073");
+//
+//  BOOST_CHECK_NE(channel3, channel4);
+//
+//  scheduler
+//  .scheduleEvent(time::milliseconds(500),
+//                 bind(&UdpChannel::connect, channel4,
+//                      "::1", "20070",
+//                      static_cast<UdpChannel::FaceCreatedCallback>(bind(&EndToEndFixture::
+//                                                                        channel_onFaceCreated, this, _1)),
+//                      static_cast<UdpChannel::ConnectFailedCallback>(bind(&EndToEndFixture::
+//                                                                          channel_onConnectFailed, this, _1))));
+//
+//  limitedIoRemaining = 2; // 2 connects
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(4),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot connect or cannot accept multiple connections"));
+//
+//  scheduler.scheduleEvent(time::seconds(0.4),
+//                          bind(&EndToEndFixture::checkFaceList, this, 2));
+//
+//  g_io.run();
+//  g_io.reset();
+//
+//  BOOST_CHECK_EQUAL(faces.size(), 3);
+//
+//
+//  face2->sendInterest(interest1);
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot send or receive Interest/Data packets"));
+//  limitedIoRemaining = 1;
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  BOOST_CHECK_EQUAL(faces.size(), 4);
+//
+//  face3->sendInterest(interest2);
+//  abortEvent =
+//  scheduler.scheduleEvent(time::seconds(1),
+//                          bind(&EndToEndFixture::abortTestCase, this,
+//                               "UdpChannel error: cannot send or receive Interest/Data packets"));
+//  limitedIoRemaining = 1;
+//  g_io.run();
+//  g_io.reset();
+//  scheduler.cancelEvent(abortEvent);
+//
+//  //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
+//  BOOST_CHECK_EQUAL(faces.size(), 5);
+//  BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,
+//                                          this,
+//                                          _1),
+//                                      bind(&EndToEndFixture::channel_onConnectFailedOk,
+//                                          this,
+//                                          _1)),
+//                    UdpChannel::Error);
+//}
+
+
+BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
+{
+  UdpFactory factory = UdpFactory();
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
+  shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
+
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  channel2->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept connection");
+
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+
+  BOOST_CHECK(static_cast<bool>(face2));
+
+  // Face::close must be invoked during io run to be counted as an op
+  scheduler::schedule(time::milliseconds(100), bind(&Face::close, face2));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "FaceClosing error: cannot properly close faces");
+
+  BOOST_CHECK(!static_cast<bool>(face2));
+
+  BOOST_CHECK_EQUAL(channel2->size(), 0);
+}
+
+BOOST_FIXTURE_TEST_CASE(ClosingIdleFace, EndToEndFixture)
+{
+  Interest interest1("ndn:/TpnzGvW9R");
+  Interest interest2("ndn:/QWiIMfj5sL");
+
+  UdpFactory factory;
+
+  shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070",
+                                                          time::seconds(2));
+  shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071",
+                                                          time::seconds(2));
+
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  channel2->connect("127.0.0.1", "20070",
+                    bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
+                    bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect or cannot accept connection");
+
+  face2->sendInterest(interest1);
+  BOOST_CHECK(!face2->isOnDemand());
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
+                                      time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_CHECK_EQUAL(faces.size(), 2);
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(2)) == LimitedIo::EXCEED_TIME,
+                      "Idle face should be still open because has been used recently");
+  BOOST_CHECK_EQUAL(faces.size(), 2);
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
+                      "Closing idle face error: face should be closed by now");
+
+  //the face on listen should be closed now
+  BOOST_CHECK_EQUAL(channel1->size(), 0);
+  //checking that face2 has not been closed
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+  BOOST_REQUIRE(static_cast<bool>(face2));
+
+  face2->sendInterest(interest2);
+  BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
+                                      time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot send or receive Interest/Data packets");
+  //channel1 should have created a new face by now
+  BOOST_CHECK_EQUAL(channel1->size(), 1);
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+  BOOST_REQUIRE(static_cast<bool>(face1));
+  BOOST_CHECK(face1->isOnDemand());
+
+  channel1->connect("127.0.0.1", "20071",
+                    bind(&EndToEndFixture::channel1_onFaceCreatedNoCheck, this, _1),
+                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(1,//1 connect
+                                      time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UdpChannel error: cannot connect");
+
+  BOOST_CHECK(!face1->isOnDemand());
+
+  //the connect should have set face1 as permanent face,
+  //but it shouln't have created any additional faces
+  BOOST_CHECK_EQUAL(channel1->size(), 1);
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+  BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_TIME,
+                      "Idle face should be still open because it's permanent now");
+  //both faces are permanent, nothing should have changed
+  BOOST_CHECK_EQUAL(channel1->size(), 1);
+  BOOST_CHECK_EQUAL(channel2->size(), 1);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/unix-stream.cpp b/tests/daemon/face/unix-stream.cpp
new file mode 100644
index 0000000..4181aa1
--- /dev/null
+++ b/tests/daemon/face/unix-stream.cpp
@@ -0,0 +1,423 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face/unix-stream-factory.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/limited-io.hpp"
+
+namespace nfd {
+namespace tests {
+
+using namespace boost::asio::local;
+
+#define CHANNEL_PATH1 "unix-stream-test.1.sock"
+#define CHANNEL_PATH2 "unix-stream-test.2.sock"
+
+BOOST_FIXTURE_TEST_SUITE(FaceUnixStream, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(ChannelMap)
+{
+  UnixStreamFactory factory;
+
+  shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
+  shared_ptr<UnixStreamChannel> channel1a = factory.createChannel(CHANNEL_PATH1);
+  BOOST_CHECK_EQUAL(channel1, channel1a);
+  std::string channel1uri = channel1->getUri().toString();
+  BOOST_CHECK_EQUAL(channel1uri.find("unix:///"), 0); // third '/' is the path separator
+  BOOST_CHECK_EQUAL(channel1uri.rfind(CHANNEL_PATH1),
+                    channel1uri.size() - std::string(CHANNEL_PATH1).size());
+
+  shared_ptr<UnixStreamChannel> channel2 = factory.createChannel(CHANNEL_PATH2);
+  BOOST_CHECK_NE(channel1, channel2);
+}
+
+class EndToEndFixture : protected BaseFixture
+{
+public:
+  void
+  client_onConnect(const boost::system::error_code& error)
+  {
+    BOOST_CHECK_MESSAGE(!error, error.message());
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel1_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    BOOST_CHECK(!static_cast<bool>(face1));
+    face1 = static_pointer_cast<UnixStreamFace>(newFace);
+    face1->onReceiveInterest +=
+      bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
+    face1->onReceiveData +=
+      bind(&EndToEndFixture::face1_onReceiveData, this, _1);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel1_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveInterest(const Interest& interest)
+  {
+    face1_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face1_onReceiveData(const Data& data)
+  {
+    face1_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveInterest(const Interest& interest)
+  {
+    face2_receivedInterests.push_back(interest);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  face2_onReceiveData(const Data& data)
+  {
+    face2_receivedDatas.push_back(data);
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onFaceCreated(const shared_ptr<Face>& newFace)
+  {
+    faces.push_back(static_pointer_cast<UnixStreamFace>(newFace));
+
+    limitedIo.afterOp();
+  }
+
+  void
+  channel_onConnectFailed(const std::string& reason)
+  {
+    BOOST_CHECK_MESSAGE(false, reason);
+
+    limitedIo.afterOp();
+  }
+
+protected:
+  LimitedIo limitedIo;
+
+  shared_ptr<UnixStreamFace> face1;
+  std::vector<Interest> face1_receivedInterests;
+  std::vector<Data> face1_receivedDatas;
+  shared_ptr<UnixStreamFace> face2;
+  std::vector<Interest> face2_receivedInterests;
+  std::vector<Data> face2_receivedDatas;
+
+  std::list< shared_ptr<UnixStreamFace> > faces;
+};
+
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd, EndToEndFixture)
+{
+  UnixStreamFactory factory;
+
+  shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  shared_ptr<stream_protocol::socket> client =
+      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
+                        bind(&EndToEndFixture::client_onConnect, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+
+  BOOST_CHECK_EQUAL(face1->getRemoteUri().getScheme(), "fd");
+  BOOST_CHECK_NO_THROW(boost::lexical_cast<int>(face1->getRemoteUri().getHost()));
+  std::string face1localUri = face1->getLocalUri().toString();
+  BOOST_CHECK_EQUAL(face1localUri.find("unix:///"), 0); // third '/' is the path separator
+  BOOST_CHECK_EQUAL(face1localUri.rfind(CHANNEL_PATH1),
+                    face1localUri.size() - std::string(CHANNEL_PATH1).size());
+
+  face2 = make_shared<UnixStreamFace>(client);
+  face2->onReceiveInterest +=
+    bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+  face2->onReceiveData +=
+    bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+
+  const FaceCounters& counters1 = face1->getCounters();
+  BOOST_CHECK_EQUAL(counters1.getNInInterests() , 1);
+  BOOST_CHECK_EQUAL(counters1.getNInDatas()     , 3);
+  BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
+  BOOST_CHECK_EQUAL(counters1.getNOutDatas()    , 1);
+
+  const FaceCounters& counters2 = face2->getCounters();
+  BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
+  BOOST_CHECK_EQUAL(counters2.getNInDatas()     , 1);
+  BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 1);
+  BOOST_CHECK_EQUAL(counters2.getNOutDatas()    , 3);
+}
+
+BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
+{
+  UnixStreamFactory factory;
+
+  shared_ptr<UnixStreamChannel> channel = factory.createChannel(CHANNEL_PATH1);
+  channel->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
+                  bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+
+  shared_ptr<stream_protocol::socket> client1 =
+      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
+                         bind(&EndToEndFixture::client_onConnect, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot connect or cannot accept connection");
+
+  BOOST_CHECK_EQUAL(faces.size(), 1);
+
+  shared_ptr<stream_protocol::socket> client2 =
+      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
+                         bind(&EndToEndFixture::client_onConnect, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot accept multiple connections");
+
+  BOOST_CHECK_EQUAL(faces.size(), 2);
+
+  // now close one of the faces
+  faces.front()->close();
+
+  // we should still be able to send/receive with the other one
+  face1 = faces.back();
+  face1->onReceiveInterest += bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
+  face1->onReceiveData += bind(&EndToEndFixture::face1_onReceiveData, this, _1);
+
+  face2 = make_shared<UnixStreamFace>(client2);
+  face2->onReceiveInterest += bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+  face2->onReceiveData += bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  face1->sendInterest(interest1);
+  face1->sendData    (data1    );
+  face2->sendInterest(interest2);
+  face2->sendData    (data2    );
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
+  BOOST_CHECK_EQUAL(face1_receivedDatas    [0].getName(), data2.getName());
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
+  BOOST_CHECK_EQUAL(face2_receivedDatas    [0].getName(), data1.getName());
+}
+
+static inline void
+noOp()
+{
+}
+
+BOOST_FIXTURE_TEST_CASE(UnixStreamFaceLocalControlHeader, EndToEndFixture)
+{
+  UnixStreamFactory factory;
+
+  shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
+  channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
+                   bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
+
+  shared_ptr<stream_protocol::socket> client =
+      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
+                        bind(&EndToEndFixture::client_onConnect, this, _1));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot connect or cannot accept connection");
+
+  BOOST_REQUIRE(static_cast<bool>(face1));
+
+  face2 = make_shared<UnixStreamFace>(client);
+  face2->onReceiveInterest +=
+    bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
+  face2->onReceiveData +=
+    bind(&EndToEndFixture::face2_onReceiveData, this, _1);
+
+  Interest interest1("ndn:/TpnzGvW9R");
+  Data     data1    ("ndn:/KfczhUqVix");
+  data1.setContent(0, 0);
+  Interest interest2("ndn:/QWiIMfj5sL");
+  Data     data2    ("ndn:/XNBV796f");
+  data2.setContent(0, 0);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
+
+  // set fake signature on data1 and data2
+  data1.setSignature(fakeSignature);
+  data2.setSignature(fakeSignature);
+
+  face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+  face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+
+  BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+
+  face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+  face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+
+  BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+
+  ////////////////////////////////////////////////////////
+
+  interest1.setIncomingFaceId(11);
+  interest1.setNextHopFaceId(111);
+
+  face1->sendInterest(interest1);
+
+  data1.setIncomingFaceId(22);
+  data1.getLocalControlHeader().setNextHopFaceId(222);
+
+  face1->sendData    (data1);
+
+  //
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face2_receivedDatas    .size(), 1);
+
+  // sending allows only IncomingFaceId, receiving allows only NextHopFaceId
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
+  BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), false);
+
+  BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
+  BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
+
+  ////////////////////////////////////////////////////////
+
+  using namespace boost::asio;
+
+  std::vector<const_buffer> interestWithHeader;
+  Block iHeader  = interest1.getLocalControlHeader().wireEncode(interest1, true, true);
+  Block iPayload = interest1.wireEncode();
+  interestWithHeader.push_back(buffer(iHeader.wire(),  iHeader.size()));
+  interestWithHeader.push_back(buffer(iPayload.wire(), iPayload.size()));
+
+  std::vector<const_buffer> dataWithHeader;
+  Block dHeader  = data1.getLocalControlHeader().wireEncode(data1, true, true);
+  Block dPayload = data1.wireEncode();
+  dataWithHeader.push_back(buffer(dHeader.wire(),  dHeader.size()));
+  dataWithHeader.push_back(buffer(dPayload.wire(), dPayload.size()));
+
+  //
+
+  client->async_send(interestWithHeader, bind(&noOp));
+  client->async_send(dataWithHeader, bind(&noOp));
+
+  BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
+                      "UnixStreamChannel error: cannot send or receive Interest/Data packets");
+
+  BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1_receivedDatas    .size(), 1);
+
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), true);
+  BOOST_CHECK_EQUAL(face1_receivedInterests[0].getNextHopFaceId(), 111);
+
+  BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
+  BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/broadcast-strategy.cpp b/tests/daemon/fw/broadcast-strategy.cpp
new file mode 100644
index 0000000..cde9b44
--- /dev/null
+++ b/tests/daemon/fw/broadcast-strategy.cpp
@@ -0,0 +1,129 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fw/broadcast-strategy.hpp"
+#include "strategy-tester.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FwBroadcastStrategy, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Forward2)
+{
+  Forwarder forwarder;
+  typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
+  BroadcastStrategyTester strategy(forwarder);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
+  fibEntry->addNextHop(face1, 0);
+  fibEntry->addNextHop(face2, 0);
+  fibEntry->addNextHop(face3, 0);
+
+  shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
+  Pit& pit = forwarder.getPit();
+  shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+  pitEntry->insertOrUpdateInRecord(face3, *interest);
+
+  strategy.afterReceiveInterest(*face3, *interest, fibEntry, pitEntry);
+  BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 0);
+  BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 2);
+  bool hasFace1 = false;
+  bool hasFace2 = false;
+  for (std::vector<BroadcastStrategyTester::SendInterestArgs>::iterator it =
+       strategy.m_sendInterestHistory.begin();
+       it != strategy.m_sendInterestHistory.end(); ++it) {
+    if (it->get<1>() == face1) {
+      hasFace1 = true;
+    }
+    if (it->get<1>() == face2) {
+      hasFace2 = true;
+    }
+  }
+  BOOST_CHECK(hasFace1 && hasFace2);
+}
+
+BOOST_AUTO_TEST_CASE(RejectScope)
+{
+  Forwarder forwarder;
+  typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
+  BroadcastStrategyTester strategy(forwarder);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert("ndn:/localhop/uS09bub6tm").first;
+  fibEntry->addNextHop(face2, 0);
+
+  shared_ptr<Interest> interest = makeInterest("ndn:/localhop/uS09bub6tm/eG3MMoP6z");
+  Pit& pit = forwarder.getPit();
+  shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+  pitEntry->insertOrUpdateInRecord(face1, *interest);
+
+  strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
+  BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(RejectLoopback)
+{
+  Forwarder forwarder;
+  typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
+  BroadcastStrategyTester strategy(forwarder);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
+  fibEntry->addNextHop(face1, 0);
+
+  shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
+  Pit& pit = forwarder.getPit();
+  shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
+  pitEntry->insertOrUpdateInRecord(face1, *interest);
+
+  strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
+  BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/client-control-strategy.cpp b/tests/daemon/fw/client-control-strategy.cpp
new file mode 100644
index 0000000..c76fb52
--- /dev/null
+++ b/tests/daemon/fw/client-control-strategy.cpp
@@ -0,0 +1,96 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fw/client-control-strategy.hpp"
+#include "strategy-tester.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FwClientControlStrategy, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Forward3)
+{
+  Forwarder forwarder;
+  typedef StrategyTester<fw::ClientControlStrategy> ClientControlStrategyTester;
+  ClientControlStrategyTester strategy(forwarder);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
+  shared_ptr<DummyLocalFace> face4 = make_shared<DummyLocalFace>();
+  face4->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
+  forwarder.addFace(face4);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
+  fibEntry->addNextHop(face2, 0);
+
+  Pit& pit = forwarder.getPit();
+
+  // Interest with valid NextHopFaceId
+  shared_ptr<Interest> interest1 = makeInterest("ndn:/0z8r6yDDe");
+  interest1->setNextHopFaceId(face1->getId());
+  shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
+  pitEntry1->insertOrUpdateInRecord(face4, *interest1);
+
+  strategy.m_sendInterestHistory.clear();
+  strategy.afterReceiveInterest(*face4, *interest1, fibEntry, pitEntry1);
+  BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[0].get<1>(), face1);
+
+  // Interest without NextHopFaceId
+  shared_ptr<Interest> interest2 = makeInterest("ndn:/y6JQADGVz");
+  shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
+  pitEntry2->insertOrUpdateInRecord(face4, *interest2);
+
+  strategy.m_sendInterestHistory.clear();
+  strategy.afterReceiveInterest(*face4, *interest2, fibEntry, pitEntry2);
+  BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[0].get<1>(), face2);
+
+  // Interest with invalid NextHopFaceId
+  shared_ptr<Interest> interest3 = makeInterest("ndn:/0z8r6yDDe");
+  interest3->setNextHopFaceId(face3->getId());
+  shared_ptr<pit::Entry> pitEntry3 = pit.insert(*interest3).first;
+  pitEntry3->insertOrUpdateInRecord(face4, *interest3);
+
+  face3->close(); // face3 is closed and its FaceId becomes invalid
+  strategy.m_sendInterestHistory.clear();
+  strategy.m_rejectPendingInterestHistory.clear();
+  strategy.afterReceiveInterest(*face4, *interest3, fibEntry, pitEntry3);
+  BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 0);
+  BOOST_REQUIRE_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
new file mode 100644
index 0000000..67784fc
--- /dev/null
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -0,0 +1,86 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_FW_DUMMY_STRATEGY_HPP
+#define NFD_TESTS_NFD_FW_DUMMY_STRATEGY_HPP
+
+#include "fw/strategy.hpp"
+
+namespace nfd {
+namespace tests {
+
+/** \brief strategy for unit testing
+ *
+ *  Triggers on DummyStrategy are recorded but does nothing
+ */
+class DummyStrategy : public fw::Strategy
+{
+public:
+  DummyStrategy(Forwarder& forwarder, const Name& name)
+    : Strategy(forwarder, name)
+  {
+  }
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry)
+  {
+    ++m_afterReceiveInterest_count;
+
+    if (static_cast<bool>(m_interestOutFace)) {
+      this->sendInterest(pitEntry, m_interestOutFace);
+    }
+    else {
+      this->rejectPendingInterest(pitEntry);
+    }
+  }
+
+  virtual void
+  beforeSatisfyPendingInterest(shared_ptr<pit::Entry> pitEntry,
+                               const Face& inFace, const Data& data)
+  {
+    ++m_beforeSatisfyPendingInterest_count;
+  }
+
+  virtual void
+  beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry)
+  {
+    ++m_beforeExpirePendingInterest_count;
+  }
+
+public:
+  int m_afterReceiveInterest_count;
+  int m_beforeSatisfyPendingInterest_count;
+  int m_beforeExpirePendingInterest_count;
+
+  /// outFace to use in afterReceiveInterest, nullptr to reject
+  shared_ptr<Face> m_interestOutFace;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_FW_DUMMY_STRATEGY_HPP
diff --git a/tests/daemon/fw/face-table.cpp b/tests/daemon/fw/face-table.cpp
new file mode 100644
index 0000000..daf9256
--- /dev/null
+++ b/tests/daemon/fw/face-table.cpp
@@ -0,0 +1,139 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fw/face-table.hpp"
+#include "fw/forwarder.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FwFaceTable, BaseFixture)
+
+static inline void
+saveFaceId(std::vector<FaceId>& faceIds, shared_ptr<Face> face)
+{
+  faceIds.push_back(face->getId());
+}
+
+BOOST_AUTO_TEST_CASE(AddRemove)
+{
+  Forwarder forwarder;
+
+  FaceTable& faceTable = forwarder.getFaceTable();
+  std::vector<FaceId> onAddHistory;
+  std::vector<FaceId> onRemoveHistory;
+  faceTable.onAdd    += bind(&saveFaceId, boost::ref(onAddHistory   ), _1);
+  faceTable.onRemove += bind(&saveFaceId, boost::ref(onRemoveHistory), _1);
+
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+
+  BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
+  BOOST_CHECK_EQUAL(face2->getId(), INVALID_FACEID);
+
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  BOOST_CHECK_NE(face1->getId(), INVALID_FACEID);
+  BOOST_CHECK_NE(face2->getId(), INVALID_FACEID);
+  BOOST_CHECK_NE(face1->getId(), face2->getId());
+
+  FaceId oldId1 = face1->getId();
+  faceTable.add(face1);
+  BOOST_CHECK_EQUAL(face1->getId(), oldId1);
+  BOOST_CHECK_EQUAL(faceTable.size(), 2);
+
+  BOOST_REQUIRE_EQUAL(onAddHistory.size(), 2);
+  BOOST_CHECK_EQUAL(onAddHistory[0], face1->getId());
+  BOOST_CHECK_EQUAL(onAddHistory[1], face2->getId());
+
+  face1->close();
+
+  BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
+
+  BOOST_REQUIRE_EQUAL(onRemoveHistory.size(), 1);
+  BOOST_CHECK_EQUAL(onRemoveHistory[0], onAddHistory[0]);
+}
+
+BOOST_AUTO_TEST_CASE(Enumerate)
+{
+  Forwarder forwarder;
+  FaceTable& faceTable = forwarder.getFaceTable();
+
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  bool hasFace1 = false, hasFace2 = false;
+
+  BOOST_CHECK_EQUAL(faceTable.size(), 0);
+  BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
+
+  faceTable.add(face1);
+  BOOST_CHECK_EQUAL(faceTable.size(), 1);
+  BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
+  hasFace1 = hasFace2 = false;
+  for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
+    if (*it == face1) {
+      hasFace1 = true;
+    }
+  }
+  BOOST_CHECK(hasFace1);
+
+  faceTable.add(face2);
+  BOOST_CHECK_EQUAL(faceTable.size(), 2);
+  BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
+  hasFace1 = hasFace2 = false;
+  for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
+    if (*it == face1) {
+      hasFace1 = true;
+    }
+    if (*it == face2) {
+      hasFace2 = true;
+    }
+  }
+  BOOST_CHECK(hasFace1);
+  BOOST_CHECK(hasFace2);
+
+  face1->close();
+  BOOST_CHECK_EQUAL(faceTable.size(), 1);
+  BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
+  hasFace1 = hasFace2 = false;
+  for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
+    if (*it == face1) {
+      hasFace1 = true;
+    }
+    if (*it == face2) {
+      hasFace2 = true;
+    }
+  }
+  BOOST_CHECK(!hasFace1);
+  BOOST_CHECK(hasFace2);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/forwarder.cpp b/tests/daemon/fw/forwarder.cpp
new file mode 100644
index 0000000..0151460
--- /dev/null
+++ b/tests/daemon/fw/forwarder.cpp
@@ -0,0 +1,352 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fw/forwarder.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include "dummy-strategy.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/limited-io.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FwForwarder, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(SimpleExchange)
+{
+  Forwarder forwarder;
+
+  Name nameA  ("ndn:/A");
+  Name nameAB ("ndn:/A/B");
+  Name nameABC("ndn:/A/B/C");
+  shared_ptr<Interest> interestAB = makeInterest(nameAB);
+  interestAB->setInterestLifetime(time::seconds(4));
+  shared_ptr<Data> dataABC = makeData(nameABC);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
+  face1->afterSend += bind(&boost::asio::io_service::stop, &g_io);
+  face2->afterSend += bind(&boost::asio::io_service::stop, &g_io);
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
+  fibEntry->addNextHop(face2, 0);
+
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNInInterests (), 0);
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutInterests(), 0);
+  face1->receiveInterest(*interestAB);
+  g_io.run();
+  g_io.reset();
+  BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 1);
+  BOOST_CHECK(face2->m_sentInterests[0].getName().equals(nameAB));
+  BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getIncomingFaceId(), face1->getId());
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNInInterests (), 1);
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutInterests(), 1);
+
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNInDatas (), 0);
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutDatas(), 0);
+  face2->receiveData(*dataABC);
+  g_io.run();
+  g_io.reset();
+  BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
+  BOOST_CHECK(face1->m_sentDatas[0].getName().equals(nameABC));
+  BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getIncomingFaceId(), face2->getId());
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNInDatas (), 1);
+  BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutDatas(), 1);
+}
+
+class ScopeLocalhostIncomingTestForwarder : public Forwarder
+{
+public:
+  ScopeLocalhostIncomingTestForwarder()
+  {
+  }
+
+  virtual void
+  onDataUnsolicited(Face& inFace, const Data& data)
+  {
+    ++m_onDataUnsolicited_count;
+  }
+
+protected:
+  virtual void
+  dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> f)
+  {
+    ++m_dispatchToStrategy_count;
+  }
+
+public:
+  int m_dispatchToStrategy_count;
+  int m_onDataUnsolicited_count;
+};
+
+BOOST_AUTO_TEST_CASE(ScopeLocalhostIncoming)
+{
+  ScopeLocalhostIncomingTestForwarder forwarder;
+  shared_ptr<Face> face1 = make_shared<DummyLocalFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  // local face, /localhost: OK
+  forwarder.m_dispatchToStrategy_count = 0;
+  shared_ptr<Interest> i1 = makeInterest("/localhost/A1");
+  forwarder.onIncomingInterest(*face1, *i1);
+  BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
+
+  // non-local face, /localhost: violate
+  forwarder.m_dispatchToStrategy_count = 0;
+  shared_ptr<Interest> i2 = makeInterest("/localhost/A2");
+  forwarder.onIncomingInterest(*face2, *i2);
+  BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 0);
+
+  // local face, non-/localhost: OK
+  forwarder.m_dispatchToStrategy_count = 0;
+  shared_ptr<Interest> i3 = makeInterest("/A3");
+  forwarder.onIncomingInterest(*face1, *i3);
+  BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
+
+  // non-local face, non-/localhost: OK
+  forwarder.m_dispatchToStrategy_count = 0;
+  shared_ptr<Interest> i4 = makeInterest("/A4");
+  forwarder.onIncomingInterest(*face2, *i4);
+  BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
+
+  // local face, /localhost: OK
+  forwarder.m_onDataUnsolicited_count = 0;
+  shared_ptr<Data> d1 = makeData("/localhost/B1");
+  forwarder.onIncomingData(*face1, *d1);
+  BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
+
+  // non-local face, /localhost: OK
+  forwarder.m_onDataUnsolicited_count = 0;
+  shared_ptr<Data> d2 = makeData("/localhost/B2");
+  forwarder.onIncomingData(*face2, *d2);
+  BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 0);
+
+  // local face, non-/localhost: OK
+  forwarder.m_onDataUnsolicited_count = 0;
+  shared_ptr<Data> d3 = makeData("/B3");
+  forwarder.onIncomingData(*face1, *d3);
+  BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
+
+  // non-local face, non-/localhost: OK
+  forwarder.m_onDataUnsolicited_count = 0;
+  shared_ptr<Data> d4 = makeData("/B4");
+  forwarder.onIncomingData(*face2, *d4);
+  BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
+}
+
+BOOST_AUTO_TEST_CASE(ScopeLocalhostOutgoing)
+{
+  Forwarder forwarder;
+  shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
+  shared_ptr<DummyFace>      face2 = make_shared<DummyFace>();
+  shared_ptr<Face>           face3 = make_shared<DummyLocalFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
+  Pit& pit = forwarder.getPit();
+
+  // local face, /localhost: OK
+  shared_ptr<Interest> interestA1 = makeInterest("/localhost/A1");
+  shared_ptr<pit::Entry> pitA1 = pit.insert(*interestA1).first;
+  pitA1->insertOrUpdateInRecord(face3, *interestA1);
+  face1->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pitA1, *face1);
+  BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
+
+  // non-local face, /localhost: violate
+  shared_ptr<Interest> interestA2 = makeInterest("/localhost/A2");
+  shared_ptr<pit::Entry> pitA2 = pit.insert(*interestA2).first;
+  pitA2->insertOrUpdateInRecord(face3, *interestA2);
+  face2->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pitA2, *face2);
+  BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 0);
+
+  // local face, non-/localhost: OK
+  shared_ptr<Interest> interestA3 = makeInterest("/A3");
+  shared_ptr<pit::Entry> pitA3 = pit.insert(*interestA3).first;
+  pitA3->insertOrUpdateInRecord(face3, *interestA3);
+  face1->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pitA3, *face1);
+  BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
+
+  // non-local face, non-/localhost: OK
+  shared_ptr<Interest> interestA4 = makeInterest("/A4");
+  shared_ptr<pit::Entry> pitA4 = pit.insert(*interestA4).first;
+  pitA4->insertOrUpdateInRecord(face3, *interestA4);
+  face2->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pitA4, *face2);
+  BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 1);
+
+  // local face, /localhost: OK
+  face1->m_sentDatas.clear();
+  forwarder.onOutgoingData(Data("/localhost/B1"), *face1);
+  BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
+
+  // non-local face, /localhost: OK
+  face2->m_sentDatas.clear();
+  forwarder.onOutgoingData(Data("/localhost/B2"), *face2);
+  BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 0);
+
+  // local face, non-/localhost: OK
+  face1->m_sentDatas.clear();
+  forwarder.onOutgoingData(Data("/B3"), *face1);
+  BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
+
+  // non-local face, non-/localhost: OK
+  face2->m_sentDatas.clear();
+  forwarder.onOutgoingData(Data("/B4"), *face2);
+  BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 1);
+}
+
+BOOST_AUTO_TEST_CASE(ScopeLocalhopOutgoing)
+{
+  Forwarder forwarder;
+  shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
+  shared_ptr<DummyFace>      face2 = make_shared<DummyFace>();
+  shared_ptr<DummyLocalFace> face3 = make_shared<DummyLocalFace>();
+  shared_ptr<DummyFace>      face4 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
+  forwarder.addFace(face4);
+  Pit& pit = forwarder.getPit();
+
+  // from local face, to local face: OK
+  shared_ptr<Interest> interest1 = makeInterest("/localhop/1");
+  shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
+  pit1->insertOrUpdateInRecord(face1, *interest1);
+  face3->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit1, *face3);
+  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+
+  // from non-local face, to local face: OK
+  shared_ptr<Interest> interest2 = makeInterest("/localhop/2");
+  shared_ptr<pit::Entry> pit2 = pit.insert(*interest2).first;
+  pit2->insertOrUpdateInRecord(face2, *interest2);
+  face3->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit2, *face3);
+  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+
+  // from local face, to non-local face: OK
+  shared_ptr<Interest> interest3 = makeInterest("/localhop/3");
+  shared_ptr<pit::Entry> pit3 = pit.insert(*interest3).first;
+  pit3->insertOrUpdateInRecord(face1, *interest3);
+  face4->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit3, *face4);
+  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
+
+  // from non-local face, to non-local face: violate
+  shared_ptr<Interest> interest4 = makeInterest("/localhop/4");
+  shared_ptr<pit::Entry> pit4 = pit.insert(*interest4).first;
+  pit4->insertOrUpdateInRecord(face2, *interest4);
+  face4->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit4, *face4);
+  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 0);
+
+  // from local face and non-local face, to local face: OK
+  shared_ptr<Interest> interest5 = makeInterest("/localhop/5");
+  shared_ptr<pit::Entry> pit5 = pit.insert(*interest5).first;
+  pit5->insertOrUpdateInRecord(face1, *interest5);
+  pit5->insertOrUpdateInRecord(face2, *interest5);
+  face3->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit5, *face3);
+  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+
+  // from local face and non-local face, to non-local face: OK
+  shared_ptr<Interest> interest6 = makeInterest("/localhop/6");
+  shared_ptr<pit::Entry> pit6 = pit.insert(*interest6).first;
+  pit6->insertOrUpdateInRecord(face1, *interest6);
+  pit6->insertOrUpdateInRecord(face2, *interest6);
+  face4->m_sentInterests.clear();
+  forwarder.onOutgoingInterest(pit6, *face4);
+  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
+}
+
+BOOST_AUTO_TEST_CASE(StrategyDispatch)
+{
+  LimitedIo limitedIo;
+  Forwarder forwarder;
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+
+  StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
+  shared_ptr<DummyStrategy> strategyP = make_shared<DummyStrategy>(
+                                        boost::ref(forwarder), "ndn:/strategyP");
+  shared_ptr<DummyStrategy> strategyQ = make_shared<DummyStrategy>(
+                                        boost::ref(forwarder), "ndn:/strategyQ");
+  strategyChoice.install(strategyP);
+  strategyChoice.install(strategyQ);
+  strategyChoice.insert("ndn:/" , strategyP->getName());
+  strategyChoice.insert("ndn:/B", strategyQ->getName());
+
+  shared_ptr<Interest> interest1 = makeInterest("ndn:/A/1");
+  strategyP->m_afterReceiveInterest_count = 0;
+  strategyP->m_interestOutFace = face2;
+  forwarder.onInterest(*face1, *interest1);
+  BOOST_CHECK_EQUAL(strategyP->m_afterReceiveInterest_count, 1);
+
+  shared_ptr<Interest> interest2 = makeInterest("ndn:/B/2");
+  strategyQ->m_afterReceiveInterest_count = 0;
+  strategyQ->m_interestOutFace = face2;
+  forwarder.onInterest(*face1, *interest2);
+  BOOST_CHECK_EQUAL(strategyQ->m_afterReceiveInterest_count, 1);
+
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
+
+  shared_ptr<Data> data1 = makeData("ndn:/A/1/a");
+  strategyP->m_beforeSatisfyPendingInterest_count = 0;
+  forwarder.onData(*face2, *data1);
+  BOOST_CHECK_EQUAL(strategyP->m_beforeSatisfyPendingInterest_count, 1);
+
+  shared_ptr<Data> data2 = makeData("ndn:/B/2/b");
+  strategyQ->m_beforeSatisfyPendingInterest_count = 0;
+  forwarder.onData(*face2, *data2);
+  BOOST_CHECK_EQUAL(strategyQ->m_beforeSatisfyPendingInterest_count, 1);
+
+  shared_ptr<Interest> interest3 = makeInterest("ndn:/A/3");
+  interest3->setInterestLifetime(time::milliseconds(30));
+  forwarder.onInterest(*face1, *interest3);
+  shared_ptr<Interest> interest4 = makeInterest("ndn:/B/4");
+  interest4->setInterestLifetime(time::milliseconds(5000));
+  forwarder.onInterest(*face1, *interest4);
+
+  strategyP->m_beforeExpirePendingInterest_count = 0;
+  strategyQ->m_beforeExpirePendingInterest_count = 0;
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(100));
+  BOOST_CHECK_EQUAL(strategyP->m_beforeExpirePendingInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyQ->m_beforeExpirePendingInterest_count, 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/ncc-strategy.cpp b/tests/daemon/fw/ncc-strategy.cpp
new file mode 100644
index 0000000..29db3b3
--- /dev/null
+++ b/tests/daemon/fw/ncc-strategy.cpp
@@ -0,0 +1,110 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "fw/ncc-strategy.hpp"
+#include "strategy-tester.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include "tests/limited-io.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FwNccStrategy, BaseFixture)
+
+// NccStrategy is fairly complex.
+// The most important property is:
+// it remembers which upstream is the fastest to return Data,
+// and favors this upstream in subsequent Interests.
+BOOST_AUTO_TEST_CASE(FavorRespondingUpstream)
+{
+  LimitedIo limitedIo;
+  Forwarder forwarder;
+  typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
+  shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(boost::ref(forwarder));
+  strategy->onAction += bind(&LimitedIo::afterOp, &limitedIo);
+
+  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
+  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
+
+  Fib& fib = forwarder.getFib();
+  shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
+  fibEntry->addNextHop(face1, 10);
+  fibEntry->addNextHop(face2, 20);
+
+  StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
+  strategyChoice.install(strategy);
+  strategyChoice.insert(Name(), strategy->getName());
+
+  Pit& pit = forwarder.getPit();
+
+  // first Interest: strategy knows nothing and follows routing
+  shared_ptr<Interest> interest1p = makeInterest("ndn:/0Jm1ajrW/%00");
+  Interest& interest1 = *interest1p;
+  interest1.setInterestLifetime(time::milliseconds(8000));
+  shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
+
+  pitEntry1->insertOrUpdateInRecord(face3, interest1);
+  strategy->afterReceiveInterest(*face3, interest1, fibEntry, pitEntry1);
+
+  // forwards to face1 because routing says it's best
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(1));
+  BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 1);
+  BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[0].get<1>(), face1);
+
+  // forwards to face2 because face1 doesn't respond
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(500));
+  BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 2);
+  BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[1].get<1>(), face2);
+
+  // face2 responds
+  shared_ptr<Data> data1p = makeData("ndn:/0Jm1ajrW/%00");
+  Data& data1 = *data1p;
+  strategy->beforeSatisfyPendingInterest(pitEntry1, *face2, data1);
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(500));
+
+  // second Interest: strategy knows face2 is best
+  shared_ptr<Interest> interest2p = makeInterest("ndn:/0Jm1ajrW/%00%01");
+  Interest& interest2 = *interest2p;
+  interest2.setInterestLifetime(time::milliseconds(8000));
+  shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
+
+  pitEntry2->insertOrUpdateInRecord(face3, interest2);
+  strategy->afterReceiveInterest(*face3, interest2, fibEntry, pitEntry2);
+
+  // forwards to face2 because it responds previously
+  limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(1));
+  BOOST_REQUIRE_GE(strategy->m_sendInterestHistory.size(), 3);
+  BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[2].get<1>(), face2);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
new file mode 100644
index 0000000..e3debef
--- /dev/null
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -0,0 +1,89 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
+#define NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
+
+#include <boost/tuple/tuple_comparison.hpp>
+#include "fw/strategy.hpp"
+
+namespace nfd {
+namespace tests {
+
+/** \class StrategyTester
+ *  \brief extends strategy S for unit testing
+ *
+ *  Actions invoked by S are recorded but not passed to forwarder
+ */
+template<typename S>
+class StrategyTester : public S
+{
+public:
+  explicit
+  StrategyTester(Forwarder& forwarder)
+    : S(forwarder, Name(S::STRATEGY_NAME).append("tester"))
+  {
+  }
+
+  /// fires after each Action
+  EventEmitter<> onAction;
+
+protected:
+  virtual void
+  sendInterest(shared_ptr<pit::Entry> pitEntry,shared_ptr<Face> outFace);
+
+  virtual void
+  rejectPendingInterest(shared_ptr<pit::Entry> pitEntry);
+
+public:
+  typedef boost::tuple<shared_ptr<pit::Entry>, shared_ptr<Face> > SendInterestArgs;
+  std::vector<SendInterestArgs> m_sendInterestHistory;
+
+  typedef boost::tuple<shared_ptr<pit::Entry> > RejectPendingInterestArgs;
+  std::vector<RejectPendingInterestArgs> m_rejectPendingInterestHistory;
+};
+
+
+template<typename S>
+inline void
+StrategyTester<S>::sendInterest(shared_ptr<pit::Entry> pitEntry,
+                                shared_ptr<Face> outFace)
+{
+  m_sendInterestHistory.push_back(SendInterestArgs(pitEntry, outFace));
+  pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
+  onAction();
+}
+
+template<typename S>
+inline void
+StrategyTester<S>::rejectPendingInterest(shared_ptr<pit::Entry> pitEntry)
+{
+  m_rejectPendingInterestHistory.push_back(RejectPendingInterestArgs(pitEntry));
+  onAction();
+}
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
diff --git a/tests/daemon/mgmt/command-validator.cpp b/tests/daemon/mgmt/command-validator.cpp
new file mode 100644
index 0000000..cb8031a
--- /dev/null
+++ b/tests/daemon/mgmt/command-validator.cpp
@@ -0,0 +1,600 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/command-validator.hpp"
+#include "core/config-file.hpp"
+
+#include "tests/test-common.hpp"
+
+#include <ndn-cpp-dev/util/command-interest-generator.hpp>
+#include <ndn-cpp-dev/util/io.hpp>
+#include <boost/filesystem.hpp>
+#include <fstream>
+
+namespace nfd {
+
+namespace tests {
+
+NFD_LOG_INIT("CommandValidatorTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtCommandValidator, BaseFixture)
+
+// authorizations
+// {
+//   authorize
+//   {
+//     certfile "tests/daemon/mgmt/cert1.ndncert"
+//     privileges
+//     {
+//       fib
+//       stats
+//     }
+//   }
+
+//   authorize
+//   {
+//     certfile "tests/daemon/mgmt/cert2.ndncert"
+//     privileges
+//     {
+//       faces
+//     }
+//   }
+// }
+
+const std::string CONFIG =
+"authorizations\n"
+"{\n"
+"  authorize\n"
+"  {\n"
+"    certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
+"    privileges\n"
+"    {\n"
+"      fib\n"
+"      stats\n"
+"    }\n"
+"  }\n"
+"  authorize\n"
+"  {\n"
+"    certfile \"tests/daemon/mgmt/cert2.ndncert\"\n"
+"    privileges\n"
+"    {\n"
+"      faces\n"
+"    }\n"
+"  }\n"
+  "}\n";
+
+const boost::filesystem::path CONFIG_PATH =
+  boost::filesystem::current_path() /= std::string("unit-test-nfd.conf");
+
+class CommandValidatorTester
+{
+public:
+
+  CommandValidatorTester()
+    : m_validated(false),
+      m_validationFailed(false)
+  {
+
+  }
+
+  void
+  generateIdentity(const Name& prefix)
+  {
+    m_identityName = prefix;
+    m_identityName.appendVersion();
+
+    const Name certName = m_keys.createIdentity(m_identityName);
+
+    m_certificate = m_keys.getCertificate(certName);
+  }
+
+  void
+  saveIdentityToFile(const char* filename)
+  {
+    std::ofstream out;
+    out.open(filename);
+
+    BOOST_REQUIRE(out.is_open());
+    BOOST_REQUIRE(static_cast<bool>(m_certificate));
+
+    ndn::io::save<ndn::IdentityCertificate>(*m_certificate, out);
+
+    out.close();
+  }
+
+  const Name&
+  getIdentityName() const
+  {
+    BOOST_REQUIRE_NE(m_identityName, Name());
+    return m_identityName;
+  }
+
+  const Name&
+  getPublicKeyName() const
+  {
+    BOOST_REQUIRE(static_cast<bool>(m_certificate));
+    return m_certificate->getPublicKeyName();
+  }
+
+  void
+  onValidated(const shared_ptr<const Interest>& interest)
+  {
+    // NFD_LOG_DEBUG("validated command");
+    m_validated = true;
+  }
+
+  void
+  onValidationFailed(const shared_ptr<const Interest>& interest, const std::string& info)
+  {
+    NFD_LOG_DEBUG("validation failed: " << info);
+    m_validationFailed = true;
+  }
+
+  bool
+  commandValidated() const
+  {
+    return m_validated;
+  }
+
+  bool
+  commandValidationFailed() const
+  {
+    return m_validationFailed;
+  }
+
+  void
+  resetValidation()
+  {
+    m_validated = false;
+    m_validationFailed = false;
+  }
+
+  ~CommandValidatorTester()
+  {
+    m_keys.deleteIdentity(m_identityName);
+  }
+
+private:
+  bool m_validated;
+  bool m_validationFailed;
+
+  ndn::KeyChain m_keys;
+  Name m_identityName;
+  shared_ptr<ndn::IdentityCertificate> m_certificate;
+};
+
+class TwoValidatorFixture : public BaseFixture
+{
+public:
+  TwoValidatorFixture()
+  {
+    m_tester1.generateIdentity("/test/CommandValidator/TwoKeys/id1");
+    m_tester1.saveIdentityToFile("tests/daemon/mgmt/cert1.ndncert");
+
+    m_tester2.generateIdentity("/test/CommandValidator/TwoKeys/id2");
+    m_tester2.saveIdentityToFile("tests/daemon/mgmt/cert2.ndncert");
+  }
+
+  ~TwoValidatorFixture()
+  {
+    boost::system::error_code error;
+    boost::filesystem::remove("tests/daemon/mgmt/cert1.ndncert", error);
+    boost::filesystem::remove("tests/daemon/mgmt/cert2.ndncert", error);
+  }
+
+protected:
+  CommandValidatorTester m_tester1;
+  CommandValidatorTester m_tester2;
+};
+
+BOOST_FIXTURE_TEST_CASE(TwoKeys, TwoValidatorFixture)
+{
+  shared_ptr<Interest> fibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
+  shared_ptr<Interest> statsCommand = make_shared<Interest>("/localhost/nfd/stats/dosomething");
+  shared_ptr<Interest> facesCommand = make_shared<Interest>("/localhost/nfd/faces/create");
+
+  ndn::CommandInterestGenerator generator;
+  generator.generateWithIdentity(*fibCommand, m_tester1.getIdentityName());
+  generator.generateWithIdentity(*statsCommand, m_tester1.getIdentityName());
+  generator.generateWithIdentity(*facesCommand, m_tester2.getIdentityName());
+
+  ConfigFile config;
+  CommandValidator validator;
+  validator.addSupportedPrivilege("faces");
+  validator.addSupportedPrivilege("fib");
+  validator.addSupportedPrivilege("stats");
+
+  validator.setConfigFile(config);
+
+  config.parse(CONFIG, false, CONFIG_PATH.native());
+
+  validator.validate(*fibCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+
+  BOOST_REQUIRE(m_tester1.commandValidated());
+  m_tester1.resetValidation();
+
+  validator.validate(*statsCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+
+  BOOST_REQUIRE(m_tester1.commandValidated());
+
+  validator.validate(*facesCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+
+  BOOST_REQUIRE(m_tester2.commandValidated());
+  m_tester2.resetValidation();
+
+  // use cert2 for fib command (authorized for cert1 only)
+  shared_ptr<Interest> unauthorizedFibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
+  generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
+
+  validator.validate(*unauthorizedFibCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+
+  BOOST_REQUIRE(m_tester2.commandValidationFailed());
+}
+
+BOOST_FIXTURE_TEST_CASE(TwoKeysDryRun, TwoValidatorFixture)
+{
+  CommandValidatorTester tester1;
+  tester1.generateIdentity("/test/CommandValidator/TwoKeys/id1");
+  tester1.saveIdentityToFile("tests/daemon/mgmt/cert1.ndncert");
+
+  CommandValidatorTester tester2;
+  tester2.generateIdentity("/test/CommandValidator/TwoKeys/id2");
+  tester2.saveIdentityToFile("tests/daemon/mgmt/cert2.ndncert");
+
+  shared_ptr<Interest> fibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
+  shared_ptr<Interest> statsCommand = make_shared<Interest>("/localhost/nfd/stats/dosomething");
+  shared_ptr<Interest> facesCommand = make_shared<Interest>("/localhost/nfd/faces/create");
+
+  ndn::CommandInterestGenerator generator;
+  generator.generateWithIdentity(*fibCommand, m_tester1.getIdentityName());
+  generator.generateWithIdentity(*statsCommand, m_tester1.getIdentityName());
+  generator.generateWithIdentity(*facesCommand, m_tester2.getIdentityName());
+
+  ConfigFile config;
+  CommandValidator validator;
+  validator.addSupportedPrivilege("faces");
+  validator.addSupportedPrivilege("fib");
+  validator.addSupportedPrivilege("stats");
+
+  validator.setConfigFile(config);
+
+  config.parse(CONFIG, true, CONFIG_PATH.native());
+
+  validator.validate(*fibCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+
+  BOOST_REQUIRE(m_tester1.commandValidationFailed());
+  m_tester1.resetValidation();
+
+  validator.validate(*statsCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+
+  BOOST_REQUIRE(m_tester1.commandValidationFailed());
+
+  validator.validate(*facesCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+
+  BOOST_REQUIRE(m_tester2.commandValidationFailed());
+  m_tester2.resetValidation();
+
+  // use cert2 for fib command (authorized for cert1 only)
+  shared_ptr<Interest> unauthorizedFibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
+  generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
+
+  validator.validate(*unauthorizedFibCommand,
+                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+
+  BOOST_REQUIRE(m_tester2.commandValidationFailed());
+}
+
+BOOST_AUTO_TEST_CASE(NoAuthorizeSections)
+{
+  const std::string NO_AUTHORIZE_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_THROW(config.parse(NO_AUTHORIZE_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(NoPrivilegesSections)
+{
+  const std::string NO_PRIVILEGES_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
+    "  }\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+
+  BOOST_CHECK_THROW(config.parse(NO_PRIVILEGES_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(InvalidCertfile)
+{
+  const std::string INVALID_CERT_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/notacertfile.ndncert\"\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_THROW(config.parse(INVALID_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(NoCertfile)
+{
+  const std::string NO_CERT_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_THROW(config.parse(NO_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(MalformedCert)
+{
+    const std::string MALFORMED_CERT_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_THROW(config.parse(MALFORMED_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
+}
+
+bool
+validateErrorMessage(const std::string& expectedMessage, const ConfigFile::Error& error)
+{
+  bool gotExpected = error.what() == expectedMessage;
+  if (!gotExpected)
+    {
+      NFD_LOG_WARN("\ncaught exception: " << error.what()
+                    << "\n\nexpected exception: " << expectedMessage);
+    }
+  return gotExpected;
+}
+
+BOOST_AUTO_TEST_CASE(NoAuthorizeSectionsDryRun)
+{
+  const std::string NO_AUTHORIZE_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_EXCEPTION(config.parse(NO_AUTHORIZE_CONFIG, true, CONFIG_PATH.native()),
+                        ConfigFile::Error,
+                        bind(&validateErrorMessage,
+                             "No authorize sections found", _1));
+}
+
+BOOST_FIXTURE_TEST_CASE(NoPrivilegesSectionsDryRun, TwoValidatorFixture)
+{
+  const std::string NO_PRIVILEGES_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
+    "  }\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/cert2.ndncert\"\n"
+    "  }\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+
+  std::stringstream expectedError;
+  expectedError << "No privileges section found for certificate file tests/daemon/mgmt/cert1.ndncert "
+                << "(" << m_tester1.getPublicKeyName().toUri() << ")\n"
+                << "No privileges section found for certificate file tests/daemon/mgmt/cert2.ndncert "
+                << "(" << m_tester2.getPublicKeyName().toUri() << ")";
+
+  BOOST_CHECK_EXCEPTION(config.parse(NO_PRIVILEGES_CONFIG, true, CONFIG_PATH.native()),
+                        ConfigFile::Error,
+                        bind(&validateErrorMessage, expectedError.str(), _1));
+}
+
+BOOST_AUTO_TEST_CASE(InvalidCertfileDryRun)
+{
+  using namespace boost::filesystem;
+
+  const std::string INVALID_KEY_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/notacertfile.ndncert\"\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/stillnotacertfile.ndncert\"\n"
+    "    privileges\n"
+    "    {\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+
+  std::stringstream error;
+  error << "Unable to open certificate file "
+        << absolute("tests/daemon/mgmt/notacertfile.ndncert").native() << "\n"
+        << "Unable to open certificate file "
+        << absolute("tests/daemon/mgmt/stillnotacertfile.ndncert").native();
+
+  BOOST_CHECK_EXCEPTION(config.parse(INVALID_KEY_CONFIG, true, CONFIG_PATH.native()),
+                        ConfigFile::Error,
+                        bind(&validateErrorMessage, error.str(), _1));
+}
+
+BOOST_AUTO_TEST_CASE(NoCertfileDryRun)
+{
+  const std::string NO_CERT_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "  authorize\n"
+    "  {\n"
+    "  }\n"
+    "}\n";
+
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+  BOOST_CHECK_EXCEPTION(config.parse(NO_CERT_CONFIG, true, CONFIG_PATH.native()),
+                        ConfigFile::Error,
+                        bind(&validateErrorMessage,
+                             "No certfile specified\n"
+                             "No certfile specified", _1));
+}
+
+BOOST_AUTO_TEST_CASE(MalformedCertDryRun)
+{
+  using namespace boost::filesystem;
+
+  const std::string MALFORMED_CERT_CONFIG =
+    "authorizations\n"
+    "{\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
+    "    privileges\n"
+    "    {\n"
+    "      fib\n"
+    "      stats\n"
+    "    }\n"
+    "  }\n"
+    "  authorize\n"
+    "  {\n"
+    "    certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
+    "  }\n"
+    "}\n";
+
+
+  ConfigFile config;
+  CommandValidator validator;
+
+  validator.setConfigFile(config);
+
+  std::stringstream error;
+  error << "Malformed certificate file "
+        << absolute("tests/daemon/mgmt/malformed.ndncert").native() << "\n"
+        << "Malformed certificate file "
+        << absolute("tests/daemon/mgmt/malformed.ndncert").native();
+
+  BOOST_CHECK_EXCEPTION(config.parse(MALFORMED_CERT_CONFIG, true, CONFIG_PATH.native()),
+                        ConfigFile::Error,
+                        bind(&validateErrorMessage, error.str(), _1));
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+
+} // namespace nfd
diff --git a/tests/daemon/mgmt/face-flags.cpp b/tests/daemon/mgmt/face-flags.cpp
new file mode 100644
index 0000000..0aa6c09
--- /dev/null
+++ b/tests/daemon/mgmt/face-flags.cpp
@@ -0,0 +1,65 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/face-flags.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFaceFlags, BaseFixture)
+
+template<typename DummyFaceBase>
+class DummyOnDemandFace : public DummyFaceBase
+{
+public:
+  DummyOnDemandFace()
+  {
+    this->setOnDemand(true);
+  }
+};
+
+BOOST_AUTO_TEST_CASE(Get)
+{
+  DummyFace face1;
+  BOOST_CHECK_EQUAL(getFaceFlags(face1), 0);
+
+  DummyLocalFace face2;
+  BOOST_CHECK_EQUAL(getFaceFlags(face2), static_cast<uint64_t>(ndn::nfd::FACE_IS_LOCAL));
+
+  DummyOnDemandFace<DummyFace> face3;
+  BOOST_CHECK_EQUAL(getFaceFlags(face3), static_cast<uint64_t>(ndn::nfd::FACE_IS_ON_DEMAND));
+
+  DummyOnDemandFace<DummyLocalFace> face4;
+  BOOST_CHECK_EQUAL(getFaceFlags(face4), static_cast<uint64_t>(ndn::nfd::FACE_IS_LOCAL |
+                                         ndn::nfd::FACE_IS_ON_DEMAND));
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
new file mode 100644
index 0000000..e799944
--- /dev/null
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -0,0 +1,1666 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/face-manager.hpp"
+#include "mgmt/internal-face.hpp"
+#include "mgmt/face-status-publisher.hpp"
+
+#include "face/face.hpp"
+#include "../face/dummy-face.hpp"
+#include "fw/face-table.hpp"
+#include "fw/forwarder.hpp"
+
+#include "common.hpp"
+#include "tests/test-common.hpp"
+#include "validation-common.hpp"
+#include "face-status-publisher-common.hpp"
+
+#include <ndn-cpp-dev/encoding/tlv.hpp>
+#include <ndn-cpp-dev/management/nfd-face-event-notification.hpp>
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("FaceManagerTest");
+
+class FaceManagerTestFace : public DummyFace
+{
+public:
+
+  FaceManagerTestFace()
+    : m_closeFired(false)
+  {
+
+  }
+
+  virtual
+  ~FaceManagerTestFace()
+  {
+
+  }
+
+  virtual void
+  close()
+  {
+    m_closeFired = true;
+  }
+
+  bool
+  didCloseFire() const
+  {
+    return m_closeFired;
+  }
+
+private:
+  bool m_closeFired;
+};
+
+class TestFaceTable : public FaceTable
+{
+public:
+  TestFaceTable(Forwarder& forwarder)
+    : FaceTable(forwarder),
+      m_addFired(false),
+      m_getFired(false),
+      m_dummy(make_shared<FaceManagerTestFace>())
+  {
+
+  }
+
+  virtual
+  ~TestFaceTable()
+  {
+
+  }
+
+  virtual void
+  add(shared_ptr<Face> face)
+  {
+    m_addFired = true;
+  }
+
+  virtual shared_ptr<Face>
+  get(FaceId id) const
+  {
+    m_getFired = true;
+    return m_dummy;
+  }
+
+  bool
+  didAddFire() const
+  {
+    return m_addFired;
+  }
+
+  bool
+  didGetFire() const
+  {
+    return m_getFired;
+  }
+
+  void
+  reset()
+  {
+    m_addFired = false;
+    m_getFired = false;
+  }
+
+  shared_ptr<FaceManagerTestFace>&
+  getDummyFace()
+  {
+    return m_dummy;
+  }
+
+private:
+  bool m_addFired;
+  mutable bool m_getFired;
+  shared_ptr<FaceManagerTestFace> m_dummy;
+};
+
+
+class TestFaceTableFixture : public BaseFixture
+{
+public:
+  TestFaceTableFixture()
+    : m_faceTable(m_forwarder)
+  {
+
+  }
+
+  virtual
+  ~TestFaceTableFixture()
+  {
+
+  }
+
+protected:
+  Forwarder m_forwarder;
+  TestFaceTable m_faceTable;
+};
+
+class TestFaceManagerCommon
+{
+public:
+  TestFaceManagerCommon()
+    : m_face(make_shared<InternalFace>()),
+      m_callbackFired(false)
+  {
+
+  }
+
+  virtual
+  ~TestFaceManagerCommon()
+  {
+
+  }
+
+  shared_ptr<InternalFace>&
+  getFace()
+  {
+    return m_face;
+  }
+
+  void
+  validateControlResponseCommon(const Data& response,
+                                const Name& expectedName,
+                                uint32_t expectedCode,
+                                const std::string& expectedText,
+                                ControlResponse& control)
+  {
+    m_callbackFired = true;
+    Block controlRaw = response.getContent().blockFromValue();
+
+    control.wireDecode(controlRaw);
+
+    // NFD_LOG_DEBUG("received control response"
+    //               << " Name: " << response.getName()
+    //               << " code: " << control.getCode()
+    //               << " text: " << control.getText());
+
+    BOOST_CHECK_EQUAL(response.getName(), expectedName);
+    BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
+    BOOST_CHECK_EQUAL(control.getText(), expectedText);
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    if (!control.getBody().empty())
+      {
+        BOOST_FAIL("found unexpected control response body");
+      }
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText,
+                          const Block& expectedBody)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    BOOST_REQUIRE(!control.getBody().empty());
+    BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
+
+    BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
+                       expectedBody.value_size()) == 0);
+
+  }
+
+  bool
+  didCallbackFire() const
+  {
+    return m_callbackFired;
+  }
+
+  void
+  resetCallbackFired()
+  {
+    m_callbackFired = false;
+  }
+
+protected:
+  shared_ptr<InternalFace> m_face;
+
+private:
+  bool m_callbackFired;
+};
+
+class FaceManagerFixture : public TestFaceTableFixture, public TestFaceManagerCommon
+{
+public:
+  FaceManagerFixture()
+    : m_manager(m_faceTable, m_face)
+  {
+    m_manager.setConfigFile(m_config);
+  }
+
+  virtual
+  ~FaceManagerFixture()
+  {
+
+  }
+
+  void
+  parseConfig(const std::string configuration, bool isDryRun)
+  {
+    m_config.parse(configuration, isDryRun, "dummy-config");
+  }
+
+  FaceManager&
+  getManager()
+  {
+    return m_manager;
+  }
+
+  void
+  addInterestRule(const std::string& regex,
+                  ndn::IdentityCertificate& certificate)
+  {
+    m_manager.addInterestRule(regex, certificate);
+  }
+
+  bool
+  didFaceTableAddFire() const
+  {
+    return m_faceTable.didAddFire();
+  }
+
+  bool
+  didFaceTableGetFire() const
+  {
+    return m_faceTable.didGetFire();
+  }
+
+  void
+  resetFaceTable()
+  {
+    m_faceTable.reset();
+  }
+
+private:
+  FaceManager m_manager;
+  ConfigFile m_config;
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFaceManager, FaceManagerFixture)
+
+bool
+isExpectedException(const ConfigFile::Error& error, const std::string& expectedMessage)
+{
+  if (error.what() != expectedMessage)
+    {
+      NFD_LOG_ERROR("expected: " << expectedMessage << "\tgot: " << error.what());
+    }
+  return error.what() == expectedMessage;
+}
+
+#ifdef HAVE_UNIX_SOCKETS
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUnix)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  unix\n"
+    "  {\n"
+    "    listen yes\n"
+    "    path /tmp/nfd.sock\n"
+    "  }\n"
+    "}\n";
+  BOOST_TEST_CHECKPOINT("Calling parse");
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUnixDryRun)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  unix\n"
+    "  {\n"
+    "    listen yes\n"
+    "    path /var/run/nfd.sock\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUnixBadListen)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  unix\n"
+    "  {\n"
+    "    listen hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"listen\" in \"unix\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUnixUnknownOption)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  unix\n"
+    "  {\n"
+    "    hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Unrecognized option \"hello\" in \"unix\" section"));
+}
+
+#endif // HAVE_UNIX_SOCKETS
+
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionTcp)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  tcp\n"
+    "  {\n"
+    "    listen yes\n"
+    "    port 6363\n"
+    "    enable_v4 yes\n"
+    "    enable_v6 yes\n"
+    "  }\n"
+    "}\n";
+  try
+    {
+      parseConfig(CONFIG, false);
+    }
+  catch (const std::runtime_error& e)
+    {
+      const std::string reason = e.what();
+      if (reason.find("Address in use") != std::string::npos)
+        {
+          BOOST_FAIL(reason);
+        }
+    }
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionTcpDryRun)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  tcp\n"
+    "  {\n"
+    "    listen yes\n"
+    "    port 6363\n"
+    "    enable_v4 yes\n"
+    "    enable_v6 yes\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionTcpBadListen)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  tcp\n"
+    "  {\n"
+    "    listen hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"listen\" in \"tcp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionTcpChannelsDisabled)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  tcp\n"
+    "  {\n"
+    "    port 6363\n"
+    "    enable_v4 no\n"
+    "    enable_v6 no\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "IPv4 and IPv6 channels have been disabled."
+                             " Remove \"tcp\" section to disable TCP channels or"
+                             " re-enable at least one channel type."));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionTcpUnknownOption)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  tcp\n"
+    "  {\n"
+    "    hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Unrecognized option \"hello\" in \"tcp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdp)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    port 6363\n"
+    "    enable_v4 yes\n"
+    "    enable_v6 yes\n"
+    "    idle_timeout 30\n"
+    "    keep_alive_interval 25\n"
+    "    mcast yes\n"
+    "    mcast_port 56363\n"
+    "    mcast_group 224.0.23.170\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpDryRun)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    port 6363\n"
+    "    idle_timeout 30\n"
+    "    keep_alive_interval 25\n"
+    "    mcast yes\n"
+    "    mcast_port 56363\n"
+    "    mcast_group 224.0.23.170\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadIdleTimeout)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    idle_timeout hello\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"idle_timeout\" in \"udp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcast)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    mcast hello\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"mcast\" in \"udp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcastGroup)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    mcast no\n"
+    "    mcast_port 50\n"
+    "    mcast_group hello\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"mcast_group\" in \"udp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcastGroupV6)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    mcast no\n"
+    "    mcast_port 50\n"
+    "    mcast_group ::1\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"mcast_group\" in \"udp\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpChannelsDisabled)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    port 6363\n"
+    "    enable_v4 no\n"
+    "    enable_v6 no\n"
+    "    idle_timeout 30\n"
+    "    keep_alive_interval 25\n"
+    "    mcast yes\n"
+    "    mcast_port 56363\n"
+    "    mcast_group 224.0.23.170\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "IPv4 and IPv6 channels have been disabled."
+                             " Remove \"udp\" section to disable UDP channels or"
+                             " re-enable at least one channel type."));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpConflictingMcast)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    port 6363\n"
+    "    enable_v4 no\n"
+    "    enable_v6 yes\n"
+    "    idle_timeout 30\n"
+    "    keep_alive_interval 25\n"
+    "    mcast yes\n"
+    "    mcast_port 56363\n"
+    "    mcast_group 224.0.23.170\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "IPv4 multicast requested, but IPv4 channels"
+                             " have been disabled (conflicting configuration options set)"));
+}
+
+
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionUdpUnknownOption)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  udp\n"
+    "  {\n"
+    "    hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Unrecognized option \"hello\" in \"udp\" section"));
+}
+
+#ifdef HAVE_LIBPCAP
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionEther)
+{
+
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast yes\n"
+    "    mcast_group 01:00:5E:00:17:AA\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionEtherDryRun)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast yes\n"
+    "    mcast_group 01:00:5E:00:17:AA\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionEtherBadMcast)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast hello\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"mcast\" in \"ether\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionEtherBadMcastGroup)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    mcast yes\n"
+    "    mcast_group\n"
+    "  }\n"
+    "}\n";
+
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Invalid value for option \"mcast_group\" in \"ether\" section"));
+}
+
+BOOST_AUTO_TEST_CASE(TestProcessSectionEtherUnknownOption)
+{
+  const std::string CONFIG =
+    "face_system\n"
+    "{\n"
+    "  ether\n"
+    "  {\n"
+    "    hello\n"
+    "  }\n"
+    "}\n";
+  BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
+                        bind(&isExpectedException, _1,
+                             "Unrecognized option \"hello\" in \"ether\" section"));
+}
+
+#endif
+
+BOOST_AUTO_TEST_CASE(TestFireInterestFilter)
+{
+  shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/faces"));
+
+  getFace()->onReceiveData +=
+    bind(&FaceManagerFixture::validateControlResponse, this,  _1,
+         command->getName(), 400, "Malformed command");
+
+  getFace()->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(MalformedCommmand)
+{
+  shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/faces"));
+
+  getFace()->onReceiveData +=
+    bind(&FaceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onFaceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(UnsignedCommand)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  getFace()->onReceiveData +=
+    bind(&FaceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 401, "Signature required");
+
+  getManager().onFaceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand, UnauthorizedCommandFixture<FaceManagerFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 403, "Unauthorized command");
+
+  getManager().onFaceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+template <typename T> class AuthorizedCommandFixture : public CommandFixture<T>
+{
+public:
+  AuthorizedCommandFixture()
+  {
+    const std::string regex = "^<localhost><nfd><faces>";
+    T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
+  }
+
+  virtual
+  ~AuthorizedCommandFixture()
+  {
+
+  }
+};
+
+BOOST_FIXTURE_TEST_CASE(UnsupportedCommand, AuthorizedCommandFixture<FaceManagerFixture>)
+{
+  ControlParameters parameters;
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("unsupported");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 501, "Unsupported command");
+
+  getManager().onFaceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+class ValidatedFaceRequestFixture : public TestFaceTableFixture,
+                                    public TestFaceManagerCommon,
+                                    public FaceManager
+{
+public:
+
+  ValidatedFaceRequestFixture()
+    : FaceManager(TestFaceTableFixture::m_faceTable, TestFaceManagerCommon::m_face),
+      m_createFaceFired(false),
+      m_destroyFaceFired(false)
+  {
+
+  }
+
+  virtual void
+  createFace(const Interest& request,
+             ControlParameters& parameters)
+  {
+    m_createFaceFired = true;
+  }
+
+  virtual void
+  destroyFace(const Interest& request,
+              ControlParameters& parameters)
+  {
+    m_destroyFaceFired = true;
+  }
+
+  virtual
+  ~ValidatedFaceRequestFixture()
+  {
+
+  }
+
+  bool
+  didCreateFaceFire() const
+  {
+    return m_createFaceFired;
+  }
+
+  bool
+  didDestroyFaceFire() const
+  {
+    return m_destroyFaceFired;
+  }
+
+private:
+  bool m_createFaceFired;
+  bool m_destroyFaceFired;
+};
+
+BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestBadOptionParse,
+                        AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
+{
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append("NotReallyParameters");
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&ValidatedFaceRequestFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  onValidatedFaceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestCreateFace,
+                        AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  onValidatedFaceRequest(command);
+  BOOST_CHECK(didCreateFaceFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestDestroyFace,
+                        AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("destroy");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  onValidatedFaceRequest(command);
+  BOOST_CHECK(didDestroyFaceFire());
+}
+
+class FaceTableFixture
+{
+public:
+  FaceTableFixture()
+    : m_faceTable(m_forwarder)
+  {
+  }
+
+  virtual
+  ~FaceTableFixture()
+  {
+  }
+
+protected:
+  Forwarder m_forwarder;
+  FaceTable m_faceTable;
+};
+
+class LocalControlFixture : public FaceTableFixture,
+                            public TestFaceManagerCommon,
+                            public FaceManager
+{
+public:
+  LocalControlFixture()
+    : FaceManager(FaceTableFixture::m_faceTable, TestFaceManagerCommon::m_face)
+  {
+  }
+};
+
+BOOST_FIXTURE_TEST_CASE(LocalControlInFaceId,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
+  BOOST_REQUIRE(dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 200, "Success", encodedParameters);
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 200, "Success", encodedParameters);
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlInFaceIdFaceNotFound,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
+  BOOST_REQUIRE(dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId() + 100);
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 410, "Face not found");
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId() + 100);
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 410, "Face not found");
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlMissingFeature,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
+  BOOST_REQUIRE(dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 400, "Malformed command");
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 400, "Malformed command");
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlInFaceIdNonLocal,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<DummyFace> dummy = make_shared<DummyFace>();
+  BOOST_REQUIRE(!dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 412, "Face is non-local");
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(enable));
+  disableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 412, "Face is non-local");
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceId,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
+  BOOST_REQUIRE(dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 200, "Success", encodedParameters);
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 200, "Success", encodedParameters);
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceIdFaceNotFound,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
+  BOOST_REQUIRE(dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId() + 100);
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 410, "Face not found");
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId() + 100);
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 410, "Face not found");
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+  BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
+}
+
+BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceIdNonLocal,
+                        AuthorizedCommandFixture<LocalControlFixture>)
+{
+  shared_ptr<DummyFace> dummy = make_shared<DummyFace>();
+  BOOST_REQUIRE(!dummy->isLocal());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name enable("/localhost/nfd/faces/enable-local-control");
+  enable.append(encodedParameters);
+
+  shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
+  enableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*enableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         enableCommand->getName(), 412, "Face is non-local");
+
+  onValidatedFaceRequest(enableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+
+  TestFaceManagerCommon::m_face->onReceiveData.clear();
+  resetCallbackFired();
+
+  Name disable("/localhost/nfd/faces/disable-local-control");
+  disable.append(encodedParameters);
+
+  shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
+  disableCommand->setIncomingFaceId(dummy->getId());
+
+  generateCommand(*disableCommand);
+
+  TestFaceManagerCommon::m_face->onReceiveData +=
+    bind(&LocalControlFixture::validateControlResponse, this, _1,
+         disableCommand->getName(), 412, "Face is non-local");
+
+  onValidatedFaceRequest(disableCommand);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+class FaceFixture : public FaceTableFixture,
+                    public TestFaceManagerCommon,
+                    public FaceManager
+{
+public:
+  FaceFixture()
+    : FaceManager(FaceTableFixture::m_faceTable,
+                  TestFaceManagerCommon::m_face)
+    , m_receivedNotification(false)
+  {
+
+  }
+
+  virtual
+  ~FaceFixture()
+  {
+
+  }
+
+  void
+  callbackDispatch(const Data& response,
+                   const Name& expectedName,
+                   uint32_t expectedCode,
+                   const std::string& expectedText,
+                   const Block& expectedBody,
+                   const ndn::nfd::FaceEventNotification& expectedFaceEvent)
+  {
+    Block payload = response.getContent().blockFromValue();
+    if (payload.type() == ndn::tlv::nfd::ControlResponse)
+      {
+        validateControlResponse(response, expectedName, expectedCode,
+                                expectedText, expectedBody);
+      }
+    else if (payload.type() == ndn::tlv::nfd::FaceEventNotification)
+      {
+        validateFaceEvent(payload, expectedFaceEvent);
+      }
+    else
+      {
+        BOOST_FAIL("Received unknown message type: #" << payload.type());
+      }
+  }
+
+  void
+  callbackDispatch(const Data& response,
+                   const Name& expectedName,
+                   uint32_t expectedCode,
+                   const std::string& expectedText,
+                   const ndn::nfd::FaceEventNotification& expectedFaceEvent)
+  {
+    Block payload = response.getContent().blockFromValue();
+    if (payload.type() == ndn::tlv::nfd::ControlResponse)
+      {
+        validateControlResponse(response, expectedName,
+                                expectedCode, expectedText);
+      }
+    else if (payload.type() == ndn::tlv::nfd::FaceEventNotification)
+      {
+        validateFaceEvent(payload, expectedFaceEvent);
+      }
+    else
+      {
+        BOOST_FAIL("Received unknown message type: #" << payload.type());
+      }
+  }
+
+  void
+  validateFaceEvent(const Block& wire,
+                    const ndn::nfd::FaceEventNotification& expectedFaceEvent)
+  {
+
+    m_receivedNotification = true;
+
+    ndn::nfd::FaceEventNotification notification(wire);
+
+    BOOST_CHECK_EQUAL(notification.getKind(), expectedFaceEvent.getKind());
+    BOOST_CHECK_EQUAL(notification.getFaceId(), expectedFaceEvent.getFaceId());
+    BOOST_CHECK_EQUAL(notification.getRemoteUri(), expectedFaceEvent.getRemoteUri());
+    BOOST_CHECK_EQUAL(notification.getLocalUri(), expectedFaceEvent.getLocalUri());
+  }
+
+  bool
+  didReceiveNotication() const
+  {
+    return m_receivedNotification;
+  }
+
+protected:
+  bool m_receivedNotification;
+};
+
+BOOST_FIXTURE_TEST_CASE(CreateFaceBadUri, AuthorizedCommandFixture<FaceFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp:/127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  createFace(*command, parameters);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(CreateFaceMissingUri, AuthorizedCommandFixture<FaceFixture>)
+{
+  ControlParameters parameters;
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  createFace(*command, parameters);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(CreateFaceUnknownScheme, AuthorizedCommandFixture<FaceFixture>)
+{
+  ControlParameters parameters;
+  // this will be an unsupported protocol because no factories have been
+  // added to the face manager
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::validateControlResponse, this, _1,
+         command->getName(), 501, "Unsupported protocol");
+
+  createFace(*command, parameters);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(OnCreated, AuthorizedCommandFixture<FaceFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  ControlParameters resultParameters;
+  resultParameters.setUri("tcp://127.0.0.1");
+  resultParameters.setFaceId(1);
+
+  shared_ptr<DummyFace> dummy(make_shared<DummyFace>());
+
+  ndn::nfd::FaceEventNotification expectedFaceEvent;
+  expectedFaceEvent.setKind(ndn::nfd::FACE_EVENT_CREATED)
+                   .setFaceId(1)
+                   .setRemoteUri(dummy->getRemoteUri().toString())
+                   .setLocalUri(dummy->getLocalUri().toString())
+                   .setFlags(0);
+
+  Block encodedResultParameters(resultParameters.wireEncode());
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::callbackDispatch, this, _1,
+         command->getName(), 200, "Success",
+         encodedResultParameters, expectedFaceEvent);
+
+  onCreated(command->getName(), parameters, dummy);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(didReceiveNotication());
+}
+
+BOOST_FIXTURE_TEST_CASE(OnConnectFailed, AuthorizedCommandFixture<FaceFixture>)
+{
+  ControlParameters parameters;
+  parameters.setUri("tcp://127.0.0.1");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("create");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::validateControlResponse, this, _1,
+         command->getName(), 408, "unit-test-reason");
+
+  onConnectFailed(command->getName(), "unit-test-reason");
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_CHECK_EQUAL(didReceiveNotication(), false);
+}
+
+
+BOOST_FIXTURE_TEST_CASE(DestroyFace, AuthorizedCommandFixture<FaceFixture>)
+{
+  shared_ptr<DummyFace> dummy(make_shared<DummyFace>());
+  FaceTableFixture::m_faceTable.add(dummy);
+
+  ControlParameters parameters;
+  parameters.setFaceId(dummy->getId());
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/faces");
+  commandName.append("destroy");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  ndn::nfd::FaceEventNotification expectedFaceEvent;
+  expectedFaceEvent.setKind(ndn::nfd::FACE_EVENT_DESTROYED)
+                   .setFaceId(dummy->getId())
+                   .setRemoteUri(dummy->getRemoteUri().toString())
+                   .setLocalUri(dummy->getLocalUri().toString())
+                   .setFlags(0);
+
+  getFace()->onReceiveData +=
+    bind(&FaceFixture::callbackDispatch, this, _1,
+         command->getName(), 200, "Success", boost::ref(encodedParameters), expectedFaceEvent);
+
+  destroyFace(*command, parameters);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(didReceiveNotication());
+}
+
+class FaceListFixture : public FaceStatusPublisherFixture
+{
+public:
+  FaceListFixture()
+    : m_manager(m_table, m_face)
+  {
+
+  }
+
+  virtual
+  ~FaceListFixture()
+  {
+
+  }
+
+protected:
+  FaceManager m_manager;
+};
+
+BOOST_FIXTURE_TEST_CASE(TestFaceList, FaceListFixture)
+
+{
+  Name commandName("/localhost/nfd/faces/list");
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  // MAX_SEGMENT_SIZE == 4400, FaceStatus size with filler counters is 55
+  // 55 divides 4400 (== 80), so only use 79 FaceStatuses and then two smaller ones
+  // to force a FaceStatus to span Data packets
+  for (int i = 0; i < 79; i++)
+    {
+      shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
+
+      uint64_t filler = std::numeric_limits<uint64_t>::max() - 1;
+      dummy->setCounters(filler, filler, filler, filler);
+
+      m_referenceFaces.push_back(dummy);
+
+      add(dummy);
+    }
+
+  for (int i = 0; i < 2; i++)
+    {
+      shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
+      uint64_t filler = std::numeric_limits<uint32_t>::max() - 1;
+      dummy->setCounters(filler, filler, filler, filler);
+
+      m_referenceFaces.push_back(dummy);
+
+      add(dummy);
+    }
+
+  ndn::EncodingBuffer buffer;
+
+  m_face->onReceiveData +=
+    bind(&FaceStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
+
+  m_manager.listFaces(*command);
+  BOOST_REQUIRE(m_finished);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/face-status-publisher-common.hpp b/tests/daemon/mgmt/face-status-publisher-common.hpp
new file mode 100644
index 0000000..11ed191
--- /dev/null
+++ b/tests/daemon/mgmt/face-status-publisher-common.hpp
@@ -0,0 +1,192 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
+#define NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
+
+#include "mgmt/face-status-publisher.hpp"
+#include "mgmt/app-face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "mgmt/face-flags.hpp"
+#include "fw/forwarder.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include <ndn-cpp-dev/management/nfd-face-status.hpp>
+
+namespace nfd {
+namespace tests {
+
+class TestCountersFace : public DummyFace
+{
+public:
+
+  TestCountersFace()
+  {
+  }
+
+  virtual
+  ~TestCountersFace()
+  {
+  }
+
+  void
+  setCounters(FaceCounter nInInterests,
+              FaceCounter nInDatas,
+              FaceCounter nOutInterests,
+              FaceCounter nOutDatas)
+  {
+    FaceCounters& counters = getMutableCounters();
+    counters.getNInInterests()  = nInInterests;
+    counters.getNInDatas()      = nInDatas;
+    counters.getNOutInterests() = nOutInterests;
+    counters.getNOutDatas()     = nOutDatas;
+  }
+
+
+};
+
+static inline uint64_t
+readNonNegativeIntegerType(const Block& block,
+                           uint32_t type)
+{
+  if (block.type() == type)
+    {
+      return readNonNegativeInteger(block);
+    }
+  std::stringstream error;
+  error << "expected type " << type << " got " << block.type();
+  throw ndn::Tlv::Error(error.str());
+}
+
+static inline uint64_t
+checkedReadNonNegativeIntegerType(Block::element_const_iterator& i,
+                                  Block::element_const_iterator end,
+                                  uint32_t type)
+{
+  if (i != end)
+    {
+      const Block& block = *i;
+      ++i;
+      return readNonNegativeIntegerType(block, type);
+    }
+  throw ndn::Tlv::Error("Unexpected end of FaceStatus");
+}
+
+class FaceStatusPublisherFixture : public BaseFixture
+{
+public:
+
+  FaceStatusPublisherFixture()
+    : m_table(m_forwarder)
+    , m_face(make_shared<InternalFace>())
+    , m_publisher(m_table, m_face, "/localhost/nfd/FaceStatusPublisherFixture")
+    , m_finished(false)
+  {
+
+  }
+
+  virtual
+  ~FaceStatusPublisherFixture()
+  {
+
+  }
+
+  void
+  add(shared_ptr<Face> face)
+  {
+    m_table.add(face);
+  }
+
+  void
+  validateFaceStatus(const Block& statusBlock, const shared_ptr<Face>& reference)
+  {
+    ndn::nfd::FaceStatus status;
+    BOOST_REQUIRE_NO_THROW(status.wireDecode(statusBlock));
+    const FaceCounters& counters = reference->getCounters();
+
+    BOOST_CHECK_EQUAL(status.getFaceId(), reference->getId());
+    BOOST_CHECK_EQUAL(status.getRemoteUri(), reference->getRemoteUri().toString());
+    BOOST_CHECK_EQUAL(status.getLocalUri(), reference->getLocalUri().toString());
+    BOOST_CHECK_EQUAL(status.getFlags(), getFaceFlags(*reference));
+    BOOST_CHECK_EQUAL(status.getNInInterests(), counters.getNInInterests());
+    BOOST_CHECK_EQUAL(status.getNInDatas(), counters.getNInDatas());
+    BOOST_CHECK_EQUAL(status.getNOutInterests(), counters.getNOutInterests());
+    BOOST_CHECK_EQUAL(status.getNOutDatas(), counters.getNOutDatas());
+  }
+
+  void
+  decodeFaceStatusBlock(const Data& data)
+  {
+    Block payload = data.getContent();
+
+    m_buffer.appendByteArray(payload.value(), payload.value_size());
+
+    BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
+    if (data.getFinalBlockId() != data.getName()[-1])
+      {
+        return;
+      }
+
+    // wrap the Face Statuses in a single Content TLV for easy parsing
+    m_buffer.prependVarNumber(m_buffer.size());
+    m_buffer.prependVarNumber(ndn::Tlv::Content);
+
+    ndn::Block parser(m_buffer.buf(), m_buffer.size());
+    parser.parse();
+
+    BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceFaces.size());
+
+    std::list<shared_ptr<Face> >::const_iterator iReference = m_referenceFaces.begin();
+    for (Block::element_const_iterator i = parser.elements_begin();
+         i != parser.elements_end();
+         ++i)
+      {
+        if (i->type() != ndn::tlv::nfd::FaceStatus)
+          {
+            BOOST_FAIL("expected face status, got type #" << i->type());
+          }
+        validateFaceStatus(*i, *iReference);
+        ++iReference;
+      }
+    m_finished = true;
+  }
+
+protected:
+  Forwarder m_forwarder;
+  FaceTable m_table;
+  shared_ptr<InternalFace> m_face;
+  FaceStatusPublisher m_publisher;
+  ndn::EncodingBuffer m_buffer;
+  std::list<shared_ptr<Face> > m_referenceFaces;
+
+protected:
+  bool m_finished;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
diff --git a/tests/daemon/mgmt/face-status-publisher.cpp b/tests/daemon/mgmt/face-status-publisher.cpp
new file mode 100644
index 0000000..836ea2d
--- /dev/null
+++ b/tests/daemon/mgmt/face-status-publisher.cpp
@@ -0,0 +1,77 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-status-publisher-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("FaceStatusPublisherTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFaceSatusPublisher, FaceStatusPublisherFixture)
+
+BOOST_AUTO_TEST_CASE(EncodingDecoding)
+{
+  Name commandName("/localhost/nfd/faces/list");
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  // MAX_SEGMENT_SIZE == 4400, FaceStatus size with filler counters is 55
+  // 55 divides 4400 (== 80), so only use 79 FaceStatuses and then two smaller ones
+  // to force a FaceStatus to span Data packets
+  for (int i = 0; i < 79; i++)
+    {
+      shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
+
+      uint64_t filler = std::numeric_limits<uint64_t>::max() - 1;
+      dummy->setCounters(filler, filler, filler, filler);
+
+      m_referenceFaces.push_back(dummy);
+
+      add(dummy);
+    }
+
+  for (int i = 0; i < 2; i++)
+    {
+      shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
+      uint64_t filler = std::numeric_limits<uint32_t>::max() - 1;
+      dummy->setCounters(filler, filler, filler, filler);
+
+      m_referenceFaces.push_back(dummy);
+
+      add(dummy);
+    }
+
+  ndn::EncodingBuffer buffer;
+
+  m_face->onReceiveData +=
+    bind(&FaceStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
+
+  m_publisher.publish();
+  BOOST_REQUIRE(m_finished);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
new file mode 100644
index 0000000..6befe54
--- /dev/null
+++ b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
@@ -0,0 +1,219 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
+#define NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
+
+#include "mgmt/fib-enumeration-publisher.hpp"
+
+#include "mgmt/app-face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "table/fib.hpp"
+#include "table/name-tree.hpp"
+
+#include "tests/test-common.hpp"
+#include "../face/dummy-face.hpp"
+
+#include <ndn-cpp-dev/encoding/tlv.hpp>
+
+namespace nfd {
+namespace tests {
+
+static inline uint64_t
+readNonNegativeIntegerType(const Block& block,
+                           uint32_t type)
+{
+  if (block.type() == type)
+    {
+      return readNonNegativeInteger(block);
+    }
+  std::stringstream error;
+  error << "Expected type " << type << " got " << block.type();
+  throw ndn::Tlv::Error(error.str());
+}
+
+static inline uint64_t
+checkedReadNonNegativeIntegerType(Block::element_const_iterator& i,
+                                  Block::element_const_iterator end,
+                                  uint32_t type)
+{
+  if (i != end)
+    {
+      const Block& block = *i;
+      ++i;
+      return readNonNegativeIntegerType(block, type);
+    }
+  std::stringstream error;
+  error << "Unexpected end of Block while attempting to read type #"
+        << type;
+  throw ndn::Tlv::Error(error.str());
+}
+
+class FibEnumerationPublisherFixture : public BaseFixture
+{
+public:
+
+  FibEnumerationPublisherFixture()
+    : m_fib(m_nameTree)
+    , m_face(make_shared<InternalFace>())
+    , m_publisher(m_fib, m_face, "/localhost/nfd/FibEnumerationPublisherFixture")
+    , m_finished(false)
+  {
+  }
+
+  virtual
+  ~FibEnumerationPublisherFixture()
+  {
+  }
+
+  bool
+  hasNextHopWithCost(const fib::NextHopList& nextHops,
+                     FaceId faceId,
+                     uint64_t cost)
+  {
+    for (fib::NextHopList::const_iterator i = nextHops.begin();
+         i != nextHops.end();
+         ++i)
+      {
+        if (i->getFace()->getId() == faceId && i->getCost() == cost)
+          {
+            return true;
+          }
+      }
+    return false;
+  }
+
+  bool
+  entryHasPrefix(const shared_ptr<fib::Entry> entry, const Name& prefix)
+  {
+    return entry->getPrefix() == prefix;
+  }
+
+  void
+  validateFibEntry(const Block& entry)
+  {
+    entry.parse();
+
+    Block::element_const_iterator i = entry.elements_begin();
+    BOOST_REQUIRE(i != entry.elements_end());
+
+
+    BOOST_REQUIRE(i->type() == ndn::Tlv::Name);
+    Name prefix(*i);
+    ++i;
+
+    std::set<shared_ptr<fib::Entry> >::const_iterator referenceIter =
+      std::find_if(m_referenceEntries.begin(), m_referenceEntries.end(),
+                   boost::bind(&FibEnumerationPublisherFixture::entryHasPrefix,
+                               this, _1, prefix));
+
+    BOOST_REQUIRE(referenceIter != m_referenceEntries.end());
+
+    const shared_ptr<fib::Entry>& reference = *referenceIter;
+    BOOST_REQUIRE_EQUAL(prefix, reference->getPrefix());
+
+    // 0 or more next hop records
+    size_t nRecords = 0;
+    const fib::NextHopList& referenceNextHops = reference->getNextHops();
+    for (; i != entry.elements_end(); ++i)
+      {
+        const ndn::Block& nextHopRecord = *i;
+        BOOST_REQUIRE(nextHopRecord.type() == ndn::tlv::nfd::NextHopRecord);
+        nextHopRecord.parse();
+
+        Block::element_const_iterator j = nextHopRecord.elements_begin();
+
+        FaceId faceId =
+          checkedReadNonNegativeIntegerType(j,
+                                            entry.elements_end(),
+                                            ndn::tlv::nfd::FaceId);
+
+        uint64_t cost =
+          checkedReadNonNegativeIntegerType(j,
+                                            entry.elements_end(),
+                                            ndn::tlv::nfd::Cost);
+
+        BOOST_REQUIRE(hasNextHopWithCost(referenceNextHops, faceId, cost));
+
+        BOOST_REQUIRE(j == nextHopRecord.elements_end());
+        nRecords++;
+      }
+    BOOST_REQUIRE_EQUAL(nRecords, referenceNextHops.size());
+
+    BOOST_REQUIRE(i == entry.elements_end());
+    m_referenceEntries.erase(referenceIter);
+  }
+
+  void
+  decodeFibEntryBlock(const Data& data)
+  {
+    Block payload = data.getContent();
+
+    m_buffer.appendByteArray(payload.value(), payload.value_size());
+
+    BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
+    if (data.getFinalBlockId() != data.getName()[-1])
+      {
+        return;
+      }
+
+    // wrap the FIB Entry blocks in a single Content TLV for easy parsing
+    m_buffer.prependVarNumber(m_buffer.size());
+    m_buffer.prependVarNumber(ndn::Tlv::Content);
+
+    ndn::Block parser(m_buffer.buf(), m_buffer.size());
+    parser.parse();
+
+    BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceEntries.size());
+
+    for (Block::element_const_iterator i = parser.elements_begin();
+         i != parser.elements_end();
+         ++i)
+      {
+        if (i->type() != ndn::tlv::nfd::FibEntry)
+          {
+            BOOST_FAIL("expected fib entry, got type #" << i->type());
+          }
+
+        validateFibEntry(*i);
+      }
+    m_finished = true;
+  }
+
+protected:
+  NameTree m_nameTree;
+  Fib m_fib;
+  shared_ptr<InternalFace> m_face;
+  FibEnumerationPublisher m_publisher;
+  ndn::EncodingBuffer m_buffer;
+  std::set<shared_ptr<fib::Entry> > m_referenceEntries;
+
+protected:
+  bool m_finished;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher.cpp b/tests/daemon/mgmt/fib-enumeration-publisher.cpp
new file mode 100644
index 0000000..725d51e
--- /dev/null
+++ b/tests/daemon/mgmt/fib-enumeration-publisher.cpp
@@ -0,0 +1,89 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/fib-enumeration-publisher.hpp"
+
+#include "mgmt/app-face.hpp"
+#include "mgmt/internal-face.hpp"
+
+#include "tests/test-common.hpp"
+#include "../face/dummy-face.hpp"
+
+#include "fib-enumeration-publisher-common.hpp"
+
+#include <ndn-cpp-dev/encoding/tlv.hpp>
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("TestFibEnumerationPublisher");
+
+
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFibEnumeration, FibEnumerationPublisherFixture)
+
+BOOST_AUTO_TEST_CASE(TestFibEnumerationPublisher)
+{
+  for (int i = 0; i < 87; i++)
+    {
+      Name prefix("/test");
+      prefix.appendSegment(i);
+
+      shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
+      shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
+
+      shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
+      entry->addNextHop(dummy1, std::numeric_limits<uint64_t>::max() - 1);
+      entry->addNextHop(dummy2, std::numeric_limits<uint64_t>::max() - 2);
+
+      m_referenceEntries.insert(entry);
+    }
+  for (int i = 0; i < 2; i++)
+    {
+      Name prefix("/test2");
+      prefix.appendSegment(i);
+
+      shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
+      shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
+
+      shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
+      entry->addNextHop(dummy1, std::numeric_limits<uint8_t>::max() - 1);
+      entry->addNextHop(dummy2, std::numeric_limits<uint8_t>::max() - 2);
+
+      m_referenceEntries.insert(entry);
+    }
+
+  ndn::EncodingBuffer buffer;
+
+  m_face->onReceiveData +=
+    bind(&FibEnumerationPublisherFixture::decodeFibEntryBlock, this, _1);
+
+  m_publisher.publish();
+  BOOST_REQUIRE(m_finished);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/fib-manager.cpp b/tests/daemon/mgmt/fib-manager.cpp
new file mode 100644
index 0000000..b38c3b8
--- /dev/null
+++ b/tests/daemon/mgmt/fib-manager.cpp
@@ -0,0 +1,920 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/fib-manager.hpp"
+#include "table/fib.hpp"
+#include "table/fib-nexthop.hpp"
+#include "face/face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "validation-common.hpp"
+#include "tests/test-common.hpp"
+
+#include "fib-enumeration-publisher-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("FibManagerTest");
+
+class FibManagerFixture : public FibEnumerationPublisherFixture
+{
+public:
+
+  virtual
+  ~FibManagerFixture()
+  {
+  }
+
+  shared_ptr<Face>
+  getFace(FaceId id)
+  {
+    if (id > 0 && static_cast<size_t>(id) <= m_faces.size())
+      {
+        return m_faces[id - 1];
+      }
+    NFD_LOG_DEBUG("No face found returning NULL");
+    return shared_ptr<DummyFace>();
+  }
+
+  void
+  addFace(shared_ptr<Face> face)
+  {
+    m_faces.push_back(face);
+  }
+
+  void
+  validateControlResponseCommon(const Data& response,
+                                const Name& expectedName,
+                                uint32_t expectedCode,
+                                const std::string& expectedText,
+                                ControlResponse& control)
+  {
+    m_callbackFired = true;
+    Block controlRaw = response.getContent().blockFromValue();
+
+    control.wireDecode(controlRaw);
+
+    // NFD_LOG_DEBUG("received control response"
+    //               << " Name: " << response.getName()
+    //               << " code: " << control.getCode()
+    //               << " text: " << control.getText());
+
+    BOOST_CHECK_EQUAL(response.getName(), expectedName);
+    BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
+    BOOST_CHECK_EQUAL(control.getText(), expectedText);
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    if (!control.getBody().empty())
+      {
+        BOOST_FAIL("found unexpected control response body");
+      }
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText,
+                          const Block& expectedBody)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    BOOST_REQUIRE(!control.getBody().empty());
+    BOOST_REQUIRE_EQUAL(control.getBody().value_size(), expectedBody.value_size());
+
+    BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
+                       expectedBody.value_size()) == 0);
+
+  }
+
+  bool
+  didCallbackFire()
+  {
+    return m_callbackFired;
+  }
+
+  void
+  resetCallbackFired()
+  {
+    m_callbackFired = false;
+  }
+
+  shared_ptr<InternalFace>
+  getInternalFace()
+  {
+    return m_face;
+  }
+
+  FibManager&
+  getFibManager()
+  {
+    return m_manager;
+  }
+
+  Fib&
+  getFib()
+  {
+    return m_fib;
+  }
+
+  void
+  addInterestRule(const std::string& regex,
+                  ndn::IdentityCertificate& certificate)
+  {
+    m_manager.addInterestRule(regex, certificate);
+  }
+
+protected:
+    FibManagerFixture()
+      : m_manager(boost::ref(m_fib),
+                  bind(&FibManagerFixture::getFace, this, _1),
+                  m_face)
+    , m_callbackFired(false)
+  {
+  }
+
+protected:
+  FibManager m_manager;
+
+  std::vector<shared_ptr<Face> > m_faces;
+  bool m_callbackFired;
+};
+
+template <typename T> class AuthorizedCommandFixture:
+    public CommandFixture<T>
+{
+public:
+  AuthorizedCommandFixture()
+  {
+    const std::string regex = "^<localhost><nfd><fib>";
+    T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
+  }
+
+  virtual
+  ~AuthorizedCommandFixture()
+  {
+  }
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFibManager, AuthorizedCommandFixture<FibManagerFixture>)
+
+bool
+foundNextHop(FaceId id, uint32_t cost, const fib::NextHop& next)
+{
+  return id == next.getFace()->getId() && next.getCost() == cost;
+}
+
+bool
+addedNextHopWithCost(const Fib& fib, const Name& prefix, size_t oldSize, uint32_t cost)
+{
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
+
+  if (static_cast<bool>(entry))
+    {
+      const fib::NextHopList& hops = entry->getNextHops();
+      return hops.size() == oldSize + 1 &&
+        std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) != hops.end();
+    }
+  return false;
+}
+
+bool
+foundNextHopWithFace(FaceId id, uint32_t cost,
+                     shared_ptr<Face> face, const fib::NextHop& next)
+{
+  return id == next.getFace()->getId() && next.getCost() == cost && face == next.getFace();
+}
+
+bool
+addedNextHopWithFace(const Fib& fib, const Name& prefix, size_t oldSize,
+                     uint32_t cost, shared_ptr<Face> face)
+{
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
+
+  if (static_cast<bool>(entry))
+    {
+      const fib::NextHopList& hops = entry->getNextHops();
+      return hops.size() == oldSize + 1 &&
+        std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) != hops.end();
+    }
+  return false;
+}
+
+BOOST_AUTO_TEST_CASE(TestFireInterestFilter)
+{
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  shared_ptr<Interest> command = makeInterest("/localhost/nfd/fib");
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this,  _1,
+         command->getName(), 400, "Malformed command");
+
+  face->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(MalformedCommmand)
+{
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  BOOST_REQUIRE(didCallbackFire() == false);
+
+  Interest command("/localhost/nfd/fib");
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command.getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(UnsupportedVerb)
+{
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+  parameters.setCost(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("unsupported");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 501, "Unsupported command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(UnsignedCommand)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+  parameters.setCost(101);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  Interest command(commandName);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse,
+         this, _1, command.getName(), 401, "Signature required");
+
+
+  getFibManager().onFibRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!addedNextHopWithCost(getFib(), "/hello", 0, 101));
+}
+
+BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand, UnauthorizedCommandFixture<FibManagerFixture>)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+  parameters.setCost(101);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse,
+         this, _1, command->getName(), 403, "Unauthorized command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(!addedNextHopWithCost(getFib(), "/hello", 0, 101));
+}
+
+BOOST_AUTO_TEST_CASE(BadOptionParse)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append("NotReallyParameters");
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(UnknownFaceId)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1000);
+  parameters.setCost(101);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 410, "Face not found");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 101) == false);
+}
+
+BOOST_AUTO_TEST_CASE(TestImplicitFaceId)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(0);
+  parameters.setCost(101);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  ControlParameters expectedParameters;
+  expectedParameters.setName("/hello");
+  expectedParameters.setFaceId(1);
+  expectedParameters.setCost(101);
+
+  Block encodedExpectedParameters(expectedParameters.wireEncode());
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  command->setIncomingFaceId(1);
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedExpectedParameters);
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(addedNextHopWithFace(getFib(), "/hello", 0, 101, getFace(1)));
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbInitialAdd)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+  parameters.setCost(101);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 101));
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbImplicitCost)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  ControlParameters resultParameters;
+  resultParameters.setName("/hello");
+  resultParameters.setFaceId(1);
+  resultParameters.setCost(0);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", resultParameters.wireEncode());
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 0));
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbAddToExisting)
+{
+  addFace(make_shared<DummyFace>());
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  for (int i = 1; i <= 2; i++)
+    {
+
+      ControlParameters parameters;
+      parameters.setName("/hello");
+      parameters.setFaceId(1);
+      parameters.setCost(100 + i);
+
+      Block encodedParameters(parameters.wireEncode());
+
+      Name commandName("/localhost/nfd/fib");
+      commandName.append("add-nexthop");
+      commandName.append(encodedParameters);
+
+      shared_ptr<Interest> command(make_shared<Interest>(commandName));
+      generateCommand(*command);
+
+      face->onReceiveData +=
+        bind(&FibManagerFixture::validateControlResponse, this, _1,
+             command->getName(), 200, "Success", encodedParameters);
+
+      getFibManager().onFibRequest(*command);
+      BOOST_REQUIRE(didCallbackFire());
+      resetCallbackFired();
+
+      shared_ptr<fib::Entry> entry = getFib().findExactMatch("/hello");
+
+      if (static_cast<bool>(entry))
+        {
+          const fib::NextHopList& hops = entry->getNextHops();
+          BOOST_REQUIRE(hops.size() == 1);
+          BOOST_REQUIRE(std::find_if(hops.begin(), hops.end(),
+                                     bind(&foundNextHop, -1, 100 + i, _1)) != hops.end());
+
+        }
+      else
+        {
+          BOOST_FAIL("Failed to find expected fib entry");
+        }
+
+      face->onReceiveData.clear();
+    }
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbUpdateFaceCost)
+{
+  addFace(make_shared<DummyFace>());
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+
+  {
+    parameters.setCost(1);
+
+    Block encodedParameters(parameters.wireEncode());
+
+    Name commandName("/localhost/nfd/fib");
+    commandName.append("add-nexthop");
+    commandName.append(encodedParameters);
+
+    shared_ptr<Interest> command(make_shared<Interest>(commandName));
+    generateCommand(*command);
+
+    face->onReceiveData +=
+      bind(&FibManagerFixture::validateControlResponse, this, _1,
+           command->getName(), 200, "Success", encodedParameters);
+
+    getFibManager().onFibRequest(*command);
+
+    BOOST_REQUIRE(didCallbackFire());
+  }
+
+  resetCallbackFired();
+  face->onReceiveData.clear();
+
+  {
+    parameters.setCost(102);
+
+    Block encodedParameters(parameters.wireEncode());
+
+    Name commandName("/localhost/nfd/fib");
+    commandName.append("add-nexthop");
+    commandName.append(encodedParameters);
+
+    shared_ptr<Interest> command(make_shared<Interest>(commandName));
+    generateCommand(*command);
+
+    face->onReceiveData +=
+      bind(&FibManagerFixture::validateControlResponse, this, _1,
+           command->getName(), 200, "Success", encodedParameters);
+
+    getFibManager().onFibRequest(*command);
+
+    BOOST_REQUIRE(didCallbackFire());
+  }
+
+  shared_ptr<fib::Entry> entry = getFib().findExactMatch("/hello");
+
+  // Add faces with cost == FaceID for the name /hello
+  // This test assumes:
+  //   FaceIDs are -1 because we don't add them to a forwarder
+  if (static_cast<bool>(entry))
+    {
+      const fib::NextHopList& hops = entry->getNextHops();
+      BOOST_REQUIRE(hops.size() == 1);
+      BOOST_REQUIRE(std::find_if(hops.begin(),
+                                 hops.end(),
+                                 bind(&foundNextHop, -1, 102, _1)) != hops.end());
+    }
+  else
+    {
+      BOOST_FAIL("Failed to find expected fib entry");
+    }
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbMissingPrefix)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setFaceId(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(AddNextHopVerbMissingFaceId)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("add-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+bool
+removedNextHopWithCost(const Fib& fib, const Name& prefix, size_t oldSize, uint32_t cost)
+{
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
+
+  if (static_cast<bool>(entry))
+    {
+      const fib::NextHopList& hops = entry->getNextHops();
+      return hops.size() == oldSize - 1 &&
+        std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) == hops.end();
+    }
+  return false;
+}
+
+void
+testRemoveNextHop(CommandFixture<FibManagerFixture>* fixture,
+                  FibManager& manager,
+                  Fib& fib,
+                  shared_ptr<Face> face,
+                  const Name& targetName,
+                  FaceId targetFace)
+{
+  ControlParameters parameters;
+  parameters.setName(targetName);
+  parameters.setFaceId(targetFace);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("remove-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  fixture->generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, fixture, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  manager.onFibRequest(*command);
+
+  BOOST_REQUIRE(fixture->didCallbackFire());
+
+  fixture->resetCallbackFired();
+  face->onReceiveData.clear();
+}
+
+BOOST_AUTO_TEST_CASE(RemoveNextHop)
+{
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  shared_ptr<Face> face3 = make_shared<DummyFace>();
+
+  addFace(face1);
+  addFace(face2);
+  addFace(face3);
+
+  shared_ptr<InternalFace> face = getInternalFace();
+  FibManager& manager = getFibManager();
+  Fib& fib = getFib();
+
+  shared_ptr<fib::Entry> entry = fib.insert("/hello").first;
+
+  entry->addNextHop(face1, 101);
+  entry->addNextHop(face2, 202);
+  entry->addNextHop(face3, 303);
+
+  testRemoveNextHop(this, manager, fib, face, "/hello", 2);
+  BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 3, 202));
+
+  testRemoveNextHop(this, manager, fib, face, "/hello", 3);
+  BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 2, 303));
+
+  testRemoveNextHop(this, manager, fib, face, "/hello", 1);
+  // BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 1, 101));
+
+  BOOST_CHECK(!static_cast<bool>(getFib().findExactMatch("/hello")));
+}
+
+BOOST_AUTO_TEST_CASE(RemoveFaceNotFound)
+{
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("remove-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(RemovePrefixNotFound)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+  parameters.setFaceId(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("remove-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(RemoveMissingPrefix)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setFaceId(1);
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("remove-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(RemoveMissingFaceId)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face = getInternalFace();
+
+  ControlParameters parameters;
+  parameters.setName("/hello");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/fib");
+  commandName.append("remove-nexthop");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  face->onReceiveData +=
+    bind(&FibManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getFibManager().onFibRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(TestFibEnumerationRequest, FibManagerFixture)
+{
+  for (int i = 0; i < 87; i++)
+    {
+      Name prefix("/test");
+      prefix.appendSegment(i);
+
+      shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
+      shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
+
+      shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
+      entry->addNextHop(dummy1, std::numeric_limits<uint64_t>::max() - 1);
+      entry->addNextHop(dummy2, std::numeric_limits<uint64_t>::max() - 2);
+
+      m_referenceEntries.insert(entry);
+    }
+  for (int i = 0; i < 2; i++)
+    {
+      Name prefix("/test2");
+      prefix.appendSegment(i);
+
+      shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
+      shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
+
+      shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
+      entry->addNextHop(dummy1, std::numeric_limits<uint8_t>::max() - 1);
+      entry->addNextHop(dummy2, std::numeric_limits<uint8_t>::max() - 2);
+
+      m_referenceEntries.insert(entry);
+    }
+
+  ndn::EncodingBuffer buffer;
+
+  m_face->onReceiveData +=
+    bind(&FibEnumerationPublisherFixture::decodeFibEntryBlock, this, _1);
+
+  shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/fib/list"));
+
+  m_manager.onFibRequest(*command);
+  BOOST_REQUIRE(m_finished);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/internal-face.cpp b/tests/daemon/mgmt/internal-face.cpp
new file mode 100644
index 0000000..04ef4a2
--- /dev/null
+++ b/tests/daemon/mgmt/internal-face.cpp
@@ -0,0 +1,236 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/internal-face.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("InternalFaceTest");
+
+class InternalFaceFixture : protected BaseFixture
+{
+public:
+
+  InternalFaceFixture()
+    : m_onInterestFired(false),
+      m_noOnInterestFired(false)
+  {
+
+  }
+
+  void
+  validateOnInterestCallback(const Name& name, const Interest& interest)
+  {
+    m_onInterestFired = true;
+  }
+
+  void
+  validateNoOnInterestCallback(const Name& name, const Interest& interest)
+  {
+    m_noOnInterestFired = true;
+  }
+
+  void
+  addFace(shared_ptr<Face> face)
+  {
+    m_faces.push_back(face);
+  }
+
+  bool
+  didOnInterestFire()
+  {
+    return m_onInterestFired;
+  }
+
+  bool
+  didNoOnInterestFire()
+  {
+    return m_noOnInterestFired;
+  }
+
+  void
+  resetOnInterestFired()
+  {
+    m_onInterestFired = false;
+  }
+
+  void
+  resetNoOnInterestFired()
+  {
+    m_noOnInterestFired = false;
+  }
+
+private:
+  std::vector<shared_ptr<Face> > m_faces;
+  bool m_onInterestFired;
+  bool m_noOnInterestFired;
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtInternalFace, InternalFaceFixture)
+
+void
+validatePutData(bool& called, const Name& expectedName, const Data& data)
+{
+  called = true;
+  BOOST_CHECK_EQUAL(expectedName, data.getName());
+}
+
+BOOST_AUTO_TEST_CASE(PutData)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face(new InternalFace);
+
+  bool didPutData = false;
+  Name dataName("/hello");
+  face->onReceiveData += bind(&validatePutData, boost::ref(didPutData), dataName, _1);
+
+  Data testData(dataName);
+  face->sign(testData);
+  face->put(testData);
+
+  BOOST_REQUIRE(didPutData);
+
+  BOOST_CHECK_THROW(face->close(), InternalFace::Error);
+}
+
+BOOST_AUTO_TEST_CASE(SendInterestHitEnd)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face(new InternalFace);
+
+  face->setInterestFilter("/localhost/nfd/fib",
+                          bind(&InternalFaceFixture::validateOnInterestCallback,
+                               this, _1, _2));
+
+  // generate command whose name is canonically
+  // ordered after /localhost/nfd/fib so that
+  // we hit the end of the std::map
+
+  Name commandName("/localhost/nfd/fib/end");
+  shared_ptr<Interest> command = makeInterest(commandName);
+  face->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didOnInterestFire());
+  BOOST_REQUIRE(didNoOnInterestFire() == false);
+}
+
+BOOST_AUTO_TEST_CASE(SendInterestHitBegin)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face(new InternalFace);
+
+  face->setInterestFilter("/localhost/nfd/fib",
+                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
+                               this, _1, _2));
+
+  // generate command whose name is canonically
+  // ordered before /localhost/nfd/fib so that
+  // we hit the beginning of the std::map
+
+  Name commandName("/localhost/nfd");
+  shared_ptr<Interest> command = makeInterest(commandName);
+  face->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didNoOnInterestFire() == false);
+}
+
+BOOST_AUTO_TEST_CASE(SendInterestHitExact)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face(new InternalFace);
+
+  face->setInterestFilter("/localhost/nfd/eib",
+                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
+                               this, _1, _2));
+
+  face->setInterestFilter("/localhost/nfd/fib",
+                          bind(&InternalFaceFixture::validateOnInterestCallback,
+                           this, _1, _2));
+
+  face->setInterestFilter("/localhost/nfd/gib",
+                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
+                               this, _1, _2));
+
+  // generate command whose name exactly matches
+  // /localhost/nfd/fib
+
+  Name commandName("/localhost/nfd/fib");
+  shared_ptr<Interest> command = makeInterest(commandName);
+  face->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didOnInterestFire());
+  BOOST_REQUIRE(didNoOnInterestFire() == false);
+}
+
+BOOST_AUTO_TEST_CASE(SendInterestHitPrevious)
+{
+  addFace(make_shared<DummyFace>());
+
+  shared_ptr<InternalFace> face(new InternalFace);
+
+  face->setInterestFilter("/localhost/nfd/fib",
+                          bind(&InternalFaceFixture::validateOnInterestCallback,
+                               this, _1, _2));
+
+  face->setInterestFilter("/localhost/nfd/fib/zzzzzzzzzzzzz/",
+                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
+                               this, _1, _2));
+
+  // generate command whose name exactly matches
+  // an Interest filter
+
+  Name commandName("/localhost/nfd/fib/previous");
+  shared_ptr<Interest> command = makeInterest(commandName);
+  face->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didOnInterestFire());
+  BOOST_REQUIRE(didNoOnInterestFire() == false);
+}
+
+BOOST_AUTO_TEST_CASE(InterestGone)
+{
+  shared_ptr<InternalFace> face = make_shared<InternalFace>();
+  shared_ptr<Interest> interest = makeInterest("ndn:/localhost/nfd/gone");
+  face->sendInterest(*interest);
+
+  interest.reset();
+  BOOST_CHECK_NO_THROW(g_io.poll());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/malformed.ndncert b/tests/daemon/mgmt/malformed.ndncert
new file mode 100644
index 0000000..38b2fbb
--- /dev/null
+++ b/tests/daemon/mgmt/malformed.ndncert
@@ -0,0 +1 @@
+definitely not a key
\ No newline at end of file
diff --git a/tests/daemon/mgmt/manager-base.cpp b/tests/daemon/mgmt/manager-base.cpp
new file mode 100644
index 0000000..74fcb6e
--- /dev/null
+++ b/tests/daemon/mgmt/manager-base.cpp
@@ -0,0 +1,201 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/manager-base.hpp"
+#include "mgmt/internal-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("ManagerBaseTest");
+
+class ManagerBaseTest : public ManagerBase, protected BaseFixture
+{
+
+public:
+
+  ManagerBaseTest()
+    : ManagerBase(make_shared<InternalFace>(), "TEST-PRIVILEGE"),
+      m_callbackFired(false)
+  {
+
+  }
+
+  void
+  testSetResponse(ControlResponse& response,
+                  uint32_t code,
+                  const std::string& text)
+  {
+    setResponse(response, code, text);
+  }
+
+  void
+  testSendResponse(const Name& name,
+                   uint32_t code,
+                   const std::string& text,
+                   const Block& body)
+  {
+    sendResponse(name, code, text, body);
+  }
+
+  void
+  testSendResponse(const Name& name,
+                   uint32_t code,
+                   const std::string& text)
+  {
+    sendResponse(name, code, text);
+  }
+
+  void
+  testSendResponse(const Name& name,
+                   const ControlResponse& response)
+  {
+    sendResponse(name, response);
+  }
+
+  shared_ptr<InternalFace>
+  getInternalFace()
+  {
+    return ndn::ptr_lib::static_pointer_cast<InternalFace>(m_face);
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText)
+  {
+    m_callbackFired = true;
+    Block controlRaw = response.getContent().blockFromValue();
+
+    ControlResponse control;
+    control.wireDecode(controlRaw);
+
+    NFD_LOG_DEBUG("received control response"
+                  << " name: " << response.getName()
+                  << " code: " << control.getCode()
+                  << " text: " << control.getText());
+
+    BOOST_REQUIRE(response.getName() == expectedName);
+    BOOST_REQUIRE(control.getCode() == expectedCode);
+    BOOST_REQUIRE(control.getText() == expectedText);
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText,
+                          const Block& expectedBody)
+  {
+    m_callbackFired = true;
+    Block controlRaw = response.getContent().blockFromValue();
+
+    ControlResponse control;
+    control.wireDecode(controlRaw);
+
+    NFD_LOG_DEBUG("received control response"
+                  << " name: " << response.getName()
+                  << " code: " << control.getCode()
+                  << " text: " << control.getText());
+
+    BOOST_REQUIRE(response.getName() == expectedName);
+    BOOST_REQUIRE(control.getCode() == expectedCode);
+    BOOST_REQUIRE(control.getText() == expectedText);
+
+    BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
+
+    BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
+                       expectedBody.value_size()) == 0);
+  }
+
+  bool
+  didCallbackFire()
+  {
+    return m_callbackFired;
+  }
+
+private:
+
+  bool m_callbackFired;
+
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtManagerBase, ManagerBaseTest)
+
+BOOST_AUTO_TEST_CASE(SetResponse)
+{
+  ControlResponse response(200, "OK");
+
+  BOOST_CHECK_EQUAL(response.getCode(), 200);
+  BOOST_CHECK_EQUAL(response.getText(), "OK");
+
+  testSetResponse(response, 100, "test");
+
+  BOOST_CHECK_EQUAL(response.getCode(), 100);
+  BOOST_CHECK_EQUAL(response.getText(), "test");
+}
+
+BOOST_AUTO_TEST_CASE(SendResponse4Arg)
+{
+  ndn::nfd::ControlParameters parameters;
+  parameters.setName("/test/body");
+
+  getInternalFace()->onReceiveData +=
+    bind(&ManagerBaseTest::validateControlResponse, this, _1,
+         "/response", 100, "test", parameters.wireEncode());
+
+  testSendResponse("/response", 100, "test", parameters.wireEncode());
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+
+BOOST_AUTO_TEST_CASE(SendResponse3Arg)
+{
+  getInternalFace()->onReceiveData +=
+    bind(&ManagerBaseTest::validateControlResponse, this, _1,
+         "/response", 100, "test");
+
+  testSendResponse("/response", 100, "test");
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(SendResponse2Arg)
+{
+  getInternalFace()->onReceiveData +=
+    bind(&ManagerBaseTest::validateControlResponse, this, _1,
+         "/response", 100, "test");
+
+  ControlResponse response(100, "test");
+
+  testSendResponse("/response", 100, "test");
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/notification-stream.cpp b/tests/daemon/mgmt/notification-stream.cpp
new file mode 100644
index 0000000..32f5a20
--- /dev/null
+++ b/tests/daemon/mgmt/notification-stream.cpp
@@ -0,0 +1,140 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/notification-stream.hpp"
+#include "mgmt/internal-face.hpp"
+
+#include "tests/test-common.hpp"
+
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("NotificationStreamTest");
+
+
+
+class NotificationStreamFixture : public BaseFixture
+{
+public:
+  NotificationStreamFixture()
+    : m_callbackFired(false)
+    , m_prefix("/localhost/nfd/NotificationStreamTest")
+    , m_message("TestNotificationMessage")
+    , m_sequenceNo(0)
+  {
+  }
+
+  virtual
+  ~NotificationStreamFixture()
+  {
+  }
+
+  void
+  validateCallback(const Data& data)
+  {
+    Name expectedName(m_prefix);
+    expectedName.appendSegment(m_sequenceNo);
+    BOOST_REQUIRE_EQUAL(data.getName(), expectedName);
+
+    ndn::Block payload = data.getContent();
+    std::string message;
+
+    message.append(reinterpret_cast<const char*>(payload.value()), payload.value_size());
+
+    BOOST_REQUIRE_EQUAL(message, m_message);
+
+    m_callbackFired = true;
+    ++m_sequenceNo;
+  }
+
+  void
+  resetCallbackFired()
+  {
+    m_callbackFired = false;
+  }
+
+protected:
+  bool m_callbackFired;
+  const std::string m_prefix;
+  const std::string m_message;
+  uint64_t m_sequenceNo;
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtNotificationStream, NotificationStreamFixture)
+
+class TestNotification
+{
+public:
+  TestNotification(const std::string& message)
+    : m_message(message)
+  {
+  }
+
+  ~TestNotification()
+  {
+  }
+
+  Block
+  wireEncode() const
+  {
+    ndn::EncodingBuffer buffer;
+
+    prependByteArrayBlock(buffer,
+                          ndn::Tlv::Content,
+                          reinterpret_cast<const uint8_t*>(m_message.c_str()),
+                          m_message.size());
+    return buffer.block();
+  }
+
+private:
+  const std::string m_message;
+};
+
+BOOST_AUTO_TEST_CASE(TestPostEvent)
+{
+  shared_ptr<InternalFace> face(make_shared<InternalFace>());
+  NotificationStream notificationStream(face, "/localhost/nfd/NotificationStreamTest");
+
+  face->onReceiveData += bind(&NotificationStreamFixture::validateCallback, this, _1);
+
+  TestNotification event1(m_message);
+  notificationStream.postNotification(event1);
+
+  BOOST_REQUIRE(m_callbackFired);
+
+  resetCallbackFired();
+
+  TestNotification event2(m_message);
+  notificationStream.postNotification(event2);
+
+  BOOST_REQUIRE(m_callbackFired);
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
+
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/segment-publisher.cpp b/tests/daemon/mgmt/segment-publisher.cpp
new file mode 100644
index 0000000..e40f372
--- /dev/null
+++ b/tests/daemon/mgmt/segment-publisher.cpp
@@ -0,0 +1,151 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/segment-publisher.hpp"
+#include "mgmt/internal-face.hpp"
+#include "mgmt/app-face.hpp"
+
+#include "tests/test-common.hpp"
+#include <ndn-cpp-dev/encoding/tlv.hpp>
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("SegmentPublisherTest");
+
+class TestSegmentPublisher : public SegmentPublisher
+{
+public:
+  TestSegmentPublisher(shared_ptr<AppFace> face,
+                       const Name& prefix,
+                       const uint64_t limit=10000)
+    : SegmentPublisher(face, prefix)
+    , m_limit((limit == 0)?(1):(limit))
+  {
+
+  }
+
+  virtual
+  ~TestSegmentPublisher()
+  {
+
+  }
+
+  uint16_t
+  getLimit() const
+  {
+    return m_limit;
+  }
+
+protected:
+
+  virtual size_t
+  generate(ndn::EncodingBuffer& outBuffer)
+  {
+    size_t totalLength = 0;
+    for (uint64_t i = 0; i < m_limit; i++)
+      {
+        totalLength += prependNonNegativeIntegerBlock(outBuffer, ndn::Tlv::Content, i);
+      }
+    return totalLength;
+  }
+
+protected:
+  const uint64_t m_limit;
+};
+
+class SegmentPublisherFixture : public BaseFixture
+{
+public:
+  SegmentPublisherFixture()
+    : m_face(make_shared<InternalFace>())
+    , m_publisher(m_face, "/localhost/nfd/SegmentPublisherFixture")
+    , m_finished(false)
+  {
+
+  }
+
+  void
+  validate(const Data& data)
+  {
+    Block payload = data.getContent();
+    NFD_LOG_DEBUG("payload size (w/o Content TLV): " << payload.value_size());
+
+    m_buffer.appendByteArray(payload.value(), payload.value_size());
+
+    uint64_t segmentNo = data.getName()[-1].toSegment();
+    if (data.getFinalBlockId() != data.getName()[-1])
+      {
+        return;
+      }
+
+    NFD_LOG_DEBUG("got final block: #" << segmentNo);
+
+    // wrap data in a single Content TLV for easy parsing
+    m_buffer.prependVarNumber(m_buffer.size());
+    m_buffer.prependVarNumber(ndn::Tlv::Content);
+
+    BOOST_TEST_CHECKPOINT("creating parser");
+    ndn::Block parser(m_buffer.buf(), m_buffer.size());
+    BOOST_TEST_CHECKPOINT("parsing aggregated response");
+    parser.parse();
+
+    BOOST_REQUIRE_EQUAL(parser.elements_size(), m_publisher.getLimit());
+
+    uint64_t expectedNo = m_publisher.getLimit() - 1;
+    for (Block::element_const_iterator i = parser.elements_begin();
+         i != parser.elements_end();
+         ++i)
+      {
+        uint64_t number = readNonNegativeInteger(*i);
+        BOOST_REQUIRE_EQUAL(number, expectedNo);
+        --expectedNo;
+      }
+    m_finished = true;
+  }
+
+protected:
+  shared_ptr<InternalFace> m_face;
+  TestSegmentPublisher m_publisher;
+  ndn::EncodingBuffer m_buffer;
+
+protected:
+  bool m_finished;
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtSegmentPublisher, SegmentPublisherFixture)
+
+BOOST_AUTO_TEST_CASE(Generate)
+{
+  m_face->onReceiveData +=
+    bind(&SegmentPublisherFixture::validate, this, _1);
+
+  m_publisher.publish();
+  BOOST_REQUIRE(m_finished);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/status-server.cpp b/tests/daemon/mgmt/status-server.cpp
new file mode 100644
index 0000000..75b4114
--- /dev/null
+++ b/tests/daemon/mgmt/status-server.cpp
@@ -0,0 +1,103 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/status-server.hpp"
+#include "fw/forwarder.hpp"
+#include "version.hpp"
+#include "mgmt/internal-face.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(MgmtStatusServer, BaseFixture)
+
+shared_ptr<const Data> g_response;
+
+void
+interceptResponse(const Data& data)
+{
+  g_response = data.shared_from_this();
+}
+
+BOOST_AUTO_TEST_CASE(Status)
+{
+  // initialize
+  time::system_clock::TimePoint t1 = time::system_clock::now();
+  Forwarder forwarder;
+  shared_ptr<InternalFace> internalFace = make_shared<InternalFace>();
+  internalFace->onReceiveData += &interceptResponse;
+  StatusServer statusServer(internalFace, boost::ref(forwarder));
+  time::system_clock::TimePoint t2 = time::system_clock::now();
+
+  // populate tables
+  forwarder.getFib().insert("ndn:/fib1");
+  forwarder.getPit().insert(*makeInterest("ndn:/pit1"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit2"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit3"));
+  forwarder.getPit().insert(*makeInterest("ndn:/pit4"));
+  forwarder.getMeasurements().get("ndn:/measurements1");
+  forwarder.getMeasurements().get("ndn:/measurements2");
+  forwarder.getMeasurements().get("ndn:/measurements3");
+  BOOST_CHECK_GE(forwarder.getFib().size(), 1);
+  BOOST_CHECK_GE(forwarder.getPit().size(), 4);
+  BOOST_CHECK_GE(forwarder.getMeasurements().size(), 3);
+
+  // request
+  shared_ptr<Interest> request = makeInterest("ndn:/localhost/nfd/status");
+  request->setMustBeFresh(true);
+  request->setChildSelector(1);
+
+  g_response.reset();
+  time::system_clock::TimePoint t3 = time::system_clock::now();
+  internalFace->sendInterest(*request);
+  g_io.run_one();
+  time::system_clock::TimePoint t4 = time::system_clock::now();
+  BOOST_REQUIRE(static_cast<bool>(g_response));
+
+  // verify
+  ndn::nfd::ForwarderStatus status;
+  BOOST_REQUIRE_NO_THROW(status.wireDecode(g_response->getContent()));
+
+  BOOST_CHECK_EQUAL(status.getNfdVersion(), NFD_VERSION);
+  BOOST_CHECK_GE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t1));
+  BOOST_CHECK_LE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t2));
+  BOOST_CHECK_GE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t3));
+  BOOST_CHECK_LE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t4));
+
+  // StatusServer under test isn't added to Forwarder,
+  // so request and response won't affect table size
+  BOOST_CHECK_EQUAL(status.getNNameTreeEntries(), forwarder.getNameTree().size());
+  BOOST_CHECK_EQUAL(status.getNFibEntries(), forwarder.getFib().size());
+  BOOST_CHECK_EQUAL(status.getNPitEntries(), forwarder.getPit().size());
+  BOOST_CHECK_EQUAL(status.getNMeasurementsEntries(), forwarder.getMeasurements().size());
+  BOOST_CHECK_EQUAL(status.getNCsEntries(), forwarder.getCs().size());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/strategy-choice-manager.cpp b/tests/daemon/mgmt/strategy-choice-manager.cpp
new file mode 100644
index 0000000..99d5636
--- /dev/null
+++ b/tests/daemon/mgmt/strategy-choice-manager.cpp
@@ -0,0 +1,548 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "mgmt/strategy-choice-manager.hpp"
+#include "face/face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "table/name-tree.hpp"
+#include "table/strategy-choice.hpp"
+#include "fw/forwarder.hpp"
+#include "fw/strategy.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include "tests/daemon/fw/dummy-strategy.hpp"
+
+#include "tests/test-common.hpp"
+#include "validation-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("StrategyChoiceManagerTest");
+
+class StrategyChoiceManagerFixture : protected BaseFixture
+{
+public:
+
+  StrategyChoiceManagerFixture()
+    : m_strategyChoice(m_forwarder.getStrategyChoice())
+    , m_face(make_shared<InternalFace>())
+    , m_manager(m_strategyChoice, m_face)
+    , m_callbackFired(false)
+  {
+    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-a"));
+    m_strategyChoice.insert("ndn:/", "/localhost/nfd/strategy/test-strategy-a");
+  }
+
+  virtual
+  ~StrategyChoiceManagerFixture()
+  {
+
+  }
+
+  void
+  validateControlResponseCommon(const Data& response,
+                                const Name& expectedName,
+                                uint32_t expectedCode,
+                                const std::string& expectedText,
+                                ControlResponse& control)
+  {
+    m_callbackFired = true;
+    Block controlRaw = response.getContent().blockFromValue();
+
+    control.wireDecode(controlRaw);
+
+    NFD_LOG_DEBUG("received control response"
+                  << " Name: " << response.getName()
+                  << " code: " << control.getCode()
+                  << " text: " << control.getText());
+
+    BOOST_CHECK_EQUAL(response.getName(), expectedName);
+    BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
+    BOOST_CHECK_EQUAL(control.getText(), expectedText);
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    if (!control.getBody().empty())
+      {
+        BOOST_FAIL("found unexpected control response body");
+      }
+  }
+
+  void
+  validateControlResponse(const Data& response,
+                          const Name& expectedName,
+                          uint32_t expectedCode,
+                          const std::string& expectedText,
+                          const Block& expectedBody)
+  {
+    ControlResponse control;
+    validateControlResponseCommon(response, expectedName,
+                                  expectedCode, expectedText, control);
+
+    BOOST_REQUIRE(!control.getBody().empty());
+    BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
+
+    BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
+                       expectedBody.value_size()) == 0);
+
+  }
+
+  bool
+  didCallbackFire()
+  {
+    return m_callbackFired;
+  }
+
+  void
+  resetCallbackFired()
+  {
+    m_callbackFired = false;
+  }
+
+  shared_ptr<InternalFace>&
+  getFace()
+  {
+    return m_face;
+  }
+
+  StrategyChoiceManager&
+  getManager()
+  {
+    return m_manager;
+  }
+
+  StrategyChoice&
+  getStrategyChoice()
+  {
+    return m_strategyChoice;
+  }
+
+  void
+  addInterestRule(const std::string& regex,
+                  ndn::IdentityCertificate& certificate)
+  {
+    m_manager.addInterestRule(regex, certificate);
+  }
+
+protected:
+  Forwarder m_forwarder;
+  StrategyChoice& m_strategyChoice;
+  shared_ptr<InternalFace> m_face;
+  StrategyChoiceManager m_manager;
+
+private:
+  bool m_callbackFired;
+};
+
+class AllStrategiesFixture : public StrategyChoiceManagerFixture
+{
+public:
+  AllStrategiesFixture()
+  {
+    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-b"));
+  }
+
+  virtual
+  ~AllStrategiesFixture()
+  {
+
+  }
+};
+
+template <typename T> class AuthorizedCommandFixture : public CommandFixture<T>
+{
+public:
+  AuthorizedCommandFixture()
+  {
+    const std::string regex = "^<localhost><nfd><strategy-choice>";
+    T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
+  }
+
+  virtual
+  ~AuthorizedCommandFixture()
+  {
+
+  }
+};
+
+BOOST_FIXTURE_TEST_SUITE(MgmtStrategyChoiceManager,
+                         AuthorizedCommandFixture<AllStrategiesFixture>)
+
+BOOST_FIXTURE_TEST_CASE(TestFireInterestFilter, AllStrategiesFixture)
+{
+  shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this,  _1,
+         command->getName(), 400, "Malformed command");
+
+  getFace()->sendInterest(*command);
+  g_io.run_one();
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(MalformedCommmand, AllStrategiesFixture)
+{
+  shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onStrategyChoiceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(UnsignedCommand, AllStrategiesFixture)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+  parameters.setStrategy("/localhost/nfd/strategy/best-route");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 401, "Signature required");
+
+  getManager().onStrategyChoiceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand,
+                        UnauthorizedCommandFixture<StrategyChoiceManagerFixture>)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+  parameters.setStrategy("/localhost/nfd/strategy/best-route");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 403, "Unauthorized command");
+
+  getManager().onStrategyChoiceRequest(*command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(UnsupportedVerb)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+  parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("unsupported");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 501, "Unsupported command");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(BadOptionParse)
+{
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append("NotReallyParameters");
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(SetStrategies)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+  parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
+  BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-b");
+}
+
+BOOST_AUTO_TEST_CASE(SetStrategiesMissingName)
+{
+  ControlParameters parameters;
+  parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+}
+
+BOOST_AUTO_TEST_CASE(SetStrategiesMissingStrategy)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
+  BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
+}
+
+BOOST_AUTO_TEST_CASE(SetUnsupportedStrategy)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+  parameters.setStrategy("/localhost/nfd/strategy/unit-test-doesnotexist");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("set");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 504, "Unsupported strategy");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+  fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
+  BOOST_CHECK_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
+}
+
+class DefaultStrategyOnlyFixture : public StrategyChoiceManagerFixture
+{
+public:
+  DefaultStrategyOnlyFixture()
+    : StrategyChoiceManagerFixture()
+  {
+
+  }
+
+  virtual
+  ~DefaultStrategyOnlyFixture()
+  {
+
+  }
+};
+
+
+/// \todo I'm not sure this code branch (code 405) can happen. The manager tests for the strategy first and will return 504.
+// BOOST_FIXTURE_TEST_CASE(SetNotInstalled, DefaultStrategyOnlyFixture)
+// {
+//   BOOST_REQUIRE(!getStrategyChoice().hasStrategy("/localhost/nfd/strategy/test-strategy-b"));
+//   ControlParameters parameters;
+//   parameters.setName("/test");
+//   parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
+
+//   Block encodedParameters(parameters.wireEncode());
+
+//   Name commandName("/localhost/nfd/strategy-choice");
+//   commandName.append("set");
+//   commandName.append(encodedParameters);
+
+//   shared_ptr<Interest> command(make_shared<Interest>(commandName));
+//   generateCommand(*command);
+
+//   getFace()->onReceiveData +=
+//     bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+//          command->getName(), 405, "Strategy not installed");
+
+//   getManager().onValidatedStrategyChoiceRequest(command);
+
+//   BOOST_REQUIRE(didCallbackFire());
+//   fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
+//   BOOST_CHECK_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
+// }
+
+BOOST_AUTO_TEST_CASE(Unset)
+{
+  ControlParameters parameters;
+  parameters.setName("/test");
+
+  BOOST_REQUIRE(m_strategyChoice.insert("/test", "/localhost/nfd/strategy/test-strategy-b"));
+  BOOST_REQUIRE_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
+                      "/localhost/nfd/strategy/test-strategy-b");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("unset");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 200, "Success", encodedParameters);
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+
+  BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
+                    "/localhost/nfd/strategy/test-strategy-a");
+}
+
+BOOST_AUTO_TEST_CASE(UnsetRoot)
+{
+  ControlParameters parameters;
+  parameters.setName("/");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("unset");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 403, "Cannot unset root prefix strategy");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+
+  BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
+                    "/localhost/nfd/strategy/test-strategy-a");
+}
+
+BOOST_AUTO_TEST_CASE(UnsetMissingName)
+{
+  ControlParameters parameters;
+
+  BOOST_REQUIRE(m_strategyChoice.insert("/test", "/localhost/nfd/strategy/test-strategy-b"));
+  BOOST_REQUIRE_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
+                      "/localhost/nfd/strategy/test-strategy-b");
+
+  Block encodedParameters(parameters.wireEncode());
+
+  Name commandName("/localhost/nfd/strategy-choice");
+  commandName.append("unset");
+  commandName.append(encodedParameters);
+
+  shared_ptr<Interest> command(make_shared<Interest>(commandName));
+  generateCommand(*command);
+
+  getFace()->onReceiveData +=
+    bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
+         command->getName(), 400, "Malformed command");
+
+  getManager().onValidatedStrategyChoiceRequest(command);
+
+  BOOST_REQUIRE(didCallbackFire());
+
+  BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
+                    "/localhost/nfd/strategy/test-strategy-b");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/validation-common.cpp b/tests/daemon/mgmt/validation-common.cpp
new file mode 100644
index 0000000..6065c27
--- /dev/null
+++ b/tests/daemon/mgmt/validation-common.cpp
@@ -0,0 +1,50 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "validation-common.hpp"
+
+#include <boost/test/unit_test.hpp>
+
+namespace nfd {
+namespace tests {
+
+const Name CommandIdentityGlobalFixture::s_identityName("/unit-test/CommandFixture/id");
+shared_ptr<ndn::IdentityCertificate> CommandIdentityGlobalFixture::s_certificate;
+
+CommandIdentityGlobalFixture::CommandIdentityGlobalFixture()
+{
+  BOOST_ASSERT(!static_cast<bool>(s_certificate));
+  s_certificate = m_keys.getCertificate(m_keys.createIdentity(s_identityName));
+}
+
+CommandIdentityGlobalFixture::~CommandIdentityGlobalFixture()
+{
+  s_certificate.reset();
+  m_keys.deleteIdentity(s_identityName);
+}
+
+BOOST_GLOBAL_FIXTURE(CommandIdentityGlobalFixture)
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/validation-common.hpp b/tests/daemon/mgmt/validation-common.hpp
new file mode 100644
index 0000000..9aa2e28
--- /dev/null
+++ b/tests/daemon/mgmt/validation-common.hpp
@@ -0,0 +1,125 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
+#define NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
+
+#include "common.hpp"
+#include <ndn-cpp-dev/util/command-interest-generator.hpp>
+
+namespace nfd {
+namespace tests {
+
+// class ValidatedManagementFixture
+// {
+// public:
+//   ValidatedManagementFixture()
+//     : m_validator(make_shared<ndn::CommandInterestValidator>())
+//   {
+//   }
+
+//   virtual
+//   ~ValidatedManagementFixture()
+//   {
+//   }
+
+// protected:
+//   shared_ptr<ndn::CommandInterestValidator> m_validator;
+// };
+
+/// a global fixture that holds the identity for CommandFixture
+class CommandIdentityGlobalFixture
+{
+public:
+  CommandIdentityGlobalFixture();
+
+  ~CommandIdentityGlobalFixture();
+
+  static const Name& getIdentityName()
+  {
+    return s_identityName;
+  }
+
+  static shared_ptr<ndn::IdentityCertificate> getCertificate()
+  {
+    BOOST_ASSERT(static_cast<bool>(s_certificate));
+    return s_certificate;
+  }
+
+private:
+  ndn::KeyChain m_keys;
+  static const Name s_identityName;
+  static shared_ptr<ndn::IdentityCertificate> s_certificate;
+};
+
+template<typename T>
+class CommandFixture : public T
+{
+public:
+  virtual
+  ~CommandFixture()
+  {
+  }
+
+  void
+  generateCommand(Interest& interest)
+  {
+    m_generator.generateWithIdentity(interest, getIdentityName());
+  }
+
+  const Name&
+  getIdentityName() const
+  {
+    return CommandIdentityGlobalFixture::getIdentityName();
+  }
+
+protected:
+  CommandFixture()
+    : m_certificate(CommandIdentityGlobalFixture::getCertificate())
+  {
+  }
+
+protected:
+  shared_ptr<ndn::IdentityCertificate> m_certificate;
+  ndn::CommandInterestGenerator m_generator;
+};
+
+template <typename T>
+class UnauthorizedCommandFixture : public CommandFixture<T>
+{
+public:
+  UnauthorizedCommandFixture()
+  {
+  }
+
+  virtual
+  ~UnauthorizedCommandFixture()
+  {
+  }
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
diff --git a/tests/daemon/table/cs.cpp b/tests/daemon/table/cs.cpp
new file mode 100644
index 0000000..cdcc0db
--- /dev/null
+++ b/tests/daemon/table/cs.cpp
@@ -0,0 +1,919 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ **/
+
+#include "table/cs.hpp"
+#include "table/cs-entry.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+class CsAccessor : public Cs
+{
+public:
+  bool
+  evictItem_accessor()
+  {
+    return evictItem();
+  }
+};
+
+BOOST_FIXTURE_TEST_SUITE(TableCs, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Insertion)
+{
+  Cs cs;
+
+  BOOST_CHECK_EQUAL(cs.insert(*makeData("/insertion")), true);
+}
+
+BOOST_AUTO_TEST_CASE(Insertion2)
+{
+  Cs cs;
+
+  cs.insert(*makeData("/a"));
+  cs.insert(*makeData("/b"));
+  cs.insert(*makeData("/c"));
+  cs.insert(*makeData("/d"));
+
+  BOOST_CHECK_EQUAL(cs.size(), 4);
+}
+
+
+BOOST_AUTO_TEST_CASE(DuplicateInsertion)
+{
+  Cs cs;
+
+  shared_ptr<Data> data0 = makeData("/insert/smth");
+  BOOST_CHECK_EQUAL(cs.insert(*data0), true);
+
+  shared_ptr<Data> data = makeData("/insert/duplicate");
+  BOOST_CHECK_EQUAL(cs.insert(*data), true);
+
+  cs.insert(*data);
+  BOOST_CHECK_EQUAL(cs.size(), 2);
+}
+
+
+BOOST_AUTO_TEST_CASE(DuplicateInsertion2)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/insert/duplicate");
+  BOOST_CHECK_EQUAL(cs.insert(*data), true);
+
+  cs.insert(*data);
+  BOOST_CHECK_EQUAL(cs.size(), 1);
+
+  shared_ptr<Data> data2 = makeData("/insert/original");
+  BOOST_CHECK_EQUAL(cs.insert(*data2), true);
+  BOOST_CHECK_EQUAL(cs.size(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(InsertAndFind)
+{
+  Cs cs;
+
+  Name name("/insert/and/find");
+
+  shared_ptr<Data> data = makeData(name);
+  BOOST_CHECK_EQUAL(cs.insert(*data), true);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name);
+
+  const Data* found = cs.find(*interest);
+
+  BOOST_REQUIRE(found != 0);
+  BOOST_CHECK_EQUAL(data->getName(), found->getName());
+}
+
+BOOST_AUTO_TEST_CASE(InsertAndNotFind)
+{
+  Cs cs;
+
+  Name name("/insert/and/find");
+  shared_ptr<Data> data = makeData(name);
+  BOOST_CHECK_EQUAL(cs.insert(*data), true);
+
+  Name name2("/not/find");
+  shared_ptr<Interest> interest = make_shared<Interest>(name2);
+
+  const Data* found = cs.find(*interest);
+
+  BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
+}
+
+
+BOOST_AUTO_TEST_CASE(InsertAndErase)
+{
+  CsAccessor cs;
+
+  shared_ptr<Data> data = makeData("/insertandelete");
+  cs.insert(*data);
+  BOOST_CHECK_EQUAL(cs.size(), 1);
+
+  cs.evictItem_accessor();
+  BOOST_CHECK_EQUAL(cs.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(StalenessQueue)
+{
+  CsAccessor cs;
+
+  Name name2("/insert/fresh");
+  shared_ptr<Data> data2 = makeData(name2);
+  data2->setFreshnessPeriod(time::milliseconds(5000));
+  cs.insert(*data2);
+
+  Name name("/insert/expire");
+  shared_ptr<Data> data = makeData(name);
+  data->setFreshnessPeriod(time::milliseconds(500));
+  cs.insert(*data);
+
+  BOOST_CHECK_EQUAL(cs.size(), 2);
+
+  sleep(3);
+
+  cs.evictItem_accessor();
+  BOOST_CHECK_EQUAL(cs.size(), 1);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name2);
+  const Data* found = cs.find(*interest);
+  BOOST_REQUIRE(found != 0);
+  BOOST_CHECK_EQUAL(found->getName(), name2);
+}
+
+//even max size
+BOOST_AUTO_TEST_CASE(ReplacementEvenSize)
+{
+  Cs cs(4);
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/c");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/e");
+  cs.insert(*data5);
+
+  BOOST_CHECK_EQUAL(cs.size(), 4);
+}
+
+//odd max size
+BOOST_AUTO_TEST_CASE(Replacement2)
+{
+  Cs cs(3);
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/c");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  BOOST_CHECK_EQUAL(cs.size(), 3);
+}
+
+BOOST_AUTO_TEST_CASE(InsertAndEraseByName)
+{
+  CsAccessor cs;
+
+  Name name("/insertandremovebyname");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
+                                                    data->wireEncode().size());
+
+  shared_ptr<Data> data2 = makeData("/a");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/z");
+  cs.insert(*data3);
+
+  BOOST_CHECK_EQUAL(cs.size(), 3);
+
+  name.append(digest1->buf(), digest1->size());
+  cs.erase(name);
+  BOOST_CHECK_EQUAL(cs.size(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(DigestCalculation)
+{
+  shared_ptr<Data> data = makeData("/digest/compute");
+
+  ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
+                                                    data->wireEncode().size());
+  BOOST_CHECK_EQUAL(digest1->size(), 32);
+
+  cs::Entry* entry = new cs::Entry();
+  entry->setData(*data, false);
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(digest1->begin(), digest1->end(),
+                                entry->getDigest()->begin(), entry->getDigest()->end());
+}
+
+BOOST_AUTO_TEST_CASE(InsertCanonical)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/c");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
+  cs.insert(*data5);
+
+  shared_ptr<Data> data6 = makeData("/c/c/1/2/3");
+  cs.insert(*data6);
+
+  shared_ptr<Data> data7 = makeData("/c/c/1");
+  cs.insert(*data7);
+}
+
+BOOST_AUTO_TEST_CASE(EraseCanonical)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/c");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
+  cs.insert(*data5);
+
+  shared_ptr<Data> data6 = makeData("/c/c/1/2/3");
+  cs.insert(*data6);
+
+  shared_ptr<Data> data7 = makeData("/c/c/1");
+  cs.insert(*data7);
+
+  ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
+                                                    data->wireEncode().size());
+
+  Name name("/a");
+  name.append(digest1->buf(), digest1->size());
+  cs.erase(name);
+  BOOST_CHECK_EQUAL(cs.size(), 6);
+}
+
+BOOST_AUTO_TEST_CASE(ImplicitDigestSelector)
+{
+  CsAccessor cs;
+
+  Name name("/digest/works");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/a");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/z/z/z");
+  cs.insert(*data3);
+
+  ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
+                                                    data->wireEncode().size());
+  uint8_t digest2[32] = {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
+
+  shared_ptr<Interest> interest = make_shared<Interest>();
+  interest->setName(Name(name).append(digest1->buf(), digest1->size()));
+  interest->setMinSuffixComponents(0);
+  interest->setMaxSuffixComponents(0);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_NE(found, static_cast<const Data*>(0));
+  BOOST_CHECK_EQUAL(found->getName(), name);
+
+  shared_ptr<Interest> interest2 = make_shared<Interest>();
+  interest2->setName(Name(name).append(digest2, 32));
+  interest2->setMinSuffixComponents(0);
+  interest2->setMaxSuffixComponents(0);
+
+  const Data* notfound = cs.find(*interest2);
+  BOOST_CHECK_EQUAL(notfound, static_cast<const Data*>(0));
+}
+
+BOOST_AUTO_TEST_CASE(ChildSelector)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/c/c");
+  cs.insert(*data5);
+
+  shared_ptr<Data> data6 = makeData("/c/f");
+  cs.insert(*data6);
+
+  shared_ptr<Data> data7 = makeData("/c/n");
+  cs.insert(*data7);
+
+  shared_ptr<Interest> interest = make_shared<Interest>("/c");
+  interest->setChildSelector(1);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found->getName(), "/c/n");
+
+  shared_ptr<Interest> interest2 = make_shared<Interest>("/c");
+  interest2->setChildSelector(0);
+
+  const Data* found2 = cs.find(*interest2);
+  BOOST_CHECK_EQUAL(found2->getName(), "/c/c");
+}
+
+BOOST_AUTO_TEST_CASE(ChildSelector2)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a/b/1");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/a/b/2");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/a/z/1");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/a/z/2");
+  cs.insert(*data4);
+
+  shared_ptr<Interest> interest = make_shared<Interest>("/a");
+  interest->setChildSelector(1);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found->getName(), "/a/z/1");
+}
+
+BOOST_AUTO_TEST_CASE(MustBeFreshSelector)
+{
+  Cs cs;
+
+  Name name("/insert/nonfresh");
+  shared_ptr<Data> data = makeData(name);
+  data->setFreshnessPeriod(time::milliseconds(500));
+  cs.insert(*data);
+
+  sleep(1);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name);
+  interest->setMustBeFresh(true);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
+}
+
+BOOST_AUTO_TEST_CASE(PublisherKeySelector)
+{
+  Cs cs;
+
+  Name name("/insert/withkey");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name);
+  Name keyName("/somewhere/key");
+
+  ndn::KeyLocator locator(keyName);
+  interest->setPublisherPublicKeyLocator(locator);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
+}
+
+BOOST_AUTO_TEST_CASE(PublisherKeySelector2)
+{
+  Cs cs;
+  Name name("/insert/withkey");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  Name name2("/insert/withkey2");
+  shared_ptr<Data> data2 = make_shared<Data>(name2);
+
+  Name keyName("/somewhere/key");
+  const ndn::KeyLocator locator(keyName);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0), 0));
+
+  fakeSignature.setKeyLocator(locator);
+  data2->setSignature(fakeSignature);
+
+  cs.insert(*data2);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name2);
+  interest->setPublisherPublicKeyLocator(locator);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_NE(found, static_cast<const Data*>(0));
+  BOOST_CHECK_EQUAL(found->getName(), data2->getName());
+}
+
+
+BOOST_AUTO_TEST_CASE(MinMaxComponentsSelector)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
+  cs.insert(*data5);
+
+  shared_ptr<Data> data6 = makeData("/c/c/6/7/8/9");
+  cs.insert(*data6);
+
+  shared_ptr<Data> data7 = makeData("/c/c/1/2/3");
+  cs.insert(*data7);
+
+  shared_ptr<Data> data8 = makeData("/c/c/1");
+  cs.insert(*data8);
+
+  shared_ptr<Interest> interest = make_shared<Interest>("/c/c");
+  interest->setMinSuffixComponents(3);
+  interest->setChildSelector(0);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found->getName(), "/c/c/1/2/3/4/5/6");
+
+  shared_ptr<Interest> interest2 = make_shared<Interest>("/c/c");
+  interest2->setMinSuffixComponents(4);
+  interest2->setChildSelector(1);
+
+  const Data* found2 = cs.find(*interest2);
+  BOOST_CHECK_EQUAL(found2->getName(), "/c/c/6/7/8/9");
+
+  shared_ptr<Interest> interest3 = make_shared<Interest>("/c/c");
+  interest3->setMaxSuffixComponents(2);
+  interest3->setChildSelector(1);
+
+  const Data* found3 = cs.find(*interest3);
+  BOOST_CHECK_EQUAL(found3->getName(), "/c/c/1");
+}
+
+BOOST_AUTO_TEST_CASE(ExcludeSelector)
+{
+  Cs cs;
+
+  shared_ptr<Data> data = makeData("/a");
+  cs.insert(*data);
+
+  shared_ptr<Data> data2 = makeData("/b");
+  cs.insert(*data2);
+
+  shared_ptr<Data> data3 = makeData("/c/a");
+  cs.insert(*data3);
+
+  shared_ptr<Data> data4 = makeData("/d");
+  cs.insert(*data4);
+
+  shared_ptr<Data> data5 = makeData("/c/c");
+  cs.insert(*data5);
+
+  shared_ptr<Data> data6 = makeData("/c/f");
+  cs.insert(*data6);
+
+  shared_ptr<Data> data7 = makeData("/c/n");
+  cs.insert(*data7);
+
+  shared_ptr<Interest> interest = make_shared<Interest>("/c");
+  interest->setChildSelector(1);
+  Exclude e;
+  e.excludeOne (Name::Component("n"));
+  interest->setExclude(e);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found->getName(), "/c/f");
+
+  shared_ptr<Interest> interest2 = make_shared<Interest>("/c");
+  interest2->setChildSelector(0);
+
+  Exclude e2;
+  e2.excludeOne (Name::Component("a"));
+  interest2->setExclude(e2);
+
+  const Data* found2 = cs.find(*interest2);
+  BOOST_CHECK_EQUAL(found2->getName(), "/c/c");
+
+  shared_ptr<Interest> interest3 = make_shared<Interest>("/c");
+  interest3->setChildSelector(0);
+
+  Exclude e3;
+  e3.excludeOne (Name::Component("c"));
+  interest3->setExclude(e3);
+
+  const Data* found3 = cs.find(*interest3);
+  BOOST_CHECK_EQUAL(found3->getName(), "/c/a");
+}
+
+//
+
+class FindFixture : protected BaseFixture
+{
+protected:
+  void
+  insert(uint32_t id, const Name& name)
+  {
+    shared_ptr<Data> data = makeData(name);
+    data->setFreshnessPeriod(time::milliseconds(99999));
+    data->setContent(reinterpret_cast<const uint8_t*>(&id), sizeof(id));
+
+    m_cs.insert(*data);
+  }
+
+  Interest&
+  startInterest(const Name& name)
+  {
+    m_interest = make_shared<Interest>(name);
+    return *m_interest;
+  }
+
+  uint32_t
+  find()
+  {
+    const Data* found = m_cs.find(*m_interest);
+    if (found == 0) {
+      return 0;
+    }
+    const Block& content = found->getContent();
+    if (content.value_size() != sizeof(uint32_t)) {
+      return 0;
+    }
+    return *reinterpret_cast<const uint32_t*>(content.value());
+  }
+
+protected:
+  Cs m_cs;
+  shared_ptr<Interest> m_interest;
+};
+
+BOOST_FIXTURE_TEST_SUITE(Find, FindFixture)
+
+BOOST_AUTO_TEST_CASE(EmptyDataName)
+{
+  insert(1, "ndn:/");
+
+  startInterest("ndn:/");
+  BOOST_CHECK_EQUAL(find(), 1);
+}
+
+BOOST_AUTO_TEST_CASE(EmptyInterestName)
+{
+  insert(1, "ndn:/A");
+
+  startInterest("ndn:/");
+  BOOST_CHECK_EQUAL(find(), 1);
+}
+
+BOOST_AUTO_TEST_CASE(Leftmost)
+{
+  insert(1, "ndn:/A");
+  insert(2, "ndn:/B/p/1");
+  insert(3, "ndn:/B/p/2");
+  insert(4, "ndn:/B/q/1");
+  insert(5, "ndn:/B/q/2");
+  insert(6, "ndn:/C");
+
+  startInterest("ndn:/B");
+  BOOST_CHECK_EQUAL(find(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(Rightmost)
+{
+  insert(1, "ndn:/A");
+  insert(2, "ndn:/B/p/1");
+  insert(3, "ndn:/B/p/2");
+  insert(4, "ndn:/B/q/1");
+  insert(5, "ndn:/B/q/2");
+  insert(6, "ndn:/C");
+
+  startInterest("ndn:/B")
+    .setChildSelector(1);
+  BOOST_CHECK_EQUAL(find(), 4);
+}
+
+BOOST_AUTO_TEST_CASE(Leftmost_ExactName1)
+{
+  insert(1, "ndn:/");
+  insert(2, "ndn:/A/B");
+  insert(3, "ndn:/A/C");
+  insert(4, "ndn:/A");
+  insert(5, "ndn:/D");
+
+  // Intuitively you would think Data 4 should be between Data 1 and 2,
+  // but Data 4 has full Name ndn:/A/<32-octet hash>.
+  startInterest("ndn:/A");
+  BOOST_CHECK_EQUAL(find(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(Leftmost_ExactName33)
+{
+  insert(1, "ndn:/");
+  insert(2, "ndn:/A");
+  insert(3, "ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"); // 33 'B's
+  insert(4, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 33 'C's
+  insert(5, "ndn:/D");
+
+  // Data 2 is returned, because <32-octet hash> is less than Data 3.
+  startInterest("ndn:/A");
+  BOOST_CHECK_EQUAL(find(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(MinSuffixComponents)
+{
+  insert(1, "ndn:/A/1/2/3/4");
+  insert(2, "ndn:/B/1/2/3");
+  insert(3, "ndn:/C/1/2");
+  insert(4, "ndn:/D/1");
+  insert(5, "ndn:/E");
+  insert(6, "ndn:/");
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(0);
+  BOOST_CHECK_EQUAL(find(), 6);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(1);
+  BOOST_CHECK_EQUAL(find(), 6);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(2);
+  BOOST_CHECK_EQUAL(find(), 5);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(3);
+  BOOST_CHECK_EQUAL(find(), 4);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(4);
+  BOOST_CHECK_EQUAL(find(), 3);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(5);
+  BOOST_CHECK_EQUAL(find(), 2);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(6);
+  BOOST_CHECK_EQUAL(find(), 1);
+
+  startInterest("ndn:/")
+    .setChildSelector(1)
+    .setMinSuffixComponents(7);
+  BOOST_CHECK_EQUAL(find(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(MaxSuffixComponents)
+{
+  insert(1, "ndn:/");
+  insert(2, "ndn:/A");
+  insert(3, "ndn:/A/B");
+  insert(4, "ndn:/A/B/C");
+  insert(5, "ndn:/A/B/C/D");
+  insert(6, "ndn:/A/B/C/D/E");
+  // Order is 6,5,4,3,2,1, because <32-octet hash> is greater than a 1-octet component.
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(0);
+  BOOST_CHECK_EQUAL(find(), 0);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(1);
+  BOOST_CHECK_EQUAL(find(), 1);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(2);
+  BOOST_CHECK_EQUAL(find(), 2);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(3);
+  BOOST_CHECK_EQUAL(find(), 3);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(4);
+  BOOST_CHECK_EQUAL(find(), 4);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(5);
+  BOOST_CHECK_EQUAL(find(), 5);
+
+  startInterest("ndn:/")
+    .setMaxSuffixComponents(6);
+  BOOST_CHECK_EQUAL(find(), 6);
+}
+
+BOOST_AUTO_TEST_CASE(DigestOrder)
+{
+  insert(1, "ndn:/A");
+  insert(2, "ndn:/A");
+  // We don't know which comes first, but there must be some order
+
+  startInterest("ndn:/A")
+    .setChildSelector(0);
+  uint32_t leftmost = find();
+
+  startInterest("ndn:/A")
+    .setChildSelector(1);
+  uint32_t rightmost = find();
+
+  BOOST_CHECK_NE(leftmost, rightmost);
+}
+
+BOOST_AUTO_TEST_CASE(DigestExclude)
+{
+  insert(1, "ndn:/A/B");
+  insert(2, "ndn:/A");
+  insert(3, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 33 'C's
+
+  startInterest("ndn:/A")
+    .setExclude(Exclude().excludeBefore(name::Component(reinterpret_cast<const uint8_t*>(
+        "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
+        "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"), 31))); // 31 0xFF's
+  BOOST_CHECK_EQUAL(find(), 2);
+
+  startInterest("ndn:/A")
+    .setChildSelector(1)
+    .setExclude(Exclude().excludeAfter(name::Component(reinterpret_cast<const uint8_t*>(
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+        "\x00"), 33))); // 33 0x00's
+  BOOST_CHECK_EQUAL(find(), 2);
+}
+
+BOOST_AUTO_TEST_CASE(ExactName32)
+{
+  insert(1, "ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"); // 32 'B's
+  insert(2, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 32 'C's
+
+  startInterest("ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB");
+  BOOST_CHECK_EQUAL(find(), 1);
+}
+
+BOOST_AUTO_TEST_CASE(MinSuffixComponents32)
+{
+  insert(1, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/1/2/3/4"); // 32 'x's
+  insert(2, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/B/1/2/3");
+  insert(3, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/C/1/2");
+  insert(4, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/D/1");
+  insert(5, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/E");
+  insert(6, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(0);
+  BOOST_CHECK_EQUAL(find(), 6);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(1);
+  BOOST_CHECK_EQUAL(find(), 6);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(2);
+  BOOST_CHECK_EQUAL(find(), 5);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(3);
+  BOOST_CHECK_EQUAL(find(), 4);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(4);
+  BOOST_CHECK_EQUAL(find(), 3);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(5);
+  BOOST_CHECK_EQUAL(find(), 2);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(6);
+  BOOST_CHECK_EQUAL(find(), 1);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setChildSelector(1)
+    .setMinSuffixComponents(7);
+  BOOST_CHECK_EQUAL(find(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(MaxSuffixComponents32)
+{
+  insert(1, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/"); // 32 'x's
+  insert(2, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A");
+  insert(3, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B");
+  insert(4, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C");
+  insert(5, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C/D");
+  insert(6, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C/D/E");
+  // Order is 6,5,4,3,2,1, because <32-octet hash> is greater than a 1-octet component.
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(0);
+  BOOST_CHECK_EQUAL(find(), 0);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(1);
+  BOOST_CHECK_EQUAL(find(), 1);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(2);
+  BOOST_CHECK_EQUAL(find(), 2);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(3);
+  BOOST_CHECK_EQUAL(find(), 3);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(4);
+  BOOST_CHECK_EQUAL(find(), 4);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(5);
+  BOOST_CHECK_EQUAL(find(), 5);
+
+  startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+    .setMaxSuffixComponents(6);
+  BOOST_CHECK_EQUAL(find(), 6);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // Find
+
+BOOST_AUTO_TEST_SUITE_END() // TableCs
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/fib.cpp b/tests/daemon/table/fib.cpp
new file mode 100644
index 0000000..bdf2fca
--- /dev/null
+++ b/tests/daemon/table/fib.cpp
@@ -0,0 +1,381 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/fib.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(TableFib, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Entry)
+{
+  Name prefix("ndn:/pxWhfFza");
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+
+  fib::Entry entry(prefix);
+  BOOST_CHECK_EQUAL(entry.getPrefix(), prefix);
+
+  const fib::NextHopList& nexthops1 = entry.getNextHops();
+  // []
+  BOOST_CHECK_EQUAL(nexthops1.size(), 0);
+
+  entry.addNextHop(face1, 20);
+  const fib::NextHopList& nexthops2 = entry.getNextHops();
+  // [(face1,20)]
+  BOOST_CHECK_EQUAL(nexthops2.size(), 1);
+  BOOST_CHECK_EQUAL(nexthops2.begin()->getFace(), face1);
+  BOOST_CHECK_EQUAL(nexthops2.begin()->getCost(), 20);
+
+  entry.addNextHop(face1, 30);
+  const fib::NextHopList& nexthops3 = entry.getNextHops();
+  // [(face1,30)]
+  BOOST_CHECK_EQUAL(nexthops3.size(), 1);
+  BOOST_CHECK_EQUAL(nexthops3.begin()->getFace(), face1);
+  BOOST_CHECK_EQUAL(nexthops3.begin()->getCost(), 30);
+
+  entry.addNextHop(face2, 40);
+  const fib::NextHopList& nexthops4 = entry.getNextHops();
+  // [(face1,30), (face2,40)]
+  BOOST_CHECK_EQUAL(nexthops4.size(), 2);
+  int i = -1;
+  for (fib::NextHopList::const_iterator it = nexthops4.begin();
+    it != nexthops4.end(); ++it) {
+    ++i;
+    switch (i) {
+      case 0 :
+        BOOST_CHECK_EQUAL(it->getFace(), face1);
+        BOOST_CHECK_EQUAL(it->getCost(), 30);
+        break;
+      case 1 :
+        BOOST_CHECK_EQUAL(it->getFace(), face2);
+        BOOST_CHECK_EQUAL(it->getCost(), 40);
+        break;
+    }
+  }
+
+  entry.addNextHop(face2, 10);
+  const fib::NextHopList& nexthops5 = entry.getNextHops();
+  // [(face2,10), (face1,30)]
+  BOOST_CHECK_EQUAL(nexthops5.size(), 2);
+  i = -1;
+  for (fib::NextHopList::const_iterator it = nexthops5.begin();
+    it != nexthops5.end(); ++it) {
+    ++i;
+    switch (i) {
+      case 0 :
+        BOOST_CHECK_EQUAL(it->getFace(), face2);
+        BOOST_CHECK_EQUAL(it->getCost(), 10);
+        break;
+      case 1 :
+        BOOST_CHECK_EQUAL(it->getFace(), face1);
+        BOOST_CHECK_EQUAL(it->getCost(), 30);
+        break;
+    }
+  }
+
+  entry.removeNextHop(face1);
+  const fib::NextHopList& nexthops6 = entry.getNextHops();
+  // [(face2,10)]
+  BOOST_CHECK_EQUAL(nexthops6.size(), 1);
+  BOOST_CHECK_EQUAL(nexthops6.begin()->getFace(), face2);
+  BOOST_CHECK_EQUAL(nexthops6.begin()->getCost(), 10);
+
+  entry.removeNextHop(face1);
+  const fib::NextHopList& nexthops7 = entry.getNextHops();
+  // [(face2,10)]
+  BOOST_CHECK_EQUAL(nexthops7.size(), 1);
+  BOOST_CHECK_EQUAL(nexthops7.begin()->getFace(), face2);
+  BOOST_CHECK_EQUAL(nexthops7.begin()->getCost(), 10);
+
+  entry.removeNextHop(face2);
+  const fib::NextHopList& nexthops8 = entry.getNextHops();
+  // []
+  BOOST_CHECK_EQUAL(nexthops8.size(), 0);
+
+  entry.removeNextHop(face2);
+  const fib::NextHopList& nexthops9 = entry.getNextHops();
+  // []
+  BOOST_CHECK_EQUAL(nexthops9.size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(Insert_LongestPrefixMatch)
+{
+  Name nameEmpty;
+  Name nameA   ("ndn:/A");
+  Name nameAB  ("ndn:/A/B");
+  Name nameABC ("ndn:/A/B/C");
+  Name nameABCD("ndn:/A/B/C/D");
+  Name nameE   ("ndn:/E");
+
+  std::pair<shared_ptr<fib::Entry>, bool> insertRes;
+  shared_ptr<fib::Entry> entry;
+
+  NameTree nameTree;
+  Fib fib(nameTree);
+  // []
+  BOOST_CHECK_EQUAL(fib.size(), 0);
+
+  entry = fib.findLongestPrefixMatch(nameA);
+  BOOST_REQUIRE(static_cast<bool>(entry)); // the empty entry
+
+  insertRes = fib.insert(nameEmpty);
+  BOOST_CHECK_EQUAL(insertRes.second, true);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameEmpty);
+  // ['/']
+  BOOST_CHECK_EQUAL(fib.size(), 1);
+
+  entry = fib.findLongestPrefixMatch(nameA);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+
+  insertRes = fib.insert(nameA);
+  BOOST_CHECK_EQUAL(insertRes.second, true);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
+  // ['/', '/A']
+  BOOST_CHECK_EQUAL(fib.size(), 2);
+
+  insertRes = fib.insert(nameA);
+  BOOST_CHECK_EQUAL(insertRes.second, false);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
+  // ['/', '/A']
+  BOOST_CHECK_EQUAL(fib.size(), 2);
+
+  entry = fib.findLongestPrefixMatch(nameA);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+
+  entry = fib.findLongestPrefixMatch(nameABCD);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+
+  insertRes = fib.insert(nameABC);
+  BOOST_CHECK_EQUAL(insertRes.second, true);
+  BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameABC);
+  // ['/', '/A', '/A/B/C']
+  BOOST_CHECK_EQUAL(fib.size(), 3);
+
+  entry = fib.findLongestPrefixMatch(nameA);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+
+  entry = fib.findLongestPrefixMatch(nameAB);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+
+  entry = fib.findLongestPrefixMatch(nameABCD);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameABC);
+
+  entry = fib.findLongestPrefixMatch(nameE);
+  BOOST_REQUIRE(static_cast<bool>(entry));
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+}
+
+BOOST_AUTO_TEST_CASE(RemoveNextHopFromAllEntries)
+{
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  Name nameEmpty("ndn:/");
+  Name nameA("ndn:/A");
+  Name nameB("ndn:/B");
+
+  std::pair<shared_ptr<fib::Entry>, bool> insertRes;
+  shared_ptr<fib::Entry> entry;
+
+  NameTree nameTree;
+  Fib fib(nameTree);
+  // {}
+
+  insertRes = fib.insert(nameA);
+  insertRes.first->addNextHop(face1, 0);
+  insertRes.first->addNextHop(face2, 0);
+  // {'/A':[1,2]}
+
+  insertRes = fib.insert(nameB);
+  insertRes.first->addNextHop(face1, 0);
+  // {'/A':[1,2], '/B':[1]}
+  BOOST_CHECK_EQUAL(fib.size(), 2);
+
+  fib.removeNextHopFromAllEntries(face1);
+  // {'/A':[2]}
+  BOOST_CHECK_EQUAL(fib.size(), 1);
+
+  entry = fib.findLongestPrefixMatch(nameA);
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
+  const fib::NextHopList& nexthopsA = entry->getNextHops();
+  BOOST_CHECK_EQUAL(nexthopsA.size(), 1);
+  BOOST_CHECK_EQUAL(nexthopsA.begin()->getFace(), face2);
+
+  entry = fib.findLongestPrefixMatch(nameB);
+  BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
+}
+
+void
+validateFindExactMatch(const Fib& fib, const Name& target)
+{
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
+  if (static_cast<bool>(entry))
+    {
+      BOOST_CHECK_EQUAL(entry->getPrefix(), target);
+    }
+  else
+    {
+      BOOST_FAIL("No entry found for " << target);
+    }
+}
+
+void
+validateNoExactMatch(const Fib& fib, const Name& target)
+{
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
+  if (static_cast<bool>(entry))
+    {
+      BOOST_FAIL("Found unexpected entry for " << target);
+    }
+}
+
+BOOST_AUTO_TEST_CASE(FindExactMatch)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
+  fib.insert("/A");
+  fib.insert("/A/B");
+  fib.insert("/A/B/C");
+
+  validateFindExactMatch(fib, "/A");
+  validateFindExactMatch(fib, "/A/B");
+  validateFindExactMatch(fib, "/A/B/C");
+  validateNoExactMatch(fib, "/");
+
+  validateNoExactMatch(fib, "/does/not/exist");
+
+  NameTree gapNameTree;
+  Fib gapFib(nameTree);
+  fib.insert("/X");
+  fib.insert("/X/Y/Z");
+
+  validateNoExactMatch(gapFib, "/X/Y");
+
+  NameTree emptyNameTree;
+  Fib emptyFib(emptyNameTree);
+  validateNoExactMatch(emptyFib, "/nothing/here");
+}
+
+void
+validateRemove(Fib& fib, const Name& target)
+{
+  fib.erase(target);
+
+  shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
+  if (static_cast<bool>(entry))
+    {
+      BOOST_FAIL("Found \"removed\" entry for " << target);
+    }
+}
+
+BOOST_AUTO_TEST_CASE(Remove)
+{
+  NameTree emptyNameTree;
+  Fib emptyFib(emptyNameTree);
+
+  emptyFib.erase("/does/not/exist"); // crash test
+
+  validateRemove(emptyFib, "/");
+
+  emptyFib.erase("/still/does/not/exist"); // crash test
+
+  NameTree nameTree;
+  Fib fib(nameTree);
+  fib.insert("/");
+  fib.insert("/A");
+  fib.insert("/A/B");
+  fib.insert("/A/B/C");
+
+  // check if we remove the right thing and leave
+  // everything else alone
+
+  validateRemove(fib, "/A/B");
+  validateFindExactMatch(fib, "/A");
+  validateFindExactMatch(fib, "/A/B/C");
+  validateFindExactMatch(fib, "/");
+
+  validateRemove(fib, "/A/B/C");
+  validateFindExactMatch(fib, "/A");
+  validateFindExactMatch(fib, "/");
+
+  validateRemove(fib, "/A");
+  validateFindExactMatch(fib, "/");
+
+  validateRemove(fib, "/");
+  validateNoExactMatch(fib, "/");
+
+  NameTree gapNameTree;
+  Fib gapFib(gapNameTree);
+  gapFib.insert("/X");
+  gapFib.insert("/X/Y/Z");
+
+  gapFib.erase("/X/Y"); //should do nothing
+  validateFindExactMatch(gapFib, "/X");
+  validateFindExactMatch(gapFib, "/X/Y/Z");
+}
+
+BOOST_AUTO_TEST_CASE(Iterator)
+{
+  NameTree nameTree;
+  Fib fib(nameTree);
+  Name nameA("/A");
+  Name nameAB("/A/B");
+  Name nameABC("/A/B/C");
+  Name nameRoot("/");
+
+  fib.insert(nameA);
+  fib.insert(nameAB);
+  fib.insert(nameABC);
+  fib.insert(nameRoot);
+
+  std::set<Name> expected;
+  expected.insert(nameA);
+  expected.insert(nameAB);
+  expected.insert(nameABC);
+  expected.insert(nameRoot);
+
+  for (Fib::const_iterator it = fib.begin(); it != fib.end(); it++)
+  {
+    bool isInSet = expected.find(it->getPrefix()) != expected.end();
+    BOOST_CHECK(isInSet);
+    expected.erase(it->getPrefix());
+  }
+
+  BOOST_CHECK_EQUAL(expected.size(), 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/measurements-accessor.cpp b/tests/daemon/table/measurements-accessor.cpp
new file mode 100644
index 0000000..6dc8ff3
--- /dev/null
+++ b/tests/daemon/table/measurements-accessor.cpp
@@ -0,0 +1,110 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/measurements-accessor.hpp"
+#include "fw/strategy.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(TableMeasurementsAccessor, BaseFixture)
+
+class MeasurementsAccessorTestStrategy : public fw::Strategy
+{
+public:
+  MeasurementsAccessorTestStrategy(Forwarder& forwarder, const Name& name)
+    : Strategy(forwarder, name)
+  {
+  }
+
+  virtual
+  ~MeasurementsAccessorTestStrategy()
+
+  {
+  }
+
+  virtual void
+  afterReceiveInterest(const Face& inFace,
+                       const Interest& interest,
+                       shared_ptr<fib::Entry> fibEntry,
+                       shared_ptr<pit::Entry> pitEntry)
+  {
+    BOOST_ASSERT(false);
+  }
+
+public: // accessors
+  MeasurementsAccessor&
+  getMeasurements_accessor()
+  {
+    return this->getMeasurements();
+  }
+};
+
+BOOST_AUTO_TEST_CASE(Access)
+{
+  Forwarder forwarder;
+
+  shared_ptr<MeasurementsAccessorTestStrategy> strategy1 =
+    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy1");
+  shared_ptr<MeasurementsAccessorTestStrategy> strategy2 =
+    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy2");
+
+  Name nameRoot("ndn:/");
+  Name nameA   ("ndn:/A");
+  Name nameAB  ("ndn:/A/B");
+  Name nameABC ("ndn:/A/B/C");
+  Name nameAD  ("ndn:/A/D");
+
+  StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
+  strategyChoice.install(strategy1);
+  strategyChoice.install(strategy2);
+  strategyChoice.insert(nameRoot, strategy1->getName());
+  strategyChoice.insert(nameA   , strategy2->getName());
+  strategyChoice.insert(nameAB  , strategy1->getName());
+
+  MeasurementsAccessor& accessor1 = strategy1->getMeasurements_accessor();
+  MeasurementsAccessor& accessor2 = strategy2->getMeasurements_accessor();
+
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameRoot)), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameA   )), false);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameAB  )), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameABC )), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameAD  )), false);
+
+  shared_ptr<measurements::Entry> entryRoot = forwarder.getMeasurements().get(nameRoot);
+  BOOST_CHECK_NO_THROW(accessor1.getParent(entryRoot));
+
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameRoot)), false);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameA   )), true);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameAB  )), false);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameABC )), false);
+  BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameAD  )), true);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/measurements.cpp b/tests/daemon/table/measurements.cpp
new file mode 100644
index 0000000..98676b5
--- /dev/null
+++ b/tests/daemon/table/measurements.cpp
@@ -0,0 +1,61 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/measurements.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(TableMeasurements, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Get_Parent)
+{
+  NameTree nameTree;
+  Measurements measurements(nameTree);
+
+  Name name0;
+  Name nameA ("ndn:/A");
+  Name nameAB("ndn:/A/B");
+
+  shared_ptr<measurements::Entry> entryAB = measurements.get(nameAB);
+  BOOST_REQUIRE(static_cast<bool>(entryAB));
+  BOOST_CHECK_EQUAL(entryAB->getName(), nameAB);
+
+  shared_ptr<measurements::Entry> entry0 = measurements.get(name0);
+  BOOST_REQUIRE(static_cast<bool>(entry0));
+
+  shared_ptr<measurements::Entry> entryA = measurements.getParent(entryAB);
+  BOOST_REQUIRE(static_cast<bool>(entryA));
+  BOOST_CHECK_EQUAL(entryA->getName(), nameA);
+
+  shared_ptr<measurements::Entry> entry0c = measurements.getParent(entryA);
+  BOOST_CHECK_EQUAL(entry0, entry0c);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/name-tree.cpp b/tests/daemon/table/name-tree.cpp
new file mode 100644
index 0000000..e5e9089
--- /dev/null
+++ b/tests/daemon/table/name-tree.cpp
@@ -0,0 +1,801 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/name-tree.hpp"
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+using name_tree::Entry;
+
+BOOST_FIXTURE_TEST_SUITE(TableNameTree, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Hash)
+{
+  Name root("/");
+  root.wireEncode();
+  size_t hashValue = name_tree::computeHash(root);
+  BOOST_CHECK_EQUAL(hashValue, static_cast<size_t>(0));
+
+  Name prefix("/nohello/world/ndn/research");
+  prefix.wireEncode();
+  std::vector<size_t> hashSet = name_tree::computeHashSet(prefix);
+  BOOST_CHECK_EQUAL(hashSet.size(), prefix.size() + 1);
+}
+
+BOOST_AUTO_TEST_CASE(Entry)
+{
+  Name prefix("ndn:/named-data/research/abc/def/ghi");
+
+  shared_ptr<name_tree::Entry> npe = make_shared<name_tree::Entry>(prefix);
+  BOOST_CHECK_EQUAL(npe->getPrefix(), prefix);
+
+  // examine all the get methods
+
+  size_t hash = npe->getHash();
+  BOOST_CHECK_EQUAL(hash, static_cast<size_t>(0));
+
+  shared_ptr<name_tree::Entry> parent = npe->getParent();
+  BOOST_CHECK(!static_cast<bool>(parent));
+
+  std::vector<shared_ptr<name_tree::Entry> >& childList = npe->getChildren();
+  BOOST_CHECK_EQUAL(childList.size(), static_cast<size_t>(0));
+
+  shared_ptr<fib::Entry> fib = npe->getFibEntry();
+  BOOST_CHECK(!static_cast<bool>(fib));
+
+  const std::vector< shared_ptr<pit::Entry> >& pitList = npe->getPitEntries();
+  BOOST_CHECK_EQUAL(pitList.size(), static_cast<size_t>(0));
+
+  // examine all the set method
+
+  npe->setHash(static_cast<size_t>(12345));
+  BOOST_CHECK_EQUAL(npe->getHash(), static_cast<size_t>(12345));
+
+  Name parentName("ndn:/named-data/research/abc/def");
+  parent = make_shared<name_tree::Entry>(parentName);
+  npe->setParent(parent);
+  BOOST_CHECK_EQUAL(npe->getParent(), parent);
+
+  // Insert FIB
+
+  shared_ptr<fib::Entry> fibEntry(new fib::Entry(prefix));
+  shared_ptr<fib::Entry> fibEntryParent(new fib::Entry(parentName));
+
+  npe->setFibEntry(fibEntry);
+  BOOST_CHECK_EQUAL(npe->getFibEntry(), fibEntry);
+
+  npe->setFibEntry(shared_ptr<fib::Entry>());
+  BOOST_CHECK(!static_cast<bool>(npe->getFibEntry()));
+
+  // Insert a PIT
+
+  shared_ptr<pit::Entry> PitEntry(make_shared<pit::Entry>(prefix));
+  shared_ptr<pit::Entry> PitEntry2(make_shared<pit::Entry>(parentName));
+
+  npe->insertPitEntry(PitEntry);
+  BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 1);
+
+  npe->insertPitEntry(PitEntry2);
+  BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 2);
+
+  npe->erasePitEntry(PitEntry);
+  BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 1);
+
+  npe->erasePitEntry(PitEntry2);
+  BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(NameTreeBasic)
+{
+  size_t nBuckets = 16;
+  NameTree nt(nBuckets);
+
+  BOOST_CHECK_EQUAL(nt.size(), 0);
+  BOOST_CHECK_EQUAL(nt.getNBuckets(), nBuckets);
+
+  Name nameABC("ndn:/a/b/c");
+  shared_ptr<name_tree::Entry> npeABC = nt.lookup(nameABC);
+  BOOST_CHECK_EQUAL(nt.size(), 4);
+
+  Name nameABD("/a/b/d");
+  shared_ptr<name_tree::Entry> npeABD = nt.lookup(nameABD);
+  BOOST_CHECK_EQUAL(nt.size(), 5);
+
+  Name nameAE("/a/e/");
+  shared_ptr<name_tree::Entry> npeAE = nt.lookup(nameAE);
+  BOOST_CHECK_EQUAL(nt.size(), 6);
+
+  Name nameF("/f");
+  shared_ptr<name_tree::Entry> npeF = nt.lookup(nameF);
+  BOOST_CHECK_EQUAL(nt.size(), 7);
+
+  // validate lookup() and findExactMatch()
+
+  Name nameAB ("/a/b");
+  BOOST_CHECK_EQUAL(npeABC->getParent(), nt.findExactMatch(nameAB));
+  BOOST_CHECK_EQUAL(npeABD->getParent(), nt.findExactMatch(nameAB));
+
+  Name nameA ("/a");
+  BOOST_CHECK_EQUAL(npeAE->getParent(), nt.findExactMatch(nameA));
+
+  Name nameRoot ("/");
+  BOOST_CHECK_EQUAL(npeF->getParent(), nt.findExactMatch(nameRoot));
+  BOOST_CHECK_EQUAL(nt.size(), 7);
+
+  Name name0("/does/not/exist");
+  shared_ptr<name_tree::Entry> npe0 = nt.findExactMatch(name0);
+  BOOST_CHECK(!static_cast<bool>(npe0));
+
+
+  // Longest Prefix Matching
+  shared_ptr<name_tree::Entry> temp;
+  Name nameABCLPM("/a/b/c/def/asdf/nlf");
+  temp = nt.findLongestPrefixMatch(nameABCLPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameABC));
+
+  Name nameABDLPM("/a/b/d/def/asdf/nlf");
+  temp = nt.findLongestPrefixMatch(nameABDLPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameABD));
+
+  Name nameABLPM("/a/b/hello/world");
+  temp = nt.findLongestPrefixMatch(nameABLPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameAB));
+
+  Name nameAELPM("/a/e/hello/world");
+  temp = nt.findLongestPrefixMatch(nameAELPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameAE));
+
+  Name nameALPM("/a/hello/world");
+  temp = nt.findLongestPrefixMatch(nameALPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameA));
+
+  Name nameFLPM("/f/hello/world");
+  temp = nt.findLongestPrefixMatch(nameFLPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameF));
+
+  Name nameRootLPM("/does_not_exist");
+  temp = nt.findLongestPrefixMatch(nameRootLPM);
+  BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameRoot));
+
+  bool eraseResult = false;
+  temp = nt.findExactMatch(nameABC);
+  if (static_cast<bool>(temp))
+    eraseResult = nt.
+  eraseEntryIfEmpty(temp);
+  BOOST_CHECK_EQUAL(nt.size(), 6);
+  BOOST_CHECK(!static_cast<bool>(nt.findExactMatch(nameABC)));
+  BOOST_CHECK_EQUAL(eraseResult, true);
+
+  eraseResult = false;
+  temp = nt.findExactMatch(nameABCLPM);
+  if (static_cast<bool>(temp))
+    eraseResult = nt.
+  eraseEntryIfEmpty(temp);
+  BOOST_CHECK(!static_cast<bool>(temp));
+  BOOST_CHECK_EQUAL(nt.size(), 6);
+  BOOST_CHECK_EQUAL(eraseResult, false);
+
+  // nt.dump(std::cout);
+
+  nt.lookup(nameABC);
+  BOOST_CHECK_EQUAL(nt.size(), 7);
+
+  eraseResult = false;
+  temp = nt.findExactMatch(nameABC);
+  if (static_cast<bool>(temp))
+    eraseResult = nt.
+  eraseEntryIfEmpty(temp);
+  BOOST_CHECK_EQUAL(nt.size(), 6);
+  BOOST_CHECK_EQUAL(eraseResult, true);
+  BOOST_CHECK(!static_cast<bool>(nt.findExactMatch(nameABC)));
+
+  BOOST_CHECK_EQUAL(nt.getNBuckets(), 16);
+
+  // should resize now
+  Name nameABCD("a/b/c/d");
+  nt.lookup(nameABCD);
+  Name nameABCDE("a/b/c/d/e");
+  nt.lookup(nameABCDE);
+  BOOST_CHECK_EQUAL(nt.size(), 9);
+  BOOST_CHECK_EQUAL(nt.getNBuckets(), 32);
+
+  // try to erase /a/b/c, should return false
+  temp = nt.findExactMatch(nameABC);
+  BOOST_CHECK_EQUAL(temp->getPrefix(), nameABC);
+  eraseResult = nt.
+  eraseEntryIfEmpty(temp);
+  BOOST_CHECK_EQUAL(eraseResult, false);
+  temp = nt.findExactMatch(nameABC);
+  BOOST_CHECK_EQUAL(temp->getPrefix(), nameABC);
+
+  temp = nt.findExactMatch(nameABD);
+  if (static_cast<bool>(temp))
+    nt.
+  eraseEntryIfEmpty(temp);
+  BOOST_CHECK_EQUAL(nt.size(), 8);
+}
+
+BOOST_AUTO_TEST_CASE(NameTreeIteratorFullEnumerate)
+{
+  size_t nBuckets = 1024;
+  NameTree nt(nBuckets);
+
+  BOOST_CHECK_EQUAL(nt.size(), 0);
+  BOOST_CHECK_EQUAL(nt.getNBuckets(), nBuckets);
+
+  Name nameABC("ndn:/a/b/c");
+  shared_ptr<name_tree::Entry> npeABC = nt.lookup(nameABC);
+  BOOST_CHECK_EQUAL(nt.size(), 4);
+
+  Name nameABD("/a/b/d");
+  shared_ptr<name_tree::Entry> npeABD = nt.lookup(nameABD);
+  BOOST_CHECK_EQUAL(nt.size(), 5);
+
+  Name nameAE("/a/e/");
+  shared_ptr<name_tree::Entry> npeAE = nt.lookup(nameAE);
+  BOOST_CHECK_EQUAL(nt.size(), 6);
+
+  Name nameF("/f");
+  shared_ptr<name_tree::Entry> npeF = nt.lookup(nameF);
+  BOOST_CHECK_EQUAL(nt.size(), 7);
+
+  Name nameRoot("/");
+  shared_ptr<name_tree::Entry> npeRoot = nt.lookup(nameRoot);
+  BOOST_CHECK_EQUAL(nt.size(), 7);
+
+  Name nameA("/a");
+  Name nameAB("/a/b");
+
+  bool hasRoot  = false;
+  bool hasA     = false;
+  bool hasAB    = false;
+  bool hasABC   = false;
+  bool hasABD   = false;
+  bool hasAE    = false;
+  bool hasF     = false;
+
+  int counter = 0;
+  NameTree::const_iterator it = nt.fullEnumerate();
+
+  for(; it != nt.end(); it++)
+  {
+    counter++;
+
+    if (it->getPrefix() == nameRoot)
+      hasRoot = true;
+    if (it->getPrefix() == nameA)
+      hasA    = true;
+    if (it->getPrefix() == nameAB)
+      hasAB   = true;
+    if (it->getPrefix() == nameABC)
+      hasABC  = true;
+    if (it->getPrefix() == nameABD)
+      hasABD  = true;
+    if (it->getPrefix() == nameAE)
+      hasAE   = true;
+    if (it->getPrefix() == nameF)
+      hasF    = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasRoot , true);
+  BOOST_CHECK_EQUAL(hasA    , true);
+  BOOST_CHECK_EQUAL(hasAB   , true);
+  BOOST_CHECK_EQUAL(hasABC  , true);
+  BOOST_CHECK_EQUAL(hasABD  , true);
+  BOOST_CHECK_EQUAL(hasAE   , true);
+  BOOST_CHECK_EQUAL(hasF    , true);
+
+  BOOST_CHECK_EQUAL(counter , 7);
+}
+
+// Predicates for testing the partial enumerate function
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_NameA_Only(const name_tree::Entry& entry)
+{
+  Name nameA("/a");
+  bool first = nameA.equals(entry.getPrefix());
+  return std::make_pair(first, true);
+}
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_Except_NameA(const name_tree::Entry& entry)
+{
+  Name nameA("/a");
+  bool first = !(nameA.equals(entry.getPrefix()));
+  return std::make_pair(first, true);
+}
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_NoSubNameA(const name_tree::Entry& entry)
+{
+  Name nameA("/a");
+  bool second = !(nameA.equals(entry.getPrefix()));
+  return std::make_pair(true, second);
+}
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_NoNameA_NoSubNameAB(const name_tree::Entry& entry)
+{
+  Name nameA("/a");
+  Name nameAB("/a/b");
+  bool first = !(nameA.equals(entry.getPrefix()));
+  bool second = !(nameAB.equals(entry.getPrefix()));
+  return std::make_pair(first, second);
+}
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_NoNameA_NoSubNameAC(const name_tree::Entry& entry)
+{
+  Name nameA("/a");
+  Name nameAC("/a/c");
+  bool first = !(nameA.equals(entry.getPrefix()));
+  bool second = !(nameAC.equals(entry.getPrefix()));
+  return std::make_pair(first, second);
+}
+
+static inline std::pair<bool, bool>
+predicate_NameTreeEntry_Example(const name_tree::Entry& entry)
+{
+  Name nameRoot("/");
+  Name nameA("/a");
+  Name nameAB("/a/b");
+  Name nameABC("/a/b/c");
+  Name nameAD("/a/d");
+  Name nameE("/e");
+  Name nameF("/f");
+
+  bool first = false;
+  bool second = false;
+
+  Name name = entry.getPrefix();
+
+  if (name == nameRoot || name == nameAB || name == nameABC || name == nameAD)
+  {
+    first = true;
+  }
+
+  if(name == nameRoot || name == nameA || name == nameF)
+  {
+    second = true;
+  }
+
+  return std::make_pair(first, second);
+}
+
+BOOST_AUTO_TEST_CASE(NameTreeIteratorPartialEnumerate)
+{
+  typedef NameTree::const_iterator const_iterator;
+
+  size_t nBuckets = 16;
+  NameTree nameTree(nBuckets);
+  int counter = 0;
+
+  // empty nameTree, should return end();
+  Name nameA("/a");
+  bool hasA = false;
+  const_iterator itA = nameTree.partialEnumerate(nameA);
+  BOOST_CHECK(itA == nameTree.end());
+
+  // We have "/", "/a", "/a/b", "a/c" now.
+  Name nameAB("/a/b");
+  bool hasAB = false;
+  nameTree.lookup(nameAB);
+
+  Name nameAC("/a/c");
+  bool hasAC = false;
+  nameTree.lookup(nameAC);
+  BOOST_CHECK_EQUAL(nameTree.size(), 4);
+
+  // Enumerate on some name that is not in nameTree
+  Name name0="/0";
+  const_iterator it0 = nameTree.partialEnumerate(name0);
+  BOOST_CHECK(it0 == nameTree.end());
+
+  // Accept "root" nameA only
+  const_iterator itAOnly = nameTree.partialEnumerate(nameA, &predicate_NameTreeEntry_NameA_Only);
+  BOOST_CHECK_EQUAL(itAOnly->getPrefix(), nameA);
+  BOOST_CHECK(++itAOnly == nameTree.end());
+
+  // Accept anything except "root" nameA
+  const_iterator itExceptA = nameTree.partialEnumerate(nameA, &predicate_NameTreeEntry_Except_NameA);
+  hasA = false;
+  hasAB = false;
+  hasAC = false;
+
+  counter = 0;
+  for (; itExceptA != nameTree.end(); itExceptA++)
+  {
+    counter++;
+
+    if (itExceptA->getPrefix() == nameA)
+      hasA  = true;
+
+    if (itExceptA->getPrefix() == nameAB)
+      hasAB = true;
+
+    if (itExceptA->getPrefix() == nameAC)
+      hasAC = true;
+  }
+  BOOST_CHECK_EQUAL(hasA,  false);
+  BOOST_CHECK_EQUAL(hasAB, true);
+  BOOST_CHECK_EQUAL(hasAC, true);
+
+  BOOST_CHECK_EQUAL(counter, 2);
+
+  Name nameAB1("a/b/1");
+  bool hasAB1 = false;
+  nameTree.lookup(nameAB1);
+
+  Name nameAB2("a/b/2");
+  bool hasAB2 = false;
+  nameTree.lookup(nameAB2);
+
+  Name nameAC1("a/c/1");
+  bool hasAC1 = false;
+  nameTree.lookup(nameAC1);
+
+  Name nameAC2("a/c/2");
+  bool hasAC2 = false;
+  nameTree.lookup(nameAC2);
+
+  BOOST_CHECK_EQUAL(nameTree.size(), 8);
+
+  // No NameA
+  // No SubTree from NameAB
+  const_iterator itNoNameANoSubNameAB = nameTree.partialEnumerate(nameA, &predicate_NameTreeEntry_NoNameA_NoSubNameAB);
+  hasA   = false;
+  hasAB  = false;
+  hasAB1 = false;
+  hasAB2 = false;
+  hasAC  = false;
+  hasAC1 = false;
+  hasAC2 = false;
+
+  counter = 0;
+
+  for (; itNoNameANoSubNameAB != nameTree.end(); itNoNameANoSubNameAB++)
+  {
+    counter++;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameA)
+      hasA   = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAB)
+      hasAB  = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAB1)
+      hasAB1 = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAB2)
+      hasAB2 = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAC)
+      hasAC  = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAC1)
+      hasAC1 = true;
+
+    if (itNoNameANoSubNameAB->getPrefix() == nameAC2)
+      hasAC2 = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasA,   false);
+  BOOST_CHECK_EQUAL(hasAB,  true);
+  BOOST_CHECK_EQUAL(hasAB1, false);
+  BOOST_CHECK_EQUAL(hasAB2, false);
+  BOOST_CHECK_EQUAL(hasAC,  true);
+  BOOST_CHECK_EQUAL(hasAC1, true);
+  BOOST_CHECK_EQUAL(hasAC2, true);
+
+  BOOST_CHECK_EQUAL(counter, 4);
+
+  // No NameA
+  // No SubTree from NameAC
+  const_iterator itNoNameANoSubNameAC = nameTree.partialEnumerate(nameA, &predicate_NameTreeEntry_NoNameA_NoSubNameAC);
+  hasA   = false;
+  hasAB  = false;
+  hasAB1 = false;
+  hasAB2 = false;
+  hasAC  = false;
+  hasAC1 = false;
+  hasAC2 = false;
+
+  counter = 0;
+
+  for (; itNoNameANoSubNameAC != nameTree.end(); itNoNameANoSubNameAC++)
+  {
+    counter++;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameA)
+      hasA   = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAB)
+      hasAB  = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAB1)
+      hasAB1 = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAB2)
+      hasAB2 = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAC)
+      hasAC  = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAC1)
+      hasAC1 = true;
+
+    if (itNoNameANoSubNameAC->getPrefix() == nameAC2)
+      hasAC2 = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasA,   false);
+  BOOST_CHECK_EQUAL(hasAB,  true);
+  BOOST_CHECK_EQUAL(hasAB1, true);
+  BOOST_CHECK_EQUAL(hasAB2, true);
+  BOOST_CHECK_EQUAL(hasAC,  true);
+  BOOST_CHECK_EQUAL(hasAC1, false);
+  BOOST_CHECK_EQUAL(hasAC2, false);
+
+  BOOST_CHECK_EQUAL(counter, 4);
+
+  // No Subtree from NameA
+  const_iterator itNoANoSubNameA = nameTree.partialEnumerate(nameA, &predicate_NameTreeEntry_NoSubNameA);
+
+  hasA   = false;
+  hasAB  = false;
+  hasAB1 = false;
+  hasAB2 = false;
+  hasAC  = false;
+  hasAC1 = false;
+  hasAC2 = false;
+
+  counter = 0;
+
+  for (; itNoANoSubNameA != nameTree.end(); itNoANoSubNameA++)
+  {
+    counter++;
+
+    if (itNoANoSubNameA->getPrefix() == nameA)
+      hasA   = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAB)
+      hasAB  = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAB1)
+      hasAB1 = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAB2)
+      hasAB2 = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAC)
+      hasAC  = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAC1)
+      hasAC1 = true;
+
+    if (itNoANoSubNameA->getPrefix() == nameAC2)
+      hasAC2 = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasA,   true);
+  BOOST_CHECK_EQUAL(hasAB,  false);
+  BOOST_CHECK_EQUAL(hasAB1, false);
+  BOOST_CHECK_EQUAL(hasAB2, false);
+  BOOST_CHECK_EQUAL(hasAC,  false);
+  BOOST_CHECK_EQUAL(hasAC1, false);
+  BOOST_CHECK_EQUAL(hasAC2, false);
+
+  BOOST_CHECK_EQUAL(counter, 1);
+
+  // Example
+  // /
+  // /A
+  // /A/B x
+  // /A/B/C
+  // /A/D x
+  // /E
+  // /F
+
+  NameTree nameTreeExample(nBuckets);
+
+  Name nameRoot("/");
+  bool hasRoot = false;
+
+  nameTreeExample.lookup(nameA);
+  hasA = false;
+  nameTreeExample.lookup(nameAB);
+  hasAB = false;
+
+  Name nameABC("a/b/c");
+  bool hasABC = false;
+  nameTreeExample.lookup(nameABC);
+
+  Name nameAD("/a/d");
+  nameTreeExample.lookup(nameAD);
+  bool hasAD = false;
+
+  Name nameE("/e");
+  nameTreeExample.lookup(nameE);
+  bool hasE = false;
+
+  Name nameF("/f");
+  nameTreeExample.lookup(nameF);
+  bool hasF = false;
+
+  counter = 0;
+  const_iterator itExample = nameTreeExample.partialEnumerate(nameA, &predicate_NameTreeEntry_Example);
+
+  for (; itExample != nameTreeExample.end(); itExample++)
+  {
+    counter++;
+
+    if (itExample->getPrefix() == nameRoot)
+      hasRoot = true;
+
+    if (itExample->getPrefix() == nameA)
+     hasA     = true;
+
+    if (itExample->getPrefix() == nameAB)
+     hasAB    = true;
+
+    if (itExample->getPrefix() == nameABC)
+     hasABC   = true;
+
+    if (itExample->getPrefix() == nameAD)
+     hasAD    = true;
+
+    if (itExample->getPrefix() == nameE)
+     hasE     = true;
+
+    if (itExample->getPrefix() == nameF)
+      hasF    = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasRoot, false);
+  BOOST_CHECK_EQUAL(hasA,    false);
+  BOOST_CHECK_EQUAL(hasAB,   true);
+  BOOST_CHECK_EQUAL(hasABC,  false);
+  BOOST_CHECK_EQUAL(hasAD,   true);
+  BOOST_CHECK_EQUAL(hasE,    false);
+  BOOST_CHECK_EQUAL(hasF,    false);
+
+  BOOST_CHECK_EQUAL(counter, 2);
+}
+
+
+BOOST_AUTO_TEST_CASE(NameTreeIteratorFindAllMatches)
+{
+  size_t nBuckets = 16;
+  NameTree nt(nBuckets);
+  int counter = 0;
+
+  Name nameABCDEF("a/b/c/d/e/f");
+  shared_ptr<name_tree::Entry> npeABCDEF = nt.lookup(nameABCDEF);
+
+  Name nameAAC("a/a/c");
+  shared_ptr<name_tree::Entry> npeAAC = nt.lookup(nameAAC);
+
+  Name nameAAD1("a/a/d/1");
+  shared_ptr<name_tree::Entry> npeAAD1 = nt.lookup(nameAAD1);
+
+  Name nameAAD2("a/a/d/2");
+  shared_ptr<name_tree::Entry> npeAAD2 = nt.lookup(nameAAD2);
+
+
+  BOOST_CHECK_EQUAL(nt.size(), 12);
+
+  Name nameRoot ("/");
+  Name nameA    ("/a");
+  Name nameAB   ("/a/b");
+  Name nameABC  ("/a/b/c");
+  Name nameABCD ("/a/b/c/d");
+  Name nameABCDE("/a/b/c/d/e");
+  Name nameAA   ("/a/a");
+  Name nameAAD  ("/a/a/d");
+
+  bool hasRoot    = false;
+  bool hasA       = false;
+  bool hasAB      = false;
+  bool hasABC     = false;
+  bool hasABCD    = false;
+  bool hasABCDE   = false;
+  bool hasABCDEF  = false;
+  bool hasAA      = false;
+  bool hasAAC     = false;
+  bool hasAAD     = false;
+  bool hasAAD1    = false;
+  bool hasAAD2    = false;
+
+  counter = 0;
+
+  for (NameTree::const_iterator it = nt.findAllMatches(nameABCDEF);
+      it != nt.end(); it++)
+  {
+    counter++;
+
+    if (it->getPrefix() == nameRoot)
+      hasRoot   = true;
+    if (it->getPrefix() == nameA)
+      hasA      = true;
+    if (it->getPrefix() == nameAB)
+      hasAB     = true;
+    if (it->getPrefix() == nameABC)
+      hasABC    = true;
+    if (it->getPrefix() == nameABCD)
+      hasABCD   = true;
+    if (it->getPrefix() == nameABCDE)
+      hasABCDE  = true;
+    if (it->getPrefix() == nameABCDEF)
+      hasABCDEF = true;
+    if (it->getPrefix() == nameAA)
+      hasAA     = true;
+    if (it->getPrefix() == nameAAC)
+      hasAAC    = true;
+    if (it->getPrefix() == nameAAD)
+      hasAAD    = true;
+    if (it->getPrefix() == nameAAD1)
+      hasAAD1   = true;
+    if (it->getPrefix() == nameAAD2)
+      hasAAD2   = true;
+  }
+
+  BOOST_CHECK_EQUAL(hasRoot   , true);
+  BOOST_CHECK_EQUAL(hasA      , true);
+  BOOST_CHECK_EQUAL(hasAB     , true);
+  BOOST_CHECK_EQUAL(hasABC    , true);
+  BOOST_CHECK_EQUAL(hasABCD   , true);
+  BOOST_CHECK_EQUAL(hasABCDE  , true);
+  BOOST_CHECK_EQUAL(hasABCDEF , true);
+  BOOST_CHECK_EQUAL(hasAA     , false);
+  BOOST_CHECK_EQUAL(hasAAC    , false);
+  BOOST_CHECK_EQUAL(hasAAD    , false);
+  BOOST_CHECK_EQUAL(hasAAD1   , false);
+  BOOST_CHECK_EQUAL(hasAAD2   , false);
+
+  BOOST_CHECK_EQUAL(counter, 7);
+}
+
+BOOST_AUTO_TEST_CASE(NameTreeHashTableResizeShrink)
+{
+  size_t nBuckets = 16;
+  NameTree nameTree(nBuckets);
+
+  Name prefix("/a/b/c/d/e/f/g/h"); // requires 9 buckets
+
+  shared_ptr<name_tree::Entry> entry = nameTree.lookup(prefix);
+  BOOST_CHECK_EQUAL(nameTree.size(), 9);
+  BOOST_CHECK_EQUAL(nameTree.getNBuckets(), 32);
+
+  nameTree.eraseEntryIfEmpty(entry);
+  BOOST_CHECK_EQUAL(nameTree.size(), 0);
+  BOOST_CHECK_EQUAL(nameTree.getNBuckets(), 16);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/pit.cpp b/tests/daemon/table/pit.cpp
new file mode 100644
index 0000000..c77c909
--- /dev/null
+++ b/tests/daemon/table/pit.cpp
@@ -0,0 +1,383 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/pit.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(TablePit, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(EntryInOutRecords)
+{
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  Name name("ndn:/KuYfjtRq");
+  shared_ptr<Interest> interest  = makeInterest(name);
+  shared_ptr<Interest> interest1 = makeInterest(name);
+  interest1->setInterestLifetime(time::milliseconds(2528));
+  interest1->setNonce(25559);
+  shared_ptr<Interest> interest2 = makeInterest(name);
+  interest2->setInterestLifetime(time::milliseconds(6464));
+  interest2->setNonce(19004);
+  shared_ptr<Interest> interest3 = makeInterest(name);
+  interest3->setInterestLifetime(time::milliseconds(3585));
+  interest3->setNonce(24216);
+  shared_ptr<Interest> interest4 = makeInterest(name);
+  interest4->setInterestLifetime(time::milliseconds(8795));
+  interest4->setNonce(17365);
+
+  pit::Entry entry(*interest);
+
+  BOOST_CHECK_EQUAL(entry.getInterest().getName(), name);
+  BOOST_CHECK_EQUAL(entry.getName(), name);
+
+  const pit::InRecordCollection& inRecords1 = entry.getInRecords();
+  BOOST_CHECK_EQUAL(inRecords1.size(), 0);
+  const pit::OutRecordCollection& outRecords1 = entry.getOutRecords();
+  BOOST_CHECK_EQUAL(outRecords1.size(), 0);
+
+  // insert InRecord
+  time::steady_clock::TimePoint before1 = time::steady_clock::now();
+  pit::InRecordCollection::iterator in1 =
+    entry.insertOrUpdateInRecord(face1, *interest1);
+  time::steady_clock::TimePoint after1 = time::steady_clock::now();
+  const pit::InRecordCollection& inRecords2 = entry.getInRecords();
+  BOOST_CHECK_EQUAL(inRecords2.size(), 1);
+  BOOST_CHECK(in1 == inRecords2.begin());
+  BOOST_CHECK_EQUAL(in1->getFace(), face1);
+  BOOST_CHECK_EQUAL(in1->getLastNonce(), interest1->getNonce());
+  BOOST_CHECK_GE(in1->getLastRenewed(), before1);
+  BOOST_CHECK_LE(in1->getLastRenewed(), after1);
+  BOOST_CHECK_LE(in1->getExpiry() - in1->getLastRenewed()
+                 - interest1->getInterestLifetime(),
+                 (after1 - before1));
+
+  // insert OutRecord
+  time::steady_clock::TimePoint before2 = time::steady_clock::now();
+  pit::OutRecordCollection::iterator out1 =
+    entry.insertOrUpdateOutRecord(face1, *interest1);
+  time::steady_clock::TimePoint after2 = time::steady_clock::now();
+  const pit::OutRecordCollection& outRecords2 = entry.getOutRecords();
+  BOOST_CHECK_EQUAL(outRecords2.size(), 1);
+  BOOST_CHECK(out1 == outRecords2.begin());
+  BOOST_CHECK_EQUAL(out1->getFace(), face1);
+  BOOST_CHECK_EQUAL(out1->getLastNonce(), interest1->getNonce());
+  BOOST_CHECK_GE(out1->getLastRenewed(), before2);
+  BOOST_CHECK_LE(out1->getLastRenewed(), after2);
+  BOOST_CHECK_LE(out1->getExpiry() - out1->getLastRenewed()
+                 - interest1->getInterestLifetime(),
+                 (after2 - before2));
+
+  // update InRecord
+  time::steady_clock::TimePoint before3 = time::steady_clock::now();
+  pit::InRecordCollection::iterator in2 =
+    entry.insertOrUpdateInRecord(face1, *interest2);
+  time::steady_clock::TimePoint after3 = time::steady_clock::now();
+  const pit::InRecordCollection& inRecords3 = entry.getInRecords();
+  BOOST_CHECK_EQUAL(inRecords3.size(), 1);
+  BOOST_CHECK(in2 == inRecords3.begin());
+  BOOST_CHECK_EQUAL(in2->getFace(), face1);
+  BOOST_CHECK_EQUAL(in2->getLastNonce(), interest2->getNonce());
+  BOOST_CHECK_LE(in2->getExpiry() - in2->getLastRenewed()
+                 - interest2->getInterestLifetime(),
+                 (after3 - before3));
+
+  // insert another InRecord
+  pit::InRecordCollection::iterator in3 =
+    entry.insertOrUpdateInRecord(face2, *interest3);
+  const pit::InRecordCollection& inRecords4 = entry.getInRecords();
+  BOOST_CHECK_EQUAL(inRecords4.size(), 2);
+  BOOST_CHECK_EQUAL(in3->getFace(), face2);
+
+  // delete all InRecords
+  entry.deleteInRecords();
+  const pit::InRecordCollection& inRecords5 = entry.getInRecords();
+  BOOST_CHECK_EQUAL(inRecords5.size(), 0);
+
+  // insert another OutRecord
+  pit::OutRecordCollection::iterator out2 =
+    entry.insertOrUpdateOutRecord(face2, *interest4);
+  const pit::OutRecordCollection& outRecords3 = entry.getOutRecords();
+  BOOST_CHECK_EQUAL(outRecords3.size(), 2);
+  BOOST_CHECK_EQUAL(out2->getFace(), face2);
+
+  // delete OutRecord
+  entry.deleteOutRecord(face2);
+  const pit::OutRecordCollection& outRecords4 = entry.getOutRecords();
+  BOOST_REQUIRE_EQUAL(outRecords4.size(), 1);
+  BOOST_CHECK_EQUAL(outRecords4.begin()->getFace(), face1);
+}
+
+BOOST_AUTO_TEST_CASE(EntryNonce)
+{
+  shared_ptr<Interest> interest = makeInterest("ndn:/qtCQ7I1c");
+
+  pit::Entry entry(*interest);
+
+  BOOST_CHECK_EQUAL(entry.addNonce(25559), true);
+  BOOST_CHECK_EQUAL(entry.addNonce(25559), false);
+  BOOST_CHECK_EQUAL(entry.addNonce(19004), true);
+  BOOST_CHECK_EQUAL(entry.addNonce(19004), false);
+}
+
+BOOST_AUTO_TEST_CASE(EntryLifetime)
+{
+  shared_ptr<Interest> interest = makeInterest("ndn:/7oIEurbgy6");
+  BOOST_ASSERT(interest->getInterestLifetime() < time::milliseconds::zero()); // library uses -1 to indicate unset lifetime
+
+  shared_ptr<Face> face = make_shared<DummyFace>();
+  pit::Entry entry(*interest);
+
+  pit::InRecordCollection::iterator inIt = entry.insertOrUpdateInRecord(face, *interest);
+  BOOST_CHECK_GT(inIt->getExpiry(), time::steady_clock::now());
+
+  pit::OutRecordCollection::iterator outIt = entry.insertOrUpdateOutRecord(face, *interest);
+  BOOST_CHECK_GT(outIt->getExpiry(), time::steady_clock::now());
+}
+
+BOOST_AUTO_TEST_CASE(EntryCanForwardTo)
+{
+  shared_ptr<Interest> interest = makeInterest("ndn:/WDsuBLIMG");
+  pit::Entry entry(*interest);
+
+  shared_ptr<Face> face1 = make_shared<DummyFace>();
+  shared_ptr<Face> face2 = make_shared<DummyFace>();
+
+  entry.insertOrUpdateInRecord(face1, *interest);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), false);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
+
+  entry.insertOrUpdateInRecord(face2, *interest);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), true);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
+
+  entry.insertOrUpdateOutRecord(face1, *interest);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), false);
+  BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
+}
+
+BOOST_AUTO_TEST_CASE(Insert)
+{
+  Name name1("ndn:/5vzBNnMst");
+  Name name2("ndn:/igSGfEIM62");
+  Exclude exclude1;
+  exclude1.excludeOne(Name::Component("u26p47oep"));
+  Exclude exclude2;
+  exclude2.excludeBefore(Name::Component("u26p47oep"));
+  ndn::KeyLocator keyLocator1("ndn:/sGAE3peMHA");
+  ndn::KeyLocator keyLocator2("ndn:/nIJH6pr4");
+
+  NameTree nameTree(16);
+  Pit pit(nameTree);
+  BOOST_CHECK_EQUAL(pit.size(), 0);
+  std::pair<shared_ptr<pit::Entry>, bool> insertResult;
+
+  // base
+  shared_ptr<Interest> interestA = make_shared<Interest>(name1);
+  insertResult = pit.insert(*interestA);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 1);
+
+  // A+MinSuffixComponents
+  shared_ptr<Interest> interestB = make_shared<Interest>(*interestA);
+  interestB->setMinSuffixComponents(2);
+  insertResult = pit.insert(*interestB);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 2);
+
+  // A+MaxSuffixComponents
+  shared_ptr<Interest> interestC = make_shared<Interest>(*interestA);
+  interestC->setMaxSuffixComponents(4);
+  insertResult = pit.insert(*interestC);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 3);
+
+  // A+KeyLocator1
+  shared_ptr<Interest> interestD = make_shared<Interest>(*interestA);
+  interestD->setPublisherPublicKeyLocator(keyLocator1);
+  insertResult = pit.insert(*interestD);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 4);
+
+  // A+KeyLocator2
+  shared_ptr<Interest> interestE = make_shared<Interest>(*interestA);
+  interestE->setPublisherPublicKeyLocator(keyLocator2);
+  insertResult = pit.insert(*interestE);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 5);
+
+  // A+Exclude1
+  shared_ptr<Interest> interestF = make_shared<Interest>(*interestA);
+  interestF->setExclude(exclude1);
+  insertResult = pit.insert(*interestF);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 6);
+
+  // A+Exclude2
+  shared_ptr<Interest> interestG = make_shared<Interest>(*interestA);
+  interestG->setExclude(exclude2);
+  insertResult = pit.insert(*interestG);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 7);
+
+  // A+ChildSelector0
+  shared_ptr<Interest> interestH = make_shared<Interest>(*interestA);
+  interestH->setChildSelector(0);
+  insertResult = pit.insert(*interestH);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 8);
+
+  // A+ChildSelector1
+  shared_ptr<Interest> interestI = make_shared<Interest>(*interestA);
+  interestI->setChildSelector(1);
+  insertResult = pit.insert(*interestI);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 9);
+
+  // A+MustBeFresh
+  shared_ptr<Interest> interestJ = make_shared<Interest>(*interestA);
+  interestJ->setMustBeFresh(true);
+  insertResult = pit.insert(*interestJ);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 10);
+
+  // A+InterestLifetime
+  shared_ptr<Interest> interestK = make_shared<Interest>(*interestA);
+  interestK->setInterestLifetime(time::milliseconds(1000));
+  insertResult = pit.insert(*interestK);
+  BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ
+  BOOST_CHECK_EQUAL(pit.size(), 10);
+
+  // A+Nonce
+  shared_ptr<Interest> interestL = make_shared<Interest>(*interestA);
+  interestL->setNonce(2192);
+  insertResult = pit.insert(*interestL);
+  BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ
+  BOOST_CHECK_EQUAL(pit.size(), 10);
+
+  // different Name+Exclude1
+  shared_ptr<Interest> interestM = make_shared<Interest>(name2);
+  interestM->setExclude(exclude1);
+  insertResult = pit.insert(*interestM);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 11);
+}
+
+BOOST_AUTO_TEST_CASE(Erase)
+{
+  Interest interest(Name("ndn:/z88Admz6A2"));
+
+  NameTree nameTree(16);
+  Pit pit(nameTree);
+
+  std::pair<shared_ptr<pit::Entry>, bool> insertResult;
+
+  BOOST_CHECK_EQUAL(pit.size(), 0);
+
+  insertResult = pit.insert(interest);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 1);
+
+  insertResult = pit.insert(interest);
+  BOOST_CHECK_EQUAL(insertResult.second, false);
+  BOOST_CHECK_EQUAL(pit.size(), 1);
+
+  pit.erase(insertResult.first);
+  BOOST_CHECK_EQUAL(pit.size(), 0);
+
+  insertResult = pit.insert(interest);
+  BOOST_CHECK_EQUAL(insertResult.second, true);
+  BOOST_CHECK_EQUAL(pit.size(), 1);
+
+}
+
+BOOST_AUTO_TEST_CASE(FindAllDataMatches)
+{
+  Name nameA   ("ndn:/A");
+  Name nameAB  ("ndn:/A/B");
+  Name nameABC ("ndn:/A/B/C");
+  Name nameABCD("ndn:/A/B/C/D");
+  Name nameD   ("ndn:/D");
+
+  Interest interestA  (nameA  );
+  Interest interestABC(nameABC);
+  Interest interestD  (nameD  );
+
+  NameTree nameTree(16);
+  Pit pit(nameTree);
+  int count = 0;
+
+  BOOST_CHECK_EQUAL(pit.size(), 0);
+
+  pit.insert(interestA  );
+  pit.insert(interestABC);
+  pit.insert(interestD  );
+
+  nameTree.lookup(nameABCD); // make sure /A/B/C/D is in nameTree
+
+  BOOST_CHECK_EQUAL(pit.size(), 3);
+
+  Data data(nameABCD);
+
+  shared_ptr<pit::DataMatchResult> matches = pit.findAllDataMatches(data);
+
+  bool hasA   = false;
+  bool hasAB  = false;
+  bool hasABC = false;
+  bool hasD   = false;
+
+  for (pit::DataMatchResult::iterator it = matches->begin();
+       it != matches->end(); ++it) {
+    ++count;
+    shared_ptr<pit::Entry> entry = *it;
+
+    if (entry->getName().equals(nameA ))
+      hasA   = true;
+
+    if (entry->getName().equals(nameAB))
+      hasAB  = true;
+
+    if (entry->getName().equals(nameABC))
+      hasABC = true;
+
+    if (entry->getName().equals(nameD))
+      hasD   = true;
+  }
+  BOOST_CHECK_EQUAL(hasA  , true);
+  BOOST_CHECK_EQUAL(hasAB , false);
+  BOOST_CHECK_EQUAL(hasABC, true);
+  BOOST_CHECK_EQUAL(hasD  , false);
+
+  BOOST_CHECK_EQUAL(count, 2);
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/strategy-choice.cpp b/tests/daemon/table/strategy-choice.cpp
new file mode 100644
index 0000000..6927375
--- /dev/null
+++ b/tests/daemon/table/strategy-choice.cpp
@@ -0,0 +1,155 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/strategy-choice.hpp"
+#include "tests/daemon/fw/dummy-strategy.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(TableStrategyChoice, BaseFixture)
+
+using fw::Strategy;
+
+BOOST_AUTO_TEST_CASE(Effective)
+{
+  Forwarder forwarder;
+  Name nameP("ndn:/strategy/P");
+  Name nameQ("ndn:/strategy/Q");
+  Name nameZ("ndn:/strategy/Z");
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+
+  StrategyChoice& table = forwarder.getStrategyChoice();
+
+  // install
+  BOOST_CHECK_EQUAL(table.install(strategyP), true);
+  BOOST_CHECK_EQUAL(table.install(strategyQ), true);
+  BOOST_CHECK_EQUAL(table.install(strategyQ), false);
+
+  BOOST_CHECK(table.insert("ndn:/", nameP));
+  // { '/'=>P }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+
+  BOOST_CHECK(table.insert("ndn:/A/B", nameP));
+  // { '/'=>P, '/A/B'=>P }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  // same instance
+  BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/"),    strategyP.get());
+  BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/A"),   strategyP.get());
+  BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/A/B"), strategyP.get());
+
+  table.erase("ndn:/A"); // no effect
+  // { '/'=>P, '/A/B'=>P }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+
+  BOOST_CHECK(table.insert("ndn:/A", nameQ));
+  // { '/'=>P, '/A/B'=>P, '/A'=>Q }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+
+  table.erase("ndn:/A/B");
+  // { '/'=>P, '/A'=>Q }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameQ);
+
+  BOOST_CHECK(!table.insert("ndn:/", nameZ)); // non existent strategy
+
+  BOOST_CHECK(table.insert("ndn:/", nameQ));
+  BOOST_CHECK(table.insert("ndn:/A", nameP));
+  // { '/'=>Q, '/A'=>P }
+
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameQ);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/D")  .getName(), nameQ);
+}
+
+class PStrategyInfo : public fw::StrategyInfo
+{
+};
+
+BOOST_AUTO_TEST_CASE(ClearStrategyInfo)
+{
+  Forwarder forwarder;
+  Name nameP("ndn:/strategy/P");
+  Name nameQ("ndn:/strategy/Q");
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+
+  StrategyChoice& table = forwarder.getStrategyChoice();
+  Measurements& measurements = forwarder.getMeasurements();
+
+  // install
+  table.install(strategyP);
+  table.install(strategyQ);
+
+  BOOST_CHECK(table.insert("ndn:/", nameP));
+  // { '/'=>P }
+  measurements.get("ndn:/")     ->getOrCreateStrategyInfo<PStrategyInfo>();
+  measurements.get("ndn:/A")    ->getOrCreateStrategyInfo<PStrategyInfo>();
+  measurements.get("ndn:/A/B")  ->getOrCreateStrategyInfo<PStrategyInfo>();
+  measurements.get("ndn:/A/C")  ->getOrCreateStrategyInfo<PStrategyInfo>();
+
+  BOOST_CHECK(table.insert("ndn:/A/B", nameP));
+  // { '/'=>P, '/A/B'=>P }
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/")   ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A")  ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
+
+  BOOST_CHECK(table.insert("ndn:/A", nameQ));
+  // { '/'=>P, '/A/B'=>P, '/A'=>Q }
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/")   ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A")  ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
+
+  table.erase("ndn:/A/B");
+  // { '/'=>P, '/A'=>Q }
+  BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/")   ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A")  ->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
+  BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/table/strategy-info-host.cpp b/tests/daemon/table/strategy-info-host.cpp
new file mode 100644
index 0000000..82d4fcc
--- /dev/null
+++ b/tests/daemon/table/strategy-info-host.cpp
@@ -0,0 +1,79 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "table/strategy-info-host.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+static int g_DummyStrategyInfo_count = 0;
+
+class DummyStrategyInfo : public fw::StrategyInfo
+{
+public:
+  DummyStrategyInfo(int id)
+    : m_id(id)
+  {
+    ++g_DummyStrategyInfo_count;
+  }
+
+  virtual ~DummyStrategyInfo()
+  {
+    --g_DummyStrategyInfo_count;
+  }
+
+  int m_id;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TableStrategyInfoHost, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(SetGetClear)
+{
+  StrategyInfoHost host;
+
+  BOOST_CHECK(!static_cast<bool>(host.getStrategyInfo<DummyStrategyInfo>()));
+
+  g_DummyStrategyInfo_count = 0;
+
+  shared_ptr<DummyStrategyInfo> info = make_shared<DummyStrategyInfo>(7591);
+  host.setStrategyInfo(info);
+  BOOST_REQUIRE(static_cast<bool>(host.getStrategyInfo<DummyStrategyInfo>()));
+  BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 7591);
+
+  info.reset(); // unlink local reference
+  // host should still have a reference to info
+  BOOST_REQUIRE(static_cast<bool>(host.getStrategyInfo<DummyStrategyInfo>()));
+  BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 7591);
+
+  host.clearStrategyInfo();
+  BOOST_CHECK(!static_cast<bool>(host.getStrategyInfo<DummyStrategyInfo>()));
+  BOOST_CHECK_EQUAL(g_DummyStrategyInfo_count, 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/global-configuration.cpp b/tests/global-configuration.cpp
new file mode 100644
index 0000000..2b4ce9d
--- /dev/null
+++ b/tests/global-configuration.cpp
@@ -0,0 +1,53 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "test-common.hpp"
+#include "core/logger.hpp"
+#include "core/config-file.hpp"
+
+#include <boost/filesystem.hpp>
+
+namespace nfd {
+namespace tests {
+
+class GlobalConfigurationFixture
+{
+public:
+  GlobalConfigurationFixture()
+  {
+    const std::string filename = "unit-tests.conf";
+    if (boost::filesystem::exists(filename))
+      {
+        ConfigFile config;
+        LoggerFactory::getInstance().setConfigFile(config);
+
+        config.parse(filename, false);
+      }
+  }
+};
+
+BOOST_GLOBAL_FIXTURE(GlobalConfigurationFixture)
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/limited-io.cpp b/tests/limited-io.cpp
new file mode 100644
index 0000000..b22be89
--- /dev/null
+++ b/tests/limited-io.cpp
@@ -0,0 +1,93 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "limited-io.hpp"
+#include "core/logger.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("LimitedIo");
+
+const int LimitedIo::UNLIMITED_OPS = std::numeric_limits<int>::max();
+const time::nanoseconds LimitedIo::UNLIMITED_TIME = time::nanoseconds::min();
+
+LimitedIo::LimitedIo()
+  : m_isRunning(false)
+  , m_nOpsRemaining(0)
+{
+}
+
+LimitedIo::StopReason
+LimitedIo::run(int nOpsLimit, const time::nanoseconds& nTimeLimit)
+{
+  BOOST_ASSERT(!m_isRunning);
+  m_isRunning = true;
+
+  m_reason = NO_WORK;
+  m_nOpsRemaining = nOpsLimit;
+  if (nTimeLimit >= time::nanoseconds::zero()) {
+    m_timeout = scheduler::schedule(nTimeLimit, bind(&LimitedIo::afterTimeout, this));
+  }
+
+  try {
+    getGlobalIoService().run();
+  }
+  catch (std::exception& ex) {
+    m_reason = EXCEPTION;
+    NFD_LOG_ERROR("g_io.run() exception: " << ex.what());
+    m_lastException = ex;
+  }
+
+  getGlobalIoService().reset();
+  scheduler::cancel(m_timeout);
+  m_isRunning = false;
+  return m_reason;
+}
+
+void
+LimitedIo::afterOp()
+{
+  --m_nOpsRemaining;
+  if (m_nOpsRemaining <= 0) {
+    m_reason = EXCEED_OPS;
+    getGlobalIoService().stop();
+  }
+}
+
+void
+LimitedIo::afterTimeout()
+{
+  m_reason = EXCEED_TIME;
+  getGlobalIoService().stop();
+}
+
+const std::exception&
+LimitedIo::getLastException() const
+{
+  return m_lastException;
+}
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/limited-io.hpp b/tests/limited-io.hpp
new file mode 100644
index 0000000..cb81247
--- /dev/null
+++ b/tests/limited-io.hpp
@@ -0,0 +1,88 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_LIMITED_IO_HPP
+#define NFD_TESTS_LIMITED_IO_HPP
+
+#include "core/global-io.hpp"
+#include "core/scheduler.hpp"
+
+namespace nfd {
+namespace tests {
+
+/** \brief provides IO operations limit and/or time limit for unit testing
+ */
+class LimitedIo
+{
+public:
+  LimitedIo();
+
+  /// indicates why .run returns
+  enum StopReason
+  {
+    /// g_io.run() runs normally because there's no work to do
+    NO_WORK,
+    /// .afterOp() has been invoked nOpsLimit times
+    EXCEED_OPS,
+    /// nTimeLimit has elapsed
+    EXCEED_TIME,
+    /// an exception is thrown
+    EXCEPTION
+  };
+
+  /** \brief g_io.run() with operation count and/or time limit
+   *
+   *  \param nOpsLimit operation count limit, pass UNLIMITED_OPS for no limit
+   *  \param nTimeLimit time limit, pass UNLIMITED_TIME for no limit
+   */
+  StopReason
+  run(int nOpsLimit, const time::nanoseconds& nTimeLimit);
+
+  /// count an operation
+  void
+  afterOp();
+
+  const std::exception&
+  getLastException() const;
+
+private:
+  void
+  afterTimeout();
+
+public:
+  static const int UNLIMITED_OPS;
+  static const time::nanoseconds UNLIMITED_TIME;
+
+private:
+  bool m_isRunning;
+  int m_nOpsRemaining;
+  EventId m_timeout;
+  StopReason m_reason;
+  std::exception m_lastException;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_LIMITED_IO_HPP
diff --git a/tests/main.cpp b/tests/main.cpp
index a7e827d..580d72b 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -1,8 +1,26 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (C) 2014 Named Data Networking Project
- * See COPYING for copyright and distribution information.
- */
+ * 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
 
 #define BOOST_TEST_MAIN 1
 #define BOOST_TEST_DYN_LINK 1
diff --git a/tests/other/cs-smoketest.cpp b/tests/other/cs-smoketest.cpp
new file mode 100644
index 0000000..7c50d49
--- /dev/null
+++ b/tests/other/cs-smoketest.cpp
@@ -0,0 +1,110 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Ilya Moiseenko <iliamo@ucla.edu>
+ **/
+
+#include "table/cs.hpp"
+#include "table/cs-entry.hpp"
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+namespace nfd {
+
+static void
+runStressTest()
+{
+  shared_ptr<Data> dataWorkload[70000];
+  shared_ptr<Interest> interestWorkload[70000];
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0), 0));
+
+  // 182 MB in memory
+  for (int i = 0; i < 70000; i++)
+    {
+      Name name("/stress/test");
+      name.appendNumber(i % 4);
+      name.appendNumber(i);
+
+      shared_ptr<Interest> interest = make_shared<Interest>(name);
+      interestWorkload[i] = interest;
+
+      shared_ptr<Data> data = make_shared<Data>(name);
+      data->setSignature(fakeSignature);
+      dataWorkload[i] = data;
+    }
+
+  time::duration<double, boost::nano> previousResult(0);
+
+  for (size_t nInsertions = 1000; nInsertions < 10000000; nInsertions *= 2)
+    {
+      Cs cs;
+      srand(time::toUnixTimestamp(time::system_clock::now()).count());
+
+      time::steady_clock::TimePoint startTime = time::steady_clock::now();
+
+      size_t workloadCounter = 0;
+      for (size_t i = 0; i < nInsertions; i++)
+        {
+          if (workloadCounter > 69999)
+            workloadCounter = 0;
+
+          cs.find(*interestWorkload[workloadCounter]);
+          cs.insert(*dataWorkload[workloadCounter]);
+
+          workloadCounter++;
+        }
+
+      time::steady_clock::TimePoint endTime = time::steady_clock::now();
+
+      time::duration<double, boost::nano> runDuration = endTime - startTime;
+      time::duration<double, boost::nano> perOperationTime = runDuration / nInsertions;
+
+      std::cout << "nItem = " << nInsertions << std::endl;
+      std::cout << "Total running time = "
+                << time::duration_cast<time::duration<double> >(runDuration)
+                << std::endl;
+      std::cout << "Average per-operation time = "
+                << time::duration_cast<time::duration<double, boost::micro> >(perOperationTime)
+                << std::endl;
+
+      if (previousResult > time::nanoseconds(1))
+        std::cout << "Change compared to the previous: "
+                  << (100.0 * perOperationTime / previousResult) << "%" << std::endl;
+
+      std::cout << "\n=================================\n" << std::endl;
+
+      previousResult = perOperationTime;
+    }
+}
+
+} // namespace nfd
+
+int
+main(int argc, char** argv)
+{
+  nfd::runStressTest();
+
+  return 0;
+}
diff --git a/tests/other/wscript b/tests/other/wscript
new file mode 100644
index 0000000..20cae46
--- /dev/null
+++ b/tests/other/wscript
@@ -0,0 +1,32 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+"""
+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
+
+This file is part of NFD (Named Data Networking Forwarding Daemon).
+See AUTHORS.md for complete list of NFD authors and contributors.
+
+NFD 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.
+
+NFD 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
+NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+top = '../..'
+
+def build(bld):
+    bld.program(target="../../cs-smoketest",
+                source="cs-smoketest.cpp",
+                use='daemon-objects',
+                install_path=None)
diff --git a/tests/test-case.cpp.sample b/tests/test-case.cpp.sample
new file mode 100644
index 0000000..259d75f
--- /dev/null
+++ b/tests/test-case.cpp.sample
@@ -0,0 +1,63 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+// #include "unit-under-test.hpp"
+// Unit being tested MUST be included first, to ensure header compiles on its own.
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+// Unit tests SHOULD go inside nfd::tests namespace.
+
+// Test suite SHOULD use BaseFixture or a subclass of it.
+BOOST_FIXTURE_TEST_SUITE(TestSkeleton, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Test1)
+{
+  int i = 0;
+  /**
+   * For reference of available Boost.Test macros, @see http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/utf/testing-tools/reference.html
+   */
+
+  BOOST_REQUIRE_NO_THROW(i = 1);
+  BOOST_REQUIRE_EQUAL(i, 1);
+}
+
+// Custom fixture SHOULD derive from BaseFixture.
+class Test2Fixture : protected BaseFixture
+{
+};
+
+BOOST_FIXTURE_TEST_CASE(Test2, Test2Fixture)
+{
+  // g_io is a shorthand of getGlobalIoService()
+  // resetGlobalIoService() is automatically called after each test case
+  g_io.run();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
new file mode 100644
index 0000000..f4fc0ed
--- /dev/null
+++ b/tests/test-common.hpp
@@ -0,0 +1,82 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TESTS_TEST_COMMON_HPP
+#define NFD_TESTS_TEST_COMMON_HPP
+
+#include <boost/test/unit_test.hpp>
+#include "core/global-io.hpp"
+#include "core/logger.hpp"
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+namespace nfd {
+namespace tests {
+
+/** \brief base test fixture
+ *
+ *  Every test case should be based on this fixture,
+ *  to have per test case io_service initialization.
+ */
+class BaseFixture
+{
+protected:
+  BaseFixture()
+    : g_io(getGlobalIoService())
+  {
+  }
+
+  ~BaseFixture()
+  {
+    resetGlobalIoService();
+  }
+
+protected:
+  /// reference to global io_service
+  boost::asio::io_service& g_io;
+};
+
+
+inline shared_ptr<Interest>
+makeInterest(const Name& name)
+{
+  return make_shared<Interest>(name);
+}
+
+inline shared_ptr<Data>
+makeData(const Name& name)
+{
+  shared_ptr<Data> data = make_shared<Data>(name);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0), 0));
+  data->setSignature(fakeSignature);
+
+  return data;
+}
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_TEST_COMMON_HPP
diff --git a/tests/wscript b/tests/wscript
new file mode 100644
index 0000000..423e5e3
--- /dev/null
+++ b/tests/wscript
@@ -0,0 +1,69 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+"""
+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
+
+This file is part of NFD (Named Data Networking Forwarding Daemon).
+See AUTHORS.md for complete list of NFD authors and contributors.
+
+NFD 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.
+
+NFD 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
+NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+top = '..'
+
+def build(bld):
+    # Unit tests
+    if bld.env['WITH_TESTS']:
+        unit_test_main = bld(
+            target='unit-tests-main',
+            name='unit-tests-main',
+            features='cxx',
+            source=bld.path.ant_glob(['*.cpp']),
+            use='core-objects',
+          )
+
+        # core tests
+        unit_tests_core = bld.program(
+            target='../unit-tests-core',
+            features='cxx cxxprogram',
+            source=bld.path.ant_glob(['core/**/*.cpp']),
+            use='core-objects unit-tests-main',
+            includes='.',
+            install_prefix=None,
+          )
+
+        # NFD tests
+        unit_tests_nfd = bld.program(
+            target='../unit-tests-daemon',
+            features='cxx cxxprogram',
+            source=bld.path.ant_glob(['daemon/**/*.cpp'],
+                                     excl=['daemon/face/ethernet.cpp',
+                                           'daemon/face/unix-*.cpp']),
+            use='daemon-objects unit-tests-main',
+            includes='.',
+            install_prefix=None,
+          )
+
+        if bld.env['HAVE_LIBPCAP']:
+            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
+
+        if bld.env['HAVE_UNIX_SOCKETS']:
+            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
+
+    # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
+    if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
+        bld.recurse("other")
diff --git a/tools/ndn-autoconfig-server.cpp b/tools/ndn-autoconfig-server.cpp
new file mode 100644
index 0000000..ac5c3bf
--- /dev/null
+++ b/tools/ndn-autoconfig-server.cpp
@@ -0,0 +1,126 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+
+void
+usage(const char* programName)
+{
+  std::cout << "Usage:\n" << programName  << " [-h] Uri \n"
+  "   -h print usage and exit\n"
+  "\n"
+  "   Uri - a FaceMgmt URI\n"
+  << std::endl;
+}
+
+using namespace ndn;
+
+class NdnAutoconfigServer
+{
+public:
+  explicit
+  NdnAutoconfigServer(const std::string& uri)
+    : m_faceMgmtUri(uri)
+  {
+  }
+
+  void
+  onInterest(const Name& name, const Interest& interest)
+  {
+    ndn::Data data(ndn::Name(interest.getName()).appendVersion());
+    data.setFreshnessPeriod(time::hours(1)); // 1 hour
+
+    // create and encode uri block
+    Block uriBlock = dataBlock(tlv::nfd::Uri,
+                               reinterpret_cast<const uint8_t*>(m_faceMgmtUri.c_str()),
+                               m_faceMgmtUri.size());
+    data.setContent(uriBlock);
+    m_keyChain.sign(data);
+    m_face.put(data);
+  }
+
+  void
+  onRegisterFailed(const ndn::Name& prefix, const std::string& reason)
+  {
+    std::cerr << "ERROR: Failed to register prefix in local hub's daemon (" <<
+              reason << ")" << std::endl;
+    m_face.shutdown();
+  }
+
+  void
+  listen()
+  {
+    m_face.setInterestFilter("/localhop/ndn-autoconf/hub",
+                             ndn::bind(&NdnAutoconfigServer::onInterest, this, _1, _2),
+                             ndn::bind(&NdnAutoconfigServer::onRegisterFailed, this, _1, _2));
+    m_face.processEvents();
+  }
+
+private:
+  ndn::Face m_face;
+  KeyChain m_keyChain;
+  std::string m_faceMgmtUri;
+
+};
+
+int
+main(int argc, char** argv)
+{
+  int opt;
+  const char* programName = argv[0];
+
+  while ((opt = getopt(argc, argv, "h")) != -1)
+  {
+    switch (opt)
+    {
+      case 'h':
+        usage(programName);
+        return 0;
+
+      default:
+        usage(programName);
+        return 1;
+    }
+  }
+
+  if (argc != optind + 1)
+  {
+    usage(programName);
+    return 1;
+  }
+  // get the configured face managment uri
+  NdnAutoconfigServer producer(argv[optind]);
+
+  try
+  {
+    producer.listen();
+  }
+  catch (std::exception& error)
+  {
+    std::cerr << "ERROR: " << error.what() << std::endl;
+  }
+  return 0;
+}
diff --git a/tools/ndn-autoconfig.cpp b/tools/ndn-autoconfig.cpp
new file mode 100644
index 0000000..b6f09cc
--- /dev/null
+++ b/tools/ndn-autoconfig.cpp
@@ -0,0 +1,302 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/management/nfd-controller.hpp>
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+#ifdef __APPLE__
+#include <arpa/nameser_compat.h>
+#endif
+
+namespace tools {
+
+class NdnAutoconfig
+{
+public:
+  union QueryAnswer
+  {
+    HEADER header;
+    uint8_t buf[NS_PACKETSZ];
+  };
+
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
+  explicit
+  NdnAutoconfig()
+    : m_controller(m_face)
+  {
+  }
+
+  // Start to look for a hub (NDN hub discovery first stage)
+  void
+  discoverHubStage1()
+  {
+    ndn::Interest interest(ndn::Name("/localhop/ndn-autoconf/hub"));
+    interest.setInterestLifetime(ndn::time::milliseconds(4000)); // 4 seconds
+    interest.setMustBeFresh(true);
+
+    std::cerr << "Stage 1: Trying muticast discovery..." << std::endl;
+    m_face.expressInterest(interest,
+                           ndn::bind(&NdnAutoconfig::onDiscoverHubStage1Success, this, _1, _2),
+                           ndn::bind(&NdnAutoconfig::discoverHubStage2, this, _1, "Timeout"));
+
+    m_face.processEvents();
+  }
+
+  // First stage OnData Callback
+  void
+  onDiscoverHubStage1Success(const ndn::Interest& interest, ndn::Data& data)
+  {
+    const ndn::Block& content = data.getContent();
+    content.parse();
+
+    // Get Uri
+    ndn::Block::element_const_iterator blockValue = content.find(ndn::tlv::nfd::Uri);
+    if (blockValue == content.elements_end())
+    {
+      discoverHubStage2(interest, "Incorrect reply to stage1");
+      return;
+    }
+    std::string faceMgmtUri(reinterpret_cast<const char*>(blockValue->value()),
+                            blockValue->value_size());
+    connectToHub(faceMgmtUri);
+  }
+
+  // First stage OnTimeout callback - start 2nd stage
+  void
+  discoverHubStage2(const ndn::Interest& interest, const std::string& message)
+  {
+    std::cerr << message << std::endl;
+    std::cerr << "Stage 2: Trying DNS query with default suffix..." << std::endl;
+
+    _res.retry = 2;
+    _res.ndots = 10;
+
+    QueryAnswer queryAnswer;
+
+    int answerSize = res_search("_ndn._udp",
+                                ns_c_in,
+                                ns_t_srv,
+                                queryAnswer.buf,
+                                sizeof(queryAnswer));
+
+    // 2nd stage failed - move on to the third stage
+    if (answerSize < 0)
+    {
+      discoverHubStage3("Failed to find NDN router using default suffix DNS query");
+    }
+    else
+    {
+      bool isParsed = parseHostAndConnectToHub(queryAnswer, answerSize);
+      if (isParsed == false)
+      {
+        // Failed to parse DNS response, try stage 3
+        discoverHubStage3("Failed to parse DNS response");
+      }
+    }
+  }
+
+  // Second stage OnTimeout callback
+  void
+  discoverHubStage3(const std::string& message)
+  {
+    std::cerr << message << std::endl;
+    std::cerr << "Stage 3: Trying to find home router..." << std::endl;
+
+    ndn::KeyChain keyChain;
+    ndn::Name identity = keyChain.getDefaultIdentity();
+    std::string serverName = "_ndn._udp.";
+
+    for (ndn::Name::const_reverse_iterator i = identity.rbegin(); i != identity.rend(); i++)
+    {
+      serverName.append(i->toEscapedString());
+      serverName.append(".");
+    }
+    serverName += "_homehub._autoconf.named-data.net";
+    std::cerr << "Stage3: About to query for a home router: " << serverName << std::endl;
+
+    QueryAnswer queryAnswer;
+
+    int answerSize = res_query(serverName.c_str(),
+                               ns_c_in,
+                               ns_t_srv,
+                               queryAnswer.buf,
+                               sizeof(queryAnswer));
+
+
+    // 3rd stage failed - abort
+    if (answerSize < 0)
+    {
+      std::cerr << "Failed to find a home router" << std::endl;
+      std::cerr << "exit" << std::endl;
+    }
+    else
+    {
+      bool isParsed = parseHostAndConnectToHub(queryAnswer, answerSize);
+      if (isParsed == false)
+      {
+        // Failed to parse DNS response
+        throw Error("Failed to parse DNS response");
+      }
+    }
+
+  }
+
+  void
+  connectToHub(const std::string& uri)
+  {
+    std::cerr << "about to connect to: " << uri << std::endl;
+
+    m_controller.start<ndn::nfd::FaceCreateCommand>(
+       ndn::nfd::ControlParameters()
+         .setUri(uri),
+       bind(&NdnAutoconfig::onHubConnectSuccess, this,
+            _1, "Succesfully created face: "),
+       bind(&NdnAutoconfig::onHubConnectError, this,
+            _1, _2, "Failed to create face: ")
+    );
+  }
+
+  void
+  onHubConnectSuccess(const ndn::nfd::ControlParameters& resp, const std::string& message)
+  {
+    std::cerr << message << resp << std::endl;
+  }
+
+  void
+  onHubConnectError(uint32_t code, const std::string& error, const std::string& message)
+  {
+    std::ostringstream os;
+    os << message << ": " << error << " (code: " << code << ")";
+    throw Error(os.str());
+  }
+
+
+  bool parseHostAndConnectToHub(QueryAnswer& queryAnswer, int answerSize)
+  {
+    // The references of the next classes are:
+    // http://www.diablotin.com/librairie/networking/dnsbind/ch14_02.htm
+    // https://gist.github.com/mologie/6027597
+
+    struct rechdr
+    {
+      uint16_t type;
+      uint16_t iclass;
+      uint32_t ttl;
+      uint16_t length;
+    };
+
+    struct srv_t
+    {
+      uint16_t priority;
+      uint16_t weight;
+      uint16_t port;
+      uint8_t* target;
+    };
+
+    if (ntohs(queryAnswer.header.ancount) == 0)
+    {
+      std::cerr << "No records found\n" << std::endl;
+      return false;
+    }
+
+    uint8_t* blob = queryAnswer.buf + NS_HFIXEDSZ;
+
+    blob += dn_skipname(blob, queryAnswer.buf + answerSize) + NS_QFIXEDSZ;
+
+    for (int i = 0; i < ntohs(queryAnswer.header.ancount); i++)
+    {
+      char hostName[NS_MAXDNAME];
+      int domainNameSize = dn_expand(queryAnswer.buf,
+                                     queryAnswer.buf + answerSize,
+                                     blob,
+                                     hostName,
+                                     NS_MAXDNAME);
+      if (domainNameSize < 0)
+      {
+        return false;
+      }
+
+      blob += domainNameSize;
+
+      domainNameSize = dn_expand(queryAnswer.buf,
+                                 queryAnswer.buf + answerSize,
+                                 blob + 16,
+                                 hostName,
+                                 NS_MAXDNAME);
+      if (domainNameSize < 0)
+      {
+        return false;
+      }
+
+      srv_t* server = reinterpret_cast<srv_t*>(&blob[sizeof(rechdr)]);
+      uint16_t convertedPort = be16toh(server->port);
+      std::string uri = "udp://";
+      uri.append(hostName);
+      uri.append(":");
+      uri.append(boost::lexical_cast<std::string>(convertedPort));
+
+      connectToHub(uri);
+      return true;
+    }
+
+    return false;
+  }
+
+private:
+  ndn::Face m_face;
+  ndn::nfd::Controller m_controller;
+};
+
+} // namespace tools
+
+int
+main()
+{
+  try
+    {
+      tools::NdnAutoconfig autoConfigInstance;
+
+      autoConfigInstance.discoverHubStage1();
+    }
+  catch (const std::exception& error)
+    {
+      std::cerr << "ERROR: " << error.what() << std::endl;
+    }
+  return 0;
+}
diff --git a/tools/ndn-tlv-peek.cpp b/tools/ndn-tlv-peek.cpp
new file mode 100644
index 0000000..00e0bdb
--- /dev/null
+++ b/tools/ndn-tlv-peek.cpp
@@ -0,0 +1,256 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2014 University of Arizona.
+ *
+ * Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
+ */
+
+#include <boost/asio.hpp>
+
+#include <ndn-cpp-dev/face.hpp>
+
+namespace ndntlvpeek {
+
+class NdnTlvPeek
+{
+public:
+  NdnTlvPeek(char* programName)
+    : m_programName(programName)
+    , m_mustBeFresh(false)
+    , m_isChildSelectorRightmost(false)
+    , m_minSuffixComponents(-1)
+    , m_maxSuffixComponents(-1)
+    , m_interestLifetime(-1)
+    , m_isPayloadOnlySet(false)
+    , m_timeout(-1)
+    , m_prefixName("")
+    , m_isDataReceived(false)
+    , m_ioService(new boost::asio::io_service)
+    , m_face(m_ioService)
+  {
+  }
+
+  void
+  usage()
+  {
+    std::cout << "\n Usage:\n " << m_programName << " "
+      "[-f] [-r] [-m min] [-M max] [-l lifetime] [-p] [-w timeout] ndn:/name\n"
+      "   Get one data item matching the name prefix and write it to stdout\n"
+      "   [-f]          - set MustBeFresh\n"
+      "   [-r]          - set ChildSelector to select rightmost child\n"
+      "   [-m min]      - set MinSuffixComponents\n"
+      "   [-M max]      - set MaxSuffixComponents\n"
+      "   [-l lifetime] - set InterestLifetime in time::milliseconds\n"
+      "   [-p]          - print payload only, not full packet\n"
+      "   [-w timeout]  - set Timeout in time::milliseconds\n"
+      "   [-h]          - print help and exit\n\n";
+    exit(1);
+  }
+
+  void
+  setMustBeFresh()
+  {
+    m_mustBeFresh = true;
+  }
+
+  void
+  setRightmostChildSelector()
+  {
+    m_isChildSelectorRightmost = true;
+  }
+
+  void
+  setMinSuffixComponents(int minSuffixComponents)
+  {
+    if (minSuffixComponents < 0)
+      usage();
+    m_minSuffixComponents = minSuffixComponents;
+  }
+
+  void
+  setMaxSuffixComponents(int maxSuffixComponents)
+  {
+    if (maxSuffixComponents < 0)
+      usage();
+    m_maxSuffixComponents = maxSuffixComponents;
+  }
+
+  void
+  setInterestLifetime(int interestLifetime)
+  {
+    if (interestLifetime < 0)
+      usage();
+    m_interestLifetime = ndn::time::milliseconds(interestLifetime);
+  }
+
+  void
+  setPayloadOnly()
+  {
+    m_isPayloadOnlySet = true;
+  }
+
+  void
+  setTimeout(int timeout)
+  {
+    if (timeout < 0)
+      usage();
+    m_timeout = ndn::time::milliseconds(timeout);
+  }
+
+  void
+  setPrefixName(char* prefixName)
+  {
+    m_prefixName = prefixName;
+    if (m_prefixName.length() == 0)
+      usage();
+  }
+
+  ndn::time::milliseconds
+  getDefaultInterestLifetime()
+  {
+    return ndn::time::seconds(4);
+  }
+
+  ndn::Interest
+  createInterestPacket()
+  {
+    ndn::Name interestName(m_prefixName);
+    ndn::Interest interestPacket(interestName);
+    if (m_mustBeFresh)
+      interestPacket.setMustBeFresh(true);
+    if (m_isChildSelectorRightmost)
+      interestPacket.setChildSelector(1);
+    if (m_minSuffixComponents >= 0)
+      interestPacket.setMinSuffixComponents(m_minSuffixComponents);
+    if (m_maxSuffixComponents >= 0)
+      interestPacket.setMaxSuffixComponents(m_maxSuffixComponents);
+    if (m_interestLifetime < ndn::time::milliseconds::zero())
+      interestPacket.setInterestLifetime(getDefaultInterestLifetime());
+    else
+      interestPacket.setInterestLifetime(m_interestLifetime);
+    return interestPacket;
+  }
+
+  void
+  onData(const ndn::Interest& interest, ndn::Data& data)
+  {
+    m_isDataReceived = true;
+    if (m_isPayloadOnlySet)
+      {
+        const ndn::Block& block = data.getContent();
+        std::cout.write(reinterpret_cast<const char*>(block.value()), block.value_size());
+      }
+    else
+      {
+        const ndn::Block& block = data.wireEncode();
+        std::cout.write(reinterpret_cast<const char*>(block.wire()), block.size());
+      }
+  }
+
+  void
+  onTimeout(const ndn::Interest& interest)
+  {
+  }
+
+  void
+  run()
+  {
+    try
+      {
+        m_face.expressInterest(createInterestPacket(),
+                               ndn::func_lib::bind(&NdnTlvPeek::onData,
+                                                   this, _1, _2),
+                               ndn::func_lib::bind(&NdnTlvPeek::onTimeout,
+                                                   this, _1));
+        if (m_timeout < ndn::time::milliseconds::zero())
+          {
+            if (m_interestLifetime < ndn::time::milliseconds::zero())
+              m_face.processEvents(getDefaultInterestLifetime());
+            else
+              m_face.processEvents(m_interestLifetime);
+          }
+        else
+          m_face.processEvents(m_timeout);
+      }
+    catch (std::exception& e)
+      {
+        std::cerr << "ERROR: " << e.what() << "\n" << std::endl;
+        exit(1);
+      }
+  }
+
+  bool
+  isDataReceived() const
+  {
+    return m_isDataReceived;
+  }
+
+private:
+
+  std::string m_programName;
+  bool m_mustBeFresh;
+  bool m_isChildSelectorRightmost;
+  int m_minSuffixComponents;
+  int m_maxSuffixComponents;
+  ndn::time::milliseconds m_interestLifetime;
+  bool m_isPayloadOnlySet;
+  ndn::time::milliseconds m_timeout;
+  std::string m_prefixName;
+  bool m_isDataReceived;
+  ndn::ptr_lib::shared_ptr<boost::asio::io_service> m_ioService;
+  ndn::Face m_face;
+};
+
+}
+
+int
+main(int argc, char* argv[])
+{
+  int option;
+  ndntlvpeek::NdnTlvPeek ndnTlvPeek (argv[0]);
+  while ((option = getopt(argc, argv, "hfrm:M:l:pw:")) != -1)
+    {
+      switch (option) {
+        case 'h':
+          ndnTlvPeek.usage();
+          break;
+        case 'f':
+          ndnTlvPeek.setMustBeFresh();
+          break;
+        case 'r':
+          ndnTlvPeek.setRightmostChildSelector();
+          break;
+        case 'm':
+          ndnTlvPeek.setMinSuffixComponents(atoi(optarg));
+          break;
+        case 'M':
+          ndnTlvPeek.setMaxSuffixComponents(atoi(optarg));
+          break;
+        case 'l':
+          ndnTlvPeek.setInterestLifetime(atoi(optarg));
+          break;
+        case 'p':
+          ndnTlvPeek.setPayloadOnly();
+          break;
+        case 'w':
+          ndnTlvPeek.setTimeout(atoi(optarg));
+          break;
+        default:
+          ndnTlvPeek.usage();
+      }
+    }
+
+  argc -= optind;
+  argv += optind;
+
+  if (argv[0] == 0)
+    ndnTlvPeek.usage();
+
+  ndnTlvPeek.setPrefixName(argv[0]);
+  ndnTlvPeek.run();
+
+  if (ndnTlvPeek.isDataReceived())
+    return 0;
+  else
+    return 1;
+}
diff --git a/tools/ndn-tlv-poke.cpp b/tools/ndn-tlv-poke.cpp
new file mode 100644
index 0000000..ba02e5e
--- /dev/null
+++ b/tools/ndn-tlv-poke.cpp
@@ -0,0 +1,254 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2014 University of Arizona.
+ *
+ * Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
+ */
+
+#include <boost/utility.hpp>
+ 
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/security/key-chain.hpp>
+
+namespace ndntlvpoke {
+
+class NdnTlvPoke : boost::noncopyable
+{
+
+public:
+
+  explicit
+  NdnTlvPoke(char* programName)
+    : m_programName(programName)
+    , m_isForceDataSet(false)
+    , m_isUseDigestSha256Set(false)
+    , m_isLastAsFinalBlockIdSet(false)
+    , m_freshnessPeriod(-1)
+    , m_timeout(-1)
+    , m_isDataSent(false)
+  {
+  }
+
+  void
+  usage()
+  {
+    std::cout << "\n Usage:\n " << m_programName << " "
+      "[-f] [-D] [-i identity] [-F] [-x freshness] [-w timeout] ndn:/name\n"
+      "   Reads payload from stdin and sends it to local NDN forwarder as a "
+      "single Data packet\n"
+      "   [-f]          - force, send Data without waiting for Interest\n"
+      "   [-D]          - use DigestSha256 signing method instead of "
+      "SignatureSha256WithRsa\n"
+      "   [-i identity] - set identity to be used for signing\n"
+      "   [-F]          - set FinalBlockId to the last component of Name\n"
+      "   [-x]          - set FreshnessPeriod in time::milliseconds\n"
+      "   [-w timeout]  - set Timeout in time::milliseconds\n"
+      "   [-h]          - print help and exit\n\n";
+    exit(1);
+  }
+
+  void
+  setForceData()
+  {
+    m_isForceDataSet = true;
+  }
+
+  void
+  setUseDigestSha256()
+  {
+    m_isUseDigestSha256Set = true;
+  }
+
+  void
+  setIdentityName(char* identityName)
+  {
+    m_identityName = ndn::make_shared<ndn::Name>(identityName);
+  }
+
+  void
+  setLastAsFinalBlockId()
+  {
+    m_isLastAsFinalBlockIdSet = true;
+  }
+
+  void
+  setFreshnessPeriod(int freshnessPeriod)
+  {
+    if (freshnessPeriod < 0)
+      usage();
+    m_freshnessPeriod = ndn::time::milliseconds(freshnessPeriod);
+  }
+
+  void
+  setTimeout(int timeout)
+  {
+    if (timeout < 0)
+      usage();
+    m_timeout = ndn::time::milliseconds(timeout);
+  }
+
+  void
+  setPrefixName(char* prefixName)
+  {
+    m_prefixName = ndn::Name(prefixName);
+  }
+
+  ndn::time::milliseconds
+  getDefaultTimeout()
+  {
+    return ndn::time::seconds(10);
+  }
+
+  ndn::Data
+  createDataPacket()
+  {
+    ndn::Data dataPacket(m_prefixName);
+    std::stringstream payloadStream;
+    payloadStream << std::cin.rdbuf();
+    std::string payload = payloadStream.str();
+    dataPacket.setContent(reinterpret_cast<const uint8_t*>(payload.c_str()), payload.length());
+    if (m_freshnessPeriod >= ndn::time::milliseconds::zero())
+      dataPacket.setFreshnessPeriod(m_freshnessPeriod);
+    if (m_isLastAsFinalBlockIdSet)
+      {
+        if (!m_prefixName.empty())
+          dataPacket.setFinalBlockId(m_prefixName.get(-1));
+        else
+          {
+            std::cerr << "Name Provided Has 0 Components" << std::endl;
+            exit(1);
+          }
+      }
+    if (m_isUseDigestSha256Set)
+      m_keyChain.signWithSha256(dataPacket);
+    else
+      {
+        if (!static_cast<bool>(m_identityName))
+          m_keyChain.sign(dataPacket);
+        else
+          m_keyChain.signByIdentity(dataPacket, *m_identityName);
+      }
+    return dataPacket;
+  }
+
+  void
+  onInterest(const ndn::Name& name,
+             const ndn::Interest& interest,
+             const ndn::Data& dataPacket)
+  {
+    m_face.put(dataPacket);
+    m_isDataSent = true;
+    m_face.shutdown();
+  }
+
+  void
+  onRegisterFailed(const ndn::Name& prefix, const std::string& reason)
+  {
+    std::cerr << "Prefix Registration Failure." << std::endl;
+    std::cerr << "Reason = " << reason << std::endl;
+  }
+
+  void
+  run()
+  {
+    try
+      {
+        ndn::Data dataPacket = createDataPacket();
+        if (m_isForceDataSet)
+          {
+            m_face.put(dataPacket);
+            m_isDataSent = true;
+          }
+        else
+          {
+            m_face.setInterestFilter(m_prefixName,
+                                     ndn::bind(&NdnTlvPoke::onInterest,
+                                               this, _1, _2, dataPacket),
+                                     ndn::bind(&NdnTlvPoke::onRegisterFailed,
+                                               this, _1, _2));
+          }
+        if (m_timeout < ndn::time::milliseconds::zero())
+          m_face.processEvents(getDefaultTimeout());
+        else
+          m_face.processEvents(m_timeout);
+      }
+    catch (std::exception& e)
+      {
+        std::cerr << "ERROR: " << e.what() << "\n" << std::endl;
+        exit(1);
+      }
+  }
+
+  bool
+  isDataSent() const
+  {
+    return m_isDataSent;
+  }
+
+private:
+
+  ndn::KeyChain m_keyChain;
+  std::string m_programName;
+  bool m_isForceDataSet;
+  bool m_isUseDigestSha256Set;
+  ndn::shared_ptr<ndn::Name> m_identityName;
+  bool m_isLastAsFinalBlockIdSet;
+  ndn::time::milliseconds m_freshnessPeriod;
+  ndn::time::milliseconds m_timeout;
+  ndn::Name m_prefixName;
+  bool m_isDataSent;
+  ndn::Face m_face;
+
+};
+
+}
+
+int
+main(int argc, char* argv[])
+{
+  int option;
+  ndntlvpoke::NdnTlvPoke ndnTlvPoke(argv[0]);
+  while ((option = getopt(argc, argv, "hfDi:Fx:w:")) != -1)
+    {
+      switch (option) {
+        case 'h':
+          ndnTlvPoke.usage();
+          break;
+        case 'f':
+          ndnTlvPoke.setForceData();
+          break;
+        case 'D':
+          ndnTlvPoke.setUseDigestSha256();
+          break;
+        case 'i':
+          ndnTlvPoke.setIdentityName(optarg);
+          break;
+        case 'F':
+          ndnTlvPoke.setLastAsFinalBlockId();
+          break;
+        case 'x':
+          ndnTlvPoke.setFreshnessPeriod(atoi(optarg));
+          break;
+        case 'w':
+          ndnTlvPoke.setTimeout(atoi(optarg));
+          break;
+        default:
+          ndnTlvPoke.usage();
+          break;
+      }
+    }
+
+  argc -= optind;
+  argv += optind;
+
+  if (argv[0] == 0)
+    ndnTlvPoke.usage();
+
+  ndnTlvPoke.setPrefixName(argv[0]);
+  ndnTlvPoke.run();
+
+  if (ndnTlvPoke.isDataSent())
+    return 0;
+  else
+    return 1;
+}
diff --git a/tools/network.hpp b/tools/network.hpp
new file mode 100644
index 0000000..3c200aa
--- /dev/null
+++ b/tools/network.hpp
@@ -0,0 +1,161 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TOOLS_NETWORK_HPP
+#define NFD_TOOLS_NETWORK_HPP
+
+#include <boost/asio.hpp>
+
+class Network
+{
+public:
+  Network()
+  {
+  }
+
+  Network(const boost::asio::ip::address& minAddress,
+          const boost::asio::ip::address& maxAddress)
+    : m_minAddress(minAddress)
+    , m_maxAddress(maxAddress)
+  {
+  }
+
+  void
+  print(std::ostream& os) const
+  {
+    os << m_minAddress << " <-> " << m_maxAddress;
+  }
+
+  bool
+  doesContain(const boost::asio::ip::address& address) const
+  {
+    return (m_minAddress <= address && address <= m_maxAddress);
+  }
+
+  static const Network&
+  getMaxRangeV4()
+  {
+    using boost::asio::ip::address_v4;
+    static Network range = Network(address_v4(0), address_v4(0xFFFFFFFF));
+    return range;
+  }
+
+  static const Network&
+  getMaxRangeV6()
+  {
+    using boost::asio::ip::address_v6;
+    static address_v6::bytes_type maxV6 = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+                                            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
+    static Network range = Network(address_v6(), address_v6(maxV6));
+    return range;
+  }
+
+private:
+  boost::asio::ip::address m_minAddress;
+  boost::asio::ip::address m_maxAddress;
+
+  friend std::istream&
+  operator>>(std::istream& is, Network& network);
+
+  friend std::ostream&
+  operator<<(std::ostream& os, const Network& network);
+};
+
+inline std::ostream&
+operator<<(std::ostream& os, const Network& network)
+{
+  network.print(os);
+  return os;
+}
+
+inline std::istream&
+operator>>(std::istream& is, Network& network)
+{
+  using namespace boost::asio;
+
+  std::string networkStr;
+  is >> networkStr;
+
+  size_t position = networkStr.find('/');
+  if (position == std::string::npos)
+    {
+      network.m_minAddress = ip::address::from_string(networkStr);
+      network.m_maxAddress = ip::address::from_string(networkStr);
+    }
+  else
+    {
+      ip::address address = ip::address::from_string(networkStr.substr(0, position));
+      size_t mask = boost::lexical_cast<size_t>(networkStr.substr(position+1));
+
+      if (address.is_v4())
+        {
+          ip::address_v4::bytes_type maskBytes = {};
+          for (size_t i = 0; i < mask; i++)
+            {
+              size_t byteId = i / 8;
+              size_t bitIndex = 7 - i % 8;
+              maskBytes[byteId] |= (1 << bitIndex);
+            }
+
+          ip::address_v4::bytes_type addressBytes = address.to_v4().to_bytes();
+          ip::address_v4::bytes_type min;
+          ip::address_v4::bytes_type max;
+
+          for (size_t i = 0; i < addressBytes.size(); i++)
+            {
+              min[i] = addressBytes[i] & maskBytes[i];
+              max[i] = addressBytes[i] | ~(maskBytes[i]);
+            }
+
+          network.m_minAddress = ip::address_v4(min);
+          network.m_maxAddress = ip::address_v4(max);
+        }
+      else
+        {
+          ip::address_v6::bytes_type maskBytes = {};
+          for (size_t i = 0; i < mask; i++)
+            {
+              size_t byteId = i / 8;
+              size_t bitIndex = 7 - i % 8;
+              maskBytes[byteId] |= (1 << bitIndex);
+            }
+
+          ip::address_v6::bytes_type addressBytes = address.to_v6().to_bytes();
+          ip::address_v6::bytes_type min;
+          ip::address_v6::bytes_type max;
+
+          for (size_t i = 0; i < addressBytes.size(); i++)
+            {
+              min[i] = addressBytes[i] & maskBytes[i];
+              max[i] = addressBytes[i] | ~(maskBytes[i]);
+            }
+
+          network.m_minAddress = ip::address_v6(min);
+          network.m_maxAddress = ip::address_v6(max);
+        }
+    }
+  return is;
+}
+
+#endif // NFD_TOOLS_NETWORK_HPP
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
new file mode 100644
index 0000000..f9e8059
--- /dev/null
+++ b/tools/nfd-autoreg.cpp
@@ -0,0 +1,316 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/name.hpp>
+
+#include <ndn-cpp-dev/management/nfd-face-event-notification.hpp>
+#include <ndn-cpp-dev/management/nfd-controller.hpp>
+
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/variables_map.hpp>
+#include <boost/program_options/parsers.hpp>
+
+#include "core/face-uri.hpp"
+#include "network.hpp"
+
+namespace po = boost::program_options;
+
+namespace nfd {
+
+using namespace ndn::nfd;
+using ndn::Face;
+
+class AutoregServer
+{
+public:
+  AutoregServer()
+    : m_controller(m_face)
+    // , m_lastNotification(<undefined>)
+    , m_cost(255)
+  {
+  }
+
+  void
+  onNfdCommandSuccess(const FaceEventNotification& notification)
+  {
+    std::cerr << "SUCCEED: " << notification << std::endl;
+  }
+
+  void
+  onNfdCommandFailure(const FaceEventNotification& notification,
+                      uint32_t code, const std::string& reason)
+  {
+    std::cerr << "FAILED: " << notification << " (code: " << code << ")" << std::endl;
+  }
+
+  bool
+  isFiltered(const FaceUri& uri)
+  {
+    const std::string& scheme = uri.getScheme();
+    if (!(scheme == "udp4" || scheme == "tcp4" ||
+          scheme == "udp6" || scheme == "tcp6"))
+      return true;
+
+    boost::asio::ip::address address = boost::asio::ip::address::from_string(uri.getHost());
+
+    for (std::vector<Network>::const_iterator network = m_blackList.begin();
+         network != m_blackList.end();
+         ++network)
+      {
+        if (network->doesContain(address))
+          return true;
+      }
+
+    for (std::vector<Network>::const_iterator network = m_whiteList.begin();
+         network != m_whiteList.end();
+         ++network)
+      {
+        if (network->doesContain(address))
+          return false;
+      }
+
+    return true;
+  }
+
+  void
+  processCreateFace(const FaceEventNotification& notification)
+  {
+    FaceUri uri(notification.getRemoteUri());
+
+    if (isFiltered(uri))
+      {
+        std::cerr << "Not processing (filtered): " << notification << std::endl;
+        return;
+      }
+
+    for (std::vector<ndn::Name>::const_iterator prefix = m_autoregPrefixes.begin();
+         prefix != m_autoregPrefixes.end();
+         ++prefix)
+      {
+        std::cout << "Try auto-register: " << *prefix << std::endl;
+
+        m_controller.start<FibAddNextHopCommand>(
+          ControlParameters()
+            .setName(*prefix)
+            .setFaceId(notification.getFaceId())
+            .setCost(m_cost),
+          bind(&AutoregServer::onNfdCommandSuccess, this, notification),
+          bind(&AutoregServer::onNfdCommandFailure, this, notification, _1, _2));
+      }
+  }
+
+  void
+  onNotification(const Data& data)
+  {
+    m_lastNotification = data.getName().get(-1).toSegment();
+
+    // process
+    FaceEventNotification notification(data.getContent().blockFromValue());
+
+    if (notification.getKind() == FACE_EVENT_CREATED &&
+        !notification.isLocal() &&
+        notification.isOnDemand())
+      {
+        processCreateFace(notification);
+      }
+    else
+      {
+        std::cout << "IGNORED: " << notification << std::endl;
+      }
+
+    Name nextNotification("/localhost/nfd/faces/events");
+    nextNotification
+      .appendSegment(m_lastNotification + 1);
+
+    // no need to set freshness or child selectors
+    m_face.expressInterest(nextNotification,
+                           bind(&AutoregServer::onNotification, this, _2),
+                           bind(&AutoregServer::onTimeout, this, _1));
+  }
+
+  void
+  onTimeout(const Interest& timedOutInterest)
+  {
+    // re-express the timed out interest, but reset Nonce, since it has to change
+
+    // To be robust against missing notification, use ChildSelector and MustBeFresh
+    Interest interest("/localhost/nfd/faces/events");
+    interest
+      .setMustBeFresh(true)
+      .setChildSelector(1)
+      .setInterestLifetime(time::seconds(60))
+      ;
+
+    m_face.expressInterest(interest,
+                           bind(&AutoregServer::onNotification, this, _2),
+                           bind(&AutoregServer::onTimeout, this, _1));
+  }
+
+  void
+  signalHandler()
+  {
+    m_face.shutdown();
+  }
+
+
+
+  void
+  usage(std::ostream& os,
+        const po::options_description& optionDesciption,
+        const char* programName)
+  {
+    os << "Usage:\n"
+       << "  " << programName << " --prefix=</autoreg/prefix> [--prefix=/another/prefix] ...\n"
+       << "\n";
+    os << optionDesciption;
+  }
+
+  void
+  startProcessing()
+  {
+    std::cout << "AUTOREG prefixes: " << std::endl;
+    for (std::vector<ndn::Name>::const_iterator prefix = m_autoregPrefixes.begin();
+         prefix != m_autoregPrefixes.end();
+         ++prefix)
+      {
+        std::cout << "  " << *prefix << std::endl;
+      }
+
+    if (!m_blackList.empty())
+      {
+        std::cout << "Blacklisted networks: " << std::endl;
+        for (std::vector<Network>::const_iterator network = m_blackList.begin();
+             network != m_blackList.end();
+             ++network)
+          {
+            std::cout << "  " << *network << std::endl;
+          }
+      }
+
+    std::cout << "Whitelisted networks: " << std::endl;
+    for (std::vector<Network>::const_iterator network = m_whiteList.begin();
+         network != m_whiteList.end();
+         ++network)
+      {
+        std::cout << "  " << *network << std::endl;
+      }
+
+    Interest interest("/localhost/nfd/faces/events");
+    interest
+      .setMustBeFresh(true)
+      .setChildSelector(1)
+      .setInterestLifetime(time::seconds(60))
+      ;
+
+    m_face.expressInterest(interest,
+                           bind(&AutoregServer::onNotification, this, _2),
+                           bind(&AutoregServer::onTimeout, this, _1));
+
+    boost::asio::signal_set signalSet(*m_face.ioService(), SIGINT, SIGTERM);
+    signalSet.async_wait(boost::bind(&AutoregServer::signalHandler, this));
+
+    m_face.processEvents();
+  }
+
+  int
+  main(int argc, char* argv[])
+  {
+    po::options_description optionDesciption;
+    optionDesciption.add_options()
+      ("help,h", "produce help message")
+      ("prefix,i", po::value<std::vector<ndn::Name> >(&m_autoregPrefixes)->composing(),
+       "prefix that should be automatically registered when new remote face is established")
+      ("cost,c", po::value<uint64_t>(&m_cost)->default_value(255),
+       "FIB cost which should be assigned to autoreg nexthops")
+      ("whitelist,w", po::value<std::vector<Network> >(&m_whiteList)->composing(),
+       "Whitelisted network, e.g., 192.168.2.0/24 or ::1/128")
+      ("blacklist,b", po::value<std::vector<Network> >(&m_blackList)->composing(),
+       "Blacklisted network, e.g., 192.168.2.32/30 or ::1/128")
+      ;
+
+    po::variables_map options;
+    try
+      {
+        po::store(po::command_line_parser(argc, argv).options(optionDesciption).run(), options);
+        po::notify(options);
+      }
+    catch (std::exception& e)
+      {
+        std::cerr << "ERROR: " << e.what() << std::endl << std::endl;
+        usage(std::cerr, optionDesciption, argv[0]);
+        return 1;
+      }
+
+    if (options.count("help"))
+      {
+        usage(std::cout, optionDesciption, argv[0]);
+        return 0;
+      }
+
+    if (m_autoregPrefixes.empty())
+      {
+        std::cerr << "ERROR: at least one --prefix must be specified" << std::endl << std::endl;
+        usage(std::cerr, optionDesciption, argv[0]);
+        return 2;
+      }
+
+    if (m_whiteList.empty())
+      {
+        // Allow everything
+        m_whiteList.push_back(Network::getMaxRangeV4());
+        m_whiteList.push_back(Network::getMaxRangeV6());
+      }
+
+    try
+      {
+        startProcessing();
+      }
+    catch (std::exception& e)
+      {
+        std::cerr << "ERROR: " << e.what() << std::endl;
+        return 2;
+      }
+
+    return 0;
+  }
+
+private:
+  Face m_face;
+  Controller m_controller;
+  uint64_t m_lastNotification;
+  std::vector<ndn::Name> m_autoregPrefixes;
+  uint64_t m_cost;
+  std::vector<Network> m_whiteList;
+  std::vector<Network> m_blackList;
+};
+
+} // namespace nfd
+
+int
+main(int argc, char* argv[])
+{
+  nfd::AutoregServer server;
+  return server.main(argc, argv);
+}
diff --git a/tools/nfd-status-http-server.py b/tools/nfd-status-http-server.py
new file mode 100755
index 0000000..52acae6
--- /dev/null
+++ b/tools/nfd-status-http-server.py
@@ -0,0 +1,206 @@
+#!/usr/bin/env python2.7
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+"""
+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
+
+This file is part of NFD (Named Data Networking Forwarding Daemon).
+See AUTHORS.md for complete list of NFD authors and contributors.
+
+NFD 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.
+
+NFD 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
+NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
+from SocketServer import ThreadingMixIn
+import sys
+import commands
+import StringIO
+import urlparse
+import logging
+import cgi
+import argparse
+import socket
+
+
+class StatusHandler(BaseHTTPRequestHandler):
+    """ The handler class to handle requests."""
+    def do_GET(self):
+        # get the url info to decide how to respond
+        parsedPath = urlparse.urlparse(self.path)
+        resultMessage = ""
+        if parsedPath.path == "/robots.txt":
+            if self.server.robots == False:
+                # return User-agent: * Disallow: / to disallow robots
+                resultMessage = "User-agent: * \nDisallow: /\n"
+            self.send_response(200)
+            self.send_header("Content-type", "text/plain")
+        elif parsedPath.path == "/":
+            # get current nfd status, and use it as result message
+            resultMessage = self.getNfdStatus()
+            self.send_response(200)
+            self.send_header("Content-type", "text/html; charset=UTF-8")
+        else:
+            # non-existing content
+            resultMessage = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 '\
+                   + 'Transitional//EN" '\
+                   + '"http://www.w3.org/TR/html4/loose.dtd">\n'\
+                   + '<html><head><title>Object not '\
+                   + 'found!</title><meta http-equiv="Content-type" ' \
+                   + 'content="text/html;charset=UTF-8"></head>\n'\
+                   + '<body><h1>Object not found!</h1>'\
+                   + '<p>The requested URL was not found on this server.</p>'\
+                   + '<h2>Error 404</h2>'\
+                   + '</body></html>'
+            self.send_response(404)
+            self.send_header("Content-type", "text/html; charset=UTF-8")
+
+        self.end_headers()
+        self.wfile.write(resultMessage)
+
+    def log_message(self, format, *args):
+        if self.server.verbose:
+            logging.info("%s - %s\n" % (self.address_string(),
+                         format % args))
+
+    def getNfdStatus(self):
+        """
+        This function tries to call nfd-status command
+        to get nfd's current status, after convert it
+        to html format, return it to the caller
+        """
+        (res, output) = commands.getstatusoutput('nfd-status')
+
+        htmlStr = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional'\
+                + '//EN" "http://www.w3.org/TR/html4/loose.dtd">\n'\
+                + '<html><head><title>NFD status</title>'\
+                + '<meta http-equiv="Content-type" content="text/html;'\
+                + 'charset=UTF-8"></head>\n<body>'
+        if res == 0:
+            # parse the output
+            buf = StringIO.StringIO(output)
+            firstLine = 0
+            for line in buf:
+                if line.endswith(":\n"):
+                    if firstLine != 0:
+                        htmlStr += "</ul>\n"
+                    firstLine += 1
+                    htmlStr += "<b>" + cgi.escape(line.strip()) + "</b><br>\n"\
+                             + "<ul>\n"
+                    continue
+                line = line.strip()
+                htmlStr += "<li>" + cgi.escape(line) + "</li>\n"
+            buf.close()
+            htmlStr += "</ul>\n"
+        else:
+            # return connection error code
+            htmlStr = htmlStr + "<p>Cannot connect to NFD,"\
+                    + " Code = " + str(res) + "</p>\n"
+        htmlStr = htmlStr + "</body></html>"
+        return htmlStr
+
+
+class ThreadHttpServer(ThreadingMixIn, HTTPServer):
+    """ Handle requests using threads """
+    def __init__(self, server, handler, verbose=False, robots=False):
+        serverAddr = server[0]
+        # socket.AF_UNSPEC is not supported, check whether it is v6 or v4
+        ipType = self.getIpType(serverAddr)
+        if ipType == socket.AF_INET6:
+            self.address_family = socket.AF_INET6
+        elif ipType == socket.AF_INET:
+            self.address_family == socket.AF_INET
+        else:
+            logging.error("The input IP address is neither IPv6 nor IPv4")
+            sys.exit(2)
+
+        try:
+            HTTPServer.__init__(self, server, handler)
+        except Exception as e:
+            logging.error(str(e))
+            sys.exit(2)
+        self.verbose = verbose
+        self.robots = robots
+
+    def getIpType(self, ipAddr):
+        """ Get ipAddr's address type """
+        # if ipAddr is an IPv6 addr, return AF_INET6
+        try:
+            socket.inet_pton(socket.AF_INET6, ipAddr)
+            return socket.AF_INET6
+        except socket.error:
+            pass
+        # if ipAddr is an IPv4 addr return AF_INET, if not, return None
+        try:
+            socket.inet_pton(socket.AF_INET, ipAddr)
+            return socket.AF_INET
+        except socket.error:
+            return None
+
+
+# main function to start
+def httpServer():
+    parser = argparse.ArgumentParser()
+    parser.add_argument("-p", type=int, metavar="port number",
+                        help="Specify the HTTP server port number, default is 8080.",
+                        dest="port", default=8080)
+    # if address is not specified, use 127.0.0.1
+    parser.add_argument("-a", default="127.0.0.1", metavar="IP address", dest="addr",
+                        help="Specify the HTTP server IP address.")
+    parser.add_argument("-r", default=False, dest="robots", action="store_true",
+                        help="Enable HTTP robots to crawl; disabled by default.")
+    parser.add_argument("-v", default=False, dest="verbose", action="store_true",
+                        help="Verbose mode.")
+
+    args = vars(parser.parse_args())
+    localPort = args["port"]
+    localAddr = args["addr"]
+    verbose = args["verbose"]
+    robots = args["robots"]
+
+    # setting log message format
+    logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s',
+                        level=logging.INFO)
+
+    # if port is invalid, exit
+    if localPort <= 0 or localPort > 65535:
+        logging.error("Specified port number is invalid")
+        sys.exit(2)
+
+    httpd = ThreadHttpServer((localAddr, localPort), StatusHandler,
+                             verbose, robots)
+    httpServerAddr = ""
+    if httpd.address_family == socket.AF_INET6:
+        httpServerAddr = "http://[%s]:%s" % (httpd.server_address[0],
+                                             httpd.server_address[1])
+    else:
+        httpServerAddr = "http://%s:%s" % (httpd.server_address[0],
+                                           httpd.server_address[1])
+
+    logging.info("Server started - at %s" % httpServerAddr)
+
+    try:
+        httpd.serve_forever()
+    except KeyboardInterrupt:
+        pass
+
+    httpd.server_close()
+
+    logging.info("Server stopped")
+
+
+if __name__ == '__main__':
+    httpServer()
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
new file mode 100644
index 0000000..efe1283
--- /dev/null
+++ b/tools/nfd-status.cpp
@@ -0,0 +1,316 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2014 University of Arizona.
+ *
+ * Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
+ */
+
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/name.hpp>
+#include <ndn-cpp-dev/interest.hpp>
+
+#include <ndn-cpp-dev/management/nfd-fib-entry.hpp>
+#include <ndn-cpp-dev/management/nfd-face-status.hpp>
+#include <ndn-cpp-dev/management/nfd-forwarder-status.hpp>
+
+namespace ndn {
+
+class NfdStatus
+{
+public:
+  explicit
+  NfdStatus(char* toolName)
+    : m_toolName(toolName)
+    , m_needVersionRetrieval(false)
+    , m_needFaceStatusRetrieval(false)
+    , m_needFibEnumerationRetrieval(false)
+  {
+  }
+
+  void
+  usage()
+  {
+    std::cout << "Usage: \n  " << m_toolName << " [options]\n\n"
+      "Show NFD version and status information\n\n"
+      "Options:\n"
+      "  [-h] - print this help message\n"
+      "  [-v] - retrieve version information\n"
+      "  [-f] - retrieve face status information\n"
+      "  [-b] - retrieve FIB information\n\n"
+      "If no options are provided, all information is retrieved.\n"
+      ;
+  }
+
+  void
+  enableVersionRetrieval()
+  {
+    m_needVersionRetrieval = true;
+  }
+
+  void
+  enableFaceStatusRetrieval()
+  {
+    m_needFaceStatusRetrieval = true;
+  }
+
+  void
+  enableFibEnumerationRetrieval()
+  {
+    m_needFibEnumerationRetrieval = true;
+  }
+
+  void
+  onTimeout()
+  {
+    std::cerr << "Request timed out" << std::endl;
+  }
+
+  void
+  fetchSegments(const Data& data, void (NfdStatus::*onDone)())
+  {
+    m_buffer->write((const char*)data.getContent().value(),
+                    data.getContent().value_size());
+
+    uint64_t currentSegment = data.getName().get(-1).toSegment();
+
+    const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
+    if (finalBlockId.empty() ||
+        finalBlockId.toSegment() > currentSegment)
+      {
+        m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
+                               bind(&NfdStatus::fetchSegments, this, _2, onDone),
+                               bind(&NfdStatus::onTimeout, this));
+      }
+    else
+      {
+        return (this->*onDone)();
+      }
+  }
+
+  void
+  afterFetchedVersionInformation(const Data& data)
+  {
+    std::cout << "General NFD status:" << std::endl;
+
+    nfd::ForwarderStatus status(data.getContent());
+    std::cout << "               version="
+              << status.getNfdVersion() << std::endl;
+    std::cout << "             startTime="
+              << time::toIsoString(status.getStartTimestamp()) << std::endl;
+    std::cout << "           currentTime="
+              << time::toIsoString(status.getCurrentTimestamp()) << std::endl;
+    std::cout << "                uptime="
+              << time::duration_cast<time::seconds>(status.getCurrentTimestamp()
+                                                    - status.getStartTimestamp()) << std::endl;
+
+    std::cout << "      nNameTreeEntries=" << status.getNNameTreeEntries()     << std::endl;
+    std::cout << "           nFibEntries=" << status.getNFibEntries()          << std::endl;
+    std::cout << "           nPitEntries=" << status.getNPitEntries()          << std::endl;
+    std::cout << "  nMeasurementsEntries=" << status.getNMeasurementsEntries() << std::endl;
+    std::cout << "            nCsEntries=" << status.getNCsEntries()           << std::endl;
+    std::cout << "          nInInterests=" << status.getNInInterests()         << std::endl;
+    std::cout << "         nOutInterests=" << status.getNOutInterests()        << std::endl;
+    std::cout << "              nInDatas=" << status.getNInDatas()             << std::endl;
+    std::cout << "             nOutDatas=" << status.getNOutDatas()            << std::endl;
+
+    if (m_needFaceStatusRetrieval)
+      {
+        fetchFaceStatusInformation();
+      }
+    else if (m_needFibEnumerationRetrieval)
+      {
+        fetchFibEnumerationInformation();
+      }
+  }
+
+  void
+  fetchVersionInformation()
+  {
+    Interest interest("/localhost/nfd/status");
+    interest.setChildSelector(1);
+    interest.setMustBeFresh(true);
+    m_face.expressInterest(
+                           interest,
+                           bind(&NfdStatus::afterFetchedVersionInformation, this, _2),
+                           bind(&NfdStatus::onTimeout, this));
+  }
+
+  void
+  afterFetchedFaceStatusInformation()
+  {
+    std::cout << "Faces:" << std::endl;
+
+    ConstBufferPtr buf = m_buffer->buf();
+
+    Block block;
+    size_t offset = 0;
+    while (offset < buf->size())
+      {
+        bool ok = Block::fromBuffer(buf, offset, block);
+        if (!ok)
+          {
+            std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
+            break;
+          }
+
+        offset += block.size();
+
+        nfd::FaceStatus faceStatus(block);
+
+        std::cout << "  faceid=" << faceStatus.getFaceId()
+                  << " remote=" << faceStatus.getRemoteUri()
+                  << " local=" << faceStatus.getLocalUri()
+                  << " counters={"
+                  << "in={" << faceStatus.getNInInterests() << "i "
+                  << faceStatus.getNInDatas() << "d}"
+                  << " out={" << faceStatus.getNOutInterests() << "i "
+                  << faceStatus.getNOutDatas() << "d}"
+                  << "}" << std::endl;
+      }
+
+    if (m_needFibEnumerationRetrieval)
+      {
+        fetchFibEnumerationInformation();
+      }
+  }
+
+  void
+  fetchFaceStatusInformation()
+  {
+    m_buffer = make_shared<OBufferStream>();
+
+    Interest interest("/localhost/nfd/faces/list");
+    interest.setChildSelector(1);
+    interest.setMustBeFresh(true);
+
+    m_face.expressInterest(interest,
+                           bind(&NfdStatus::fetchSegments, this, _2,
+                                &NfdStatus::afterFetchedFaceStatusInformation),
+                           bind(&NfdStatus::onTimeout, this));
+  }
+
+  void
+  afterFetchedFibEnumerationInformation()
+  {
+    std::cout << "FIB:" << std::endl;
+
+    ConstBufferPtr buf = m_buffer->buf();
+
+    Block block;
+    size_t offset = 0;
+    while (offset < buf->size())
+      {
+        bool ok = Block::fromBuffer(buf, offset, block);
+        if (!ok)
+          {
+            std::cerr << "ERROR: cannot decode FibEntry TLV" << std::endl;
+            break;
+          }
+        offset += block.size();
+
+        nfd::FibEntry fibEntry(block);
+
+        std::cout << "  " << fibEntry.getPrefix() << " nexthops={";
+        for (std::list<nfd::NextHopRecord>::const_iterator
+               nextHop = fibEntry.getNextHopRecords().begin();
+             nextHop != fibEntry.getNextHopRecords().end();
+             ++nextHop)
+          {
+            if (nextHop != fibEntry.getNextHopRecords().begin())
+              std::cout << ", ";
+            std::cout << "faceid=" << nextHop->getFaceId()
+                      << " (cost=" << nextHop->getCost() << ")";
+          }
+        std::cout << "}" << std::endl;
+      }
+  }
+
+  void
+  fetchFibEnumerationInformation()
+  {
+    m_buffer = make_shared<OBufferStream>();
+
+    Interest interest("/localhost/nfd/fib/list");
+    interest.setChildSelector(1);
+    interest.setMustBeFresh(true);
+    m_face.expressInterest(interest,
+                           bind(&NfdStatus::fetchSegments, this, _2,
+                                &NfdStatus::afterFetchedFibEnumerationInformation),
+                           bind(&NfdStatus::onTimeout, this));
+  }
+
+  void
+  fetchInformation()
+  {
+    if (!m_needVersionRetrieval &&
+        !m_needFaceStatusRetrieval &&
+        !m_needFibEnumerationRetrieval)
+      {
+        enableVersionRetrieval();
+        enableFaceStatusRetrieval();
+        enableFibEnumerationRetrieval();
+      }
+
+    if (m_needVersionRetrieval)
+      {
+        fetchVersionInformation();
+      }
+    else if (m_needFaceStatusRetrieval)
+      {
+        fetchFaceStatusInformation();
+      }
+    else if (m_needFibEnumerationRetrieval)
+      {
+        fetchFibEnumerationInformation();
+      }
+
+    m_face.processEvents();
+  }
+
+private:
+  std::string m_toolName;
+  bool m_needVersionRetrieval;
+  bool m_needFaceStatusRetrieval;
+  bool m_needFibEnumerationRetrieval;
+  Face m_face;
+
+  shared_ptr<OBufferStream> m_buffer;
+};
+
+}
+
+int main( int argc, char* argv[] )
+{
+  int option;
+  ndn::NfdStatus nfdStatus (argv[0]);
+
+  while ((option = getopt(argc, argv, "hvfb")) != -1) {
+    switch (option) {
+    case 'h':
+      nfdStatus.usage();
+      return 0;
+    case 'v':
+      nfdStatus.enableVersionRetrieval();
+      break;
+    case 'f':
+      nfdStatus.enableFaceStatusRetrieval();
+      break;
+    case 'b':
+      nfdStatus.enableFibEnumerationRetrieval();
+      break;
+    default:
+      nfdStatus.usage();
+      return 1;
+    }
+  }
+
+  try {
+    nfdStatus.fetchInformation();
+  }
+  catch (std::exception& e) {
+    std::cerr << "ERROR: " << e.what() << std::endl;
+    return 2;
+  }
+
+  return 0;
+}
diff --git a/tools/nfdc.cpp b/tools/nfdc.cpp
new file mode 100644
index 0000000..a603cd6
--- /dev/null
+++ b/tools/nfdc.cpp
@@ -0,0 +1,281 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+#include "nfdc.hpp"
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/regex_find_format.hpp>
+#include <boost/regex.hpp>
+
+void
+usage(const char* programName)
+{
+  std::cout << "Usage:\n" << programName  << " [-h] COMMAND\n"
+    "       -h print usage and exit\n"
+    "\n"
+    "   COMMAND can be one of following:\n"
+    "       add-nexthop <name> <faceId> [<cost>]\n"
+    "           Add a nexthop to a FIB entry\n"
+    "       remove-nexthop <name> <faceId> \n"
+    "           Remove a nexthop from a FIB entry\n"
+    "       create <uri> \n"
+    "           Create a face in one of the following formats:\n"
+    "           UDP unicast:    udp[4|6]://<remote-IP-or-host>[:<remote-port>]\n"
+    "           TCP:            tcp[4|6]://<remote-IP-or-host>[:<remote-port>] \n"
+    "       destroy <faceId> \n"
+    "           Destroy a face\n"
+    "       set-strategy <name> <strategy> \n"
+    "           Set the strategy for a namespace \n"
+    "       unset-strategy <name> \n"
+    "           Unset the strategy for a namespace \n"
+    << std::endl;
+}
+
+namespace nfdc {
+
+Nfdc::Nfdc(ndn::Face& face)
+  : m_controller(face)
+{
+}
+
+Nfdc::~Nfdc()
+{
+}
+
+bool
+Nfdc::dispatch(const std::string& command, const char* commandOptions[], int nOptions)
+{
+  if (command == "add-nexthop") {
+    if (nOptions == 2)
+      fibAddNextHop(commandOptions, false);
+    else if (nOptions == 3)
+      fibAddNextHop(commandOptions, true);
+    else
+      return false;
+  }
+  else if (command == "remove-nexthop") {
+    if (nOptions != 2)
+      return false;
+    fibRemoveNextHop(commandOptions);
+  }
+  else if (command == "create") {
+    if (nOptions != 1)
+      return false;
+    faceCreate(commandOptions);
+  }
+  else if (command == "destroy") {
+    if (nOptions != 1)
+      return false;
+    faceDestroy(commandOptions);
+  }
+  else if (command == "set-strategy") {
+    if (nOptions != 2)
+      return false;
+    strategyChoiceSet(commandOptions);
+  }
+  else if (command == "unset-strategy") {
+    if (nOptions != 1)
+      return false;
+    strategyChoiceUnset(commandOptions);
+  }
+  else
+    usage(m_programName);
+
+  return true;
+}
+
+void
+Nfdc::fibAddNextHop(const char* commandOptions[], bool hasCost)
+{
+  const std::string& name = commandOptions[0];
+  const int faceId = boost::lexical_cast<int>(commandOptions[1]);
+
+  ControlParameters parameters;
+  parameters
+    .setName(name)
+    .setFaceId(faceId);
+
+  if (hasCost)
+  {
+    const uint64_t cost = boost::lexical_cast<uint64_t>(commandOptions[2]);
+    parameters.setCost(cost);
+  }
+
+  m_controller.start<FibAddNextHopCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Nexthop insertion succeeded"),
+    bind(&Nfdc::onError, this, _1, _2, "Nexthop insertion failed"));
+}
+
+void
+Nfdc::fibRemoveNextHop(const char* commandOptions[])
+{
+  const std::string& name = commandOptions[0];
+  const int faceId = boost::lexical_cast<int>(commandOptions[1]);
+
+  ControlParameters parameters;
+  parameters
+    .setName(name)
+    .setFaceId(faceId);
+
+  m_controller.start<FibRemoveNextHopCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Nexthop removal succeeded"),
+    bind(&Nfdc::onError, this, _1, _2, "Nexthop removal failed"));
+}
+
+namespace {
+
+inline bool
+isValidUri(const std::string& input)
+{
+  // an extended regex to support the validation of uri structure
+  // boost::regex e("^[a-z0-9]+-?+[a-z0-9]+\\:\\/\\/.*");
+  boost::regex e("^[a-z0-9]+\\:.*");
+  return boost::regex_match(input, e);
+}
+
+} // anonymous namespace
+
+void
+Nfdc::faceCreate(const char* commandOptions[])
+{
+  const std::string& uri = commandOptions[0];
+  if (!isValidUri(uri))
+    throw Error("invalid uri format");
+
+  ControlParameters parameters;
+  parameters
+    .setUri(uri);
+
+  m_controller.start<FaceCreateCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Face creation succeeded"),
+    bind(&Nfdc::onError, this, _1, _2, "Face creation failed"));
+}
+
+void
+Nfdc::faceDestroy(const char* commandOptions[])
+{
+  const int faceId = boost::lexical_cast<int>(commandOptions[0]);
+
+  ControlParameters parameters;
+  parameters
+    .setFaceId(faceId);
+
+  m_controller.start<FaceDestroyCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Face destroy succeeded"),
+    bind(&Nfdc::onError, this, _1, _2, "Face destroy failed"));
+}
+
+void
+Nfdc::strategyChoiceSet(const char* commandOptions[])
+{
+  const std::string& name = commandOptions[0];
+  const std::string& strategy = commandOptions[1];
+
+  ControlParameters parameters;
+  parameters
+    .setName(name)
+    .setStrategy(strategy);
+
+  m_controller.start<StrategyChoiceSetCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Successfully set strategy choice"),
+    bind(&Nfdc::onError, this, _1, _2, "Failed to set strategy choice"));
+}
+
+void
+Nfdc::strategyChoiceUnset(const char* commandOptions[])
+{
+  const std::string& name = commandOptions[0];
+
+  ControlParameters parameters;
+  parameters
+    .setName(name);
+
+  m_controller.start<StrategyChoiceUnsetCommand>(
+    parameters,
+    bind(&Nfdc::onSuccess, this, _1, "Successfully unset strategy choice"),
+    bind(&Nfdc::onError, this, _1, _2, "Failed to unset strategy choice"));
+}
+
+void
+Nfdc::onSuccess(const ControlParameters& parameters, const std::string& message)
+{
+  std::cout << message << ": " << parameters << std::endl;
+}
+
+void
+Nfdc::onError(uint32_t code, const std::string& error, const std::string& message)
+{
+  std::ostringstream os;
+  os << message << ": " << error << " (code: " << code << ")";
+  throw Error(os.str());
+}
+
+} // namespace nfdc
+
+int
+main(int argc, char** argv)
+{
+  ndn::Face face;
+  nfdc::Nfdc p(face);
+
+  p.m_programName = argv[0];
+  int opt;
+  while ((opt = getopt(argc, argv, "h")) != -1) {
+    switch (opt) {
+      case 'h':
+        usage(p.m_programName);
+        return 0;
+
+      default:
+        usage(p.m_programName);
+        return 1;
+    }
+  }
+
+  if (argc == optind) {
+    usage(p.m_programName);
+    return 1;
+  }
+
+  try {
+    bool isOk = p.dispatch(argv[optind],
+                           const_cast<const char**>(argv + optind + 1),
+                           argc - optind - 1);
+    if (!isOk) {
+      usage(p.m_programName);
+      return 1;
+    }
+
+    face.processEvents();
+  }
+  catch (const std::exception& e) {
+    std::cerr << "ERROR: " << e.what() << std::endl;
+    return 2;
+  }
+  return 0;
+}
diff --git a/tools/nfdc.hpp b/tools/nfdc.hpp
new file mode 100644
index 0000000..ab74e10
--- /dev/null
+++ b/tools/nfdc.hpp
@@ -0,0 +1,154 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_TOOLS_NFDC_HPP
+#define NFD_TOOLS_NFDC_HPP
+
+#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cpp-dev/management/controller.hpp>
+#include <ndn-cpp-dev/management/nfd-controller.hpp>
+#include <vector>
+
+namespace nfdc {
+
+using namespace ndn::nfd;
+
+class Nfdc
+{
+public:
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
+  explicit
+  Nfdc(ndn::Face& face);
+
+  ~Nfdc();
+
+  bool
+  dispatch(const std::string& cmd,
+           const char* cmdOptions[],
+           int nOptions);
+
+  /**
+   * \brief Adds a nexthop to a FIB entry.
+   *
+   * If the FIB entry does not exist, it is inserted automatically
+   *
+   * cmd format:
+   *   name
+   *
+   * \param cmdOptions Add next hop command parameters without leading 'add-nexthop' component
+   */
+  void
+  fibAddNextHop(const char* cmdOptions[], bool hasCost);
+
+  /**
+   * \brief Removes a nexthop from an existing FIB entry
+   *
+   * If the last nexthop record in a FIB entry is removed, the FIB entry is also deleted
+   *
+   * cmd format:
+   *   name faceId
+   *
+   * \param cmdOptions Remove next hop command parameters without leading
+   *                   'remove-nexthop' component
+   */
+  void
+  fibRemoveNextHop(const char* cmdOptions[]);
+
+  /**
+   * \brief create new face
+   *
+   * This command allows creation of UDP unicast and TCP faces only.
+   *
+   * cmd format:
+   *   uri
+   *
+   * \param cmdOptions Create face command parameters without leading 'create' component
+   */
+  void
+  faceCreate(const char* cmdOptions[]);
+
+  /**
+   * \brief destroy a face
+   *
+   * cmd format:
+   *   faceId
+   *
+   * \param cmdOptions Destroy face command parameters without leading 'destroy' component
+   */
+  void
+  faceDestroy(const char* cmdOptions[]);
+
+  /**
+   * \brief Set the strategy for a namespace
+   *
+   *
+   * cmd format:
+   *   name strategy
+   *
+   * \param cmdOptions Set strategy choice command parameters without leading
+   *                   'set-strategy' component
+   */
+  void
+  strategyChoiceSet(const char* cmdOptions[]);
+
+  /**
+   * \brief Unset the strategy for a namespace
+   *
+   *
+   * cmd format:
+   *   name strategy
+   *
+   * \param cmdOptions Unset strategy choice command parameters without leading
+   *                   'unset-strategy' component
+   */
+  void
+  strategyChoiceUnset(const char* cmdOptions[]);
+
+private:
+  void
+  onSuccess(const ControlParameters& parameters,
+            const std::string& message);
+
+  void
+  onError(uint32_t code, const std::string& error, const std::string& message);
+
+public:
+  const char* m_programName;
+
+private:
+  Controller m_controller;
+};
+
+} // namespace nfdc
+
+#endif // NFD_TOOLS_NFDC_HPP
diff --git a/unit-tests.conf.sample b/unit-tests.conf.sample
new file mode 100644
index 0000000..d75c19c
--- /dev/null
+++ b/unit-tests.conf.sample
@@ -0,0 +1,31 @@
+log
+{
+  ; default_level specifies the logging level for modules
+  ; that are not explicitly named. All debugging levels
+  ; listed above the selected value are enabled.
+  ;
+  ; Valid values:
+  ;
+  ;  NONE ; no messages
+  ;  ERROR ; error messages
+  ;  WARN ; warning messages
+  ;  INFO ; informational messages (default)
+  ;  DEBUG ; debugging messages
+  ;  TRACE ; trace messages (most verbose)
+  ;  ALL ; all messages
+
+  ; default_level INFO
+
+  ; You may override default_level by assigning a logging level
+  ; to the desired module name. Module names can be found in two ways:
+  ;
+  ; Run:
+  ;   nfd --modules
+  ;
+  ; Or look for NFD_LOG_INIT(<module name>) statements in .cpp files
+  ;
+  ; Example module-level settings:
+  ;
+  ; FibManager DEBUG
+  ; Forwarder INFO
+}
\ No newline at end of file
diff --git a/version.hpp b/version.hpp
new file mode 100644
index 0000000..08dccaf
--- /dev/null
+++ b/version.hpp
@@ -0,0 +1,55 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_VERSION_HPP
+#define NFD_VERSION_HPP
+
+namespace nfd {
+
+/** NFD version follows Semantic Versioning 2.0.0 specification
+ *  http://semver.org/
+ */
+
+/** \brief NFD version represented as an integer
+ *
+ *  MAJOR*1000000 + MINOR*1000 + PATCH
+ */
+#define NFD_VERSION 1000
+
+/** \brief NFD version represented as a string
+ *
+ *  MAJOR.MINOR.PATCH
+ */
+#define NFD_VERSION_STRING "0.1.0"
+
+/// MAJOR version
+#define NFD_VERSION_MAJOR (NFD_VERSION / 1000000)
+/// MINOR version
+#define NFD_VERSION_MINOR (NFD_VERSION % 1000000 / 1000)
+/// PATCH version
+#define NFD_VERSION_PATCH (NFD_VERSION % 1000)
+
+} // namespace nfd
+
+#endif // NFD_VERSION_HPP
diff --git a/wscript b/wscript
index f25aebf..39ea4b1 100644
--- a/wscript
+++ b/wscript
@@ -1,72 +1,182 @@
 # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 
+"""
+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
+
+This file is part of NFD (Named Data Networking Forwarding Daemon).
+See AUTHORS.md for complete list of NFD authors and contributors.
+
+NFD 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.
+
+NFD 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
+NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+VERSION = '0.1.0'
+APPNAME = "nfd"
+BUGREPORT = "http://redmine.named-data.net/projects/nfd"
+URL = "https://github.com/named-data/NFD"
+
 from waflib import Logs
+import os
 
 def options(opt):
-    opt.load('compiler_cxx gnu_dirs')
-    opt.load('flags boost doxygen coverage', tooldir=['.waf-tools'])
+    opt.load(['compiler_cxx', 'gnu_dirs'])
+    opt.load(['boost', 'unix-socket', 'dependency-checker',
+              'default-compiler-flags', 'coverage',
+              'doxygen', 'sphinx_build'],
+             tooldir=['.waf-tools'])
 
-    nrdopt = opt.add_option_group('NRD Options')
-    nrdopt.add_option('--debug', action='store_true', default=False,
-                      dest='debug',
-                      help='''Compile library debugging mode without all optimizations (-O0)''')
-    nrdopt.add_option('--with-tests', action='store_true',
-                      default=False, dest='with_tests', help='''Build unit tests''')
+    nfdopt = opt.add_option_group('NFD Options')
+    opt.addUnixOptions(nfdopt)
+    opt.addDependencyOptions(nfdopt, 'libpcap')
+    nfdopt.add_option('--without-libpcap', action='store_true', default=False,
+                      dest='without_libpcap',
+                      help='''Disable libpcap (Ethernet face support will be disabled)''')
+
+    opt.addDependencyOptions(nfdopt, 'librt',     '(optional)')
+    opt.addDependencyOptions(nfdopt, 'libresolv', '(optional)')
+
+    nfdopt.add_option('--with-c++11', action='store_true', default=False, dest='use_cxx11',
+                      help='''Enable C++11 mode (experimental, may not work)''')
+    nfdopt.add_option('--with-tests', action='store_true', default=False,
+                      dest='with_tests', help='''Build unit tests''')
+    nfdopt.add_option('--with-other-tests', action='store_true', default=False,
+                      dest='with_other_tests', help='''Build other tests''')
 
 def configure(conf):
-    conf.load("compiler_cxx gnu_dirs boost flags")
+    conf.load("compiler_cxx boost gnu_dirs sphinx_build")
+
+    try: conf.load("doxygen")
+    except: pass
+
+    try: conf.load("sphinx_build")
+    except: pass
+
+    conf.load('default-compiler-flags')
 
     conf.check_cfg(package='libndn-cpp-dev', args=['--cflags', '--libs'],
                    uselib_store='NDN_CPP', mandatory=True)
 
-    boost_libs = 'system'
+    boost_libs = 'system chrono program_options'
     if conf.options.with_tests:
         conf.env['WITH_TESTS'] = 1
         conf.define('WITH_TESTS', 1);
         boost_libs += ' unit_test_framework'
 
+    if conf.options.with_other_tests:
+        conf.env['WITH_OTHER_TESTS'] = 1
+
     conf.check_boost(lib=boost_libs)
+
     if conf.env.BOOST_VERSION_NUMBER < 104800:
-        Logs.error("Minimum required boost version is 1.48")
+        Logs.error("Minimum required boost version is 1.48.0")
         Logs.error("Please upgrade your distribution or install custom boost libraries" +
                    " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
         return
 
-    # conf.load('coverage')
+    conf.load('unix-socket')
 
-    # try:
-    #     conf.load('doxygen')
-    # except:
-    #     pass
+    conf.checkDependency(name='librt', lib='rt', mandatory=False)
+    conf.checkDependency(name='libresolv', lib='resolv', mandatory=False)
+    if not conf.options.without_libpcap:
+        conf.checkDependency(name='libpcap', lib='pcap', mandatory=True,
+                             errmsg='not found, but required for Ethernet face support. '
+                                    'Specify --without-libpcap to disable Ethernet face support.')
 
-    conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nrd.conf' % conf.env['SYSCONFDIR'])
-    conf.write_config_header('src/config.hpp')
+    conf.load('coverage')
 
-def build (bld):
-    bld(
+    conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nfd.conf' % conf.env['SYSCONFDIR'])
+
+    conf.write_config_header('config.hpp')
+
+def build(bld):
+    core = bld(
+        target='core-objects',
+        name='core-objects',
         features='cxx',
-        name='nrd-objects',
-        source=bld.path.ant_glob('src/*.cpp',
-                                 excl='src/main.cpp'),
-        use='NDN_CPP BOOST',
+        source=bld.path.ant_glob(['core/**/*.cpp']),
+        use='BOOST NDN_CPP LIBRT',
+        includes='. core',
+        export_includes='. core',
         )
 
-    bld.program(
-        target='nrd',
-        source='src/main.cpp',
-        use='nrd-objects'
+    nfd_objects = bld(
+        target='daemon-objects',
+        name='daemon-objects',
+        features='cxx',
+        source=bld.path.ant_glob(['daemon/**/*.cpp'],
+                                 excl=['daemon/face/ethernet-*.cpp',
+                                       'daemon/face/unix-*.cpp',
+                                       'daemon/main.cpp']),
+        use='core-objects',
+        includes='daemon',
+        export_includes='daemon',
         )
 
-    # Unit tests
-    if bld.env['WITH_TESTS']:
-        unit_tests = bld.program(
-            target='unit-tests',
-            features='cxx cxxprogram',
-            source=bld.path.ant_glob(['tests/**/*.cpp']),
-            use='nrd-objects',
-            includes=['.', 'src'],
-            install_prefix=None,
+    if bld.env['HAVE_LIBPCAP']:
+        nfd_objects.source += bld.path.ant_glob('daemon/face/ethernet-*.cpp')
+        nfd_objects.use += ' LIBPCAP'
+
+    if bld.env['HAVE_UNIX_SOCKETS']:
+        nfd_objects.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
+
+    bld(target='bin/nfd',
+        features='cxx cxxprogram',
+        source='daemon/main.cpp',
+        use='daemon-objects',
+        )
+
+    for app in bld.path.ant_glob('tools/*.cpp'):
+        bld(features=['cxx', 'cxxprogram'],
+            target='bin/%s' % (str(app.change_ext(''))),
+            source=['tools/%s' % (str(app))],
+            use='core-objects LIBRESOLV',
             )
 
-    bld.install_files('${SYSCONFDIR}/ndn', 'nrd.conf.sample')
+    bld.recurse("tests")
 
+    bld(features="subst",
+        source='nfd.conf.sample.in',
+        target='nfd.conf.sample',
+        install_path="${SYSCONFDIR}/ndn",
+        IF_HAVE_LIBPCAP="" if bld.env['HAVE_LIBPCAP'] else "; ")
+
+    bld(features='subst',
+        source='tools/nfd-status-http-server.py',
+        target='nfd-status-http-server',
+        install_path="${BINDIR}",
+        chmod=0755)
+
+    if bld.env['SPHINX_BUILD']:
+        bld(features="sphinx",
+            builder="man",
+            outdir="docs/manpages",
+            config="docs/conf.py",
+            source=bld.path.ant_glob('docs/manpages/**/*.rst'),
+            install_path="${MANDIR}/")
+
+def doxygen(bld):
+    if not bld.env.DOXYGEN:
+        bld.fatal("ERROR: cannot build documentation (`doxygen' is not found in $PATH)")
+    bld(features="doxygen",
+        doxyfile='docs/doxygen.conf',
+        install_path=None)
+
+def sphinx(bld):
+    bld(features="sphinx",
+        outdir="docs",
+        source=bld.path.ant_glob('docs/**/*.rst'),
+        config="docs/conf.py",
+        install_path=None)