[ndnSIM] Drop cached data in ndnsim

Zeinab Rezaiefar zeinab.rezaiefar at gmail.com
Fri Feb 14 00:53:13 PST 2020


Dear Spyridon,
Since I want to apply the proposed method in a router, the router needs to
decide to remove the cached content. Therefore, I think I should use the
erase method in CS. To do this, I modified content-store-impl.hpp as
follows:
virtual void
  Remove (const Name fullKey,shared_ptr<const Data> data);
….
template<class Policy>
void
ContentStoreImpl<Policy>::Remove (const Name fullKey,shared_ptr<const Data>
data) {
  super::erase(fullKey);
}

and also ndn-content-store.hpp :
virtual void
  Remove (const Name fullKey,shared_ptr<const Data> data) = 0;

and ndn-content-store-nocache.hpp:

virtual void
  Remove(const Name fullKey,shared_ptr<const Data> data);

and content-store-nocache.cpp;
void
Nocache::Remove (const Name fullKey,shared_ptr<const Data> data) {
}

however, when I drop a cached data from forward.cpp with using the Remove
function, I receive SIGSEGV error as follows:

Program received signal SIGSEGV, Segmentation fault.
ns3::ndn::cs::ContentStoreImpl<ns3::ndn::ndnSIM::lru_policy_traits>::Next
(this=0x555555777200, from=...)
    at ../src/ndnSIM/model/cs/content-store-impl.hpp:335
335     if (item->payload() == 0)

if it does not mind, may I know where I am doing mistake.
thanks
Best regards
Zeinab





On Fri, Feb 14, 2020 at 12:33 PM Spyridon Mastorakis <
smastorakis at unomaha.edu> wrote:

> Yes, the freshness period is set by the data producer.
>
> If you really want to erase an entry from CS, the erase method of CS
> should work.
>
> Spyridon (Spyros) Mastorakis
> Assistant Professor
> Computer Science Department
> University of Nebraska, Omaha
> Peter Kiewit Institute Room 175A
> https://sites.google.com/site/spyridonmastorakis
>
> On Feb 13, 2020, at 2:17 AM, Zeinab Rezaiefar <zeinab.rezaiefar at gmail.com>
> wrote:
>
> Dear Spyridon,
> I have noticed that data accessed from cs::Entry is constant so I cannot
> change the freshness period of data and set it to zero. Therefore, I will
> receive an error with following commands in the forward.cpp file:
> for(ns3::Ptr<ns3::ndn::cs::Entry> csentry= m_csFromNdnSim->Begin();
> csentry!= m_csFromNdnSim->End(); csentry=m_csFromNdnSim->Next(csentry))
> {
> csentry->GetData()->setFreshnessPeriod(time::milliseconds(0));
> }
>
> error :
> ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:221:61: error: passing
> ‘std::__shared_ptr_access<const ndn::Data, (__gnu_cxx::_Lock_policy)2,
> false, false>::element_type’ {aka ‘const ndn::Data’} as ‘this’ argument
> discards qualifiers [-fpermissive]
>  csentry->GetData()->setFreshnessPeriod(time::milliseconds(0));
>
>
> However, maybe I understood something wrong from your solution.
> I will be really grateful to know your opinion about this and your
> another solution regarding this issue.
> Thanks
> Bets regards
> Zeinab
>
> On Wed, Feb 12, 2020 at 5:48 PM Zeinab Rezaiefar <
> zeinab.rezaiefar at gmail.com> wrote:
>
>> Dear Spyridon,
>> Thank you so much for your answer and help. It is a good trick to not
>> reply Interest with the cached data. However, as I understand data will not
>> be deleted from the cache so
>> in the case that I need to consider limited cache size, I may face a
>> problem in evaluating the method. I prefer this data will be deleted from
>> the cache so there will enough space for another data. If it does not mind,
>> may I know your another solution as well.
>> Thank you so much for time and help
>> Best regards
>> Zeinab
>>
>> On Tue, Feb 11, 2020 at 11:54 PM Spyridon Mastorakis <
>> smastorakis at unomaha.edu> wrote:
>>
>>> One thing you can do without actually dropping any cached packets (and
>>> it is a straightforward “hack”) is to set the freshness period of data
>>> packets to 0 (or something very close to that) and set the MustBeFresh flag
>>> of Interests to true (so that you simply ignore stale cached data packets):
>>>
>>>
>>> https://named-data.net/wp-content/uploads/2018/08/hoticn18realtime-retrieval.pdf
>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__named-2Ddata.net_wp-2Dcontent_uploads_2018_08_hoticn18realtime-2Dretrieval.pdf&d=DwMFaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=TlLWo0V2mY6hXNl5sm9tOM6OXdVtEhT0bVm3jDl6bfU&s=sRiAexvDBsuR4Q8QueXsUl2kdtfuFTpJ85-XMsh1Jrk&e=>
>>>
>>> If you really need to drop the packets, then I can give you another
>>> solution.
>>>
>>> Spyridon (Spyros) Mastorakis
>>> Assistant Professor
>>> Computer Science Department
>>> University of Nebraska, Omaha
>>> Peter Kiewit Institute Room 175A
>>> https://sites.google.com/site/spyridonmastorakis
>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__sites.google.com_site_spyridonmastorakis&d=DwMFaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=TlLWo0V2mY6hXNl5sm9tOM6OXdVtEhT0bVm3jDl6bfU&s=Oa5Nwbou7OqP9pty6UVe4Iy0afQ6mofOxuovgVyMohk&e=>
>>>
>>>
>>>
>>> On Feb 11, 2020, at 1:49 AM, Zeinab Rezaiefar via ndnSIM <
>>> ndnsim at lists.cs.ucla.edu> wrote:
>>>
>>> Hello there,
>>> In continue of my previous email regarding dropping cached data, I have
>>> noticed that I need to erase data (using before evict signal)from cache and
>>> also clean up the index from policy. Since I want to command the cache to
>>> erase data from the forward.cpp file, I would like to know I can use Cs::
>>> erase function to erase data from cache ?
>>> May I know that I need still to cleanup index from policy as well.
>>> I will be grateful to know our suggestions and guidance
>>> Thanks
>>> Best regards
>>> Zeinab
>>>
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200214/80db27c5/attachment-0001.html>


More information about the ndnSIM mailing list