diff --git a/nlsr.cpp b/nlsr.cpp
index 5a873df..a92f8cb 100644
--- a/nlsr.cpp
+++ b/nlsr.cpp
@@ -91,7 +91,12 @@
 	{
 		return EXIT_FAILURE;
 	}
+	
 	nlsr.getConfParameter().buildRouterPrefix();
+	nlsr.getLsdb().setLsaRefreshTime(nlsr.getConfParameter().getLsaRefreshTime());
+	nlsr.getFib().setFibEntryRefreshTime(2*nlsr.getConfParameter().getLsaRefreshTime());
+	nlsr.getFib().scheduleFibRefreshing(nlsr, 60);
+	nlsr.getLsdb().setThisRouterPrefix(nlsr.getConfParameter().getRouterPrefix());
 
 	/* debugging purpose start */
 	cout <<	nlsr.getConfParameter();
diff --git a/nlsr_fe.cpp b/nlsr_fe.cpp
index 350270e..1b9621f 100644
--- a/nlsr_fe.cpp
+++ b/nlsr_fe.cpp
@@ -39,6 +39,7 @@
 operator<<(ostream& os, FibEntry& fe)
 {
 	os<<"Name Prefix: "<<fe.getName()<<endl;
+	os<<"Time to Refresh: "<<fe.getTimeToRefresh()<<endl;
 	os<<fe.getNhl()<<endl;
 	return os;
 }
diff --git a/nlsr_fe.hpp b/nlsr_fe.hpp
index c3af73b..8392dfb 100644
--- a/nlsr_fe.hpp
+++ b/nlsr_fe.hpp
@@ -14,6 +14,7 @@
 public:
 	FibEntry()
 		: name()
+		, timeToRefresh(0)
 	{
 	}
 
@@ -32,10 +33,21 @@
 		return nhl;
 	}
 
+	int getTimeToRefresh()
+	{
+		return timeToRefresh;
+	}
+
+	void setTimeToRefresh(int ttr)
+	{
+		timeToRefresh=ttr;
+	}
+
 	bool isEqualNextHops(Nhl &nhlOther);
 	
 private:
 	string name;
+	int timeToRefresh;
 	Nhl nhl;
 };
 
diff --git a/nlsr_fib.cpp b/nlsr_fib.cpp
index 2bfc568..399584f 100644
--- a/nlsr_fib.cpp
+++ b/nlsr_fib.cpp
@@ -2,6 +2,7 @@
 #include "nlsr_fe.hpp"
 #include "nlsr_fib.hpp"
 #include "nlsr_nhl.hpp"
+#include "nlsr.hpp"
 
 using namespace std;
 
@@ -29,13 +30,6 @@
   }
 }
 
-/**
-If NHL is equal for current FIB and NPT then to change
-Otherwise
- Add the first Nexthop to FIB
- remove all old nexthop from FIB
- And add all other Nexthop to FIB
-*/
 
 void 
 Fib::updateFib(string name, Nhl& nextHopList, int maxFacesPerPrefix)
@@ -46,6 +40,7 @@
 									       fibTable.end(), bind(&fibEntryNameCompare, _1, name));
   if( it != fibTable.end() )
   {
+  		nextHopList.sortNhl();
   		if ( !(*it).isEqualNextHops(nextHopList) ) 
   		{
   			std::list<NextHop>::iterator nhit=nextHopList.getNextHopList().begin();
@@ -57,22 +52,56 @@
   			{
   				(*it).getNhl().addNextHop((*nhit));
   			}
+
+  			(*it).setTimeToRefresh(fibEntryRefreshTime);
   		}
   		(*it).getNhl().sortNhl();
+  		//update NDN-FIB
   }
   else
   {
+  		nextHopList.sortNhl();
   		FibEntry newEntry(name);
-  		for(std::list<NextHop>::iterator nhit=nextHopList.getNextHopList().begin();
-  															nhit!=nextHopList.getNextHopList().end();++nhit)
+  		std::list<NextHop>::iterator nhit=nextHopList.getNextHopList().begin();
+  		for(int i=startFace; i< endFace ; i++)
   		{
   			newEntry.getNhl().addNextHop((*nhit));
+  			++nhit;
   		}
   		newEntry.getNhl().sortNhl();
+  		newEntry.setTimeToRefresh(fibEntryRefreshTime);
   		fibTable.push_back(newEntry);	
+  		//Update NDN-FIB
   }
 }
 
