[Nfd-dev] How to enable a new forwarding strategy

Lei Liu bigcatlei at gmail.com
Wed Feb 10 15:13:39 PST 2016


Hi Alex,

We tried the tmp.hpp and tmp.cpp files provided by you, but still have the
same problem when installing the new forwarding strategy.

Below is our details procedures. Please take a look to see if there is any
problem.

1. install ndn-cxx
git clone https://github.com/named-data/ndn-cxx
./waf configure
./waf
sudo ./waf install

2. install NFD
git clone --recursive https://github.com/named-data/NFD
added tmp.hpp and tmp.cpp files into daemon/fw folder
./waf configure
./waf
sudo ./waf install

3. run NFD and enable the new forwarding strategy
nfd-start
nfdc set-strategy /hello /localhost/nfd/strategy/tmp/%FD%00
ERROR: Failed to set strategy choice: unsupported strategy (code:504)

Other build-in forwarding strategies are working well on this machine, such
as the client-control, best-route, etc.

Please let me know your opinion,
Thanks,
Best regards,

Lei


2016-02-09 17:36 GMT-08:00 bigcatlei at gmail.com <bigcatlei at gmail.com>:

> Hi Alex,
>
> Thanks!
>
> We also put it in daemon/fw. Maybe something is wrong in our side. We
> will double check carefully.
>
> Thanks,
> Best regards,
>
> Lei
>
>
> On Feb 9, 2016,5:30 PM,Alex Afanasyev <aa at cs.ucla.edu> wrote:
>
>
> On Feb 9, 2016, at 4:51 PM, bigcatlei at gmail.com wrote:
>
> Hi Alex,
>
> Thanks for your reply. We did add the following into our cpp program
>
> const Name
> YourStrategyClass::STRATEGY_NAME("ndn:/localhost/nfd/strategy/you-strategy-name/%FD%00");
> NFD_REGISTER_STRATEGY(YourStrategyClass);
>
>
> But it doesn't work. The nfdc cannot use the new strategy with the error
> code 504.
>
> Is there any other particular things that we need to note in order to
> install a new forwarding strategy?
>
>
> Hmm. It should work.  I just tried to create a dummy strategy.  I just
> added tmp.hpp and tmp.cpp files into daemon/fw folder and had invocation
> of NFD_REGISTER_STRATEGY macro.  After I run the compiled NFD, I'm able to
> use nfdc to set strategy:
>
>     # nfdc set-strategy /hello /localhost/nfd/strategy/tmp/%FD%00
>     Successfully set strategy choice: ControlParameters(Name: /hello,
> Strategy: /localhost/nfd/strategy/tmp/%FD%00, )
>
> <add-tmp-strategy.patch>
>
>
> Did you added your strategy files in some other location?
>
> ---
> Alex
>
>
> Thanks,
> Best regards,
>
> Lei
>
>
> On Feb 9, 2016,3:58 PM,Alex Afanasyev <aa at cs.ucla.edu> wrote:
>
>
> On Feb 9, 2016, at 2:31 PM, Lei Liu <bigcatlei at gmail.com> wrote:
>
>
> Hi,
>
>
> We developed a new forwarding strategy, but how to actually use it in NFD?
> nfdc command-line tool does not recognize this new forwarding strategy.
>
>
> NFD developer guide mentioned to modify daemon/fw/available-strategies.cpp
> and install the new strategy to the list of existing built-in strategies.
> But this file "daemon/fw/available-strategies.cpp" is no longer available
> in the latest NFD.
>
>
> Thanks,
>
> Best regards,
>
>
> Lei
>
>
> In .cpp file of your strategy just add
>
> const Name
> YourStrategyClass::STRATEGY_NAME("ndn:/localhost/nfd/strategy/you-strategy-name/%FD%00");
> NFD_REGISTER_STRATEGY(YourStrategyClass);
>
> After that you should be able to use
> ndn:/localhost/nfd/strategy/you-strategy-name in nfdc.
>
> ---
> Alex
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160210/484c5bf2/attachment.html>


More information about the Nfd-dev mailing list