diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index 055584c..4e88ff2 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -82,8 +82,12 @@
   BOOST_REQUIRE_EQUAL(this->receivedPackets->size(), 2);
   BOOST_CHECK(this->receivedPackets->at(0).packet == pkt1);
   BOOST_CHECK(this->receivedPackets->at(1).packet == pkt2);
-  BOOST_CHECK_EQUAL(this->receivedPackets->at(0).endpoint,
-                    this->receivedPackets->at(1).endpoint);
+  BOOST_CHECK(this->receivedPackets->at(0).endpoint == this->receivedPackets->at(1).endpoint);
+  // check that the endpoint is empty (monostate) if and only if the transport is unicast
+  constexpr bool isUnicast = std::is_same_v<typename std::remove_pointer_t<decltype(T::transport)>::addressing,
+                                            face::Unicast>;
+  BOOST_CHECK_EQUAL(std::holds_alternative<std::monostate>(this->receivedPackets->at(0).endpoint),
+                    isUnicast);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveIncomplete, T, DatagramTransportFixtures, T)
diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index 8374430..15ab445 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.hpp
@@ -60,17 +60,17 @@
   /** \brief causes the face to receive an Interest
    */
   void
-  receiveInterest(const Interest& interest, const EndpointId& endpointId);
+  receiveInterest(const Interest& interest, const EndpointId& endpointId = {});
 
   /** \brief causes the face to receive a Data
    */
   void
-  receiveData(const Data& data, const EndpointId& endpointId);
+  receiveData(const Data& data, const EndpointId& endpointId = {});
 
   /** \brief causes the face to receive a Nack
    */
   void
