diff --git a/src/lsa.cpp b/src/lsa.cpp
index dbb6ee5..ddae871 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -29,13 +29,13 @@
 }
 
 NameLsa::NameLsa(const ndn::Name& origR, const string& lst, uint32_t lsn,
-                 uint32_t lt,
+                 const ndn::time::system_clock::TimePoint& lt,
                  NamePrefixList& npl)
 {
   m_origRouter = origR;
   m_lsType = lst;
   m_lsSeqNo = lsn;
-  m_lifeTime = lt;
+  m_expirationTimePoint = lt;
   std::list<ndn::Name>& nl = npl.getNameList();
   for (std::list<ndn::Name>::iterator it = nl.begin(); it != nl.end(); it++) {
     addName((*it));
@@ -48,7 +48,7 @@
   string nameLsaData;
   nameLsaData = m_origRouter.toUri() + "|" + "name" + "|"
                 + boost::lexical_cast<std::string>(m_lsSeqNo) + "|"
-                + boost::lexical_cast<std::string>(m_lifeTime);
+                + ndn::time::toIsoString(m_expirationTimePoint);
   nameLsaData += "|";
   nameLsaData += boost::lexical_cast<std::string>(m_npl.getSize());
   std::list<ndn::Name> nl = m_npl.getNameList();
@@ -74,7 +74,7 @@
   try {
     m_lsType = *tok_iter++;
     m_lsSeqNo = boost::lexical_cast<uint32_t>(*tok_iter++);
-    m_lifeTime = boost::lexical_cast<uint32_t>(*tok_iter++);
+    m_expirationTimePoint = ndn::time::fromIsoString(*tok_iter++);
     numName = boost::lexical_cast<uint32_t>(*tok_iter++);
   }
   catch (std::exception& e) {
@@ -94,7 +94,7 @@
   _LOG_DEBUG("  Origination Router: " << m_origRouter);
   _LOG_DEBUG("  Ls Type: " << m_lsType);
   _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
-  _LOG_DEBUG("  Ls Lifetime: " << m_lifeTime);
+  _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
   _LOG_DEBUG("  Names: ");
   int i = 1;
   std::list<ndn::Name> nl = m_npl.getNameList();
@@ -110,8 +110,8 @@
   os << "Name Lsa: " << endl;
   os << "  Origination Router: " << nLsa.getOrigRouter() << endl;
   os << "  Ls Type: " << nLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << (unsigned int)nLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << (unsigned int)nLsa.getLifeTime() << endl;
+  os << "  Ls Seq No: " << nLsa.getLsSeqNo() << endl;
+  os << "  Ls Lifetime: " << nLsa.getExpirationTimePoint() << endl;
   os << "  Names: " << endl;
   int i = 1;
   std::list<ndn::Name> nl = nLsa.getNpl().getNameList();
@@ -126,13 +126,13 @@
 
 CoordinateLsa::CoordinateLsa(const ndn::Name& origR, const string lst,
                              uint32_t lsn,
-                             uint32_t lt
-                             , double r, double theta)
+                             const ndn::time::system_clock::TimePoint& lt,
+                             double r, double theta)
 {
   m_origRouter = origR;
   m_lsType = lst;
   m_lsSeqNo = lsn;
-  m_lifeTime = lt;
+  m_expirationTimePoint = lt;
   m_corRad = r;
   m_corTheta = theta;
 }
@@ -162,7 +162,7 @@
   corLsaData += "coordinate";
   corLsaData += "|";
   corLsaData += (boost::lexical_cast<std::string>(m_lsSeqNo) + "|");
-  corLsaData += (boost::lexical_cast<std::string>(m_lifeTime) + "|");
+  corLsaData += (ndn::time::toIsoString(m_expirationTimePoint) + "|");
   corLsaData += (boost::lexical_cast<std::string>(m_corRad) + "|");
   corLsaData += (boost::lexical_cast<std::string>(m_corTheta) + "|");
   return corLsaData;
@@ -182,7 +182,7 @@
   try {
     m_lsType   = *tok_iter++;
     m_lsSeqNo  = boost::lexical_cast<uint32_t>(*tok_iter++);
-    m_lifeTime = boost::lexical_cast<uint32_t>(*tok_iter++);
+    m_expirationTimePoint = ndn::time::fromIsoString(*tok_iter++);
     m_corRad   = boost::lexical_cast<double>(*tok_iter++);
     m_corTheta = boost::lexical_cast<double>(*tok_iter++);
   }
@@ -199,7 +199,7 @@
   _LOG_DEBUG("  Origination Router: " << m_origRouter);
   _LOG_DEBUG("  Ls Type: " << m_lsType);
   _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
-  _LOG_DEBUG("  Ls Lifetime: " << m_lifeTime);
+  _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
   _LOG_DEBUG("    Hyperbolic Radius: " << m_corRad);
   _LOG_DEBUG("    Hyperbolic Theta: " << m_corRad);
 }
@@ -210,8 +210,8 @@
   os << "Cor Lsa: " << endl;
   os << "  Origination Router: " << cLsa.getOrigRouter() << endl;
   os << "  Ls Type: " << cLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << (unsigned int)cLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << (unsigned int)cLsa.getLifeTime() << endl;
+  os << "  Ls Seq No: " << cLsa.getLsSeqNo() << endl;
+  os << "  Ls Lifetime: " << cLsa.getExpirationTimePoint() << endl;
   os << "    Hyperbolic Radius: " << cLsa.getCorRadius() << endl;
   os << "    Hyperbolic Theta: " << cLsa.getCorTheta() << endl;
   return os;
@@ -219,13 +219,13 @@
 
 
 AdjLsa::AdjLsa(const ndn::Name& origR, const string& lst, uint32_t lsn,
-               uint32_t lt,
+               const ndn::time::system_clock::TimePoint& lt,
                uint32_t nl , AdjacencyList& adl)
 {
   m_origRouter = origR;
   m_lsType = lst;
   m_lsSeqNo = lsn;
-  m_lifeTime = lt;
+  m_expirationTimePoint = lt;
   m_noLink = nl;
   std::list<Adjacent> al = adl.getAdjList();
   for (std::list<Adjacent>::iterator it = al.begin(); it != al.end(); it++) {
@@ -256,7 +256,7 @@
   string adjLsaData;
   adjLsaData = m_origRouter.toUri() + "|" + "adjacency" + "|"
                + boost::lexical_cast<std::string>(m_lsSeqNo) + "|"
-               + boost::lexical_cast<std::string>(m_lifeTime);
+               + ndn::time::toIsoString(m_expirationTimePoint);
   adjLsaData += "|";
   adjLsaData += boost::lexical_cast<std::string>(m_adl.getSize());
   std::list<Adjacent> al = m_adl.getAdjList();
@@ -286,7 +286,7 @@
   try {
     m_lsType   = *tok_iter++;
     m_lsSeqNo  = boost::lexical_cast<uint32_t>(*tok_iter++);
-    m_lifeTime = boost::lexical_cast<uint32_t>(*tok_iter++);
+    m_expirationTimePoint = ndn::time::fromIsoString(*tok_iter++);
     numLink    = boost::lexical_cast<uint32_t>(*tok_iter++);
   }
   catch (std::exception& e) {
@@ -332,7 +332,7 @@
   _LOG_DEBUG("  Origination Router: " << m_origRouter);
   _LOG_DEBUG("  Ls Type: " << m_lsType);
   _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
-  _LOG_DEBUG("  Ls Lifetime: " << m_lifeTime);
+  _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
   _LOG_DEBUG("  Adjacents: ");
   int i = 1;
   std::list<Adjacent> al = m_adl.getAdjList();
@@ -351,9 +351,9 @@
   os << "Adj Lsa: " << endl;
   os << "  Origination Router: " << aLsa.getOrigRouter() << endl;
   os << "  Ls Type: " << aLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << (unsigned int)aLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << (unsigned int)aLsa.getLifeTime() << endl;
-  os << "  No Link: " << (unsigned int)aLsa.getNoLink() << endl;
+  os << "  Ls Seq No: " << aLsa.getLsSeqNo() << endl;
+  os << "  Ls Lifetime: " << aLsa.getExpirationTimePoint() << endl;
+  os << "  No Link: " << aLsa.getNoLink() << endl;
   os << "  Adjacents: " << endl;
   int i = 1;
   std::list<Adjacent> al = aLsa.getAdl().getAdjList();
diff --git a/src/lsa.hpp b/src/lsa.hpp
index bc43772..03fc7b6 100644
--- a/src/lsa.hpp
+++ b/src/lsa.hpp
@@ -3,6 +3,8 @@
 
 #include <boost/cstdint.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
+#include <ndn-cxx/util/time.hpp>
+
 #include "adjacent.hpp"
 #include "name-prefix-list.hpp"
 #include "adjacency-list.hpp"
@@ -15,7 +17,7 @@
   Lsa()
     : m_origRouter()
     , m_lsSeqNo()
-    , m_lifeTime()
+    , m_expirationTimePoint()
     , m_expiringEventId()
   {
   }
@@ -57,16 +59,16 @@
     m_origRouter = org;
   }
 
-  uint32_t
-  getLifeTime() const
+  const ndn::time::system_clock::TimePoint&
+  getExpirationTimePoint() const
   {
-    return m_lifeTime;
+    return m_expirationTimePoint;
   }
 
   void
-  setLifeTime(uint32_t lt)
+  setExpirationTimePoint(const ndn::time::system_clock::TimePoint& lt)
   {
-    m_lifeTime = lt;
+    m_expirationTimePoint = lt;
   }
 
   void
@@ -85,7 +87,7 @@
   ndn::Name m_origRouter;
   std::string m_lsType;
   uint32_t m_lsSeqNo;
-  uint32_t m_lifeTime;
+  ndn::time::system_clock::TimePoint m_expirationTimePoint;
   ndn::EventId m_expiringEventId;
 };
 
@@ -100,7 +102,7 @@
   }
 
   NameLsa(const ndn::Name& origR, const std::string& lst, uint32_t lsn,
-          uint32_t lt,
+          const ndn::time::system_clock::TimePoint& lt,
           NamePrefixList& npl);
 
   NamePrefixList&
@@ -152,7 +154,8 @@
   }
 
   AdjLsa(const ndn::Name& origR, const std::string& lst, uint32_t lsn,
-         uint32_t lt, uint32_t nl , AdjacencyList& adl);
+         const ndn::time::system_clock::TimePoint& lt,
+         uint32_t nl , AdjacencyList& adl);
 
   AdjacencyList&
   getAdl()
