[ndnSIM] How to trace ReceivedInterests?

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Jan 8 17:58:08 PST 2015


You can just connect to the TraceSource and do whatever trace processing you need.  

Currently, we don’t have in ndnSIM trace helpers that simplify this operation.  But it is very simple to do such tracing

1. define callback

void
WillBeCalledWhenInterestIsReceived(Ptr<const Interest> i, Ptr<App> a, Ptr<Face> f)
{
   ...
}

2. connect callback to trace source of the application you interested in

/NodeList/[i]/ApplicationList/[i]/$ns3::ndn::App

Config::ConnectWithoutContext("/NodeList/1/ApplicationList/2/ReceivedInterests", MakeCallback(&WillBeCalledWhenInterestIsReceived);


Numbers here you will probably need to guess (they depend on the order nodes and applications are created in the scenario).


This tracing can be arbitrarily complex.  You can look to L3RateTrace source code that Spyros has pointed out for more reference implementation.  The only difference there is that L3Tracer takes input from the whole NDN stack (aggregate among all network channels and applications), while you want to look for specific application.

—
Alex

> On Jan 8, 2015, at 2:46 AM, 최원준 <wonjunchoi001 at gmail.com> wrote:
> 
> Hello.
> 
> I have no idea how to trace below value.
> 
> I hope some can help me.
> 
> ns3::ndn::App <http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_app.html>
> ReceivedInterests: ReceivedInterests
> ReceivedNacks: ReceivedNacks
> ReceivedDatas: ReceivedDatas
> TransmittedInterests: TransmittedInterests
> TransmittedDatas: TransmittedDatas
> Best regards
> Wonjun, Choi
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150108/d4b3ea2b/attachment.html>


More information about the ndnSIM mailing list