[ndnSIM] Find corresponding CS entry for the given data packet

Alex Afanasyev aa at CS.UCLA.EDU
Thu Jul 7 16:13:51 PDT 2016


> On Jul 2, 2016, at 2:44 AM, 潘庆超 <15045081947 at 163.com> wrote:
> 
> forwarder.cpp:there are two functions,
> void find(const Interest& interest, const HitCallback& hitCallback, const MissCallback& missCallback) const ;
> shared_ptr<Data> Lookup(shared_ptr<const Interest> interest);
> What's the difference between them?

I'm guessing that you're referring to nfd::cs::Cs::find(...) and ns3::ndn::ContentStore::Lookup(...)

In ndnSIM 2.x we added a hack to support ndnSIM 1.x caching policies and caching policies implemented in NFD.  So, the first method refers to NFD-implemented policies, and the second to old-style CS.  There is a little bit of description about this here: http://ndnsim.net/2.1/cs.html

--
Alex

> 
> At 2016-07-01 22:22:57, "Junxiao Shi" <shijunxiao at email.arizona.edu> wrote:
> Hi Qinchao
> 
> 
> 
> I understand your question as: given a ContentStore and a Data packet, determine whether the same Data packet already exists in the ContentStore.
> 
> This can be achieved as:
> 
> 
> 
> void
> 
> isDataInContentStore(const ndn::Data& data, const nfd::cs::Cs& cs,
> 
>                      std::function<void(bool)> cb)
> 
> {
> 
>   ndn::Name fullName = data.getFullName();
> 
>   ndn::Interest interest(fullName);
> 
>   cs.find(interest,
> 
>           bind([cb] { cb(true); }),
> 
>           bind([cb] { cb(false); }));
> 
> }
> 
> 
> 
> First we create an Interest that would match the specified Data packet if it exists in the CS; the Interest would not match any other Data packet because it contains the implicit digest. The CS is then queried with the Interest, and the result is returned asynchronously.
> 
> 
> 
> Yours, Junxiao
> 
> 
> 
> From: 潘庆超
> Sent: Friday, July 1, 2016 07:06
> To: ndnsim at lists.cs.ucla.edu
> Subject: [ndnSIM] Find corresponding CS entry for the given data packet
> 
> 
> 
> hello ,i am doing some simulations about NDN . I have a problem. i want to know whether there are some contents in cs can match the given data packet when a node receive a data packet, how can i do ?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160707/425e56f8/attachment.bin>


More information about the ndnSIM mailing list