2

I want to add some process delay on a consumer node before Interest packets being sent out. And I find that Simulator::Schedule() functions may achieve this purpose. But I am not sure how to use it exactly because ndnSIM has its own protocol process and if I schedule a new event it may cause some unexpected results. Or is there some other way to insert a delay on a node in NS-3?

iamabug
  • 306
  • 4
  • 11

1 Answers1

2

AFAIK, the way to introduce processing delay is with Simulator::Schedule(). In your example you mention you want to delay the send of an Interest packet. Instead of calling the method directly, you can schedule it after some (randon) time, ie. your process delay. This should not break the simulation.

Konstantinos
  • 556
  • 4
  • 9
  • I think the problem of Schedule() is that it only delays the event but the node still can process other tasks while waiting. And my real purpose is to simulate the occupation of CPU cycles. I feel that a simulation software may not be able to do this. – iamabug Jul 08 '17 at 01:10
  • Yes, you are correct about that but your question was about adding a 'process delay before sending a packet' and that can be achieved with the scheduler. Now if you want to 'block' all other operations that is a different story and I something to be investigated. However, even in real systems, you still can receive packets while processing others. The CPU is not blocked 100%, plus there are other processing units to handle certain tasks. – Konstantinos Jul 08 '17 at 19:26
  • Thanks, great to have someone to discuss with. – iamabug Jul 09 '17 at 00:53