@@ -213,8 +216,8 @@
   }
 
   CoordinateLsa(const ndn::Name& origR, const std::string lst, uint32_t lsn,
-                uint32_t lt
-                , double r, double theta);
+                const ndn::time::system_clock::TimePoint& lt,
+                double r, double theta);
 
   const ndn::Name
   getKey() const;
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index f99482d..9a2afab 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -32,7 +32,7 @@
   NameLsa nameLsa(m_nlsr.getConfParameter().getRouterPrefix(),
                   "name",
                   m_nlsr.getSequencingManager().getNameLsaSeq() + 1,
-                  m_nlsr.getConfParameter().getRouterDeadInterval(),
+                  getLsaExpirationTimePoint(),
                   m_nlsr.getNamePrefixList());
   m_nlsr.getSequencingManager().increaseNameLsaSeq();
   return installNameLsa(nameLsa);
@@ -66,9 +66,10 @@
 }
 
 ndn::EventId
-Lsdb::scheduleNameLsaExpiration(const ndn::Name& key, int seqNo, int expTime)
+Lsdb::scheduleNameLsaExpiration(const ndn::Name& key, int seqNo,
+                                const ndn::time::seconds& expTime)
 {
-  return m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+  return m_nlsr.getScheduler().scheduleEvent(expTime,
                                              ndn::bind(&Lsdb::exprireOrRefreshNameLsa,
                                                        this, key, seqNo));
 }