+void
+Fib::refreshFib(nlsr& pnlsr)
+{
+	for ( std::list<FibEntry >::iterator it = fibTable.begin() ;
+																		               it != fibTable.end() ; ++it)
+	{
+		(*it).setTimeToRefresh((*it).getTimeToRefresh()-60);
+		if( (*it).getTimeToRefresh() < 0 )
+		{
+			cout<<"Refreshing FIB entry : "<<endl;
+			cout<<(*it)<<endl;
+			(*it).setTimeToRefresh(fibEntryRefreshTime);
+			//update NDN-FIB
+		}
+	}
+
+	printFib();
+	scheduleFibRefreshing(pnlsr,60);
+}
+
+void 
+Fib::scheduleFibRefreshing(nlsr& pnlsr, int refreshTime)
+{
+		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(refreshTime),
+								         ndn::bind(&Fib::refreshFib,this,boost::ref(pnlsr)));
+}
+
 void Fib::cleanFib()
 {
 	for( std::list<FibEntry >::iterator it=fibTable.begin(); it != fibTable.end();
@@ -93,12 +122,12 @@
 
 
 void 
-Fib::removeFibEntryHop(Nhl& nl, int doNotRemoveHop)
+Fib::removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId)
 {
 	for( std::list<NextHop >::iterator it=nl.getNextHopList().begin(); 
 	                                      it != nl.getNextHopList().end();   ++it)
 	{
-		if ( (*it).getConnectingFace() != doNotRemoveHop )
+		if ( (*it).getConnectingFace() != doNotRemoveHopFaceId )
 		{
 			nl.getNextHopList().erase(it);
 		}
@@ -129,7 +158,6 @@
 	for(std::list<FibEntry>::iterator it = fibTable.begin(); it!=fibTable.end();
 	                                                                         ++it)
 	{
-		//(*it).getNhl().sortNhl();
 		cout<<(*it);
 	}
 }
diff --git a/nlsr_fib.hpp b/nlsr_fib.hpp
index f1f54ed..453b7db 100644
--- a/nlsr_fib.hpp
+++ b/nlsr_fib.hpp
@@ -17,15 +17,23 @@
 
 	void removeFromFib(string name);
 	void updateFib(string name, Nhl& nextHopList, int maxFacesPerPrefix);
+	void scheduleFibRefreshing(nlsr& pnlsr, int refreshTime);
 	void cleanFib();
+	void setFibEntryRefreshTime(int fert)
+	{
+		fibEntryRefreshTime=fert;
+	}
+	
 	void printFib();
 
 private:
-	void removeFibEntryHop(Nhl& nl, int doNotRemoveHop);
+	void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
 	int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
+	void refreshFib(nlsr& pnlsr);
 	
 private:
 	std::list<FibEntry> fibTable;	
+	int fibEntryRefreshTime;
 };
 
 #endif
diff --git a/nlsr_lsdb.cpp b/nlsr_lsdb.cpp
index da7d86e..9e3ffe7 100644
--- a/nlsr_lsdb.cpp
+++ b/nlsr_lsdb.cpp
@@ -42,10 +42,18 @@
 }
 
 
+void 
+Lsdb::scheduleNameLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+{
+	pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+								                      ndn::bind(&Lsdb::exprireOrRefreshNameLsa,
+								                      this,boost::ref(pnlsr), key, seqNo));
+}
 
 bool 
 Lsdb::installNameLsa(nlsr& pnlsr, NameLsa &nlsa)
 {
+	int timeToExpire=lsaRefreshTime;
 	std::pair<NameLsa& , bool> chkNameLsa=getNameLsa(nlsa.getNameLsaKey());
 	if ( !chkNameLsa.second )
 	{
@@ -62,7 +70,14 @@
 					pnlsr.getNpt().addNpte((*it),nlsa.getOrigRouter(),pnlsr);
 				}
 			}
-		} 
+		}
+
+		if(nlsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
+		{
+			timeToExpire=nlsa.getLifeTime();
+		}
+		scheduleNameLsaExpiration( pnlsr, nlsa.getNameLsaKey(),
+			                                         nlsa.getLsSeqNo(), timeToExpire);
 	}
 	else
 	{
@@ -110,8 +125,14 @@
       				pnlsr.getNpt().removeNpte((*it),nlsa.getOrigRouter(),pnlsr);
       			}
       		}
-      }  
-			
+      } 
+
+			if(nlsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
+			{
+				timeToExpire=nlsa.getLifeTime();
+			}
+			scheduleNameLsaExpiration( pnlsr, nlsa.getNameLsaKey(),
+			                                         nlsa.getLsSeqNo(), timeToExpire);
 		}
 	}
 	
