[ndnSIM] Threading Issue in ndnSIM

Atif Rehman atif_r at outlook.com
Fri May 10 23:18:08 PDT 2019


Hello Xinyu Ma and Alex,

Thank you so much for the response. My problem was solved using your provided solutions.

I used "Simulator::Schedule(...)" to delay processing of data packet on producer node and manged PIT timer expiry using InterestLifeTime (I am controlling its value based on my own requirements).

Regards

Atif Ur Rehman (Ph.D. Student)


________________________________
From: Alex Afanasyev <cawka1 at gmail.com>
Sent: Monday, January 14, 2019 12:13 AM
To: Atif Rehman
Subject: Re: [ndnSIM] Threading Issue in ndnSIM



On Jan 13, 2019, at 1:11 PM, Atif Rehman <atif_r at outlook.com> wrote:

Alex,

Thank you so much for your prompt response and clarification. From your reply i understand that, I need to schedule an event and trigger it whenever the the processing time (random number) is greater than 1 second on producer node.  And In the event handler i need to write a code that expires the PIT timer which is associated with that particular Interest.

Not fully following this. To simulate processing time, you need to schedule creation of data packet the desired amount of time ahead, instead of directly creating it inside OnInterest method.  You can use what Xinyu suggested in the other reply to your question.

PIT timer is inside Forwarder and you should be able to control it via setting proper InterestLifetime in the interests you send. You shouldn't be doing any "manual" expiration of PIT entry.

-
Alex


 In case if i am wrong, then it would be great if you could please share some links that help me to understand better.

Thank you,

Regards

Atif Ur Rehman (Ph.D. Student)
From: Alex Afanasyev <cawka1 at gmail.com>
Sent: Sunday, January 13, 2019 9:33 PM
To: Atif Rehman
Subject: Re: [ndnSIM] Threading Issue in ndnSIM

You cannot use threading primitives in NS-3 in general, as it is simulating time, not running code in real time. If you want to simulate delays, you need to schedule events.  You should see many examples of how to do it in the code.

---
Alex

On Jan 13, 2019, at 11:16 AM, Atif Rehman via ndnSIM <ndnsim at lists.cs.ucla.edu> wrote:

Hello everyone,

I am analyzing the behavior of PIT timer in a ndnSIM by varying the processing time at producer node. For example, when the first request arrives at producer/provider node the processing time is 300 ms which means the producer will reply with data packet after 300 ms. All subsequent requests responded back with random processing time i.e. 300 ms, 749 ms, 1500 ms, 1700 ms, 249 ms etc. The value of a PIT timer is set to 1 second. Moreover, I am using  usleep(microseconds) function in Producer::OnInterest(shared_ptr<const Interest> interest) function after following line  NS_LOG_FUNCTION(this << interest); to create random processing delay on producer node.

The issue which i am facing is, it seems that usleep() function halt all threads of ndnSIM and PIT timer did not expire after 1 second even when the processing time is 1500, 1700 ms (greater than 1 second). I am using usleep() function because my understanding is (I might be wrong here) when we install NDN stack on any node, it runs in a separate thread. Therefore, if each node is running in separate thread then usleep() should not halt whole ndnSIM rather it should only halt the processing of producer node.

I shall be grateful if someone help me in this regard or suggest some alternative solution.


Regards

Atif Ur Rehman (Ph.D. Student)

_______________________________________________
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/20190511/0b6f045e/attachment.html>


More information about the ndnSIM mailing list