[ndnSIM] How to count the forwarding hops of an Interest

Amir Ibrahim a.ibrahim at fci-cu.edu.eg
Tue May 16 12:30:18 PDT 2017

In the forwarder::onIncomingInterest method you can extract the interest
hop count tag the same way as in consumer::onData method.

On May 16, 2017 10:29 AM, "Zhuhua Liao (zliao)" <Z.Liao at memphis.edu> wrote:

Thank you for your reply, but can I get the hop count at the forwarder?
Because I want to stop forwarding an Interest, if its forwarding hops
exceed a certain amount.
*From:* Amir Ibrahim <a.ibrahim at fci-cu.edu.eg>
*Sent:* Monday, May 15, 2017 9:54:11 PM
*To:* Zhuhua Liao (zliao)
*Cc:* ndnsim at lists.cs.ucla.edu
*Subject:* Re: [ndnSIM] How to count the forwarding hops of an Interest

I think that interest, as well as data packet,  already has a hop count
field. If you want to get total hop count of an interest you can get it at
the producer application.

On May 15, 2017 10:25 PM, "Zhuhua Liao (zliao)" <Z.Liao at memphis.edu> wrote:

Greetings All,
    Now I have a question regarding how to count the forwarding hops of an
Interest in ndnSIM.  I simply added the below codes, but it seems like I
got the wrong forwarding hops:
  1. added "interest->setTag(make_shared<lp::HopCountTag>(0));" for
hopcount initialization at the function "SendPacket" in consumer.cpp;
 2. added "interest.setTag(make_shared<lp::HopCountTag>(hopCount + 1))" for
one hop increment when forwarding a time at the function
"onIncomingInterest" in Forwarder.cpp.

I do not know if you have a right solution to count the forwarding hops for
an interest?



ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu


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

More information about the ndnSIM mailing list