<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>You can run ndndump (<a href="https://github.com/named-data/ndn-tools" class="x_OWAAutoLink" id="LPlnk762868">https://github.com/named-data/ndn-tools</a>) on each interface of node b.</p>
<p>ndndump logs interest, data, timeout, and information about interface.</p>
<br>
<p><span style="font-size:12pt">To do so you can use the following code:</span><br>
</p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt"></p>
<div>for host in self.net.hosts:</div>
<div>        for intf in host.intfNames():</div>
<div>               ndnDumpOutputFile = <span>"dump.%s_%s" % (intf, str(host.intf(intf).IP()))</span></div>
<div>               <span>host.cmd("ndndump  -i %s > %s &" % (intf, ndnDumpOutputFile))</span></div>
<div>            </div>
<div></div>
<div>If you want to capture the FIB you can run nfd-status -b periodically and log it.</div>
<div>You can also turn on NFD logs on b to see more information about NFD.</div>
<div>In the topology file:</div>
<div>b: _ nfd-log-level=DEBUG</div>
<div><br>
</div>
Ashlesh</span>
<p></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matteo Bertolino <Matteo.Bertolino@eurecom.fr><br>
<b>Sent:</b> Tuesday, September 13, 2016 2:48:38 AM<br>
<b>To:</b> Ashlesh Gawande (agawande)<br>
<b>Cc:</b> mini-ndn@lists.cs.ucla.edu<br>
<b>Subject:</b> Re: [Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some information</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Thank you Ashlesh Gawande and Jeff Burke.<br>
I need a clarify about the 3^ point.<br>
I would like that the intermediate note b (in a----b----c) work  <br>
following the default NLSR and NFD, but I would like print "what  <br>
happens".<br>
For example.<br>
"Interest packet arrived"<br>
"Interest forwarded to interface xxx"<br>
"my FIB is: yyy"<br>
"Timeout expired/Data packet arrived"<br>
Which advices could you say me in order to realize this behaviour?<br>
and so on.<br>
Have a nice day,<br>
Matteo<br>
<br>
Quoting "Ashlesh Gawande (agawande)" <agawande@memphis.edu>:<br>
<br>
> Your mail to Mini-NDN list bounced, because you used this email to send:<br>
><br>
> bertolin@eurecom.fr instead of matteo.bertolino@eurecom.fr<br>
> I have subscribed this email as well, please confirm so that I can   <br>
> grant permission to post.<br>
><br>
><br>
> 1) For printing data:<br>
><br>
><br>
>    void<br>
>    onData(const Interest& interest, const Data& data)<br>
>    {<br>
>      std::cout << data << std::endl;<br>
><br>
><br>
>      std::string receivedContent = reinterpret_cast<const   <br>
> char*>(data.getContent().value());<br>
>      int receivedContentLength = data.getContent().value_size();<br>
>      receivedContent = receivedContent.substr(0, receivedContentLength);<br>
>      std::cout << receivedContent << std::endl;<br>
>     }<br>
><br>
>     (Taken from here:   <br>
> <a href="https://github.com/named-data/ndn-traffic-generator/blob/master/src/ndn-traffic-client.cpp#L558">
https://github.com/named-data/ndn-traffic-generator/blob/master/src/ndn-traffic-client.cpp#L558</a>)<br>
><br>
><br>
> 2) PIT is not printed or logged currently. It is planned to be   <br>
> logged in future but cannot say when.<br>
><br>
>     You can modify PIT related files here:   <br>
> <a href="https://github.com/named-data/NFD/tree/master/daemon/table">https://github.com/named-data/NFD/tree/master/daemon/table</a><br>
><br>
>     and add some logging.<br>
><br>
><br>
> 3) Just have a 3 node topology.<br>
><br>
>     a----b----c<br>
><br>
>     NFD and NLSR runs on each node by default.<br>
><br>
>     Use NLSR on a to advertise your route to the network:<br>
><br>
>     mininet> a nlsrc advertise /sample<br>
><br>
><br>
><br>
>     Then run consumer on 'a' and producer on 'c'.<br>
><br>
><br>
>     If you don't want to use NLSR. You would have to create a route   <br>
> on 'b' using the route command so         that 'a' can reach 'c'.   <br>
> Then you can use nfdc register to register a prefix towards c from   <br>
> a. In Mini-NDN     a node can only reach its neighbors.<br>
><br>
><br>
> Ashlesh<br>
><br>
> ________________________________<br>
> From: Ndn-interest <ndn-interest-bounces@lists.cs.ucla.edu> on   <br>
> behalf of bertolin@eurecom.fr <bertolin@eurecom.fr><br>
> Sent: Monday, September 12, 2016 9:13:37 AM<br>
> To: ndn-interest@lists.cs.ucla.edu<br>
> Cc: mini-ndn@lists.cs.ucla.edu<br>
> Subject: [Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some   <br>
> information<br>
><br>
> Good morning at all and thank you again for the help that I am<br>
> receiving by your community.<br>
> I spent some time, without success, in trying to print the following<br>
> information (I am working in miniNDN:<br>
><br>
> 1) The Content of the Data.<br>
> If I print the packet, I obtain:<br>
> Name: /mat/try/normandie/%FC%00%05%3CO%E0%D0%FC%D7<br>
> MetaInfo: ContentType: 0, FreshnessPeriod: 10000 milliseconds<br>
> Content: (size: 6)<br>
> Signature: (type: 1, value_length: 256)<br>
><br>
> So I manage to play with the blocks and the buffers, but the<br>
> documentation is not really verbose. However, I though to write:<br>
><br>
>         void onData(const Interest& interest, const Data& data) {<br>
>                 log << "Data received correctly" << std::endl;<br>
>                 log << data << endl;<br>
><br>
>                 //take block<br>
>                 ndn::Block x = data.getContent();<br>
><br>
>                 //take buffer<br>
>                 shared_ptr<const Buffer> buffer = x.getBuffer();<br>
><br>
>                 //take string<br>
>                 std::string content((char*)buffer.get(), 6);<br>
>                 log << content << endl;<br>
>          }<br>
><br>
> But on my log file I obtained just not-printable random characters!<br>
> Where did I wrong?<br>
><br>
> 2) the PIT table of a node. I did not find any with nfd-status and<br>
> other commands. Is it possible in principle ?<br>
><br>
> 3) Finallyh, I would like to concentrate here another question a bit<br>
> different. Working with miniNDN, I would like to build the following<br>
> topology:<br>
> Consume <-------> gateway <-------> Producer.<br>
> I already wrote my version of consumer and producer, with the callback<br>
> onInterest, onData etc.. But with the gateway, conceptually how should<br>
> I structure the program that works on this node?<br>
><br>
> Thank you for you help, I say it again it so I will not fill up the<br>
> mailing list with just "thank you" answers :)<br>
> Matteo<br>
><br>
> -------------------------------------------------------------------------------<br>
> This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr">
http://webmail.eurecom.fr</a><br>
><br>
><br>
> _______________________________________________<br>
> Ndn-interest mailing list<br>
> Ndn-interest@lists.cs.ucla.edu<br>
> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest">http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest</a><br>
><br>
<br>
<br>
<br>
-------------------------------------------------------------------------------<br>
This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr">
http://webmail.eurecom.fr</a><br>
<br>
</div>
</span></font>
</body>
</html>