@@ -76,7 +77,7 @@
 bool
 Lsdb::installNameLsa(NameLsa& nlsa)
 {
-  int timeToExpire = m_lsaRefreshTime;
+  ndn::time::seconds timeToExpire = ndn::time::seconds(m_lsaRefreshTime);
   NameLsa* chkNameLsa = findNameLsa(nlsa.getKey());
   if (chkNameLsa == 0) {
     addNameLsa(nlsa);
@@ -96,7 +97,9 @@
       }
     }
     if (nlsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-      timeToExpire = nlsa.getLifeTime();
+      ndn::time::system_clock::Duration duration = nlsa.getExpirationTimePoint() -
+                                                   ndn::time::system_clock::now();
+      timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
     }
     nlsa.setExpiringEventId(scheduleNameLsaExpiration(nlsa.getKey(),
                                                       nlsa.getLsSeqNo(),
@@ -108,7 +111,7 @@
       _LOG_DEBUG("Old Name LSA ");
       chkNameLsa->writeLog();
       chkNameLsa->setLsSeqNo(nlsa.getLsSeqNo());
-      chkNameLsa->setLifeTime(nlsa.getLifeTime());
+      chkNameLsa->setExpirationTimePoint(nlsa.getExpirationTimePoint());
       chkNameLsa->getNpl().sort();
       nlsa.getNpl().sort();
       std::list<ndn::Name> nameToAdd;
@@ -142,7 +145,9 @@
         }
       }
       if (nlsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-        timeToExpire = nlsa.getLifeTime();
+        ndn::time::system_clock::Duration duration = nlsa.getExpirationTimePoint() -
+                                                     ndn::time::system_clock::now();
+        timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
       }
       cancelScheduleLsaExpiringEvent(chkNameLsa->getExpiringEventId());
       chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(nlsa.getKey(),
@@ -232,7 +237,7 @@
   CoordinateLsa corLsa(m_nlsr.getConfParameter().getRouterPrefix(),
                        "coordinate",
                        m_nlsr.getSequencingManager().getCorLsaSeq() + 1,
-                       m_nlsr.getConfParameter().getRouterDeadInterval(),
+                       getLsaExpirationTimePoint(),
                        m_nlsr.getConfParameter().getCorR(),
                        m_nlsr.getConfParameter().getCorTheta());
   m_nlsr.getSequencingManager().increaseCorLsaSeq();
@@ -269,9 +274,9 @@
 
 ndn::EventId
 Lsdb::scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo,
-                                      int expTime)
+                                      const ndn::time::seconds& expTime)
 {
-  return m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+  return m_nlsr.getScheduler().scheduleEvent(expTime,
                                              ndn::bind(&Lsdb::exprireOrRefreshCoordinateLsa,
                                                        this, key, seqNo));
 }
