[ndnSIM] New forwarding Strategy

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Fri Mar 3 12:27:06 PST 2017


Hi,

use the strategy choice helper. If there is not such a strategy implemented, NFD will log an appropriate error message:

https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.5.0-30-g934f505-ndnSIM/daemon/mgmt/strategy-choice-manager.cpp#L58-L59

Enable the “StrategyChoiceManager" logging component to be able to see 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 1, 2017, at 7:33 PM, Rajvardhan Deshmukh <rdeshmukh at umass.edu> wrote:
> 
> Hi Spyridon,
> Thank you for helping me.I apologize for the back to back emails.
> I have written a new forwarding strategy and
> included following in z-strategy.cpp
> const Name ZStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/ZStrategy/%FD%00");
> NFD_REGISTER_STRATEGY(ZStrategy);
> 
> after saving the files z-strategy.cpp and z-strategy.hpp in /NFD/daemon/fw
> i used ./waf
> then included the below method in my main(network simulation)program.
> 
> How do i call it in my main program(#include "NFD/daemon/fw/z-strategy.hpp") that implements this strategy?
> 1.
> StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/ZStrategy");
> --------------------------------------------------------------------------------------------------------------
> Problem: Can't test if this is implemented or not
> 
> OR
> 
> 2.
> I moved the random-load-balancer-strategy.hpp and random-load-balancer-strategy.cpp to /NFD/daemon/fw/
> and was able to use StrategyChoiceHelper::Install<nfd::fw::RandomLoadBalancerStrategy>(nodes,"/");
> 
> I tried using:
> StrategyChoiceHelper::Install<nfd::fw::ZStrategy>(nodes,"/");
> ---------------------------------------------------------------------------------------------------------------
> Gives error:
> scratch/rvanet.cc.2.o: In function `void ns3::ndn::StrategyChoiceHelper::Install<nfd::fw::ZStrategy>(ns3::Ptr<ns3::Node>, ndn::Name const&)':
> /home/rajvardhan/ndnSIM/ns-3/build/./ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp:122: undefined reference to `nfd::fw::ZStrategy::STRATEGY_NAME'
> /home/rajvardhan/ndnSIM/ns-3/build/./ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp:126: undefined reference to `nfd::fw::ZStrategy::STRATEGY_NAME'
> scratch/rvanet.cc.2.o: In function `std::unique_ptr<nfd::fw::ZStrategy, std::default_delete<nfd::fw::ZStrategy> > ndn::make_unique<nfd::fw::ZStrategy, std::reference_wrapper<nfd::Forwarder> >(std::reference_wrapper<nfd::Forwarder>&&)':
> /home/rajvardhan/ndnSIM/ns-3/build/ns3/ndnSIM/ndn-cxx/util/backports.hpp:42: undefined reference to `nfd::fw::ZStrategy::STRATEGY_NAME'
> /home/rajvardhan/ndnSIM/ns-3/build/ns3/ndnSIM/ndn-cxx/util/backports.hpp:42: undefined reference to `nfd::fw::ZStrategy::ZStrategy(nfd::Forwarder&, ndn::Name const&)'
> collect2: error: ld returned 1 exit status
> ----------------------------------------------------------------------------------------------------------------
> 
> 
> 
> 
> Let me know if further details are required to debug this problem.
> 
> Thanks a lot.
> 
> Regards,
> Raj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170303/6bb80448/attachment-0001.html>


More information about the ndnSIM mailing list