[ndnSIM] Data from onData
Puming Fang
pfang at umass.edu
Wed Mar 29 09:49:14 PDT 2023
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 <mailto: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 <mailto:ndnsim at lists.cs.ucla.edu>
> Reply-To: Puming Fang <pfang at umass.edu <mailto: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 <mailto: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/3f82ab57/attachment-0001.html>
More information about the ndnSIM
mailing list