@@ -279,7 +284,7 @@
 bool
 Lsdb::installCoordinateLsa(CoordinateLsa& clsa)
 {
-  int timeToExpire = m_lsaRefreshTime;
+  ndn::time::seconds timeToExpire = ndn::time::seconds(m_lsaRefreshTime);
   CoordinateLsa* chkCorLsa = findCoordinateLsa(clsa.getKey());
   if (chkCorLsa == 0) {
     _LOG_DEBUG("New Coordinate LSA. Adding to LSDB");
@@ -295,7 +300,9 @@
       m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr);
     }
     if (clsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-      timeToExpire = clsa.getLifeTime();
+      ndn::time::system_clock::Duration duration = clsa.getExpirationTimePoint() -
+                                                   ndn::time::system_clock::now();
+      timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
     }
     scheduleCoordinateLsaExpiration(clsa.getKey(),
                                     clsa.getLsSeqNo(), timeToExpire);
@@ -306,7 +313,7 @@
       _LOG_DEBUG("Old Coordinate LSA");
       chkCorLsa->writeLog();
       chkCorLsa->setLsSeqNo(clsa.getLsSeqNo());
-      chkCorLsa->setLifeTime(clsa.getLifeTime());
+      chkCorLsa->setExpirationTimePoint(clsa.getExpirationTimePoint());
       if (!chkCorLsa->isEqualContent(clsa)) {
         chkCorLsa->setCorRadius(clsa.getCorRadius());
         chkCorLsa->setCorTheta(clsa.getCorTheta());
@@ -315,7 +322,9 @@
         }
       }
       if (clsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-        timeToExpire = clsa.getLifeTime();
+        ndn::time::system_clock::Duration duration = clsa.getExpirationTimePoint() -
+                                                     ndn::time::system_clock::now();
+        timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
       }
       cancelScheduleLsaExpiringEvent(chkCorLsa->getExpiringEventId());
       chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(clsa.getKey(),
@@ -474,9 +483,10 @@
 
 
 ndn::EventId
-Lsdb::scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo, int expTime)
+Lsdb::scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo,
+                               const ndn::time::seconds& expTime)
 {
-  return m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+  return m_nlsr.getScheduler().scheduleEvent(expTime,
                                              ndn::bind(&Lsdb::exprireOrRefreshAdjLsa,
                                                        this, key, seqNo));
 }
