[ndnSIM] Content Store data manipulation

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Nov 21 19:46:31 PST 2013


Hi Isuru,

If you want to get hold of the node on which the strategy running, then you can do the following in any of the ndn::ForwardingStrategy methods:

Ptr<Node> node = this->GetObject<Node>();

After that you can node->GetId() to get node id.

---
Alex

On Nov 19, 2013, at 6:46 AM, i.liyanage at surrey.ac.uk wrote:

> Hi Alex,
> 
> Is it possible to get the node number, within the model/fw/ndn-forwarding-strategy.cc code.
> 
> many thanks,
> Isuru.
> From: Alexander Afanasyev <cawka1 at gmail.com> on behalf of Alex Afanasyev <alexander.afanasyev at ucla.edu>
> Sent: 17 November 2013 20:19
> To: Liyanage IU Mr (PG/R - Electronic Eng)
> Cc: ndnsim
> Subject: Re: [ndnSIM] Content Store data manipulation
>  
> Hi Isuru,
> 
> The ContentStore::Add method is called (and which results in calling of the selected ContentStoreImpl<Policy>::Add method) from ndn::ForwardingStrategy (model/fw/ndn-forwarding-strategy.ccline 239 and 255).
> 
> Further, ContentStoreImpl<Policy>::Add calls insert method on the underlying policy-based controller, which results in calling policy-specific 'insert' method.  For example, if selected policy is Lru, then `insert' method defined in utils/trie/lru-policy.h line 77-87.
> 
> ---
> Alex
> 
> On Nov 17, 2013, at 10:57 AM, <i.liyanage at surrey.ac.uk> <i.liyanage at surrey.ac.uk> wrote:
> 
>> Hi Alex,
>> 
>> I looked at the both implementations and still not sure how to handle the entries in CS.
>> 
>> for an example when data is received by a node what method inserts the data to CS??
>> Assuming the method ContentStoreImpl<Policy>::Add (Ptr<const Data> data) is executed,
>> from where does this method is called
>> 
>> many thanks,
>> Isuru
>> From: Alexander Afanasyev <cawka1 at gmail.com> on behalf of Alex Afanasyev <alexander.afanasyev at ucla.edu>
>> Sent: 14 November 2013 22:21
>> To: Liyanage IU Mr (PG/R - Electronic Eng)
>> Cc: ndnsim at lists.cs.ucla.edu
>> Subject: Re: [ndnSIM] Content Store data manipulation
>>  
>> Hi Isuru,
>> 
>> utils/ folder contain general-use policies and model/cs/ folder contain policy that can be used only with ContentStore.  I would recommend to start with general-use and just peek at ContentStore-specific policy to see how to access information from cached entry.
>> 
>> ---
>> Alex
>> 
>> On Nov 14, 2013, at 9:36 AM, <i.liyanage at surrey.ac.uk> <i.liyanage at surrey.ac.uk> wrote:
>> 
>>> Hi Alex,
>>> 
>>> To write a policy which file should I refer to. I noticed the ContentStore implementation in */model/ cs folder and policy file in */utils/ trie folder.
>>> Could you suggest me good way to start to create a new policy.
>>> 
>>> Many thanks,
>>> Isuru
>>> 
>>> From: Alexander Afanasyev <cawka1 at gmail.com> on behalf of Alex Afanasyev <alexander.afanasyev at ucla.edu>
>>> Sent: 14 November 2013 16:07
>>> To: Liyanage IU Mr (PG/R - Electronic Eng)
>>> Cc: ndnsim at lists.cs.ucla.edu
>>> Subject: Re: [ndnSIM] Content Store data manipulation
>>>  
>>> Hi Isuru,
>>> 
>>> Since ContentStore is property of the forwarding daemon, there is no application interface to directly manage (add/remove) entries.  You can have full control over the cache content if you write a so-called policy, but this will not be application.
>>> 
>>> ---
>>> Alex
>>> 
>>> On Nov 14, 2013, at 3:25 AM, i.liyanage at surrey.ac.uk wrote:
>>> 
>>>> Hi,
>>>> 
>>>> Is it possible to add/remove Content Store entries using a application on a node.
>>>> If it is what methods should I use.
>>>> 
>>>> many thanks,
>>>> Isuru
>>>> _______________________________________________
>>>> 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
> 
> _______________________________________________
> 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/20131121/73f94e68/attachment.html>


More information about the ndnSIM mailing list