[ndnSIM] how to add private member variable in class Intererst
Spyridon (Spyros) Mastorakis
mastorakis at CS.UCLA.EDU
Mon Mar 27 19:30:24 PDT 2017
Hi,
why you do not use the hopCount of a data packet? This is already provided by ndnSIM.
I guess that you do not encode your hop count as a TLV field for the Interest. You will to modify the wireEncode and wireDecode methods of the Interest class to do that.
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 27, 2017, at 7:25 PM, gc199211 <gc199211 at mail.ustc.edu.cn> wrote:
>
>
> Hi sir :
> I find out that my last email is incomplete in maillist, so I finish it and send again.
> I am trying to add hop information in Interest recently on ndnSIM 2.2. Here is my code.
> 1). I add a private member variable which is named hop in ndnSIM/ndn-cxx/src/interest.h
> private:
> Name m_name;
> ......
> mutable Block m_wire;
> int hop; // a new private member variable
>
> 2). I increace the value of hop in the nfd::Forwarder::onOutgoingInterest(shared_ptr<pit::Entry> pitEntry, Face& outFace,bool wantNewNonce),so as to caculate the hop .
>
> int tmpHop=interest->getHop();
> tmpHop++;
> interest->setHop(tmpHop);
>
> Here is my problem,It seems that the hop value is always 0 no matter how many nodes it is forwarded.How to solve the problem? I know there is a ns3::ndn::FwHopCountTag a to caculate the hop in ns3::ndn::NetDeviceLinkService ,But I want to caculate the hop value directly in Interest. If it works ,I can add other member variable in Interest which is quite important for my research.Thank you very much .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170327/e40040e0/attachment.html>
More information about the ndnSIM
mailing list