[Mini-NDN] [Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some information

Ashlesh Gawande (agawande) agawande at memphis.edu
Tue Sep 13 00:59:34 PDT 2016


You can run ndndump (https://github.com/named-data/ndn-tools) on each interface of node b.

ndndump logs interest, data, timeout, and information about interface.


To do so you can use the following code:


for host in self.net.hosts:
        for intf in host.intfNames():
               ndnDumpOutputFile = "dump.%s_%s" % (intf, str(host.intf(intf).IP()))
               host.cmd("ndndump  -i %s > %s &" % (intf, ndnDumpOutputFile))

If you want to capture the FIB you can run nfd-status -b periodically and log it.
You can also turn on NFD logs on b to see more information about NFD.
In the topology file:
b: _ nfd-log-level=DEBUG

Ashlesh

________________________________
From: Matteo Bertolino <Matteo.Bertolino at eurecom.fr>
Sent: Tuesday, September 13, 2016 2:48:38 AM
To: Ashlesh Gawande (agawande)
Cc: mini-ndn at lists.cs.ucla.edu
Subject: Re: [Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some information

Thank you Ashlesh Gawande and Jeff Burke.
I need a clarify about the 3^ point.
I would like that the intermediate note b (in a----b----c) work
following the default NLSR and NFD, but I would like print "what
happens".
For example.
"Interest packet arrived"
"Interest forwarded to interface xxx"
"my FIB is: yyy"
"Timeout expired/Data packet arrived"
Which advices could you say me in order to realize this behaviour?
and so on.
Have a nice day,
Matteo

Quoting "Ashlesh Gawande (agawande)" <agawande at memphis.edu>:

> Your mail to Mini-NDN list bounced, because you used this email to send:
>
> bertolin at eurecom.fr instead of matteo.bertolino at eurecom.fr
> I have subscribed this email as well, please confirm so that I can
> grant permission to post.
>
>
> 1) For printing data:
>
>
>    void
>    onData(const Interest& interest, const Data& data)
>    {
>      std::cout << data << std::endl;
>
>
>      std::string receivedContent = reinterpret_cast<const
> char*>(data.getContent().value());
>      int receivedContentLength = data.getContent().value_size();
>      receivedContent = receivedContent.substr(0, receivedContentLength);
>      std::cout << receivedContent << std::endl;
>     }
>
>     (Taken from here:
> https://github.com/named-data/ndn-traffic-generator/blob/master/src/ndn-traffic-client.cpp#L558)
>
>
> 2) PIT is not printed or logged currently. It is planned to be
> logged in future but cannot say when.
>
>     You can modify PIT related files here:
> https://github.com/named-data/NFD/tree/master/daemon/table
>
>     and add some logging.
>
>
> 3) Just have a 3 node topology.
>
>     a----b----c
>
>     NFD and NLSR runs on each node by default.
>
>     Use NLSR on a to advertise your route to the network:
>
>     mininet> a nlsrc advertise /sample
>
>
>
>     Then run consumer on 'a' and producer on 'c'.
>
>
>     If you don't want to use NLSR. You would have to create a route
> on 'b' using the route command so         that 'a' can reach 'c'.
> Then you can use nfdc register to register a prefix towards c from
> a. In Mini-NDN     a node can only reach its neighbors.
>
>
> Ashlesh
>
> ________________________________
> From: Ndn-interest <ndn-interest-bounces at lists.cs.ucla.edu> on
> behalf of bertolin at eurecom.fr <bertolin at eurecom.fr>
> Sent: Monday, September 12, 2016 9:13:37 AM
> To: ndn-interest at lists.cs.ucla.edu
> Cc: mini-ndn at lists.cs.ucla.edu
> Subject: [Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some
> information
>
> Good morning at all and thank you again for the help that I am
> receiving by your community.
> I spent some time, without success, in trying to print the following
> information (I am working in miniNDN:
>
> 1) The Content of the Data.
> If I print the packet, I obtain:
> Name: /mat/try/normandie/%FC%00%05%3CO%E0%D0%FC%D7
> MetaInfo: ContentType: 0, FreshnessPeriod: 10000 milliseconds
> Content: (size: 6)
> Signature: (type: 1, value_length: 256)
>
> So I manage to play with the blocks and the buffers, but the
> documentation is not really verbose. However, I though to write:
>
>         void onData(const Interest& interest, const Data& data) {
>                 log << "Data received correctly" << std::endl;
>                 log << data << endl;
>
>                 //take block
>                 ndn::Block x = data.getContent();
>
>                 //take buffer
>                 shared_ptr<const Buffer> buffer = x.getBuffer();
>
>                 //take string
>                 std::string content((char*)buffer.get(), 6);
>                 log << content << endl;
>          }
>
> But on my log file I obtained just not-printable random characters!
> Where did I wrong?
>
> 2) the PIT table of a node. I did not find any with nfd-status and
> other commands. Is it possible in principle ?
>
> 3) Finallyh, I would like to concentrate here another question a bit
> different. Working with miniNDN, I would like to build the following
> topology:
> Consume <-------> gateway <-------> Producer.
> I already wrote my version of consumer and producer, with the callback
> onInterest, onData etc.. But with the gateway, conceptually how should
> I structure the program that works on this node?
>
> Thank you for you help, I say it again it so I will not fill up the
> mailing list with just "thank you" answers :)
> Matteo
>
> -------------------------------------------------------------------------------
> This message was sent using EURECOM Webmail: http://webmail.eurecom.fr
>
>
> _______________________________________________
> Ndn-interest mailing list
> Ndn-interest at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest
>



-------------------------------------------------------------------------------
This message was sent using EURECOM Webmail: http://webmail.eurecom.fr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20160913/70ee3e3c/attachment.html>


More information about the Mini-NDN mailing list