[ndnSIM] how to use nfd::scheduler::schedule() to delay PIT deletion

Junxiao Shi shijunxiao at email.arizona.edu
Fri Jun 8 14:10:38 PDT 2018


Hi 书忆江南

NFD allows a forwarding strategy to extend PIT entry lifetime for strategy
measurements purpose.
You may do so in afterReceiveData
<https://github.com/named-data/NFD/blob/c0822fa4a5a302d1c68f7da51e9f1a36542b861d/daemon/fw/strategy.hpp#L175-L200>
trigger of your custom strategy class. Call setExpiryTimer
<https://github.com/named-data/NFD/blob/c0822fa4a5a302d1c68f7da51e9f1a36542b861d/daemon/fw/strategy.hpp#L306>
to
set the new PIT entry lifetime.

You shouldn't change forwarder.cpp: doing that is unsupported and will void
your warranty.

Yours, Junxiao

> On Jun 6, 2018, at 1:04 AM, 书忆江南 <375446972 at qq.com> wrote:
>
> Hi all,
> We all know that when a data packet satisfies a interest, the PIT entry
> will be deleted immediately, but i want to delay the PIT entry deletion,
> when first data packet satisfies a interest in Incomming Data pipeline, do
> not delete the PIT entry(or outRecord in NFD) immediately, let the PIT
> entry stay for a while, so that second and third data packet will find this
> PIT entry and satisfy the same interest.
> Instead of one interest for one data packet, I want a mechanisim like
> sending one interest to retrieve multi data packets. I came up with a
> method but it comes out a error, I modified the file
> NFD/daemon/fw/forwarder.cpp, in the onIncomingData() method, my code is
> shown below:
>
> void
> Forwarder::onIncomingData(Face& inFace, const Data& data)
> {
>    ......
>    // mark PIT satisfied
>     pitEntry->clearInRecords();
>     //pitEntry->deleteOutRecord(inFace);  //this is the origin method to
> delete PIT entry(or outRecord)
>     nfd::scheduler::schedule(time::seconds(1),[&]{pitEntry->deleteOutRecord(inFace);});
> //my method to delay PIT entry deletion
>    ......
> }
>
> The compilation using ./waf is successful, but when the simulation runs
> ,it came out the following error:
>
> Command ['/home/yyc/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3-dev-25nodes-debug']
> terminated with signal SIGSEGV. Run it under a debugger to get more
> information (./waf --run <program> --command-template="gdb --args %s
> <args>").
>
> I don't know if my method is wrong, or the parameter i wrote in the
> parenthesis of schedule() is wrong. Can anyone helps? I will be grateful
> for your help.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180608/d24e6390/attachment.html>


More information about the ndnSIM mailing list