@@ -484,7 +494,7 @@
 bool
 Lsdb::installAdjLsa(AdjLsa& alsa)
 {
-  int timeToExpire = m_lsaRefreshTime;
+  ndn::time::seconds timeToExpire = ndn::time::seconds(m_lsaRefreshTime);
   AdjLsa* chkAdjLsa = findAdjLsa(alsa.getKey());
   if (chkAdjLsa == 0) {
     _LOG_DEBUG("New Adj LSA. Adding to LSDB");
@@ -493,7 +503,9 @@
     alsa.addNptEntries(m_nlsr);
     m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr);
     if (alsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-      timeToExpire = alsa.getLifeTime();
+      ndn::time::system_clock::Duration duration = alsa.getExpirationTimePoint() -
+                                                   ndn::time::system_clock::now();
+      timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
     }
     scheduleAdjLsaExpiration(alsa.getKey(),
                              alsa.getLsSeqNo(), timeToExpire);
@@ -504,14 +516,16 @@
       _LOG_DEBUG("Old Adj LSA");
       chkAdjLsa->writeLog();
       chkAdjLsa->setLsSeqNo(alsa.getLsSeqNo());
-      chkAdjLsa->setLifeTime(alsa.getLifeTime());
+      chkAdjLsa->setExpirationTimePoint(alsa.getExpirationTimePoint());
       if (!chkAdjLsa->isEqualContent(alsa)) {
         chkAdjLsa->getAdl().reset();
         chkAdjLsa->getAdl().addAdjacents(alsa.getAdl());
         m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr);
       }
       if (alsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
-        timeToExpire = alsa.getLifeTime();
+        ndn::time::system_clock::Duration duration = alsa.getExpirationTimePoint() -
+                                                     ndn::time::system_clock::now();
+        timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
       }
       cancelScheduleLsaExpiringEvent(chkAdjLsa->getExpiringEventId());
       chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(alsa.getKey(),
@@ -530,7 +544,7 @@
   AdjLsa adjLsa(m_nlsr.getConfParameter().getRouterPrefix(),
                 "adjacency",
                 m_nlsr.getSequencingManager().getAdjLsaSeq() + 1,
-                m_nlsr.getConfParameter().getRouterDeadInterval(),
+                getLsaExpirationTimePoint(),
                 m_nlsr.getAdjacencyList().getNumOfActiveNeighbor(),
                 m_nlsr.getAdjacencyList());
   m_nlsr.getSequencingManager().increaseAdjLsaSeq();
@@ -606,11 +620,12 @@
         _LOG_DEBUG("Own Name LSA, so refreshing name LSA");
         chkNameLsa->setLsSeqNo(chkNameLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setNameLsaSeq(chkNameLsa->getLsSeqNo());
+        chkNameLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         chkNameLsa->writeLog();
         // schedule refreshing event again
         chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(chkNameLsa->getKey(),
                                                                  chkNameLsa->getLsSeqNo(),
-                                                                 m_lsaRefreshTime));
+                                                                 ndn::time::seconds(m_lsaRefreshTime)));
         // publish routing update
         ndn::Name lsaPrefix = m_nlsr.getConfParameter().getLsaPrefix();
         lsaPrefix.append(m_nlsr.getConfParameter().getRouterPrefix());
@@ -643,10 +658,11 @@
         _LOG_DEBUG("Own Adj LSA, so refreshing Adj LSA");
         chkAdjLsa->setLsSeqNo(chkAdjLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
+        chkAdjLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         // schedule refreshing event again
         chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(chkAdjLsa->getKey(),
                                                                chkAdjLsa->getLsSeqNo(),
-                                                               m_lsaRefreshTime));
+                                                               ndn::time::seconds(m_lsaRefreshTime)));
         // publish routing update
         ndn::Name lsaPrefix = m_nlsr.getConfParameter().getLsaPrefix();
         lsaPrefix.append(m_nlsr.getConfParameter().getRouterPrefix());
