[ndnSIM] Data from onData

Sirapop Theeranantachai sirapop741 at gmail.com
Fri Mar 31 01:18:19 PDT 2023


Now that I realized the mailing list is missing from recipients, maybe some
experts here could verify this possible issue:

If an App is installed on a node AND a FIB entry of a certain prefix is
installed on the same node.
The app will read the packet On Interest.

After the Interest passes through and stores an entries on PIT, that App
will NOT read the packet On Data because this particlar name is stored in
the PIT and it's unnecessary to pass it to the App. If possible, please
confirm that this is the intended behavior.

Best,
Mark

On Fri, Mar 31, 2023, 1:05 AM Sirapop Theeranantachai <sirapop741 at gmail.com>
wrote:

> Hi Puming,
>
> Thanks for providing us your scenario. Now I see why OnData is not called.
> VNDN acts as both application and router.
>
> When the consumer sends Interest to VNDN nodes along the way to the
> producer, each nodes will follow the FIB entry (inserted by AddRoute) and
> pass to applications at the same time. OnInterest will be invoked as if
> VNDN is a producer (without any Data replies based on your code) while
> Interest will still be forwarded by FIB.
>
> When the data gets back from the producer, I suspect that the Data packet
> may be forwarded to the consumer by PIT without going through the VNDN app.
>
> This is assuming your channels are set up correctly. I need to verify and
> will let you know if this is the intended behavior.
>
> Best,
> Mari
>
> On Thu, Mar 30, 2023, 9:40 PM Puming Fang <pfang at umass.edu> wrote:
>
>> Hi Mark,
>>
>> Our test scenario includes a consumer, two VNDN nodes, and a producer. I
>> am trying to write different features for the VNDN node.
>>
>> The material you provided is really helpful. Thank you!
>>
>> Best,
>> Puming
>>
>> On Mar 29, 2023, at 9:42 PM, Sirapop Theeranantachai <
>> sirapop741 at gmail.com> wrote:
>>
>> Hi Puming,
>>
>> Would you also provide us with a code that instantiates the custom
>> application you are running? Based on your code, your app does not send any
>> interest when the app is initialized. You may need to schedule something on
>> application starts like the example on this page:
>> https://ndnsim.net/current/applications.html
>> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fndnsim.net%2Fcurrent%2Fapplications.html&data=05%7C01%7Cpfang%40umass.edu%7Ca390ac0861af429adeb908db30d92f2d%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638157481592274078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lee40qYIQ2%2BpYYTpogisQhNMcGZSuw7BTyeTn6xm8lI%3D&reserved=0>
>>
>>  Simulator::Schedule(Seconds(1.0), &CustomApp::SendInterest, this);
>>
>> May I ask what scenario are you planning to create?
>>
>> Extra tips: Right now, your application acts as both consumer and
>> producer. I just want to make sure that you may need to:
>> 1) If you plan to run your custom app on >1 nodes, you may need to create
>> and install *channels* between two faces on two different nodes.
>> 2) Add routes to the correct face.
>> If face_1 is on node_1 and face_2 is on node_2. You need to do
>> AddRoute(node_1, prefix, face_1, xx) and AddRoute(node_2, prefix, face_2,
>> yy). This will tell node_1 to forward the given prefix to face_1. Then, *Channels
>> *will forward them to the other end.
>>
>> Usually when we run simulations on NDN, we do not install the route
>> (AddRoute) inside the application. Instead, we create a consumer, a
>> producer, a channel between them, and add routes between two nodes.
>> AddRoute has an overloaded function that takes two nodes as parameters.
>> https://ndnsim.net/current/doxygen/ndn-fib-helper_8cpp_source.html#l00085
>> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fndnsim.net%2Fcurrent%2Fdoxygen%2Fndn-fib-helper_8cpp_source.html%23l00085&data=05%7C01%7Cpfang%40umass.edu%7Ca390ac0861af429adeb908db30d92f2d%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638157481592274078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gPK9R96BIEig6SJR0mlau5uCVtRBtiSNF2T7NujsCH0%3D&reserved=0>
>> For example, you can alternatively do AddRoute(node_1, prefix, node_2,
>> xx) outside your application classes. This helper function will look up the
>> other end of its installed channel to find the outgoing face.
>>
>> In an ideal case, if you want a node to act as both consumer and
>> producer, you may want to create two different applications and install
>> them on the same node. I personally did not try creating an application
>> that acts as both, but it technically *should* work.
>>
>> Note that in the ndnSIM examples on custom apps: (
>> ndn-simple-with-custom-app.cpp). Only one node is installed--so no
>> channels--and Interest is sent to the same node. This set-up is very
>> specific and I doubt that this is what you really want to test? assuming
>> that  your code shares quite a similarity.
>>
>> ndnSIM can be pretty challenging to get started. Please let me know if
>> this solves your issue!
>>
>> Best,
>> Mark
>>
>> On Wed, Mar 29, 2023 at 12:52 PM Puming Fang <pfang at umass.edu> wrote:
>>
>>> Hi Mark,
>>>
>>>
>>> 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?
>>>
>>> Yes.
>>>
>>> I have attached the files for your review. Thanks.
>>>
>>> Best,
>>> Puming
>>>
>>> On Mar 29, 2023, at 11:40 AM, Sirapop Theeranantachai <
>>> sirapop741 at gmail.com> wrote:
>>>
>>> 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%7Ca390ac0861af429adeb908db30d92f2d%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638157481592274078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Rh8GBsoA%2F%2BMhhZnOKnA3Z8aqCZJpjW4pk%2FzetG10ZVw%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
>>>> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.lists.cs.ucla.edu%2Fmailman%2Flistinfo%2Fndnsim&data=05%7C01%7Cpfang%40umass.edu%7Ca390ac0861af429adeb908db30d92f2d%7C7bd08b0b33954dc194bbd0b2e56a497f%7C0%7C0%7C638157481592274078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Rh8GBsoA%2F%2BMhhZnOKnA3Z8aqCZJpjW4pk%2FzetG10ZVw%3D&reserved=0>
>>>>
>>>>
>>>>
>>> <Screenshot_2023-03-29-21-31-55-66_40deb401b9ffe8e1df2f1cc5ba480b12.jpg>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20230331/6768398c/attachment-0001.html>


More information about the ndnSIM mailing list