[ndnSIM] New forwarding Strategy
Rajvardhan Deshmukh
rdeshmukh at umass.edu
Tue Feb 28 08:25:03 PST 2017
hi Spyros,
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
More information about the ndnSIM
mailing list