[ndnSIM] How to count the forwarding hops of an Interest
Zhuhua Liao (zliao)
Z.Liao at memphis.edu
Tue May 16 19:42:59 PDT 2017
Thanks a lot. I have got the hop count in the forwarder through your hint.
Zhuhua
________________________________
From: Amir Ibrahim <a.ibrahim at fci-cu.edu.eg>
Sent: Tuesday, May 16, 2017 2:30:18 PM
To: Zhuhua Liao (zliao)
Cc: ndnsim at lists.cs.ucla.edu
Subject: Re: [ndnSIM] How to count the forwarding hops of an Interest
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<mailto: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<mailto: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<mailto: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<mailto: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?
Thanks!
Zhuhua
_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170517/a9de6a0d/attachment-0001.html>
More information about the ndnSIM
mailing list