diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 41ab2e2..3263b43 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -300,7 +300,7 @@
 
 void
 Forwarder::onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
-                              time::milliseconds dataFreshnessPeriod)
+                              ndn::optional<time::milliseconds> dataFreshnessPeriod)
 {
   NFD_LOG_DEBUG("onInterestFinalize interest=" << pitEntry->getName() <<
                 (isSatisfied ? " satisfied" : " unsatisfied"));
@@ -552,7 +552,7 @@
 
 void
 Forwarder::setStragglerTimer(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
-                             time::milliseconds dataFreshnessPeriod)
+                             ndn::optional<time::milliseconds> dataFreshnessPeriod)
 {
   time::nanoseconds stragglerTime = time::milliseconds(100);
 
@@ -577,18 +577,15 @@
 
 void
 Forwarder::insertDeadNonceList(pit::Entry& pitEntry, bool isSatisfied,
-                               time::milliseconds dataFreshnessPeriod, Face* upstream)
+                               ndn::optional<time::milliseconds> dataFreshnessPeriod, Face* upstream)
 {
   // need Dead Nonce List insert?
-  bool needDnl = false;
+  bool needDnl = true;
   if (isSatisfied) {
-    bool hasFreshnessPeriod = dataFreshnessPeriod >= time::milliseconds::zero();
-    // Data never becomes stale if it doesn't have FreshnessPeriod field
+    BOOST_ASSERT(dataFreshnessPeriod);
+    BOOST_ASSERT(*dataFreshnessPeriod >= time::milliseconds::zero());
     needDnl = static_cast<bool>(pitEntry.getInterest().getMustBeFresh()) &&
-              (hasFreshnessPeriod && dataFreshnessPeriod < m_deadNonceList.getLifetime());
-  }
-  else {
-    needDnl = true;
+              *dataFreshnessPeriod < m_deadNonceList.getLifetime();
   }
 
   if (!needDnl) {
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index fca81eb..b0cc156 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -216,7 +216,7 @@
    */
   VIRTUAL_WITH_TESTS void
   onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
-                     time::milliseconds dataFreshnessPeriod = time::milliseconds(-1));
+                     ndn::optional<time::milliseconds> dataFreshnessPeriod = ndn::nullopt);
 
   /** \brief incoming Data pipeline
    */
@@ -249,7 +249,7 @@
 
   VIRTUAL_WITH_TESTS void
   setStragglerTimer(const shared_ptr<pit::Entry>& pitEntry, bool isSatisfied,
-                    time::milliseconds dataFreshnessPeriod = time::milliseconds(-1));
+                    ndn::optional<time::milliseconds> dataFreshnessPeriod = ndn::nullopt);
 
   VIRTUAL_WITH_TESTS void
   cancelUnsatisfyAndStragglerTimer(pit::Entry& pitEntry);
@@ -260,7 +260,7 @@
    */
   VIRTUAL_WITH_TESTS void
   insertDeadNonceList(pit::Entry& pitEntry, bool isSatisfied,
-                      time::milliseconds dataFreshnessPeriod, Face* upstream);
+                      ndn::optional<time::milliseconds> dataFreshnessPeriod, Face* upstream);
 
   /** \brief call trigger (method) on the effective strategy of pitEntry
    */
diff --git a/daemon/table/cs-entry-impl.cpp b/daemon/table/cs-entry-impl.cpp
index c8bd357..255cfff 100644
--- a/daemon/table/cs-entry-impl.cpp
+++ b/daemon/table/cs-entry-impl.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -46,13 +46,6 @@
   return !this->hasData();
 }
 
-bool
-EntryImpl::canStale() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return this->getStaleTime() < time::steady_clock::TimePoint::max();
-}
-
 void
 EntryImpl::unsetUnsolicited()
 {
diff --git a/daemon/table/cs-entry-impl.hpp b/daemon/table/cs-entry-impl.hpp
index d061f88..262fcd1 100644
--- a/daemon/table/cs-entry-impl.hpp
+++ b/daemon/table/cs-entry-impl.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -52,11 +52,6 @@
    */
   EntryImpl(shared_ptr<const Data> data, bool isUnsolicited);
 
-  /** \return true if entry can become stale, false if entry is never stale
-   */
-  bool
-  canStale() const;
-
   void
   unsetUnsolicited();
 
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index d4f3921..4bf84d5 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -48,12 +48,7 @@
 Entry::updateStaleTime()
 {
   BOOST_ASSERT(this->hasData());
-  if (m_data->getFreshnessPeriod() >= time::milliseconds::zero()) {
-    m_staleTime = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
-  }
-  else {
-    m_staleTime = time::steady_clock::TimePoint::max();
-  }
+  m_staleTime = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
 }
 
 bool
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 68289cf..48895b1 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -76,8 +76,8 @@
     return m_isUnsolicited;
   }
 