@@ -122,8 +143,7 @@
 Lsdb::addNameLsa(NameLsa &nlsa)
 {
 	std::list<NameLsa >::iterator it = std::find_if( nameLsdb.begin(), 
-																		nameLsdb.end(),	
-   													  bind(nameLsaCompareByKey, _1, nlsa.getNameLsaKey()));
+					 nameLsdb.end(), bind(nameLsaCompareByKey, _1, nlsa.getNameLsaKey()));
 
 	if( it == nameLsdb.end())
 	{
@@ -222,9 +242,18 @@
 	return std::make_pair(boost::ref(clsa),false);
 }
 
+void
+Lsdb::scheduleCorLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+{
+	pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+								                      ndn::bind(&Lsdb::exprireOrRefreshCorLsa,
+								                      this,boost::ref(pnlsr),key,seqNo));
+}
+
 bool 
 Lsdb::installCorLsa(nlsr& pnlsr, CorLsa &clsa)
 {
+	int timeToExpire=lsaRefreshTime;
 	std::pair<CorLsa& , bool> chkCorLsa=getCorLsa(clsa.getCorLsaKey());
 	if ( !chkCorLsa.second )
 	{
@@ -236,14 +265,15 @@
 		}
 		if (pnlsr.getConfParameter().getIsHyperbolicCalc() >=1 )
 		{
-			if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
-			{
-				pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-								ndn::bind(&RoutingTable::calculate, 
-								&pnlsr.getRoutingTable(),boost::ref(pnlsr)));
-				pnlsr.setIsRouteCalculationScheduled(1);
-			}	
+			pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);	
 		}
+
+		if(clsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
+		{
+				timeToExpire=clsa.getLifeTime();
+		}
+	  scheduleCorLsaExpiration(pnlsr,clsa.getCorLsaKey(),
+	                                         clsa.getLsSeqNo(), timeToExpire);
 		
 	}
 	else
@@ -259,16 +289,17 @@
 
 				if (pnlsr.getConfParameter().getIsHyperbolicCalc() >=1 )
 				{
-					if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
-					{
-						pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-								ndn::bind(&RoutingTable::calculate, 
-								&pnlsr.getRoutingTable(),boost::ref(pnlsr)));
-						pnlsr.setIsRouteCalculationScheduled(1);
-					}	
+					pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);	
 				}
 				
 			}
+
+			if(clsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
+			{
+				timeToExpire=clsa.getLifeTime();
+			}
+			scheduleCorLsaExpiration(pnlsr,clsa.getCorLsaKey(),
+	                                         clsa.getLsSeqNo(), timeToExpire);
 		}
 		
 	}
@@ -337,12 +368,7 @@
 
 
 // Adj LSA and LSDB related function starts here
-/*
-static bool
-adjLsaCompare(AdjLsa& alsa1, AdjLsa& alsa2){
-	return alsa1.getLsaKey()==alsa1.getLsaKey();
-}
-*/
+
 static bool
 adjLsaCompareByKey(AdjLsa& alsa, string& key){
 	return alsa.getAdjLsaKey()==key;
@@ -366,10 +392,9 @@
 			}
 			else
 			{
-				//remove if there is any adj lsa in LSDB
 				string key=pnlsr.getConfParameter().getRouterPrefix()+"/2";
 				removeAdjLsa(pnlsr,key);
-				// Remove alll fib entries as per NPT
+				pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
 			}
 			pnlsr.setAdjBuildCount(pnlsr.getAdjBuildCount()-adjBuildCount);
 		}		
@@ -378,7 +403,7 @@
 	{
 		pnlsr.setIsBuildAdjLsaSheduled(1);
 		int schedulingTime=pnlsr.getConfParameter().getInterestRetryNumber()*
-		                   pnlsr.getConfParameter().getInterestRetryNumber();
+		                   pnlsr.getConfParameter().getInterestResendTime();
 		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(schedulingTime),
 							ndn::bind(&Lsdb::scheduledAdjLsaBuild, pnlsr.getLsdb(), 
 																									boost::ref(pnlsr)));
@@ -417,21 +442,34 @@
 	return std::make_pair(boost::ref(alsa),false);
 }
 