@@ -682,11 +698,12 @@
         _LOG_DEBUG("Own Cor LSA, so refreshing Cor LSA");
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
+        chkCorLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
         // schedule refreshing event again
         chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(
                                         chkCorLsa->getKey(),
                                         chkCorLsa->getLsSeqNo(),
-                                        m_lsaRefreshTime));
+                                        ndn::time::seconds(m_lsaRefreshTime)));
         // publish routing update
         ndn::Name lsaPrefix = m_nlsr.getConfParameter().getLsaPrefix();
         lsaPrefix.append(m_nlsr.getConfParameter().getRouterPrefix());
@@ -921,6 +938,14 @@
   _LOG_DEBUG("Interest timed out for  LSA(name): " << interestName);
 }
 
+ndn::time::system_clock::TimePoint
+Lsdb::getLsaExpirationTimePoint()
+{
+  ndn::time::system_clock::TimePoint expirationTimePoint = ndn::time::system_clock::now();
+  expirationTimePoint = expirationTimePoint +
+                        ndn::time::seconds(m_nlsr.getConfParameter().getRouterDeadInterval());
+  return expirationTimePoint;
+}
 
 void
 Lsdb::printAdjLsdb()
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index ff7450a..752b52b 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -4,6 +4,7 @@
 #include <utility>
 #include <boost/cstdint.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/util/time.hpp>
 
 #include "lsa.hpp"
 
@@ -115,20 +116,22 @@
   doesAdjLsaExist(const ndn::Name& key);
 
   ndn::EventId
-  scheduleNameLsaExpiration(const ndn::Name& key, int seqNo, int expTime);
+  scheduleNameLsaExpiration(const ndn::Name& key, int seqNo,
+                            const ndn::time::seconds& expTime);
 
   void
   exprireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo);
 
   ndn::EventId
-  scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo, int expTime);
+  scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo,
+                           const ndn::time::seconds& expTime);
 
   void
   exprireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo);
 
   ndn::EventId
   scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo,
-                                  int expTime);
+                                  const ndn::time::seconds& expTime);
 
   void
   exprireOrRefreshCoordinateLsa(const ndn::Name& lsaKey,
@@ -174,6 +177,9 @@
   void
   processInterestTimedOut(const ndn::Interest& interest);
 
+  ndn::time::system_clock::TimePoint
+  getLsaExpirationTimePoint();
+
 private:
   void
   cancelScheduleLsaExpiringEvent(ndn::EventId eid);
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index ba2731f..f35bae7 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -37,6 +37,7 @@
 FibEntry::writeLog()
 {
   _LOG_DEBUG("Name Prefix: " << m_name);
+  _LOG_DEBUG("Time to Refresh: " << m_expirationTimePoint);
   _LOG_DEBUG("Seq No: " << m_seqNo);
   m_nexthopList.writeLog();
 }
@@ -45,7 +46,7 @@
 operator<<(ostream& os, FibEntry fe)
 {
   os << "Name Prefix: " << fe.getName() << endl;
-  os << "Time to Refresh: " << fe.getTimeToRefresh() << endl;
+  os << "Time to Refresh: " << fe.getExpirationTimePoint() << endl;
   os << fe.getNexthopList() << endl;
   return os;
 }
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
index 14d3772..35da960 100644
--- a/src/route/fib-entry.hpp
+++ b/src/route/fib-entry.hpp
@@ -6,6 +6,7 @@
 #include <boost/cstdint.hpp>
 
 #include <ndn-cxx/util/scheduler.hpp>
+#include <ndn-cxx/util/time.hpp>
 
 #include "nexthop.hpp"
 #include "nexthop-list.hpp"
@@ -17,14 +18,14 @@
 public:
   FibEntry()
     : m_name()
-    , m_timeToRefresh(0)
+    , m_expirationTimePoint()
     , m_seqNo(0)
     , m_nexthopList()
   {
   }
 
   FibEntry(const ndn::Name& name)
-    : m_timeToRefresh(0)
+    : m_expirationTimePoint()
     , m_seqNo(0)
     , m_nexthopList()
   {
@@ -43,16 +44,16 @@
     return m_nexthopList;
   }
 
-  int32_t
-  getTimeToRefresh() const
+  const ndn::time::system_clock::TimePoint&
+  getExpirationTimePoint() const
   {
-    return m_timeToRefresh;
+    return m_expirationTimePoint;
   }
 
   void
-  setTimeToRefresh(int32_t ttr)
+  setExpirationTimePoint(const ndn::time::system_clock::TimePoint& ttr)
   {
-    m_timeToRefresh = ttr;
+    m_expirationTimePoint = ttr;
   }
 
   void
@@ -87,7 +88,7 @@
 
 private:
   ndn::Name m_name;
-  int32_t m_timeToRefresh;
+  ndn::time::system_clock::TimePoint m_expirationTimePoint;
   ndn::EventId m_expiringEventId;
   int32_t m_seqNo;
   NexthopList m_nexthopList;
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 17269dc..633eaa8 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -32,13 +32,13 @@
 
 ndn::EventId
 Fib::scheduleEntryRefreshing(const ndn::Name& name, int32_t feSeqNum,
-                             int32_t refreshTime)
+                             const ndn::time::seconds& expTime)
 {
   std::cout << "Fib::scheduleEntryRefreshing Called" << std::endl;
   std::cout << "Name: " << name << " Seq Num: " << feSeqNum << std::endl;
   _LOG_DEBUG("Fib::scheduleEntryRefreshing Called");
   _LOG_DEBUG("Name: " << name << " Seq Num: " << feSeqNum);
-  return m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(refreshTime),
+  return m_nlsr.getScheduler().scheduleEvent(expTime,
                                              ndn::bind(&Fib::refreshEntry, this,
                                                        name, feSeqNum));
 }
