<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Hi
</span>André,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The experiment setup seems fine. Can you add 20 - 30s sleep after starting the NLSR and see if the problem goes away?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<blockquote type="cite" style="color: rgb(50, 49, 48); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; font-size: 15px; background-color: rgb(255, 255, 255)">
<div style="margin: 0px">
<div dir="auto" style="margin: 0px">
<blockquote type="cite">
<div dir="ltr" style="margin: 0px">
<p><tt>info('Starting NLSR on nodes\n')</tt><tt><br>
</tt><tt>    nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)</tt><tt><br>
</tt></p>
<p><tt>    time.sleep(30) # 30s to be on safe side.<br>
</tt></p>
<p><tt>    # Run producer</tt><tt><br>
</tt><tt>    producer = ndn.net.hosts[0]</tt></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
NLSR takes some time to compute the whole routing table. So, if the routes are not set up by the time the consumer requests for the data, it will get the NoRoute nacks.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Saurab Dulal</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mini-NDN <mini-ndn-bounces@lists.cs.ucla.edu> on behalf of Alexander Wilhelm Lane (awlane) <awlane@memphis.edu><br>
<b>Sent:</b> Tuesday, September 29, 2020 6:03 PM<br>
<b>To:</b> adcarneiro@inf.ufrgs.br <adcarneiro@inf.ufrgs.br><br>
<b>Cc:</b> mini-ndn@lists.cs.ucla.edu <mini-ndn@lists.cs.ucla.edu><br>
<b>Subject:</b> Re: [Mini-NDN] Issues with producer and consumer in Python experiment</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Apologies if these are unhelpful suggestions but could you post the output from the producer program when called from the script? You should just be able to capture that in Bash. You also
 could try using something like ndnping to see if it’s an issue with NFD or routing in the script or something occurring when you run the producer.
<div class=""><br class="">
<div class="">I’d recommend using the getPopen method from minindn.util in the future as it uses the more robust Python popen API.</div>
<div class="">-Alex<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Sep 29, 2020, at 3:28 PM, Lan Wang (lanwang) <<a href="mailto:lanwang@memphis.edu" class="">lanwang@memphis.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div dir="auto" class=""><br class="">
<div dir="ltr" class=""><br class="">
Begin forwarded message:<br class="">
<br class="">
</div>
<blockquote type="cite" class="">
<div dir="ltr" class=""><b class="">From:</b> "André D. Carneiro" <<a href="mailto:adcarneiro@inf.ufrgs.br" class="">adcarneiro@inf.ufrgs.br</a>><br class="">
<b class="">Date:</b> September 28, 2020 at 8:56:41 PM CDT<br class="">
<b class="">To:</b> "Lan Wang (lanwang)" <<a href="mailto:lanwang@memphis.edu" class="">lanwang@memphis.edu</a>><br class="">
<b class="">Subject:</b> <b class="">Re:  [Mini-NDN] Issues with producer and consumer in Python experiment</b><br class="">
<br class="">
</div>
</blockquote>
<blockquote type="cite" class="">
<div dir="ltr" class="">
<p class="">Hi,<br class="">
</p>
<p class=""><br class="">
</p>
<p class="">the consumers are getting NACKs when the commands are issued within python, when running the same commands in the hosts' xterm windows, the consumers get the data. Here is the simplest code I used to test it, it was based on the mnndn.py script
 and the imports were kept the same.</p>
<p class="">The only exception to that is the consumer ran by the same host that also ran the producer program, which received the data.</p>
<p class=""><tt class="">if __name__ == '__main__':</tt><tt class=""><br class="">
</tt><tt class="">    setLogLevel('info')</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    Minindn.cleanUp()</tt><tt class=""><br class="">
</tt><tt class="">    Minindn.verifyDependencies()</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    ndn = Minindn()</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    ndn.start()</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    info('Starting NFD on nodes\n')</tt><tt class=""><br class="">
</tt><tt class="">    nfds = AppManager(ndn, ndn.net.hosts, Nfd)</tt><tt class=""><br class="">
</tt><tt class="">    info('Starting NLSR on nodes\n')</tt><tt class=""><br class="">
</tt><tt class="">    nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    # Run producer</tt><tt class=""><br class="">
</tt><tt class="">    producer = ndn.net.hosts[0]</tt><tt class=""><br class="">
</tt><tt class="">    strInterestFilter = '/myApp/' + producer.name</tt><tt class=""><br class="">
</tt><tt class="">    strCmdAdvertise = 'nlsrc advertise ' + strInterestFilter</tt><tt class=""><br class="">
</tt><tt class="">    strCmdProducer  = 'producer ' + strInterestFilter + ' &'</tt><tt class=""><br class="">
</tt><tt class="">    producer.cmd(strCmdAdvertise)</tt><tt class=""><br class="">
</tt><tt class="">    producer.cmd(strCmdProducer)</tt><tt class=""><br class="">
</tt><tt class="">    time.sleep(1)</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    # Run consumers</tt><tt class=""><br class="">
</tt><tt class="">    for host in ndn.net.hosts:</tt><tt class=""><br class="">
</tt><tt class="">        strCmdConsumer = 'consumer ' + strInterestFilter</tt><tt class=""><br class="">
</tt><tt class="">        host.cmd(strCmdConsumer)      </tt><tt class=""><br class="">
</tt><tt class="">    </tt><tt class=""><br class="">
</tt><tt class="">    MiniNDNCLI(<a href="http://ndn.net" class="">ndn.net</a>)</tt><tt class=""><br class="">
</tt><tt class=""><br class="">
</tt><tt class="">    ndn.stop()</tt><br class="">
</p>
<p class=""><br class="">
</p>
<p class="">Printing the commands above issued to the hosts, I get the following:</p>
<p class=""><tt class="">CmdProducer: nlsrc advertise /myApp/a</tt><tt class=""><br class="">
</tt><tt class="">CmdProducer: producer /myApp/a &</tt><tt class=""><br class="">
</tt><tt class="">CmdConsumer: consumer /myApp/a</tt><tt class=""><br class="">
</tt><tt class="">CmdConsumer: consumer /myApp/a</tt><tt class=""><br class="">
</tt><tt class="">CmdConsumer: consumer /myApp/a</tt><tt class=""><br class="">
</tt><tt class="">CmdConsumer: consumer /myApp/a</tt></p>
<p class=""><tt class=""><br class="">
</tt></p>
<p class="">Running these same commands in the hosts' xterm windows, in the same default topology, all the consumers get the data as expected. I believe there must be some command missing from the python script, I just don't know what it is.</p>
<p class="">The producer and consumer programs used here are only slightly modified versions of the ones in the examples folder so that they log times and accept some parameters from the command line. They were compiled and have a symbolic link so they can
 be called without their full path.</p>