-  /** \return the absolute time when the stored Data becomes expired
-   *  \retval time::steady_clock::TimePoint::max() if the stored Data never expires
+  /** \return the absolute time when the stored Data becomes stale
+   *  \note if the returned TimePoint is in the past, the Data is stale
    *  \pre hasData()
    */
   const time::steady_clock::TimePoint&
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index a61f334..934d759 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -117,11 +117,8 @@
   }
   else {
     entryInfo->queueType = QUEUE_FIFO;
-
-    if (i->canStale()) {
-      entryInfo->moveStaleEventId = scheduler::schedule(i->getData().getFreshnessPeriod(),
-                                              bind(&PriorityFifoPolicy::moveToStaleQueue, this, i));
-    }
+    entryInfo->moveStaleEventId = scheduler::schedule(i->getData().getFreshnessPeriod(),
+                                                      bind(&PriorityFifoPolicy::moveToStaleQueue, this, i));
   }
 
   Queue& queue = m_queues[entryInfo->queueType];
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index ecbbf38..0e14b0f 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -47,7 +47,6 @@
   insert(uint32_t id, const Name& name, const std::function<void(Data&)>& modifyData = nullptr)
   {
     shared_ptr<Data> data = makeData(name);
-    data->setFreshnessPeriod(time::milliseconds(99999));
     data->setContent(reinterpret_cast<const uint8_t*>(&id), sizeof(id));
 
     if (modifyData != nullptr) {
@@ -253,15 +252,12 @@
   CHECK_CS_FIND(6);
 }
 
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MustBeFresh, 1)
 BOOST_AUTO_TEST_CASE(MustBeFresh)
 {
-  ///\todo #3944 add /A/1 without FreshnessPeriod, which is same as FreshnessPeriod=0ms
+  insert(1, "/A/1"); // omitted FreshnessPeriod means FreshnessPeriod = 0 ms
   insert(2, "/A/2", [] (Data& data) { data.setFreshnessPeriod(time::seconds(0)); });
   insert(3, "/A/3", [] (Data& data) { data.setFreshnessPeriod(time::seconds(1)); });
   insert(4, "/A/4", [] (Data& data) { data.setFreshnessPeriod(time::seconds(3600)); });
-  insert(5, "/A/5"); // omitted FreshnessPeriod means infinite
-  ///\todo #3944 delete /A/5
 
   // lookup at exact same moment as insertion is not tested because this won't happen in reality
 
@@ -283,8 +279,7 @@
   this->advanceClocks(time::seconds(3500)); // @7002s
   startInterest("/A")
     .setMustBeFresh(true);
-  CHECK_CS_FIND(5); // expected failure https://redmine.named-data.net/issues/3944#note-2
-  ///\todo #3944 this should not find any Data
+  CHECK_CS_FIND(0);
 }
 
 BOOST_AUTO_TEST_CASE(DigestOrder)
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index fad1528..73cf7de 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -178,8 +178,6 @@
 BOOST_AUTO_TEST_CASE(Lifetime)
 {
   shared_ptr<Interest> interest = makeInterest("ndn:/7oIEurbgy6");
-  // library uses -1 to indicate unset lifetime
-  BOOST_ASSERT(interest->getInterestLifetime() < time::milliseconds::zero());
 
   shared_ptr<Face> face = make_shared<DummyFace>();
   Entry entry(*interest);
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index 8a784f6..a468ed0 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -78,6 +78,12 @@
   BOOST_CHECK_EQUAL(insertResult.second, true);
   BOOST_CHECK_EQUAL(pit.size(), 1);
 
+  // same as A
+  shared_ptr<Interest> interestA2 = make_shared<Interest>(*interestA);
+  insertResult = pit.insert(*interestA2);
+  BOOST_CHECK_EQUAL(insertResult.second, false); // sharing the same PIT entry
+  BOOST_CHECK_EQUAL(pit.size(), 1);
+
   // A+MinSuffixComponents
   shared_ptr<Interest> interestB = make_shared<Interest>(*interestA);
   interestB->setMinSuffixComponents(2);
@@ -120,47 +126,40 @@
   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);
+  BOOST_CHECK_EQUAL(pit.size(), 8);
 
   // 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);
+  BOOST_CHECK_EQUAL(pit.size(), 9);
 
   // 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);
+  BOOST_CHECK_EQUAL(insertResult.second, false); // only guiders differ
+  BOOST_CHECK_EQUAL(pit.size(), 9);
 
   // 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);
+  BOOST_CHECK_EQUAL(insertResult.second, false); // only guiders differ
+  BOOST_CHECK_EQUAL(pit.size(), 9);
 
   // 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_CHECK_EQUAL(pit.size(), 10);
 }
 
 BOOST_AUTO_TEST_CASE(Erase)
