[Mini-NDN] [Nfd-dev] General NFD status - reusing the functions to calculate CS PIT FIB entries

Aman Maldar amanmaldar at gmail.com
Thu Feb 15 10:08:30 PST 2018


 Hello Mr. Afanasyev,

Automatically create proper interest to request status dataset:

controller.fetch<ndn::nfd::ForwarderGeneralStatusDataset>( ...


I tried writing the tool for the same using
/ndn-cxx/examples/consumer.cpp. I set the interest as
localhost/nfd/tatus/general.

My concern is that lambda function needs multiple parameters and I am not
able to work around multiple namespaces/include directories while providing
those params.

The controller will also properly decode the retrieved TLV and will give it
to you in a callback (lamda function in .cpp).  Your job is to print the
value you need from the ForwarderStatus  data structure.
 - I am not able to call this function itself.


Can I just send a correct interest packet   (localhost/nfd/tatus/general )
and decode a data packet using some mechanism without going through all
these?

Is there any other way you can recommend I should try to do this?  Is there
any previous attempt writing such tool? I appreciate your help.

On Sun, Feb 11, 2018 at 10:50 PM, Alex Afanasyev <aa at cs.fiu.edu> wrote:

>
>
> On Feb 11, 2018, at 9:48 PM, Aman Maldar <amanmaldar at gmail.com> wrote:
>
> Thank you Mr. Afanasyev,
>
> write a tool that requests General Status Dataset from NFD
>
> - This is exactly something I am looking for.
>
> I tried following
> mini-ndn >> a ndnping /localhost/nfd/status/general
>
> Following is the log. The question is, I am new to this tlv mapping
> concept. I read the link mentioned, but I am not able to understand how the
> mapping is done,
> Assume, I just want to get CS entries from response below? How do I do
> that? or Please redirect me to reference/documentation. Sorry, may be this
> is a rookie question.
>
> 1518402552.534222 DEBUG: [Forwarder] FWD onIncomingInterest face=277
> interest=/localhost/nfd/status/general/ping/3148021819785972518
> 1518402552.534329 DEBUG: [Forwarder] FWD onContentStoreMiss
> interest=/localhost/nfd/status/general/ping/3148021819785972518
> 1518402552.534358 DEBUG: [Forwarder] FWD onOutgoingInterest face=1
> interest=/localhost/nfd/status/general/ping/3148021819785972518
> 1518402552.535748 DEBUG: [Forwarder] FWD onIncomingData face=1
> data=/localhost/nfd/status/general/ping/3148021819785972518/%FD%00%00%
> 01a%87%D8B%D6/%00%00
>
>
> You need to look more carefully at https://github.com/named-da
> ta/NFD/blob/master/tools/nfdc/forwarder-general-module.cpp  It has all
> the pieces to write such a tool using ndn-cxx
>
> Automatically create proper interest to request status dataset:
>
> controller.fetch<ndn::nfd::ForwarderGeneralStatusDataset>( ...
>
> The controller will also properly decode the retrieved TLV and will give
> it to you in a callback (lamda function in .cpp).  Your job is to print the
> value you need from the ForwarderStatus  data structure.
>
> --
> Alex
>
> Thank you again.
>
> On Sun, Feb 11, 2018 at 8:46 PM, Alex Afanasyev <aa at cs.fiu.edu> wrote:
>
>>
>>
>> On Feb 11, 2018, at 8:04 PM, Aman Maldar <amanmaldar at gmail.com> wrote:
>>
>> Hello,
>>
>> I want reuse some results of "a nfdc status show" command.
>>
>> I undestand, the above command executes the code to calculate number of
>> entries in FIB, CS, PIT.
>>
>>
>> nfdc doesn't calculate anything, rather just requesting stats from NFD
>> and then reporting it to you.
>>
>>
>> The file which call the command above is present in
>> "/mini-ndn/NFD/nfdc/tools/main.cpp" (I hope this is correct, or guide me
>> to correct one please)
>>
>> However, I am trying to dig deep into this to find out which is the *single
>> function* that I can reuse  to calculate CS entries only or FIB entries
>> only or PIT entries only.
>>
>>
>> Depending on how much time you want to spend on this, you could either
>> use some unix pipe'ing to extract the line/number you need or write a tool
>> that requests General Status Dataset from NFD (
>> https://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus) and
>> prints the number you are looking for.
>>
>>
>> Can someone guide me on how to get the desired functions so that I can
>> reuse it?
>>
>>
>> Things are made modular, so actual code is "a bit" burried.  You can take
>> a look here https://github.com/named-data/NFD/blob/master/tools/nfd
>> c/forwarder-general-module.cpp
>>
>>
>> Thank you in advance.
>>
>> --
>> *Regards,*
>> *Mr. Maldar Aman M.*
>> *University of Massachusetts, Lowell*
>> _______________________________________________
>> Nfd-dev mailing list
>> Nfd-dev at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
>>
>>
>> ______________
>> Alex Afanasyev
>> Assistant Professor, SCIS, Florida International University
>> 11200 SW 8th Street, ECS Room 261B, Miami, FL 33199
>> phone: +1.305.348.4960 <(305)%20348-4960> (office); email: aa at cs.fiu.edu
>> <aa at cs.fiu.edu>
>> web: https://users.cs.fiu.edu/~afanasyev/
>>
>>
>>
>
>
> --
> *Regards,*
> *Mr. Maldar Aman M.*
> *University of Massachusetts, Lowell*
>
>
> ______________
> Alex Afanasyev
> Assistant Professor, SCIS, Florida International University
> 11200 SW 8th Street, ECS Room 261B, Miami, FL 33199
> phone: +1.305.348.4960 <(305)%20348-4960> (office); email: aa at cs.fiu.edu
> <aa at cs.fiu.edu>
> web: https://users.cs.fiu.edu/~afanasyev/
>
>
>


-- 
*Regards,*
*Mr. Maldar Aman M.*
*University of Massachusetts, Lowell*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20180215/8cdaddb6/attachment.html>


More information about the Mini-NDN mailing list