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

Lan Wang (lanwang) lanwang at memphis.edu
Mon Feb 12 06:42:26 PST 2018



> Begin forwarded message:
> 
> 
> From: Alex Afanasyev <aa at cs.fiu.edu>
> Subject: Re: [Nfd-dev] General NFD status - reusing the functions to calculate CS PIT FIB entries
> Date: February 11, 2018 at 9:50:07 PM CST
> To: Aman Maldar <amanmaldar at gmail.com>
> Cc: mini-ndn at lists.cs.ucla.edu, "nfd-dev at lists.cs.ucla.edu" <nfd-dev at lists.cs.ucla.edu>
> 
> 
> 
> 
>> On Feb 11, 2018, at 9:48 PM, Aman Maldar <amanmaldar at gmail.com <mailto: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-data/NFD/blob/master/tools/nfdc/forwarder-general-module.cpp <https://github.com/named-data/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 <mailto:aa at cs.fiu.edu>> wrote:
>> 
>> 
>>> On Feb 11, 2018, at 8:04 PM, Aman Maldar <amanmaldar at gmail.com <mailto: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 <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/nfdc/forwarder-general-module.cpp <https://github.com/named-data/NFD/blob/master/tools/nfdc/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 <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>
>> 
>> ______________
>> Alex Afanasyev
>> Assistant Professor, SCIS, Florida International University
>> 11200 SW 8th Street, ECS Room 261B, Miami, FL 33199
>> phone: +1.305.348.4960 <tel:(305)%20348-4960> (office); email: aa at cs.fiu.edu <mailto:aa at cs.fiu.edu>
>> web: https://users.cs.fiu.edu/~afanasyev/ <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 (office); email: aa at cs.fiu.edu <mailto:aa at cs.fiu.edu>
> web: https://users.cs.fiu.edu/~afanasyev/ <https://users.cs.fiu.edu/~afanasyev/>
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20180212/c972959b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20180212/c972959b/attachment.sig>


More information about the Mini-NDN mailing list