[ndnSIM] Getting Hop Count on Insert Method for New Custom Policy

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu Mar 16 17:26:22 PDT 2017


Hi,

that means that you fetch data from the local cache or NFD (or some other local application).

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On Mar 16, 2017, at 5:24 PM, Rizky Yanuar <mryanuar21 at gmail.com> wrote:
> 
> Hi Spyridon,
> 
> Thanks for the reply! I've tried the code and it passed the compiling process, but everytime I check the hop count I always got 0 as the value. I've checked the pointer and looks like it always get nullptr as its value. Here is my code on the insert method:
> shared_ptr<const Data> data = item->payload()->GetData();
>     	auto hopCountTag = data->getTag<lp::HopCountTag>();
>     	NS_LOG_DEBUG(hopCountTag); // it returns 0
> 
> 
> 
> On Fri, Mar 17, 2017 at 12:39 AM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu <mailto:mastorakis at cs.ucla.edu>> wrote:
> Hi,
> 
> since the latest version of ndnSIM (v2.3), we do not use the NS3 packet tags for the hop count, but we rather use the LP tags implemented for the NDN Link Protocol (NDNLP):
> 
> https://github.com/named-data-ndnSIM/ndnSIM/blob/master/apps/ndn-consumer.cpp#L227-L232 <https://github.com/named-data-ndnSIM/ndnSIM/blob/master/apps/ndn-consumer.cpp#L227-L232>
> 
> Hope that this helps,
> 
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> Internet Research Laboratory
> Computer Science Department
> UCLA
> 
>> On Mar 16, 2017, at 3:00 AM, Rizky Yanuar <mryanuar21 at gmail.com <mailto:mryanuar21 at gmail.com>> wrote:
>> 
>> Hello,
>> 
>> I'm trying to get the hop count from a packet in a new custom policy based from existing policy (which is freshness-policy). I've tried using the example that's Alex mentioned in this mail: http://www.lists.cs.ucla.edu/pipermail/ndnsim/2016-February/002423.html <http://www.lists.cs.ucla.edu/pipermail/ndnsim/2016-February/002423.html>
>> 
>> However, on the compiling process I still got an error message:
>> 
>> In file included from ../src/ndnSIM/model/cs/content-store-with-freshness.hpp:28:0,
>>                  from ../src/ndnSIM/model/cs/content-store-with-freshness.cpp:20:
>> ../src/ndnSIM/model/cs/custom-policies/freshness-policy.hpp: In member function ‘bool ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base, Container, Hook>::type::insert(typename ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base, Container, Hook>::type::parent_trie::iterator)’:
>> ../src/ndnSIM/model/cs/custom-policies/freshness-policy.hpp:114:27: error: expected unqualified-id before ‘typename’
>>       auto dataTag = data->typename getTag<Ns3PacketTag>();
>>                            ^
>> 
>> I've tried remove the typename declaration and the <Ns3PacketTag> but I still failed on the compilation process. I'd greatly appreciate if anyone has any advice for this problem. Thank you very much.
>> 
> 

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


More information about the ndnSIM mailing list