@@ -67,7 +67,7 @@
       it->setSeqNo(feSeqNum + 1);
       it->setExpiringEventId(scheduleEntryRefreshing(it->getName() ,
                                                      it->getSeqNo(),
-                                                     m_refreshTime));
+                                                     ndn::time::seconds(m_refreshTime)));
     }
   }
 }
@@ -128,9 +128,12 @@
                        std::ceil(nhit->getRouteCost()), m_refreshTime);
       }
       newEntry.getNexthopList().sort();
-      newEntry.setTimeToRefresh(m_refreshTime);
+      ndn::time::system_clock::TimePoint expirationTimePoint = ndn::time::system_clock::now();
+      expirationTimePoint = expirationTimePoint + ndn::time::seconds(m_refreshTime);
+      newEntry.setExpirationTimePoint(expirationTimePoint);
       newEntry.setSeqNo(1);
-      newEntry.setExpiringEventId(scheduleEntryRefreshing(name , 1, m_refreshTime));
+      newEntry.setExpiringEventId(scheduleEntryRefreshing(name , 1,
+                                                          ndn::time::seconds(m_refreshTime)));
       m_table.push_back(newEntry);
     }
   }
@@ -156,14 +159,17 @@
                          std::ceil(nhit->getRouteCost()), m_refreshTime);
         }
       }
-      it->setTimeToRefresh(m_refreshTime);
+      ndn::time::system_clock::TimePoint expirationTimePoint = ndn::time::system_clock::now();
+      expirationTimePoint = expirationTimePoint + ndn::time::seconds(m_refreshTime);
+      it->setExpirationTimePoint(expirationTimePoint);
       std::cout << "Cancellling Scheduled event" << std::endl;
       std::cout << "Name: " << name << "Seq num: " << it->getSeqNo() << std::endl;
       _LOG_DEBUG("Cancelling Scheduled event. Name: " << name);
       cancelScheduledExpiringEvent(it->getExpiringEventId());
       it->setSeqNo(it->getSeqNo() + 1);
       (*it).setExpiringEventId(scheduleEntryRefreshing(it->getName() ,
-                                                       it->getSeqNo(), m_refreshTime));
+                                                       it->getSeqNo(),
+                                                       ndn::time::seconds(m_refreshTime)));
     }
     else {
       remove(name);
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index d144e1f..02aa400 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -5,6 +5,7 @@
 #include <boost/cstdint.hpp>
 
 #include <ndn-cxx/management/nfd-controller.hpp>
+#include <ndn-cxx/util/time.hpp>
 #include "face-map.hpp"
 #include "fib-entry.hpp"
 
@@ -56,7 +57,7 @@
 
   ndn::EventId
   scheduleEntryRefreshing(const ndn::Name& name, int32_t feSeqNum,
-                          int32_t refreshTime);
+                          const ndn::time::seconds& expTime);
 
   void
   cancelScheduledExpiringEvent(ndn::EventId eid);
