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

Ashlesh Gawande (agawande) agawande at memphis.edu
Mon Sep 12 10:35:31 PDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20160912/59629743/attachment.html>


More information about the Mini-NDN mailing list