diff --git a/daemon/face/internal-client-face.cpp b/daemon/face/internal-client-face.cpp
deleted file mode 100644
index 510b087..0000000
--- a/daemon/face/internal-client-face.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * 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-client-face.hpp"
-#include "internal-face.hpp"
-#include "core/global-io.hpp"
-
-#include <ndn-cxx/management/nfd-local-control-header.hpp>
-
-namespace nfd {
-
-void
-InternalClientFace::Transport::receive(const Block& block)
-{
-  if (m_receiveCallback) {
-    m_receiveCallback(block);
-  }
-}
-
-void
-InternalClientFace::Transport::close()
-{
-}
-
-void
-InternalClientFace::Transport::send(const Block& wire)
-{
-  onSendBlock(wire);
-}
-
-void
-InternalClientFace::Transport::send(const Block& header, const Block& payload)
-{
-  ndn::EncodingBuffer encoder(header.size() + payload.size(), header.size() + payload.size());
-  encoder.appendByteArray(header.wire(), header.size());
-  encoder.appendByteArray(payload.wire(), payload.size());
-
-  this->send(encoder.block());
-}
-
-void
-InternalClientFace::Transport::pause()
-{
-}
-
-void
-InternalClientFace::Transport::resume()
-{
-}
-
-InternalClientFace::InternalClientFace(const shared_ptr<InternalFace>& face,
-                                       const shared_ptr<InternalClientFace::Transport>& transport,
-                                       ndn::KeyChain& keyChain)
-  : ndn::Face(transport, getGlobalIoService(), keyChain)
-  , m_face(face)
-  , m_transport(transport)
-{
-  construct();
-}
-
-void
-InternalClientFace::construct()
-{
-  m_face->onSendInterest.connect(bind(&InternalClientFace::receive<Interest>, this, _1));
-  m_face->onSendData.connect(bind(&InternalClientFace::receive<Data>, this, _1));
-  m_transport->onSendBlock.connect(bind(&InternalFace::receive, m_face, _1));
-}
-
-shared_ptr<InternalClientFace>
-makeInternalClientFace(const shared_ptr<InternalFace>& face,
-                       ndn::KeyChain& keyChain)
-{
-  auto transport = make_shared<InternalClientFace::Transport>();
-  return shared_ptr<InternalClientFace>(new InternalClientFace(face, transport, keyChain));
-}
-
-} // namespace nfd
diff --git a/daemon/face/internal-client-face.hpp b/daemon/face/internal-client-face.hpp
deleted file mode 100644
index abc375b..0000000
--- a/daemon/face/internal-client-face.hpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * 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_INTERNAL_CLIENT_FACE_HPP
-#define NFD_DAEMON_FACE_INTERNAL_CLIENT_FACE_HPP
-
-#include "common.hpp"
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/transport/transport.hpp>
-#include <ndn-cxx/lp/packet.hpp>
-
-namespace nfd {
-
-class InternalFace;
-class InternalClientFace;
-
-shared_ptr<InternalClientFace>
-makeInternalClientFace(const shared_ptr<InternalFace>& face, ndn::KeyChain& keyChain);
-
-/** \brief a client face that is connected to NFD InternalFace
- */
-class InternalClientFace : public ndn::Face
-{
-public:
-  template<typename Packet>
-  void
-  receive(const Packet& packet);
-
-private:
-  class Transport : public ndn::Transport
-  {
-  public:
-    signal::Signal<Transport, Block> onSendBlock;
-
-    void
-    receive(const Block& block);
-
-    virtual void
-    close() DECL_OVERRIDE;
-
-    virtual void
-    send(const Block& wire) DECL_OVERRIDE;
-
-    virtual void
-    send(const Block& header, const Block& payload) DECL_OVERRIDE;
-
-    virtual void
-    pause() DECL_OVERRIDE;
-
-    virtual void
-    resume() DECL_OVERRIDE;
-  };
-
-private:
-  InternalClientFace(const shared_ptr<InternalFace>& face,
-                     const shared_ptr<InternalClientFace::Transport>& transport,
-                     ndn::KeyChain& keyChain);
-
-  void
-  construct();
-
-  friend shared_ptr<InternalClientFace>
-  makeInternalClientFace(const shared_ptr<InternalFace>& face,
-                         ndn::KeyChain& keyChain);
-
-private:
-  shared_ptr<InternalFace> m_face;
-  shared_ptr<InternalClientFace::Transport> m_transport;
-};
-
-template<typename Packet>
-void
-InternalClientFace::receive(const Packet& packet)
-{
-  lp::Packet lpPacket(packet.wireEncode());
-
-  ndn::nfd::LocalControlHeader localControlHeader = packet.getLocalControlHeader();
-
-  if (localControlHeader.hasIncomingFaceId()) {
-    lpPacket.add<lp::IncomingFaceIdField>(localControlHeader.getIncomingFaceId());
-  }
-
-  if (localControlHeader.hasNextHopFaceId()) {
-    lpPacket.add<lp::NextHopFaceIdField>(localControlHeader.getNextHopFaceId());
-  }
-
-  m_transport->receive(lpPacket.wireEncode());
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_INTERNAL_CLIENT_FACE_HPP
diff --git a/daemon/face/internal-face.cpp b/daemon/face/internal-face.cpp
index c5ab2ca..c89f87f 100644
--- a/daemon/face/internal-face.cpp
+++ b/daemon/face/internal-face.cpp
@@ -24,70 +24,34 @@
  */
 
 #include "internal-face.hpp"
+#include "generic-link-service.hpp"
+#include "internal-transport.hpp"
+#include "lp-face-wrapper.hpp"
+#include "core/global-io.hpp"
 
 namespace nfd {
+namespace face {
 
-InternalFace::InternalFace()
-  : Face(FaceUri("internal://"), FaceUri("internal://"), true)
+std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
+makeInternalFace(ndn::KeyChain& clientKeyChain)
 {
+  GenericLinkService::Options serviceOpts;
+  serviceOpts.allowLocalFields = true;
+
+  auto face = make_unique<LpFace>(make_unique<GenericLinkService>(serviceOpts),
+                                  make_unique<InternalForwarderTransport>());
+  auto faceW = make_shared<LpFaceWrapper>(std::move(face));
+  // TODO#3172 eliminate wrapper
+
+  InternalForwarderTransport* forwarderTransport =
+    static_cast<InternalForwarderTransport*>(faceW->getLpFace()->getTransport());
+  auto clientTransport = make_shared<InternalClientTransport>();
+  clientTransport->connectToForwarder(forwarderTransport);
+
+  auto clientFace = make_shared<ndn::Face>(clientTransport, getGlobalIoService(), clientKeyChain);
+
+  return std::make_tuple(faceW, clientFace);
 }
 
-void
-InternalFace::sendInterest(const Interest& interest)
-{
-  this->emitSignal(onSendInterest, interest);
-}
-
-void
-InternalFace::sendData(const Data& data)
-{
-  this->emitSignal(onSendData, data);
-}
-
-void
-InternalFace::close()
-{
-}
-
-void
-InternalFace::receive(const Block& blockFromClient)
-{
-  const Block& payLoad = ndn::nfd::LocalControlHeader::getPayload(blockFromClient);
-  if (payLoad.type() == ndn::tlv::Interest) {
-    receiveInterest(*extractPacketFromBlock<Interest>(blockFromClient, payLoad));
-  }
-  else if (payLoad.type() == ndn::tlv::Data) {
-    receiveData(*extractPacketFromBlock<Data>(blockFromClient, payLoad));
-  }
-}
-
-void
-InternalFace::receiveInterest(const Interest& interest)
-{
-  this->emitSignal(onReceiveInterest, interest);
-}
-
-void
-InternalFace::receiveData(const Data& data)
-{
-  this->emitSignal(onReceiveData, data);
-}
-
-template<typename Packet>
-shared_ptr<Packet>
-InternalFace::extractPacketFromBlock(const Block& blockFromClient, const Block& payLoad)
-{
-  auto packet = make_shared<Packet>(payLoad);
-  if (&payLoad != &blockFromClient) {
-    packet->getLocalControlHeader().wireDecode(blockFromClient);
-  }
-  return packet;
-}
-
-template shared_ptr<Interest>
-InternalFace::extractPacketFromBlock<Interest>(const Block& blockFromClient, const Block& payLoad);
-
-template shared_ptr<Data>
-InternalFace::extractPacketFromBlock<Data>(const Block& blockFromClient, const Block& payLoad);
-
+} // namespace face
 } // namespace nfd
diff --git a/daemon/face/internal-face.hpp b/daemon/face/internal-face.hpp
index 1014fca..94e1960 100644
--- a/daemon/face/internal-face.hpp
+++ b/daemon/face/internal-face.hpp
@@ -27,76 +27,25 @@
 #define NFD_DAEMON_FACE_INTERNAL_FACE_HPP
 
 #include "face.hpp"
+#include <ndn-cxx/face.hpp>
 
 namespace nfd {
+namespace face {
 
-/**
- * @brief represents a face for internal use in NFD.
+/** \brief make a pair of forwarder-side face and client-side face
+ *         that are connected with each other
+ *
+ *  Network-layer packets sent by one face will be received by the other face
+ *  after io.poll().
+ *
+ *  \param clientKeyChain A KeyChain used by client-side face to sign
+ *                        prefix registration commands.
+ *  \return a forwarder-side face and a client-side face connected with each other
  */
-class InternalFace : public Face
-{
-public:
+std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
+makeInternalFace(ndn::KeyChain& clientKeyChain);
 
-  InternalFace();
-
-  virtual void
-  sendInterest(const Interest& interest) DECL_OVERRIDE;
-
-  virtual void
-  sendData(const Data& data) DECL_OVERRIDE;
-
-  virtual void
-  close() DECL_OVERRIDE;
-
-  /**
-   * @brief receive a block from a client face
-   *
-   * step1. extracte the packet payload from the received block.
-   * step2. check the type (either Interest or Data) through the payload.
-   * step3. call receiveInterest / receiveData respectively according to the type.
-   *
-   * @param blockFromClient the block from a client face
-   */
-  void
-  receive(const Block& blockFromClient);
-
-  /**
-   * @brief receive an Interest from a client face
-   *
-   * emit the onReceiveInterest signal.
-   *
-   * @param interest the received Interest packet
-   */
-  void
-  receiveInterest(const Interest& interest);
-
-  /**
-   * @brief receive a Data from a client face
-   *
-   * emit the onReceiveData signal.
-   *
-   * @param data the received Data packet
-   */
-  void
-  receiveData(const Data& data);
-
-  /**
-   * @brief compose the whole packet from the received block after payload is extracted
-   *
-   * construct a packet from the extracted payload, and then decode the localControlHeader if the
-   * received block holds more information than the payload.
-   *
-   * @tparam Packet the type of packet, Interest or Data
-   * @param blockFromClient the received block
-   * @param payLoad the extracted payload
-   *
-   * @return a complete packet
-   */
-  template<typename Packet>
-  static shared_ptr<Packet>
-  extractPacketFromBlock(const Block& blockFromClient, const Block& payLoad);
-};
-
+} // namespace face
 } // namespace nfd
 
 #endif // NFD_DAEMON_FACE_INTERNAL_FACE_HPP
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
new file mode 100644
index 0000000..d9dc238
--- /dev/null
+++ b/daemon/face/internal-transport.cpp
@@ -0,0 +1,129 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * 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-transport.hpp"
+#include "core/global-io.hpp"
+
+namespace nfd {
+namespace face {
+
+NFD_LOG_INCLASS_DEFINE(InternalForwarderTransport, "InternalForwarderTransport");
+
+InternalForwarderTransport::InternalForwarderTransport(
+    const FaceUri& localUri, const FaceUri& remoteUri,
+    ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
+{
+  this->setLocalUri(localUri);
+  this->setRemoteUri(remoteUri);
+  this->setScope(scope);
+  this->setPersistency(ndn::nfd::FACE_PERSISTENCY_PERMANENT);
+  this->setLinkType(linkType);
+
+  NFD_LOG_FACE_INFO("Creating transport");
+}
+
+void
+InternalForwarderTransport::receiveFromLink(const Block& packet)
+{
+  NFD_LOG_FACE_TRACE(__func__);
+
+  Packet p;
+  p.packet = packet;
+  this->receive(std::move(p));
+}
+
+void
+InternalForwarderTransport::doSend(Packet&& packet)
+{
+  NFD_LOG_FACE_TRACE(__func__);
+
+  this->emitSignal(afterSend, packet.packet);
+}
+
+void
+InternalForwarderTransport::doClose()
+{
+  NFD_LOG_FACE_TRACE(__func__);
+
+  this->setState(TransportState::CLOSED);
+}
+
+NFD_LOG_INCLASS_DEFINE(InternalClientTransport, "InternalClientTransport");
+
+static void
+asyncReceive(InternalTransportBase* recipient, const Block& packet)
+{
+  getGlobalIoService().post([packet, recipient] {
+    recipient->receiveFromLink(packet);
+  });
+}
+
+void
+InternalClientTransport::connectToForwarder(InternalForwarderTransport* forwarderTransport)
+{
+  NFD_LOG_DEBUG(__func__ << " " << forwarderTransport);
+
+  m_fwToClientTransmitConn.disconnect();
+  m_clientToFwTransmitConn.disconnect();
+  m_fwTransportStateConn.disconnect();
+
+  if (forwarderTransport != nullptr) {
+    m_fwToClientTransmitConn = forwarderTransport->afterSend.connect(bind(&asyncReceive, this, _1));
+    m_clientToFwTransmitConn = this->afterSend.connect(bind(&asyncReceive, forwarderTransport, _1));
+    m_fwTransportStateConn = forwarderTransport->afterStateChange.connect(
+      [this] (TransportState oldState, TransportState newState) {
+        if (newState == TransportState::CLOSED) {
+          this->connectToForwarder(nullptr);
+        }
+      });
+  }
+}
+
+void
+InternalClientTransport::receiveFromLink(const Block& packet)
+{
+  if (m_receiveCallback) {
+    m_receiveCallback(packet);
+  }
+}
+
+void
+InternalClientTransport::send(const Block& wire)
+{
+  this->emitSignal(afterSend, wire);
+}
+
+void
+InternalClientTransport::send(const Block& header, const Block& payload)
+{
+  ndn::EncodingBuffer encoder(header.size() + payload.size(), header.size() + payload.size());
+  encoder.appendByteArray(header.wire(), header.size());
+  encoder.appendByteArray(payload.wire(), payload.size());
+
+  this->send(encoder.block());
+}
+
+} // namespace face
+} // namespace nfd
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
new file mode 100644
index 0000000..a282638
--- /dev/null
+++ b/daemon/face/internal-transport.hpp
@@ -0,0 +1,127 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * 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_INTERNAL_TRANSPORT_HPP
+#define NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
+
+#include "transport.hpp"
+#include <ndn-cxx/transport/transport.hpp>
+
+namespace nfd {
+namespace face {
+
+/** \brief abstracts a transport that can be paired with another
+ */
+class InternalTransportBase
+{
+public:
+  /** \brief causes the transport to receive a link-layer packet
+   */
+  virtual void
+  receiveFromLink(const Block& packet) = 0;
+
+  signal::Signal<InternalTransportBase, Block> afterSend;
+
+protected:
+  DECLARE_SIGNAL_EMIT(afterSend)
+};
+
+/** \brief implements a forwarder-side transport that can be paired with another
+ */
+class InternalForwarderTransport : public face::Transport, public InternalTransportBase
+{
+public:
+  InternalForwarderTransport(const FaceUri& localUri = FaceUri("internal://"),
+                             const FaceUri& remoteUri = FaceUri("internal://"),
+                             ndn::nfd::FaceScope scope = ndn::nfd::FACE_SCOPE_LOCAL,
+                             ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+
+  virtual void
+  receiveFromLink(const Block& packet) DECL_OVERRIDE;
+
+protected:
+  virtual void
+  doClose() DECL_OVERRIDE;
+
+private:
+  virtual void
+  doSend(Packet&& packet) DECL_OVERRIDE;
+
+private:
+  NFD_LOG_INCLASS_DECLARE();
+};
+
+/** \brief implements a client-side transport that can be paired with another
+ */
+class InternalClientTransport : public ndn::Transport, public InternalTransportBase
+{
+public:
+  /** \brief connect to a forwarder-side transport
+   *  \param forwarderTransport the forwarder-side transport to connect to; may be nullptr
+   *
+   *  The connected forwarder-side transport will be disconnected automatically if this method
+   *  is called again, or if that transport is closed.
+   *  It's safe to use InternalClientTransport without a connected forwarder-side transport:
+   *  all sent packets would be lost, and nothing would be received.
+   */
+  void
+  connectToForwarder(InternalForwarderTransport* forwarderTransport);
+
+  virtual void
+  receiveFromLink(const Block& packet) DECL_OVERRIDE;
+
+  virtual void
+  close() DECL_OVERRIDE
+  {
+  }
+
+  virtual void
+  pause() DECL_OVERRIDE
+  {
+  }
+
+  virtual void
+  resume() DECL_OVERRIDE
+  {
+  }
+
+  virtual void
+  send(const Block& wire) DECL_OVERRIDE;
+
+  virtual void
+  send(const Block& header, const Block& payload) DECL_OVERRIDE;
+
+private:
+  NFD_LOG_INCLASS_DECLARE();
+
+  signal::ScopedConnection m_fwToClientTransmitConn;
+  signal::ScopedConnection m_clientToFwTransmitConn;
+  signal::ScopedConnection m_fwTransportStateConn;
+};
+
+} // namespace face
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
