[ndnSIM] what a data structure is the CS?

Alex Afanasyev alexander.afanasyev at ucla.edu
Mon May 13 11:00:26 PDT 2013


Hi Shenglan,

As you may have seen in one of my recent posts to ndnSIM mailing list, CS, as well as all other data structures in ndnSIM, are organized using the underlying data structure that is a complex tree. Each node of the tree corresponds to a name component, and connection to child nodes is implemented as a hash array.   If you want, you can check more details by looking into the source code in https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/trie.h. 

In addition to tree (trie) itself, there is a notion of policies that can be applied to the stored elements (https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/trie-with-policy.h).  You can think about it as that each item belongs to two independent containers: one is the tree and another one is something defined by the policy.  There is actually, already a policy that can provide you a statistical information about aggregate number of CS operations (https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/aggregate-stats-policy.h).   

To track number of operations for individual items, you would need to create a policy like this https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/random-policy.h.  Line https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/random-policy.h#L41  defines additional data that needs to be stored in each item.   Depending on what you want to do with this statistical data, you may need to use different types of boost::intrusive hooks and containers  (in Random policy, all items in the policy are kept sorted by a random value, so that beginning of the policy container always points to some random item).

---
Alex

On May 13, 2013, at 4:51 AM, 陈胜蓝 <blindeafer at 163.com> wrote:

> Hi Alex, 
> Sorry to bother you again.
> I have a question about the CS.Is it store the prefix and entry of every contentobject,and what is the data structure of CS?
> If I could add new item that record a statistical result of service times(times that a content is send out) for every contentobject in CS,and how to add the new struct?
> 
> Best regards,
> Shenglan
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130513/e75bdf05/attachment.html>


More information about the ndnSIM mailing list