-  receiveNack(const lp::Nack& nack, const EndpointId& endpointId);
+  receiveNack(const lp::Nack& nack, const EndpointId& endpointId = {});
 
   /** \brief Emitted after a network-layer packet is sent.
    *
diff --git a/tests/daemon/face/face-endpoint.t.cpp b/tests/daemon/face/face-endpoint.t.cpp
new file mode 100644
index 0000000..123a0f9
--- /dev/null
+++ b/tests/daemon/face/face-endpoint.t.cpp
@@ -0,0 +1,62 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2022,  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 "face/face-endpoint.hpp"
+
+#include "tests/test-common.hpp"
+#include "dummy-face.hpp"
+
+#include <boost/lexical_cast.hpp>
+
+namespace nfd::tests {
+
+using namespace nfd::face;
+
+BOOST_AUTO_TEST_SUITE(Face)
+BOOST_AUTO_TEST_SUITE(TestFaceEndpoint)
+
+BOOST_AUTO_TEST_CASE(Print)
+{
+  DummyFace face;
+  FaceEndpoint faceEndpoint1(face);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(faceEndpoint1), "0");
+
+  ethernet::Address ethEp{0x01, 0x00, 0x5e, 0x90, 0x10, 0x01};
+  FaceEndpoint faceEndpoint2(face, ethEp);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(faceEndpoint2), "(0, 01:00:5e:90:10:01)");
+
+  udp::Endpoint udp4Ep{boost::asio::ip::address_v4(0xe00017aa), 56363};
+  FaceEndpoint faceEndpoint3(face, udp4Ep);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(faceEndpoint3), "(0, 224.0.23.170:56363)");
+
+  udp::Endpoint udp6Ep{boost::asio::ip::address_v6::loopback(), 12345};
+  FaceEndpoint faceEndpoint4(face, udp6Ep);
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(faceEndpoint4), "(0, [::1]:12345)");
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestFaceEndpoint
+BOOST_AUTO_TEST_SUITE_END() // Face
+
+} // namespace nfd::tests
diff --git a/tests/daemon/face/face.t.cpp b/tests/daemon/face/face.t.cpp
index 34a19a7..8b8448d 100644
--- a/tests/daemon/face/face.t.cpp
+++ b/tests/daemon/face/face.t.cpp
@@ -104,16 +104,16 @@
   face1->afterReceiveNack.connect([&] (auto&&...) { ++nReceivedNacks; });
 
   for (size_t i = 0; i < nInInterests; ++i) {
-    face1->receiveInterest(*makeInterest("/JSQdqward4"), 0);
+    face1->receiveInterest(*makeInterest("/JSQdqward4"));
   }
 
   for (size_t i = 0; i < nInData; ++i) {
-    face1->receiveData(*makeData("/hT8FDigWn1"), 0);
+    face1->receiveData(*makeData("/hT8FDigWn1"));
   }
 
   for (size_t i = 0; i < nInNacks; ++i) {
     face1->receiveNack(makeNack(*makeInterest("/StnEVTj4Ex", false, std::nullopt, 561),
-                                lp::NackReason::CONGESTION), 0);
+                                lp::NackReason::CONGESTION));
   }
 
   for (size_t i = 0; i < nOutInterests; ++i) {
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index 16a3592..073c3db 100644
--- a/tests/daemon/face/lp-reassembler.t.cpp
+++ b/tests/daemon/face/lp-reassembler.t.cpp
@@ -38,7 +38,7 @@
   LpReassemblerFixture()
   {
     reassembler.beforeTimeout.connect(
-      [this] (EndpointId remoteEp, size_t nDroppedFragments) {
+      [this] (const EndpointId& remoteEp, size_t nDroppedFragments) {
         timeoutHistory.emplace_back(remoteEp, nDroppedFragments);
       });
   }
@@ -72,7 +72,7 @@
   bool isComplete = false;
   Block netPacket;
   lp::Packet packet;
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received);
 
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
@@ -93,7 +93,7 @@
   bool isComplete = false;
   Block netPacket;
   lp::Packet packet;
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received);
 
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
@@ -113,7 +113,7 @@
   bool isComplete = false;
   Block netPacket;
   lp::Packet packet;
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received);
 
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
@@ -132,7 +132,7 @@
   bool isComplete = false;
   Block netPacket;
   lp::Packet packet;
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received);
 
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
@@ -172,15 +172,15 @@
   Block netPacket;
   lp::Packet packet;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
 
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received3);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received3);
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
   BOOST_CHECK_EQUAL_COLLECTIONS(data, data + sizeof(data), netPacket.begin(), netPacket.end());
@@ -215,13 +215,13 @@
   Block netPacket;
   lp::Packet packet;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment(0, received3);
+  std::tie(isComplete, netPacket, packet) = reassembler.receiveFragment({}, received3);
   BOOST_REQUIRE(isComplete);
   BOOST_CHECK(packet.has<lp::NextHopFaceIdField>());
   BOOST_CHECK_EQUAL_COLLECTIONS(data, data + sizeof(data), netPacket.begin(), netPacket.end());
@@ -254,14 +254,14 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, frag2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, frag2);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, frag0);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, frag0);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, frag1);
-  BOOST_REQUIRE(isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, frag1);
+  BOOST_TEST(isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(Duplicate)
@@ -276,11 +276,11 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, frag0);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, frag0);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(1, frag0);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, frag0);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(Timeout)
@@ -301,21 +301,21 @@
   received2.add<lp::FragCountField>(2);
   received2.add<lp::SequenceField>(1001);
 
-  const EndpointId REMOTE_EP = 11028;
+  const EndpointId REMOTE_EP = ethernet::getDefaultMulticastAddress();
   bool isComplete = false;
   std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP, received1);
-  BOOST_REQUIRE(!isComplete);
+  BOOST_TEST(!isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
   BOOST_CHECK(timeoutHistory.empty());
 
   advanceClocks(1_ms, 600);
   BOOST_CHECK_EQUAL(reassembler.size(), 0);
   BOOST_REQUIRE_EQUAL(timeoutHistory.size(), 1);
-  BOOST_CHECK_EQUAL(std::get<0>(timeoutHistory.back()), REMOTE_EP);
+  BOOST_CHECK(std::get<0>(timeoutHistory.back()) == REMOTE_EP);
   BOOST_CHECK_EQUAL(std::get<1>(timeoutHistory.back()), 1);
 
   std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP, received2);
-  BOOST_REQUIRE(!isComplete);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(MissingSequence)
@@ -344,19 +344,19 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received3);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received3);
+  BOOST_TEST(!isComplete);
 
   advanceClocks(1_ms, 600);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(FragCountOverLimit)
@@ -372,8 +372,8 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(MissingFragCount)
@@ -403,14 +403,14 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received3);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received3);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_CASE(OverFragCount)
@@ -444,14 +444,14 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received1);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received1);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received2);
+  BOOST_TEST(!isComplete);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received3);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment({}, received3);
+  BOOST_TEST(!isComplete);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // MultiFragment
@@ -491,20 +491,23 @@
 
   bool isComplete = false;
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(1, frag1_1);
-  BOOST_REQUIRE(!isComplete);
+  const EndpointId REMOTE_EP_1 = ethernet::Address::fromString("11:22:33:45:67:89");
+  const EndpointId REMOTE_EP_2 = ethernet::Address::fromString("11:22:33:ab:cd:ef");
+
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP_1, frag1_1);
+  BOOST_TEST(!isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(2, frag2_2);
-  BOOST_REQUIRE(!isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP_2, frag2_2);
+  BOOST_TEST(!isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 2);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(1, frag1_2);
-  BOOST_REQUIRE(isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP_1, frag1_2);
+  BOOST_TEST(isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
 
-  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(2, frag2_1);
-  BOOST_REQUIRE(isComplete);
+  std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(REMOTE_EP_2, frag2_1);
+  BOOST_TEST(isComplete);
   BOOST_CHECK_EQUAL(reassembler.size(), 0);
 }
 
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index f32d30f..efdd4f2 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -72,7 +72,7 @@
   BOOST_CHECK_EQUAL(transport->canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERMANENT), true);
 }
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveMultipleRemoteEndpoints, T, MulticastUdpTransportFixtures, T)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveFromMultipleEndpoints, T, MulticastUdpTransportFixtures, T)
 {
   TRANSPORT_TEST_INIT();
 
@@ -93,8 +93,8 @@
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
 
   BOOST_REQUIRE_EQUAL(this->receivedPackets->size(), 2);
-  BOOST_CHECK_EQUAL(this->receivedPackets->at(0).endpoint,
-                    this->receivedPackets->at(1).endpoint);
+  BOOST_CHECK(this->receivedPackets->at(0).endpoint == this->receivedPackets->at(1).endpoint);
+  BOOST_CHECK(std::holds_alternative<nfd::udp::Endpoint>(this->receivedPackets->at(0).endpoint));
 
   this->sendToGroup(remoteSockTx2, buf1);
   this->sendToGroup(remoteSockTx2, buf2);
@@ -105,10 +105,11 @@
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
 
   BOOST_REQUIRE_EQUAL(this->receivedPackets->size(), 4);
-  BOOST_CHECK_EQUAL(this->receivedPackets->at(2).endpoint,
-                    this->receivedPackets->at(3).endpoint);
-  BOOST_CHECK_NE(this->receivedPackets->at(0).endpoint,
-                 this->receivedPackets->at(2).endpoint);
+  EndpointId epId2(remoteSockTx2.local_endpoint());
+  BOOST_CHECK(this->receivedPackets->at(0).endpoint != epId2);
+  BOOST_CHECK(this->receivedPackets->at(1).endpoint != epId2);
+  BOOST_CHECK(this->receivedPackets->at(2).endpoint == epId2);
+  BOOST_CHECK(this->receivedPackets->at(3).endpoint == epId2);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestMulticastUdpTransport
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index 9c13653..2acacfb 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -93,8 +93,8 @@
   BOOST_REQUIRE_EQUAL(this->receivedPackets->size(), 2);
   BOOST_CHECK(this->receivedPackets->at(0).packet == pkt1);
   BOOST_CHECK(this->receivedPackets->at(1).packet == pkt2);
-  BOOST_CHECK_EQUAL(this->receivedPackets->at(0).endpoint, 0);
-  BOOST_CHECK_EQUAL(this->receivedPackets->at(1).endpoint, 0);
+  BOOST_CHECK(this->receivedPackets->at(0).endpoint == EndpointId{});
+  BOOST_CHECK(this->receivedPackets->at(1).endpoint == EndpointId{});
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveMultipleSegments, T, StreamTransportFixtures, T)
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index fe79de9..e8733b2 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -166,8 +166,8 @@
   BOOST_REQUIRE_EQUAL(this->serverReceivedPackets->size(), 2);
   BOOST_CHECK(this->serverReceivedPackets->at(0).packet == pkt1);
   BOOST_CHECK(this->serverReceivedPackets->at(1).packet == pkt2);
-  BOOST_CHECK_EQUAL(this->serverReceivedPackets->at(0).endpoint, 0);
-  BOOST_CHECK_EQUAL(this->serverReceivedPackets->at(1).endpoint, 0);
+  BOOST_CHECK(this->serverReceivedPackets->at(0).endpoint == EndpointId{});
+  BOOST_CHECK(this->serverReceivedPackets->at(1).endpoint == EndpointId{});
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveMalformed, T, WebSocketTransportFixtures, T)
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index efaf90c..ce408ec 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -86,7 +86,7 @@
   // first Interest goes to nexthop with lowest FIB cost,
   // however face1 is downstream so it cannot be used
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.back().outFaceId, face2->getId());
 
@@ -98,7 +98,7 @@
   std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
   periodicalRetxFrom4 = [&] {
     pitEntry->insertOrUpdateInRecord(*face4, *interest);
-    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face4, 0), pitEntry);
+    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face4), pitEntry);
 
     size_t nSent = strategy.sendInterestHistory.size();
     if (nSent > nSentLast) {
@@ -130,7 +130,7 @@
   for (int i = 0; i < 3; ++i) {
     this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
     pitEntry->insertOrUpdateInRecord(*face5, *interest);
-    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face5, 0), pitEntry);
+    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face5), pitEntry);
   }
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 3);
   BOOST_CHECK_NE(strategy.sendInterestHistory[0].outFaceId, face1->getId());
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 98f767f..6fbb688 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -69,7 +69,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
-  face1->receiveInterest(*makeInterest("/A/B"), 0);
+  face1->receiveInterest(*makeInterest("/A/B"));
   this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), "/A/B");
@@ -83,7 +83,7 @@
 
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 0);
-  face2->receiveData(*makeData("/A/B"), 0);
+  face2->receiveData(*makeData("/A/B"));
   this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
   BOOST_CHECK_EQUAL(face1->sentData[0].getName(), "/A/B");
@@ -116,7 +116,7 @@
 
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
-  face1->receiveInterest(*makeInterest("/A", true), 0);
+  face1->receiveInterest(*makeInterest("/A", true));
   this->advanceClocks(1_ms, 5_ms);
   // Interest matching ContentStore should not be forwarded
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 0);
@@ -145,7 +145,7 @@
 
   auto interest = makeInterest("/A");
   BOOST_CHECK_EQUAL(interest->hasNonce(), false);
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
 
   // Ensure Nonce added if incoming packet did not have Nonce
   BOOST_REQUIRE_EQUAL(face2->getCounters().nOutInterests, 1);
@@ -191,7 +191,7 @@
   auto interest = makeInterest("/A/B");
   interest->setTag(make_shared<lp::NextHopFaceIdTag>(face2->getId()));
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(face3->sentInterests.size(), 0);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
@@ -211,7 +211,7 @@
 
   // Incoming interest w/o HopLimit will not be dropped on send or receive paths
   auto interestNoHopLimit = makeInterest("/remote/abcdefgh");
-  faceIn->receiveInterest(*interestNoHopLimit, 0);
+  faceIn->receiveInterest(*interestNoHopLimit);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(faceRemote->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nInHopLimitZero, 0);
@@ -222,7 +222,7 @@
   // Incoming interest w/ HopLimit > 1 will not be dropped on send/receive
   auto interestHopLimit2 = makeInterest("/remote/ijklmnop");
   interestHopLimit2->setHopLimit(2);
-  faceIn->receiveInterest(*interestHopLimit2, 0);
+  faceIn->receiveInterest(*interestHopLimit2);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nOutInterests, 2);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nInHopLimitZero, 0);
@@ -234,7 +234,7 @@
   // Incoming interest w/ HopLimit == 1 will be dropped on send path if going out on remote face
   auto interestHopLimit1Remote = makeInterest("/remote/qrstuvwx");
   interestHopLimit1Remote->setHopLimit(1);
-  faceIn->receiveInterest(*interestHopLimit1Remote, 0);
+  faceIn->receiveInterest(*interestHopLimit1Remote);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nOutInterests, 2);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nInHopLimitZero, 0);
@@ -244,7 +244,7 @@
   // Incoming interest w/ HopLimit == 1 will not be dropped on send path if going out on local face
   auto interestHopLimit1Local = makeInterest("/local/abcdefgh");
   interestHopLimit1Local->setHopLimit(1);
-  faceIn->receiveInterest(*interestHopLimit1Local, 0);
+  faceIn->receiveInterest(*interestHopLimit1Local);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(faceLocal->getCounters().nOutInterests, 1);
   BOOST_CHECK_EQUAL(faceLocal->getCounters().nInHopLimitZero, 0);
@@ -256,7 +256,7 @@
   // Interest w/ HopLimit == 0 will be dropped on receive path
   auto interestHopLimit0 = makeInterest("/remote/yzabcdef");
   interestHopLimit0->setHopLimit(0);
-  faceIn->receiveInterest(*interestHopLimit0, 0);
+  faceIn->receiveInterest(*interestHopLimit0);
   this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(faceRemote->getCounters().nOutInterests, 2);
   BOOST_CHECK_EQUAL(faceIn->getCounters().nInHopLimitZero, 1);
@@ -267,7 +267,7 @@
 BOOST_AUTO_TEST_CASE(AddDefaultHopLimit)
 {
   auto face = addFace();
-  auto faceEndpoint = FaceEndpoint(*face, 0);
+  auto faceEndpoint = FaceEndpoint(*face);
   Pit& pit = forwarder.getPit();
   auto i1 = makeInterest("/A");
   auto pitA = pit.insert(*i1).first;
@@ -306,47 +306,47 @@
   // local face, /localhost: OK
   strategy.afterReceiveInterest_count = 0;
   auto i1 = makeInterest("/localhost/A1");
-  forwarder.onIncomingInterest(*i1, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*i1, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
 
   // non-local face, /localhost: violate
   strategy.afterReceiveInterest_count = 0;
   auto i2 = makeInterest("/localhost/A2");
-  forwarder.onIncomingInterest(*i2, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingInterest(*i2, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 0);
 
   // local face, non-/localhost: OK
   strategy.afterReceiveInterest_count = 0;
   auto i3 = makeInterest("/A3");
-  forwarder.onIncomingInterest(*i3, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*i3, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
 
   // non-local face, non-/localhost: OK
   strategy.afterReceiveInterest_count = 0;
   auto i4 = makeInterest("/A4");
-  forwarder.onIncomingInterest(*i4, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingInterest(*i4, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(strategy.afterReceiveInterest_count, 1);
 
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 0);
 
   // local face, /localhost: OK
   auto d1 = makeData("/localhost/B1");
-  forwarder.onIncomingData(*d1, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingData(*d1, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
 
   // non-local face, /localhost: violate
   auto d2 = makeData("/localhost/B2");
-  forwarder.onIncomingData(*d2, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingData(*d2, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
 
   // local face, non-/localhost: OK
   auto d3 = makeData("/B3");
-  forwarder.onIncomingData(*d3, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingData(*d3, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 2);
 
   // non-local face, non-/localhost: OK
   auto d4 = makeData("/B4");
-  forwarder.onIncomingData(*d4, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingData(*d4, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 3);
 }
 
@@ -361,31 +361,31 @@
   auto interest1 = makeInterest("/A/1");
   strategyA.afterReceiveInterest_count = 0;
   strategyA.interestOutFace = face2;
-  forwarder.onIncomingInterest(*interest1, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*interest1, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveInterest_count, 1);
 
   auto interest2 = makeInterest("/B/2", true);
   strategyB.afterReceiveInterest_count = 0;
   strategyB.interestOutFace = face2;
-  forwarder.onIncomingInterest(*interest2, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*interest2, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyB.afterReceiveInterest_count, 1);
 
   this->advanceClocks(1_ms, 5_ms);
 
   auto data1 = makeData("/A/1");
   strategyA.beforeSatisfyInterest_count = 0;
-  forwarder.onIncomingData(*data1, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingData(*data1, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(strategyA.beforeSatisfyInterest_count, 1);
 
   auto data2 = makeData("/B/2/b");
   strategyB.beforeSatisfyInterest_count = 0;
-  forwarder.onIncomingData(*data2, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingData(*data2, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(strategyB.beforeSatisfyInterest_count, 1);
 
   auto interest3 = makeInterest("/A/3", false, 30_ms);
-  forwarder.onIncomingInterest(*interest3, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*interest3, FaceEndpoint(*face1));
   auto interest4 = makeInterest("/B/4", false, 5_s);
-  forwarder.onIncomingInterest(*interest4, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*interest4, FaceEndpoint(*face1));
 }
 
 BOOST_AUTO_TEST_CASE(IncomingData)
@@ -409,7 +409,7 @@
   pitC->insertOrUpdateInRecord(*face4, *interestC);
 
   auto dataD = makeData("/A/B/C/D");
-  forwarder.onIncomingData(*dataD, FaceEndpoint(*face3, 0));
+  forwarder.onIncomingData(*dataD, FaceEndpoint(*face3));
   this->advanceClocks(1_ms, 5_ms);
 
   BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
@@ -477,14 +477,14 @@
   auto nack1 = makeNack(*interest1, lp::NackReason::CONGESTION);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack1, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingNack(nack1, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 1);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
   auto nack2 = makeNack(*interest2, lp::NackReason::CONGESTION);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack2, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingNack(nack2, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 1);
 
@@ -498,7 +498,7 @@
   auto nack3 = makeNack(*makeInterest("/yEcw5HhdM", false, std::nullopt, 243), lp::NackReason::CONGESTION);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack3, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingNack(nack3, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
@@ -510,7 +510,7 @@
   auto nack4a = makeNack(*interest4, lp::NackReason::CONGESTION);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack4a, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingNack(nack4a, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
@@ -518,7 +518,7 @@
   auto nack4b = makeNack(*makeInterest("/Etab4KpY", false, std::nullopt, 294), lp::NackReason::CONGESTION);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack4b, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingNack(nack4b, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
@@ -526,7 +526,7 @@
   pit4->insertOrUpdateOutRecord(*face3, *interest4);
   strategyA.afterReceiveNack_count = 0;
   strategyB.afterReceiveNack_count = 0;
-  forwarder.onIncomingNack(nack4a, FaceEndpoint(*face3, 0));
+  forwarder.onIncomingNack(nack4a, FaceEndpoint(*face3));
   BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 }
@@ -620,19 +620,19 @@
   // receive Interest on face1
   face1->sentNacks.clear();
   auto interest1a = makeInterest("/zT4XwK0Hnx/28JBUvbEzc", false, std::nullopt, 732);
-  face1->receiveInterest(*interest1a, 0);
+  face1->receiveInterest(*interest1a);
   BOOST_CHECK(face1->sentNacks.empty());
 
   // receive Interest with duplicate Nonce on face1: legit retransmission
   face1->sentNacks.clear();
   auto interest1b = makeInterest("/zT4XwK0Hnx/28JBUvbEzc", false, std::nullopt, 732);
-  face1->receiveInterest(*interest1b, 0);
+  face1->receiveInterest(*interest1b);
   BOOST_CHECK(face1->sentNacks.empty());
 
   // receive Interest with duplicate Nonce on face2
   face2->sentNacks.clear();
   auto interest2a = makeInterest("/zT4XwK0Hnx/28JBUvbEzc", false, std::nullopt, 732);
-  face2->receiveInterest(*interest2a, 0);
+  face2->receiveInterest(*interest2a);
   BOOST_REQUIRE_EQUAL(face2->sentNacks.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentNacks.back().getInterest().wireEncode(), interest2a->wireEncode());
   BOOST_CHECK_EQUAL(face2->sentNacks.back().getReason(), lp::NackReason::DUPLICATE);
@@ -640,13 +640,13 @@
   // receive Interest with new Nonce on face2
   face2->sentNacks.clear();
   auto interest2b = makeInterest("/zT4XwK0Hnx/28JBUvbEzc", false, std::nullopt, 944);
-  face2->receiveInterest(*interest2b, 0);
+  face2->receiveInterest(*interest2b);
   BOOST_CHECK(face2->sentNacks.empty());
 
   // receive Interest with duplicate Nonce on face3, don't send Nack to multi-access face
   face3->sentNacks.clear();
   auto interest3a = makeInterest("/zT4XwK0Hnx/28JBUvbEzc", false, std::nullopt, 732);
-  face3->receiveInterest(*interest3a, 0);
+  face3->receiveInterest(*interest3a);
   BOOST_CHECK(face3->sentNacks.empty());
 }
 
@@ -659,7 +659,7 @@
   face2->afterSend.connect([face1, face2] (uint32_t pktType) {
     if (pktType == tlv::Interest) {
       auto interest = make_shared<Interest>(face2->sentInterests.back());
-      getScheduler().schedule(170_ms, [face1, interest] { face1->receiveInterest(*interest, 0); });
+      getScheduler().schedule(170_ms, [face1, interest] { face1->receiveInterest(*interest); });
     }
   });
 
@@ -669,7 +669,7 @@
 
   // receive an Interest
   auto interest = makeInterest("/A/1", false, 50_ms, 82101183);
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
 
   // interest should be forwarded only once, as long as Nonce is in Dead Nonce List
   BOOST_ASSERT(25_ms * 40 < forwarder.getDeadNonceList().getLifetime());
@@ -693,7 +693,7 @@
   auto& pit = forwarder.getPit();
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
-  forwarder.onIncomingInterest(*interest, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingInterest(*interest, FaceEndpoint(*face1));
   this->advanceClocks(100_ms, 20_s);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
@@ -704,7 +704,7 @@
   auto data = makeData("/A");
 
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 0);
-  forwarder.onIncomingData(*data, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingData(*data, FaceEndpoint(*face1));
   this->advanceClocks(1_ms, 10_ms);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nUnsolicitedData, 1);
 }
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index 3b91c63..a69c3a5 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -85,7 +85,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
 
@@ -96,7 +96,7 @@
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face2, *interest);
 
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2), pitEntry);
   // Since the interest is the same as the one sent out earlier, the PIT entry should not be
   // rejected, as any data coming back must be able to satisfy the original interest from face 1
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
@@ -162,7 +162,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
 
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_TEST(didSendInterestTo(*face1));
@@ -179,7 +179,7 @@
   std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
   periodicalRetxFrom4 = [&] {
     pitEntry->insertOrUpdateInRecord(*face3, *interest);
-    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
+    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3), pitEntry);
 
     size_t nSent = strategy.sendInterestHistory.size();
     if (nSent > nSentLast) {
@@ -207,7 +207,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 0);
 }
@@ -227,7 +227,7 @@
   auto interest = makeInterest("/t8ZiSOi3");
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
 
   // forwarded to faces 2 and 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -242,7 +242,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face2, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2), pitEntry);
 
   // forwarded only to face 1, suppressed on face 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -256,7 +256,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3), pitEntry);
 
   // suppressed on face 1, forwarded on face 2 (and suppression window doubles)
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -270,7 +270,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3), pitEntry);
 
   // forwarded only to face 1, suppressed on face 2
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -284,7 +284,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
 
   // forwarded to faces 2 and 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -303,7 +303,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
 
@@ -491,12 +491,12 @@
   auto interest = makeInterest("ndn:/localhop/H0D6i5fc");
   auto pitEntry = this->pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*this->inFace1, *interest);
-  this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->inFace1, 0), pitEntry);
+  this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->inFace1), pitEntry);
 
   if (this->inFace2 != nullptr) {
     auto interest2 = makeInterest("ndn:/localhop/H0D6i5fc");
     pitEntry->insertOrUpdateInRecord(*this->inFace2, *interest2);
-    this->strategy.afterReceiveInterest(*interest2, FaceEndpoint(*this->inFace2, 0), pitEntry);
+    this->strategy.afterReceiveInterest(*interest2, FaceEndpoint(*this->inFace2), pitEntry);
   }
 
   this->strategy.sendInterestHistory.clear();
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index c2b6c41..3153a7d 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -132,8 +132,8 @@
   interest1->setInterestLifetime(90_ms);
   interest2->setInterestLifetime(90_ms);
 
-  face1->receiveInterest(*interest1, 0);
-  face2->receiveInterest(*interest2, 0);
+  face1->receiveInterest(*interest1);
+  face2->receiveInterest(*interest2);
   BOOST_CHECK_EQUAL(pit.size(), 2);
 
   this->advanceClocks(100_ms);
@@ -156,10 +156,10 @@
   interest->setInterestLifetime(90_ms);
   auto data = makeData("/A/0");
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
 
   this->advanceClocks(30_ms);
-  face2->receiveData(*data, 0);
+  face2->receiveData(*data);
 
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
@@ -191,14 +191,14 @@
   Cs& cs = forwarder.getCs();
   cs.insert(*data);
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 1);
 
   this->advanceClocks(190_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
@@ -224,13 +224,13 @@
   auto interest = makeInterest("/A/0", false, 90_ms, 562);
   lp::Nack nack = makeNack(*interest, lp::NackReason::CONGESTION);
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
   auto entry = pit.find(*interest);
   entry->insertOrUpdateOutRecord(*face2, *interest);
   entry->insertOrUpdateOutRecord(*face3, *interest);
 
   this->advanceClocks(10_ms);
-  face2->receiveNack(nack, 0);
+  face2->receiveNack(nack);
 
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 1);
@@ -255,7 +255,7 @@
 
   auto interest = makeInterest("/A/0", false, 90_ms);
 
-  face->receiveInterest(*interest, 0);
+  face->receiveInterest(*interest);
   BOOST_CHECK_EQUAL(pit.size(), 1);
 
   this->advanceClocks(100_ms);
@@ -289,30 +289,30 @@
   auto interest2 = makeInterest("/A/0", false, 90_ms);
   auto data = makeData("/A/0");
 
-  face1->receiveInterest(*interest1, 0);
-  face2->receiveInterest(*interest2, 0);
+  face1->receiveInterest(*interest1);
+  face2->receiveInterest(*interest2);
   BOOST_CHECK_EQUAL(pit.size(), 2);
 
   // beforeSatisfyInterest: the first Data prolongs PIT expiry timer by 190 ms
   this->advanceClocks(30_ms);
-  face3->receiveData(*data, 0);
+  face3->receiveData(*data);
   this->advanceClocks(189_ms);
   BOOST_CHECK_EQUAL(pit.size(), 2);
   this->advanceClocks(2_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
-  face1->receiveInterest(*interest1, 0);
-  face2->receiveInterest(*interest2, 0);
+  face1->receiveInterest(*interest1);
+  face2->receiveInterest(*interest2);
 
   // beforeSatisfyInterest: the second Data prolongs PIT expiry timer
   // and the third one sets the timer to now
   this->advanceClocks(30_ms);
-  face3->receiveData(*data, 0);
+  face3->receiveData(*data);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 2);
 
   this->advanceClocks(30_ms);
-  face3->receiveData(*data, 0);
+  face3->receiveData(*data);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
@@ -341,27 +341,27 @@
   auto interest = makeInterest("/A/0", false, 90_ms);
   auto data = makeData("/A/0");
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
 
   // afterReceiveData: the first Data prolongs PIT expiry timer by 290 ms
   this->advanceClocks(30_ms);
-  face2->receiveData(*data, 0);
+  face2->receiveData(*data);
   this->advanceClocks(289_ms);
   BOOST_CHECK_EQUAL(pit.size(), 1);
   this->advanceClocks(2_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
 
   // afterReceiveData: the second Data prolongs PIT expiry timer
   // and the third one sets the timer to now
   this->advanceClocks(30_ms);
-  face2->receiveData(*data, 0);
+  face2->receiveData(*data);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 1);
 
   this->advanceClocks(30_ms);
-  face2->receiveData(*data, 0);
+  face2->receiveData(*data);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 
@@ -390,20 +390,20 @@
   auto interest = makeInterest("/A/0", false, 90_ms, 562);
   lp::Nack nack = makeNack(*interest, lp::NackReason::CONGESTION);
 
-  face1->receiveInterest(*interest, 0);
+  face1->receiveInterest(*interest);
   auto entry = pit.find(*interest);
   entry->insertOrUpdateOutRecord(*face2, *interest);
   entry->insertOrUpdateOutRecord(*face3, *interest);
 
   //pitEntry is not erased after receiving the first Nack
   this->advanceClocks(10_ms);
-  face2->receiveNack(nack, 0);
+  face2->receiveNack(nack);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 1);
 
   //pitEntry is erased after receiving the second Nack
   this->advanceClocks(10_ms);
-  face3->receiveNack(nack, 0);
+  face3->receiveNack(nack);
   this->advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
index b89d48c..ae34b03 100644
--- a/tests/daemon/fw/random-strategy.t.cpp
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -80,7 +80,7 @@
     auto pitEntry = pit.insert(*interest).first;
 
     pitEntry->insertOrUpdateInRecord(*face1, *interest);
-    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
+    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1), pitEntry);
   }
 
   // Map outFaceId -> SentInterests
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 9dcd0c9..4b6961d 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -108,7 +108,7 @@
   pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
 
   auto f = [&] {
-    this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3, 0), pitEntry);
+    this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3), pitEntry);
   };
   BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo, 2));
 
@@ -144,7 +144,7 @@
 
   lp::Nack nack3 = makeNack(*interest1, lp::NackReason::CONGESTION);
   pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
-  this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3, 0), pitEntry);
+  this->strategy.afterReceiveNack(nack3, FaceEndpoint(*this->face3), pitEntry);
 
   BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0); // don't send Nack until all upstreams have Nacked
 
@@ -152,7 +152,7 @@
   pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
 
   auto f = [&] {
-    this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4, 0), pitEntry);
+    this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4), pitEntry);
   };
   BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo));
 
@@ -186,7 +186,7 @@
 
   lp::Nack nack4 = makeNack(*interest2, lp::NackReason::CONGESTION);
   pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
-  this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4, 0), pitEntry);
+  this->strategy.afterReceiveNack(nack4, FaceEndpoint(*this->face4), pitEntry);
 
   BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0);
 }
@@ -319,13 +319,13 @@
 
   lp::Nack nack3 = makeNack(*interest1, Combination::firstReason);
   pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
-  strategy.afterReceiveNack(nack3, FaceEndpoint(*face3, 0), pitEntry);
+  strategy.afterReceiveNack(nack3, FaceEndpoint(*face3), pitEntry);
 
   BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
 
   lp::Nack nack4 = makeNack(*interest1, Combination::secondReason);
   pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
-  strategy.afterReceiveNack(nack4, FaceEndpoint(*face4, 0), pitEntry);
+  strategy.afterReceiveNack(nack4, FaceEndpoint(*face4), pitEntry);
 
   BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitInterest.wireEncode(),
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index 4fab4e5..3dfce2c 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -165,7 +165,7 @@
   pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
 
   auto f = [&] {
-    this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->face1, 0), pitEntry);
+    this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->face1), pitEntry);
   };
   BOOST_REQUIRE(this->strategy.waitForAction(f, this->limitedIo, 2));
 
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index d44460f..392becb 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -128,7 +128,7 @@
   pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3), pitEntry); },
     this->limitedIo));
 
   BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -147,7 +147,7 @@
   pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3), pitEntry); },
     this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
 
   BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -170,7 +170,7 @@
   pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->localFace3), pitEntry); },
     this->limitedIo));
 
   BOOST_REQUIRE_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -190,7 +190,7 @@
   pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1), pitEntry); },
     this->limitedIo, T::willRejectPitEntry() + T::willSendNackNoRoute()));
 
   BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -213,7 +213,7 @@
   pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->nonLocalFace1), pitEntry); },
     this->limitedIo));
 
   BOOST_REQUIRE_EQUAL(this->strategy.sendInterestHistory.size(), 1);
@@ -236,7 +236,7 @@
   pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4), pitEntry); },
     this->limitedIo, T::canProcessNack()));
 
   BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
@@ -261,7 +261,7 @@
   pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
 
   BOOST_REQUIRE(this->strategy.waitForAction(
-    [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4, 0), pitEntry); },
+    [&] { this->strategy.afterReceiveNack(nack, FaceEndpoint(*this->localFace4), pitEntry); },
     this->limitedIo, T::canProcessNack()));
 
   BOOST_CHECK_EQUAL(this->strategy.sendInterestHistory.size(), 0);
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index ee5ae77..67be5b2 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -114,7 +114,7 @@
   faceTable.add(face1);
 
   auto data1 = makeData("/unsolicited-from-local");
-  forwarder.onIncomingData(*data1, FaceEndpoint(*face1, 0));
+  forwarder.onIncomingData(*data1, FaceEndpoint(*face1));
   BOOST_CHECK_EQUAL(isInCs(*data1), T::ShouldAdmitLocal::value);
 
   auto face2 = make_shared<DummyFace>("dummy://", "dummy://",
@@ -122,7 +122,7 @@
   faceTable.add(face2);
 
   auto data2 = makeData("/unsolicited-from-non-local");
-  forwarder.onIncomingData(*data2, FaceEndpoint(*face2, 0));
+  forwarder.onIncomingData(*data2, FaceEndpoint(*face2));
   BOOST_CHECK_EQUAL(isInCs(*data2), T::ShouldAdmitNonLocal::value);
 }
 