<p class=""><br class="">
</p>
<p class="">best regards,</p>
<p class="">André Dexheimer Carneiro<br class="">
</p>
<p class=""><br class="">
</p>
<div class="x_moz-cite-prefix">On 28/09/2020 13:29, Lan Wang (lanwang) wrote:<br class="">
</div>
<blockquote type="cite" class="">Can you explain what specific problems you have right now?  Are the consumers getting the data?
<div class=""><br class="">
</div>
<div class="">Lan<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Sep 27, 2020, at 7:33 PM, Lan Wang (lanwang) <<a href="mailto:lanwang@memphis.edu" class="">lanwang@memphis.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space"><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">Begin forwarded message:</div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br class="">
</div>
<div class="">
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">From: </b></span><span class="" style="">André D. Carneiro <<a href="mailto:adcarneiro@inf.ufrgs.br" class="">adcarneiro@inf.ufrgs.br</a>><br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">Subject: </b></span><span class="" style=""><b class="">Issues with producer and consumer in Python experiment</b><br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">Date: </b></span><span class="" style="">September 27, 2020 at 5:42:24 PM CDT<br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">To: </b></span><span class="" style=""><a href="mailto:mini-ndn@lists.cs.ucla.edu" class="">mini-ndn@lists.cs.ucla.edu</a><br class="">
</span></div>
<br class="">
<br class="">
Hi everyone and thanks very much for the help so far,<br class="">
<br class="">
<br class="">
I have the basics covered now and the install seems to be working fine. Running producers/consumers on the MiniNDN CLI responds as I expected so I got back to my python experiment. Only when instantiating producers/consumers via the 'host.cmd' directive I am
 getting NACKs, though I'm not sure why. These producer and consumer programs are copies from the ones in the examples directory, only with minimal changes to log the elapsed time and accept interest filters from the command line.<br class="">
<br class="">
To give you a broad view of the script, all the producers are instantiated during setup, being assigned their interest filter, after running their respective 'nlsrc advertise'  command (thanks for that again) and running in the background (ex. 'producer /a
 &').<br class="">
<br class="">
The consumers are instantiated by demand, the main difference being that they don't run in the background (without the '&') and they are responsible for logging the elapsed time when onData, onNack or onTimeout is called.<br class="">
<br class="">
When the experiment is done and the CLI is shown, I ran 'nlsrc lsdb' and noticed that the advertise commands had worked because the interest filters show up in their respective hosts. I also tried adding the 'export HOME' command for each host before calling
 the producer or consumer programs, but it did not seem to make any difference.<br class="">
<br class="">
<br class="">
Also note that a consumer can run while a producer for that same host is running in the background, which I don't think is a problem.<br class="">
<br class="">
<br class="">
Best regards,<br class="">
<br class="">
André Dexheimer Carneiro<br class="">
<br class="">
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
Mini-NDN mailing list<br class="">
<a href="mailto:Mini-NDN@lists.cs.ucla.edu" class="">Mini-NDN@lists.cs.ucla.edu</a><br class="">
<a class="x_moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn">http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
Mini-NDN mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Mini-NDN@lists.cs.ucla.edu">Mini-NDN@lists.cs.ucla.edu</a>
<a class="x_moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn">http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn</a>
</pre>
</blockquote>
</div>
</blockquote>
</div>
_______________________________________________<br class="">
Mini-NDN mailing list<br class="">
<a href="mailto:Mini-NDN@lists.cs.ucla.edu" class="">Mini-NDN@lists.cs.ucla.edu</a><br class="">
http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>