+
+
+void 
+Lsdb::scheduleAdjLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+{
+	pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
+								                      ndn::bind(&Lsdb::exprireOrRefreshAdjLsa,
+								                      this,boost::ref(pnlsr),key,seqNo));
+}
+
 bool 
 Lsdb::installAdjLsa(nlsr& pnlsr, AdjLsa &alsa)
 {
+	int timeToExpire=lsaRefreshTime;
 	std::pair<AdjLsa& , bool> chkAdjLsa=getAdjLsa(alsa.getAdjLsaKey());
 	if ( !chkAdjLsa.second )
 	{
 		addAdjLsa(alsa);
 		alsa.addNptEntriesForAdjLsa(pnlsr);
-		if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
+		pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
+
+		if(alsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
 		{
-			pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-								ndn::bind(&RoutingTable::calculate, 
-								&pnlsr.getRoutingTable(),boost::ref(pnlsr)));
-			pnlsr.setIsRouteCalculationScheduled(1);
+				timeToExpire=alsa.getLifeTime();
 		}
+		scheduleAdjLsaExpiration(pnlsr,alsa.getAdjLsaKey(),
+		                                            alsa.getLsSeqNo(),timeToExpire);
+		
 	}
 	else
 	{
@@ -444,14 +482,15 @@
 			{
 				chkAdjLsa.first.getAdl().resetAdl();
 				chkAdjLsa.first.getAdl().addAdjacentsFromAdl(alsa.getAdl());
-				if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
-				{
-					pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-								ndn::bind(&RoutingTable::calculate, 
-								&pnlsr.getRoutingTable(),boost::ref(pnlsr)));
-					pnlsr.setIsRouteCalculationScheduled(1);
-				}	
+				pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);	
 			}
+			
+			if(alsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
+			{
+				timeToExpire=alsa.getLifeTime();
+			}
+			scheduleAdjLsaExpiration(pnlsr,alsa.getAdjLsaKey(),
+		                                            alsa.getLsSeqNo(),timeToExpire);
 		}
 		
 	}
@@ -510,6 +549,107 @@
 		return adjLsdb;
 }
 
+void 
+Lsdb::setLsaRefreshTime(int lrt)
+{
+	lsaRefreshTime=lrt;
+}
+
+void 
+Lsdb::setThisRouterPrefix(string trp)
+{
+	thisRouterPrefix=trp;
+}
+
+void 
+Lsdb::exprireOrRefreshNameLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+{
+	cout<<"Lsdb::exprireOrRefreshNameLsa Called "<<endl;
+	cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
+	std::pair<NameLsa& , bool> chkNameLsa=getNameLsa(lsaKey);
+	if( chkNameLsa.second )
+	{
+		cout<<" LSA Exists with seq no: "<<chkNameLsa.first.getLsSeqNo()<<endl;
+		if ( chkNameLsa.first.getLsSeqNo() == seqNo )
+		{
+			if(chkNameLsa.first.getOrigRouter() == thisRouterPrefix )
+			{
+				cout<<"Own Name LSA, so refreshing name LSA"<<endl;
+				chkNameLsa.first.setLsSeqNo(chkNameLsa.first.getLsSeqNo()+1);
+				pnlsr.getSm().setNameLsaSeq(chkNameLsa.first.getLsSeqNo());
+				// publish routing update
+			}
+			else
+			{
+				cout<<"Other's Name LSA, so removing form LSDB"<<endl;
+				removeNameLsa(pnlsr, lsaKey);
+			}
+		}
+	}
+}
+
+void 
+Lsdb::exprireOrRefreshAdjLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+{
+	cout<<"Lsdb::exprireOrRefreshAdjLsa Called "<<endl;
+	cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
+	std::pair<AdjLsa& , bool> chkAdjLsa=getAdjLsa(lsaKey);
+	if( chkAdjLsa.second )
+	{
+		cout<<" LSA Exists with seq no: "<<chkAdjLsa.first.getLsSeqNo()<<endl;
+		if ( chkAdjLsa.first.getLsSeqNo() == seqNo )
+		{
+			if(chkAdjLsa.first.getOrigRouter() == thisRouterPrefix )
+			{
+				cout<<"Own Adj LSA, so refreshing Adj LSA"<<endl;
+				chkAdjLsa.first.setLsSeqNo(chkAdjLsa.first.getLsSeqNo()+1);
+				pnlsr.getSm().setAdjLsaSeq(chkAdjLsa.first.getLsSeqNo());
+				// publish routing update
+			}
+			else
+			{
+				cout<<"Other's Adj LSA, so removing form LSDB"<<endl;
+				removeAdjLsa(pnlsr, lsaKey);
+			}
+
+			// schedule Routing table calculaiton
+			pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
+		}
+	}
+}
+
+void 
+Lsdb::exprireOrRefreshCorLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+{
+	cout<<"Lsdb::exprireOrRefreshCorLsa Called "<<endl;
+	cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
+	std::pair<CorLsa& , bool> chkCorLsa=getCorLsa(lsaKey);
+	if( chkCorLsa.second )
+	{
+		cout<<" LSA Exists with seq no: "<<chkCorLsa.first.getLsSeqNo()<<endl;
+		if ( chkCorLsa.first.getLsSeqNo() == seqNo )
+		{
+			if(chkCorLsa.first.getOrigRouter() == thisRouterPrefix )
+			{
+				cout<<"Own Cor LSA, so refreshing Cor LSA"<<endl;
+				chkCorLsa.first.setLsSeqNo(chkCorLsa.first.getLsSeqNo()+1);
+				pnlsr.getSm().setCorLsaSeq(chkCorLsa.first.getLsSeqNo());
+				// publish routing update
+			}
+			else
+			{
+				cout<<"Other's Cor LSA, so removing form LSDB"<<endl;
+				removeCorLsa(pnlsr, lsaKey);
+			}
+
+			if (pnlsr.getConfParameter().getIsHyperbolicCalc() >=1 )
+			{
+				pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);	
+			}
+		}
+	}
+}
+
 
 void 
 Lsdb::printAdjLsdb()
