[ndnSIM] Obtaining the number of Interest packets

sai gautams saigautam96 at gmail.com
Sun Oct 10 17:21:23 PDT 2021


Hi Zakaria and Sangita,

I want to pop in and answer your question here. I have gone through the
entire thread, and it seems like a total of 500 interests will be generated
in your case, requesting 50 different types of content. Correct me,
Sangita, if I am wrong, as I am new to this area and still learning.

On Sun, Oct 10, 2021 at 9:08 PM Zakaria SABIR <zakaria.sabir at uit.ac.ma>
wrote:

> Yes, the script is the same I shared before:
>
>   ndn::AppHelper consumerHelper("ns3::ndn::ConsumerZipfMandelbrot");
>   consumerHelper.SetAttribute("Frequency", DoubleValue(10.0));
>   consumerHelper.SetAttribute("NumberOfContents", StringValue("50"));
>   consumerHelper.SetPrefix("/Interest1");
>   consumerHelper.Install(nodes.Get(0));
>   consumerHelper.Install(nodes.Get(3));
>   consumerHelper.Install(nodes.Get(4));
>
>   ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerZipfMandelbrot");
>   consumerHelper2.SetAttribute("Frequency", DoubleValue(10.0));
>   consumerHelper2.SetAttribute("NumberOfContents", StringValue("50"));
>   consumerHelper2.SetPrefix("/Interest2");
>   consumerHelper2.Install(nodes.Get(6));
>   consumerHelper2.Install(nodes.Get(8));
>   consumerHelper2.Install(nodes.Get(5));
>
> and I have also 4 producers:
>
>   ndn::AppHelper producerHelper("ns3::ndn::Producer");
>   producerHelper.SetPrefix("/");
>   producerHelper.SetAttribute("PayloadSize", StringValue("1200"));
>   producerHelper.Install(nodes.Get(1));
>   producerHelper.Install(nodes.Get(2));
>   producerHelper.Install(nodes.Get(7));
>   producerHelper.Install(nodes.Get(9));
>>
> On Sun, Oct 10, 2021 at 10:52 AM sangita...... <sangita.engg at gmail.com>
> wrote:
>
>> Are all the  6 nodes are configured with consumer application ? Can you
>> share the script ?
>>
>> On Sun, Oct 10, 2021, 10:10 Zakaria SABIR <zakaria.sabir at uit.ac.ma>
>> wrote:
>>
>>> Hi Sangita,
>>>
>>> Thank you for the clarification, I understand now. But, is
>>> this depending on the number of nodes and the number of consumer
>>> applications? For example, in my case, I specified the number of contents
>>> to 50. I have the frequency set to 10 Interests / s and the simulation is
>>> running for 50 s. I have 2 consumer applications and 6 nodes. What is the
>>> total number of Interests that will be generated in this case?
>>>
>>> My best regards,
>>> Zakaria
>>>>>>
>>> On Sat, Oct 9, 2021 at 8:33 PM sangita...... <sangita.engg at gmail.com>
>>> wrote:
>>>
>>>> Hi Zakaria,
>>>>
>>>> No I think you are missing a point that numberofcontent signifies type
>>>> of content. Now for example:  for type 1-content 10 interests can be
>>>> generated,..for type 2-content 4 interests ..for type 3-content 7 interests
>>>> ...likewise.
>>>>
>>>> Now the total no of interests that would generated depends on
>>>> frequency.
>>>>
>>>> Now if frequency is high let's say 100 per sec and your simulation is
>>>> running for 10 second then 1000 interests will  be generated.  But all
>>>> these interests will only request for 100 contents. Now which content will
>>>> be requested how many times depends on zipf distribution.
>>>>
>>>>
>>>> On Sat, Oct 9, 2021, 14:54 Zakaria SABIR <zakaria.sabir at uit.ac.ma>
>>>> wrote:
>>>>
>>>>> Yes, I found 88 Data responses for Interest1 and 48 Data responses for
>>>>> Interest2.
>>>>> I thought that regardless of the frequency rate, if the number of
>>>>> generated Interests reached the specified number of contents, no more
>>>>> Interests will be generated. It's not the case?
>>>>>
>>>>> My best regards,
>>>>> Zakaria
>>>>>>>>>>
>>>>> On Sat, Oct 9, 2021 at 1:09 PM sangita...... <sangita.engg at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> What do you mean by finding 88 content for interest1 and 48 for
>>>>>> interest 2 ?
>>>>>> 88 interest packets are generated with prefix intereste1 and 48 with
>>>>>> prefix interest2 ?
>>>>>>
>>>>>> Why do you expect 100 content in log file ? How many interest would
>>>>>> be generated it depends on frequency rate and interest for which content
>>>>>> among 100 contents would be generated  that depends on  zipf distribution .
>>>>>>
>>>>>> With regards,
>>>>>> Sangita
>>>>>>
>>>>>> On Sat, Oct 9, 2021, 12:03 Zakaria SABIR <zakaria.sabir at uit.ac.ma>
>>>>>> wrote:
>>>>>>
>>>>>>> I tried to limit the number of contents to 100 (50 for Interest1 and
>>>>>>> 50 for Interest2) like this:
>>>>>>>
>>>>>>>   ndn::AppHelper consumerHelper("ns3::ndn::ConsumerZipfMandelbrot");
>>>>>>>   consumerHelper.SetAttribute("Frequency", DoubleValue(10.0));
>>>>>>>   consumerHelper.SetAttribute("NumberOfContents", StringValue("50"));
>>>>>>>   consumerHelper.SetPrefix("/Interest1");
>>>>>>>   consumerHelper.Install(nodes.Get(0));
>>>>>>>   consumerHelper.Install(nodes.Get(3));
>>>>>>>   consumerHelper.Install(nodes.Get(4));
>>>>>>>
>>>>>>>   ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerZipfMandelbrot");
>>>>>>>   consumerHelper2.SetAttribute("Frequency", DoubleValue(10.0));
>>>>>>>   consumerHelper2.SetAttribute("NumberOfContents",
>>>>>>> StringValue("50"));
>>>>>>>   consumerHelper2.SetPrefix("/Interest2");
>>>>>>>   consumerHelper2.Install(nodes.Get(6));
>>>>>>>   consumerHelper2.Install(nodes.Get(8));
>>>>>>>   consumerHelper2.Install(nodes.Get(5));
>>>>>>>
>>>>>>> I expected to find exactly 100 content in the log file, but I found
>>>>>>> 88 for Interest1 and 48 for Interest2.
>>>>>>> I wonder what the reason for this is??
>>>>>>>
>>>>>>> My best regards,
>>>>>>> Zakaria
>>>>>>>>>>>>>>
>>>>>>> On Sat, Oct 9, 2021 at 9:20 AM Zakaria SABIR <
>>>>>>> zakaria.sabir at uit.ac.ma> wrote:
>>>>>>>
>>>>>>>> Hi Sangita,
>>>>>>>>
>>>>>>>> Yes, it makes sense. Thank you for the explanation. I will try it
>>>>>>>> out.
>>>>>>>>
>>>>>>>> My best regards,
>>>>>>>> Zakaria
>>>>>>>>>>>>>>>>
>>>>>>>> On Fri, Oct 8, 2021 at 12:01 PM sangita...... <
>>>>>>>> sangita.engg at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi zakira,
>>>>>>>>>
>>>>>>>>> As per the ndn architecture whenever your interest arrive to a
>>>>>>>>> producer , it generate a data packet with the same name of interest .  So
>>>>>>>>> when you mention NumberOfContents as 100 it means there are 100 content for
>>>>>>>>> which interest packets will be generated following the distribution.
>>>>>>>>> Let's say it will generate the interests like /interest1 / 1 ,
>>>>>>>>> then interest1 / 5 , then interest1 / 16 and so on. And this interest/x  :
>>>>>>>>> x will vary between 1 - 100 when you mention the number of content 100.
>>>>>>>>> Again , if you generate another app for interest2 , then it will
>>>>>>>>> generate another set of 100 content with the prefix interest2.
>>>>>>>>>
>>>>>>>>> If you mention the NumberOfContents as 1000 , then it will vary
>>>>>>>>> till 1000.
>>>>>>>>>
>>>>>>>>> Does that make sense?
>>>>>>>>>
>>>>>>>>> Sangita
>>>>>>>>>
>>>>>>>>> On Fri, Oct 8, 2021, 11:50 Zakaria SABIR <zakaria.sabir at uit.ac.ma>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Sangita,
>>>>>>>>>>
>>>>>>>>>> I see that there is another way to create different Interests.
>>>>>>>>>> But I didn't quite understand about the number of contents. In my case, I
>>>>>>>>>> want to define the maximum number of generated Interest packets in one
>>>>>>>>>> step, and I want to define the maximum number of generated Data packets in
>>>>>>>>>> another step. Does the line:
>>>>>>>>>> consumerHelper2.SetAttribute("NumberOfContents",
>>>>>>>>>> StringValue("100"));
>>>>>>>>>> specifies the maximum number of Interest or Data packets?
>>>>>>>>>>
>>>>>>>>>> My best regards,
>>>>>>>>>> Zakaria
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 8, 2021 at 11:17 AM sangita...... <
>>>>>>>>>> sangita.engg at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Zakaria,
>>>>>>>>>>>
>>>>>>>>>>> Yes no of content means  total no of content that follows zipf
>>>>>>>>>>> distribution. The frequency of generating content 1 is double than content
>>>>>>>>>>> 2 and so on.
>>>>>>>>>>>
>>>>>>>>>>> Another thing is you can generate different interests without
>>>>>>>>>>> making multiple app.
>>>>>>>>>>>
>>>>>>>>>>> Like:
>>>>>>>>>>> In your ConsumerZipfMandelbrot header file you can mention
>>>>>>>>>>> Static const Name prefix = Name ( "/service");
>>>>>>>>>>>
>>>>>>>>>>> Then in ConsumerZipfMandelbrot .cc file you can set like this.
>>>>>>>>>>>
>>>>>>>>>>> Name name = Name (prefix)
>>>>>>>>>>> If ( some condition)
>>>>>>>>>>> name.append ("interest 1")
>>>>>>>>>>> Else
>>>>>>>>>>> Name.append ("interest 2")
>>>>>>>>>>>
>>>>>>>>>>> Interest.setName (name)
>>>>>>>>>>>
>>>>>>>>>>> Anyway, both thing works. It depends how you want your
>>>>>>>>>>> implementation.
>>>>>>>>>>>
>>>>>>>>>>> Thanks and Regards,
>>>>>>>>>>> Sangita
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Oct 8, 2021, 10:45 Zakaria SABIR <
>>>>>>>>>>> zakaria.sabir at uit.ac.ma> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi Sonia,
>>>>>>>>>>>>
>>>>>>>>>>>> Yesterday, I found the error. To use two different Interests, I
>>>>>>>>>>>> had to create another app like this:
>>>>>>>>>>>>
>>>>>>>>>>>>   ndn::AppHelper *consumerHelper*("ns3::ndn::ConsumerCbr");
>>>>>>>>>>>>   consumerHelper.SetAttribute("Frequency", DoubleValue(10.0));
>>>>>>>>>>>>   consumerHelper.SetPrefix("*/Interest1*");
>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(0));
>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(3));
>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(4));
>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(5));
>>>>>>>>>>>>
>>>>>>>>>>>>   ndn::AppHelper *consumerHelper2*("ns3::ndn::ConsumerCbr");
>>>>>>>>>>>>   consumerHelper2.SetAttribute("Frequency", DoubleValue(10.0));
>>>>>>>>>>>>   consumerHelper2.SetPrefix("*/Interest2*");
>>>>>>>>>>>>   consumerHelper2.Install(nodes.Get(6));
>>>>>>>>>>>>   consumerHelper2.Install(nodes.Get(8));
>>>>>>>>>>>>   consumerHelper2.Install(nodes.Get(5));
>>>>>>>>>>>>
>>>>>>>>>>>> I did it that way and I used the command that you indicated
>>>>>>>>>>>> before (NS_LOG=ndn.Producer:ndn.Consumer ./waf --run="scenario"). The
>>>>>>>>>>>> "Interest2" appeared in the consumer log file as well. :)
>>>>>>>>>>>>
>>>>>>>>>>>> Now I have another question: In the "ConsumerZipfMandelbrot"
>>>>>>>>>>>> application, what is the difference between these two attributes:
>>>>>>>>>>>> "NumberOfContents" and "Frequency"? I know that the frequency is the number
>>>>>>>>>>>> of Interests per second, but what about the number of contents? Is it the
>>>>>>>>>>>> maximum number of contents that producers can generate? or the maximum
>>>>>>>>>>>> number of Interests that consumers can generate?
>>>>>>>>>>>>
>>>>>>>>>>>> My best regards,
>>>>>>>>>>>> Zakaria
>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 8, 2021 at 3:39 AM sonia sabir <
>>>>>>>>>>>> zohanoor67 at gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Zakaria,[image: image.gif]
>>>>>>>>>>>>> It seems like Interest for /Interest2 has not been sent. Try
>>>>>>>>>>>>> this
>>>>>>>>>>>>>
>>>>>>>>>>>>> consumerHelper.SetPrefix("/interest1");
>>>>>>>>>>>>> ApplicationContainer App1 =
>>>>>>>>>>>>> consumerHelper.Install(nodes.Get(6));
>>>>>>>>>>>>> App1.Start (Seconds (10.0));
>>>>>>>>>>>>> App1.Stop (Seconds (100.0));
>>>>>>>>>>>>> Do the same for "/Interest1".
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hope it works for you.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, Oct 6, 2021 at 11:52 PM Zakaria SABIR <
>>>>>>>>>>>>> zakaria.sabir at uit.ac.ma> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thank you Sangita and Sonia,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I'm using "ConsumerCbr", son do I have to change in the file
>>>>>>>>>>>>>> "ndn-consumer-cbr.cpp"?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> For the commander: NS_LOG=ndn.Producer:ndn.Consumer ./waf
>>>>>>>>>>>>>> --run="scenario", it gives me just one type of Interest packet like this:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 0s 5 ndn.Consumer:SendPacket(): [INFO ] > Interest for 0
>>>>>>>>>>>>>> 0s 5 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to
>>>>>>>>>>>>>> add 0 with +0.0ns. already 0 items
>>>>>>>>>>>>>> 0s 6 ndn.Consumer:SendPacket()
>>>>>>>>>>>>>> 0s 6 ndn.Consumer:SendPacket(): [INFO ] > Interest for 0
>>>>>>>>>>>>>> 0s 6 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to
>>>>>>>>>>>>>> add 0 with +0.0ns. already 0 items
>>>>>>>>>>>>>> 0s 8 ndn.Consumer:SendPacket()
>>>>>>>>>>>>>> 0s 8 ndn.Consumer:SendPacket(): [INFO ] > Interest for 0
>>>>>>>>>>>>>> 0s 8 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to
>>>>>>>>>>>>>> add 0 with +0.0ns. already 0 items
>>>>>>>>>>>>>> 0.000127315s 9 ndn.Producer:OnInterest(0x19f49d0, 0x1a64910)
>>>>>>>>>>>>>> 0.000127315s 9 ndn.Producer:OnInterest(): [INFO ] node(9)
>>>>>>>>>>>>>> responding with Data: /*Interest1*/%FE%00
>>>>>>>>>>>>>> 0.000324162s 1 ndn.Producer:OnInterest(0x19f3f10, 0x1a587b0)
>>>>>>>>>>>>>> 0.000324162s 1 ndn.Producer:OnInterest(): [INFO ] node(1)
>>>>>>>>>>>>>> responding with Data: /*Interest1*/%FE%00
>>>>>>>>>>>>>> 0.000810172s 4 ndn.Consumer:OnData(0x19f1060, 0x1a4d0b0)
>>>>>>>>>>>>>> 0.000810172s 4 ndn.Consumer:OnData(): [INFO ] < DATA for 0
>>>>>>>>>>>>>> 0.000810172s 4 ndn.Consumer:OnData(): [DEBUG] Hop count: 1
>>>>>>>>>>>>>> 0.00102885s 2 ndn.Producer:OnInterest(0x19f4270, 0x1a40620)
>>>>>>>>>>>>>> 0.00102885s 2 ndn.Producer:OnInterest(): [INFO ] node(2)
>>>>>>>>>>>>>> responding with Data: /*Interest1*/%FE%00
>>>>>>>>>>>>>> 0.1s 0 ndn.Consumer:SendPacket()
>>>>>>>>>>>>>> 0.1s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 1
>>>>>>>>>>>>>> 0.1s 0 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to
>>>>>>>>>>>>>> add 1 with +100000000.0ns. already 1 items
>>>>>>>>>>>>>> 0.1s 3 ndn.Consumer:SendPacket()
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I don't know if I have an error in specifying two names of
>>>>>>>>>>>>>> Interest packets. Here is a part of my code:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   consumerHelper.SetPrefix("/Interest1");
>>>>>>>>>>>>>>   consumerHelper.SetAttribute("Frequency",
>>>>>>>>>>>>>> DoubleValue(10.0));
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(0));
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(3));
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(4));
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(5))
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   consumerHelper.SetPrefix("/Interest2");
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(6));
>>>>>>>>>>>>>>   consumerHelper.Install(nodes.Get(8));
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   ndn::AppHelper producerHelper("ns3::ndn::Producer");
>>>>>>>>>>>>>>   producerHelper.SetPrefix("/");
>>>>>>>>>>>>>>   producerHelper.SetAttribute("PayloadSize",
>>>>>>>>>>>>>> StringValue("1200"));
>>>>>>>>>>>>>>   producerHelper.Install(nodes.Get(1));
>>>>>>>>>>>>>>   producerHelper.Install(nodes.Get(2));
>>>>>>>>>>>>>>   producerHelper.Install(nodes.Get(7));
>>>>>>>>>>>>>>   producerHelper.Install(nodes.Get(9));
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> My best regards,
>>>>>>>>>>>>>> Zakaria
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Wed, Oct 6, 2021 at 2:40 AM sonia sabir <
>>>>>>>>>>>>>> zohanoor67 at gmail.com> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> [image: image.gif]You can see it in the consumer log file.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> run your scenario with consumer and producer log enabled
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> NS_LOG=ndn.Producer:ndn.Consumer ./waf --run="scenario"
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Sonia
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Tue, Oct 5, 2021 at 7:29 PM Zakaria SABIR <
>>>>>>>>>>>>>>> zakaria.sabir at uit.ac.ma> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi everyone, I hope you are well.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I have created two names of Interest packets in my
>>>>>>>>>>>>>>>> scenario, and I want to know how many times each Interest packet has been
>>>>>>>>>>>>>>>> forwarded. I tried to use the "L3RateTracer", but it just gives the number
>>>>>>>>>>>>>>>> of all the Interest packets.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Could you help me, please?
>>>>>>>>>>>>>>>> My best regards.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Zakaria
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> ndnSIM mailing list
>>>>>>>>>>>>>>>> ndnSIM at lists.cs.ucla.edu
>>>>>>>>>>>>>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> ndnSIM mailing list
>>>>>>>>>>>> ndnSIM at lists.cs.ucla.edu
>>>>>>>>>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>


-- 

*Sai Gautam Mandapati*

Deakin University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20211011/70b89400/attachment-0001.html>


More information about the ndnSIM mailing list