[Nfd-dev] How to use the client control forwarding strategy

Alex Afanasyev aa at CS.UCLA.EDU
Mon Feb 8 17:22:40 PST 2016

Hi Lei,

To use client-control strategy you will need two pieces:  enable local control feature on the face and use the corresponding NDNLP header to indicate where to forward.

To enable the feature, you can refer to  http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature <http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature>

With ndn-cxx, you can write something like this (or follow Junxiao's example)

  ndn::Face **face**;
  ndn::KeyChain keyChain;
  ndn::nfd::Controller controller(**face**, keyChain);

    ... callback for success ...,
    ... callback for failure (e.g., permission denied) ...);


  ndn::Interest x("/hello/world");
  **face**.expressInterest(x, ...);


> On Feb 8, 2016, at 5:19 PM, Junxiao Shi <shijunxiao at email.arizona.EDU> wrote:
> Hi Liu
> I've used client-control in one simple app.
> https://github.com/yoursunny/ndn6-tools/blob/7322ea378dbcdd0014b5217cb49da6283c3f9e94/remote-register-prefix.cpp#L92-L121 <https://github.com/yoursunny/ndn6-tools/blob/7322ea378dbcdd0014b5217cb49da6283c3f9e94/remote-register-prefix.cpp#L92-L121>
> (not intended as a tutorial)
> Yours, Junxiao
> On Feb 8, 2016 17:36, "Lei Liu" <bigcatlei at gmail.com <mailto:bigcatlei at gmail.com>> wrote:
> Hi,
> Can anyone help to elaborate how to enable the client control forwarding strategy in NFD?
> I understand that by using nfdc, we can set strategy to a name such as:
> nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/client-control
> Then, suppose we have an interest like /app1/video, how can we force it to be forwarded to a specific face? NFD developer guide mentioned a NextHopFaceId field in the interest message, but how to enable this feature and send an interest with a NextHopFaceId field?
> Thanks,
> Best regards,
> Lei
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu <mailto:Nfd-dev at lists.cs.ucla.edu>
> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev <http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev>
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160208/80c2fba7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160208/80c2fba7/attachment.bin>

More information about the Nfd-dev mailing list