[ndnSIM] Implementing My Own Cache Management Policy

Kanin Assantachai kanin at inl.ics.keio.ac.jp
Wed Mar 25 10:13:57 PDT 2015

Hello all,

I am currently using ndnSIM 1.0, and I have been trying to implement my own cache management policy for a while already. However, I have quite a lot of questions to ask as follows.

1. Referring to the source code of LRU policy (lru-policy.h), what are  the roles (functions) of codes from line 39 to line 47? I have crossed  check with the code of empty policy (empty-policy.h) and I found that  such codes are not necessary for the case of policy that does not  implement any algorithm.

2. From line 89 to 96 of the same file (lru-policy.h), the "lookup"  function is implemented there. Why doesn't it handle the case of cache  miss? Based on the code, it seems to me that this case is not handled at  all.

3. It seems to me that the "policy_container" in the code serves as a  cache storage (list). I wonder if there are functions I can  use to access specific orders of cached objects in the list at a particular time. Let's say I would like to get the first 5 contents which are stored in the cache storage. How can I possibly do that?

4. This question is about the policy I would like to implement. How can  I make nodes automatically send messages about some of the contents of  their stored cache objects to next neighbor nodes? Is it better to  implement this detail in the same cache policy file that I am going to create, or in different files  at different levels? Please kindly provide some suggestions.

5. When I simulated the example file "ndn-simple-with-cs-lfu.cc" using the visualizer, I discovered that the request from consumer node still reaches the producer node even after the intermediate router has received the requested content from producer at least once. (The second request from consumer node is sent before the content in the cache of the router expires.) If cache is enabled at the router, why does the later requests (after the first one) still reaches the producer node? Why doesn't the router serve the request with its cache content?

Thank you for your responses in advance.

Kanin Assantachai

More information about the ndnSIM mailing list