[ndnSIM] Data from onData

Sirapop Theeranantachai sirapop741 at gmail.com
Wed Mar 29 11:40:05 PDT 2023


Would you be able to provide us your full .cpp and .hpp of custom consumer
and producer?

Just a confirmation, this line:

> NS_LOG_INFO("VNDN node receives Interest, Interest = " <<
> interest->getName());
>
does run, but this line:

> NS_LOG_INFO("VNDN node receives Data, Data = " << data->getName());
>
does not?

If you're writing a custom consumer/producer *that extends from App*, for
example, ndn-vndn.cpp, you may need to change the line

> NS_LOG_COMPONENT_DEFINE("ndn.Consumer");
>
in ndn-vndn.hpp to something else like ndn.VNDN so that you are able to log
them with NS_LOG

You also have a choice to extend an already existing ndn.Consumer rather
than adding another custom consumer extending from "App".
For instance, ndnSIM has a few examples: consumer-cbr, consumer-window,
consumer-batchers. All of them extend from Consumer, not App

Mark

On Wed, Mar 29, 2023 at 9:49 AM Puming Fang <pfang at umass.edu> wrote:

> Hi Mark,
>
> Thanks for the reply.
>
> I am trying to write a customized application “VNDN".
>
> void
> VNDN::OnInterest(std::shared_ptr<const ndn::Interest> interest)
> {
> ndn::App::OnInterest(interest);
> NS_LOG_INFO("VNDN node receives Interest, Interest = " << interest->
> getName());
> }
> // Callback that will be called when Data arrives
> void
> VNDN::OnData(std::shared_ptr<const ndn::Data> data)
> {
> if (!m_active)
> return;
> ndn::App::OnData(data); // tracing inside
> NS_LOG_INFO("VNDN node receives Data, Data = " << data->getName());
> }
>
> I run the following command:
> NS_LOG=ndn.Consumer:ndn.Producer:ndn.VNDN ./*waf ** —run=xxx*
>
> The VNDN::OnInterest is called upon the arrival of the Interest but VNDN::OnData
> is not called upon the arrival of the Data.
>
> Thank you for your time and assistance.
>
> Best,
> Puming
>
>
> On Mar 29, 2023, at 1:27 AM, Sirapop Theeranantachai via ndnSIM <
> ndnsim at lists.cs.ucla.edu> wrote:
>
> Hello,
>
> What command did you run when you use ndnSIM. Consumers and producers in
> ndnSIM will print out logs only if "NS_LOG" variables are defined as
> ndn.Consumer and ndn.Producer respectively.
>
> For example,
> ndn.Consumer contains "OnData", "SendPacket", and "OnTimeout".
> ndn.Producer contains "OnInterest".
> If you want ndnSIM to show the log of both "OnData" and "OnInterest", you
> may need to put prefix before the ./waf command such as:
>
> *NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=xxx *
>
> If the packet does not actually arrive, you will see OnTimeout instead, so
> I do believe the packets are arriving.
>
> Hope this help!
> Mark
>
> Begin forwarded message:
>
> *From: *Puming Fang via ndnSIM <ndnsim at lists.cs.ucla.edu>
> *Subject: **[ndnSIM] App::OnData(data) is not called when Data Arrives*
> *Date: *March 27, 2023 at 11:11:32 AM PDT
> *To: *ndnsim at lists.cs.ucla.edu
> *Reply-To: *Puming Fang <pfang at umass.edu>
>
> Dear NDN team,
>
> I am currently working with ndnsim and have a query regarding the handling
> of Interest and Data packets. While attempting to implement certain
> operations upon the arrival of these packets, I have noticed that while the
> "App::OnInterest(Interest)" function works as expected, the
> "App::OnData(Data)" function does not seem to be called when the Data
> packet arrives. My intention is to log some information upon the arrival of
> Data packets.
>
> I can confirm that the Data packets are indeed arriving at the node and
> being forwarded correctly. Could you please advise me on what could be
> causing this issue?
>
> Thank you for your time and assistance.
>
> Best, Puming
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> https://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.lists.cs.ucla.edu%2Fmailman%2Flistinfo%2Fndnsim&data=05%7C01%7Cpfang%40umass.edu%7Ce7cf139fa72f4b12606b08db302f746c%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638156752614482532%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ikrf%2FYiN%2BCYx5uLulzviUe6zch8tJwrdlY%2FvXhPW5Dg%3D&reserved=0>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
>
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.lists.cs.ucla.edu%2Fmailman%2Flistinfo%2Fndnsim&data=05%7C01%7Cpfang%40umass.edu%7Ce7cf139fa72f4b12606b08db302f746c%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638156752614482532%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ikrf%2FYiN%2BCYx5uLulzviUe6zch8tJwrdlY%2FvXhPW5Dg%3D&reserved=0
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20230329/7c0769b1/attachment-0001.html>


More information about the ndnSIM mailing list