diff --git a/nlsr_lsdb.hpp b/nlsr_lsdb.hpp
index 9ba0729..62c91ee 100644
--- a/nlsr_lsdb.hpp
+++ b/nlsr_lsdb.hpp
@@ -11,6 +11,7 @@
 class Lsdb{
 public:
 	Lsdb()
+		: lsaRefreshTime(0)
 	{
 	}
 
@@ -38,6 +39,10 @@
 	std::pair<AdjLsa& , bool> getAdjLsa(string key);
 	std::list<AdjLsa>& getAdjLsdb();
 	void printAdjLsdb();
+
+	//void scheduleRefreshLsdb(nlsr& pnlsr, int interval);
+	void setLsaRefreshTime(int lrt);
+	void setThisRouterPrefix(string trp);
 	
 private:
 	bool addNameLsa(NameLsa &nlsa);
@@ -49,6 +54,13 @@
 
 	bool addAdjLsa(AdjLsa &alsa);
 	bool doesAdjLsaExist(string key);
+  
+	void scheduleNameLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
+	void exprireOrRefreshNameLsa(nlsr& pnlsr, string lsaKey, int seqNo);
+	void scheduleAdjLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
+	void exprireOrRefreshAdjLsa(nlsr& pnlsr, string lsaKey, int seqNo);
+	void scheduleCorLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
+	void exprireOrRefreshCorLsa(nlsr& pnlsr, string lsaKey, int seqNo);
 	
 
 private:
@@ -56,6 +68,9 @@
 	std::list<AdjLsa> adjLsdb;
 	std::list<CorLsa> corLsdb;
 
+	int lsaRefreshTime;
+	string thisRouterPrefix;
+
 };
 
 #endif
diff --git a/nlsr_rt.cpp b/nlsr_rt.cpp
index ae7fc88..efa423a 100644
--- a/nlsr_rt.cpp
+++ b/nlsr_rt.cpp
@@ -81,9 +81,7 @@
 	}
 	else
 	{
-		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-									 ndn::bind(&RoutingTable::calculate,this,boost::ref(pnlsr)));
-		pnlsr.setIsRouteCalculationScheduled(1);
+		scheduleRoutingTableCalculation(pnlsr);
 	}
 
 }
@@ -121,6 +119,17 @@
 	hrtc.calculatePath(vMap,boost::ref(*this),pnlsr);
 }
 
+void
+RoutingTable::scheduleRoutingTableCalculation(nlsr& pnlsr)
+{
+	if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
+	{
+		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
+								ndn::bind(&RoutingTable::calculate,this,boost::ref(pnlsr)));
+		pnlsr.setIsRouteCalculationScheduled(1);
+	}
+}
+
 static bool
 routingTableEntryCompare(RoutingTableEntry& rte, string& destRouter){
 	return rte.getDestination()==destRouter;
diff --git a/nlsr_rt.hpp b/nlsr_rt.hpp
index 8585184..ef54742 100644
--- a/nlsr_rt.hpp
+++ b/nlsr_rt.hpp
@@ -26,6 +26,7 @@
 	void addNextHopToDryTable(string destRouter, NextHop& nh);
 	void printDryRoutingTable();
 	std::pair<RoutingTableEntry&, bool> findRoutingTableEntry(string destRouter);
+	void scheduleRoutingTableCalculation(nlsr& pnlsr);
 
 private:
 	void calculateLsRoutingTable(nlsr& pnlsr);
